From 2e2af3581748853ae735e44229e5d3ad14ee120c Mon Sep 17 00:00:00 2001 From: Enrico Faulhaber Date: Wed, 19 Jul 2017 10:39:34 +0200 Subject: [PATCH] [deb] Add control files. Change-Id: I081d0dbb35a96810617c58b2ca99c02161122918 --- .gitignore | 3 ++ debian/README | 6 ++++ debian/changelog | 73 +++++++++++++++++++++++++++++++++++++++ debian/compat | 1 + debian/control | 22 ++++++++++++ debian/copyright | 28 +++++++++++++++ debian/docs | 0 debian/rules | 19 +++++++++++ debian/source/format | 1 + secop/version.py | 81 ++++++++++++++++++++++++++++++++++++++++++++ setup.py | 61 +++++++++++++++++++++++++++++++++ 11 files changed, 295 insertions(+) create mode 100644 debian/README create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/docs create mode 100755 debian/rules create mode 100644 debian/source/format create mode 100644 secop/version.py create mode 100644 setup.py diff --git a/.gitignore b/.gitignore index 7706128..285de8a 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,6 @@ pid/* # ide .idea + +RELEASE-VERSION +build diff --git a/debian/README b/debian/README new file mode 100644 index 0000000..f925e08 --- /dev/null +++ b/debian/README @@ -0,0 +1,6 @@ +The Debian Package secop-core +----------------------------- + +SECoP is currently under development. + + -- Enrico Faulhaber Fri, 21 Jul 2017 10:32:04 +0200 diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..88fd024 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,73 @@ +secop-core (0.0.1) UNRELEASED; urgency=medium + + [ Enrico Faulhaber ] + * Changes. + * First checkin, base point for development + * move handlers to messages + * enhance docu a little + + [ Erik Dahlbäck ] + * This is a test commit + * Revert "This is a test commit" + + [ Enrico Faulhaber ] + * Devices infrastructure and minimal server + * rework on transport (encoding/framing) and dispatcher + + [ Alexander Lenz ] + * Improvements. + * Fix/Improve startup/init. + * Fix deprecated imports. + + [ Enrico Faulhaber ] + * [Test] Erik is testing SECoP with PVEPICS module + * demo syntax from Markus Zolliker, initial commit + test file + * Implement a variant of the Demo protocol from Markus + * split epics related devices into epics.py + * apply validators to before calling write_func + * use per instance copies of PARAMS + * Remove Features + * coding style: adopt pep8 + * provide class and baseclass parameters + * Unify error handling (a little more) + * provide a status2 parameter + * unsubscribe upon disconnect + * Fix dispatcher._setParamValue + * reworking messages + * fix wrong replies for change and do + * Update docu to reflect current implementation. + * Provide basic client Object + * Pep8 improvements + cleanup + * Fix some bugs. + + [ Alexander Lenz ] + * Stub debug client gui. + + [ Enrico Faulhaber ] + * Polishing + * Bug hunting and polishing + * polishing for a demo + * implement configurable module-properties + * provide anchor point for test suite using pytest + * Use mlzlog for better logging + + [ Erik Dahlbäck ] + * rework Epics support/testing with LS336 + * fix whitespace issues + + [ Enrico Faulhaber ] + * autopep8 + * GUI: show grouping of parameters + * implement datatypes + * replace validators with datatypes + * update docs + * remove obsolete file + * (over-)improve error loging during startup + * datatypes: fix serialisation for unlimited types + * fix logging + * Switch descriptive data to new format + * provide debian control files + + [ Alexander Lenz ] + + -- Enrico Faulhaber Wed, 19 Jul 2017 10:49:20 +0200 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..3012466 --- /dev/null +++ b/debian/control @@ -0,0 +1,22 @@ +Source: secop-playground +Section: misc +Priority: extra +Maintainer: Enrico Faulhaber +Build-Depends: debhelper (>= 9.0.0), + git, + python (>= 2.7), + python-setuptools +Standards-Version: 3.9.3 + +Package: secop-core +Architecture: all +Depends: python (>= 2.7), + python-setuptools, + python-numpy, + python-psutil (>= 0.4), + python-pytango, + python-mlzlog, + markdown, + python-daemon, + python-pytest +Description: SECoP Playground core system diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..82f5c43 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,28 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: playground +Source: http://forge.frm2.tum.de/cgit/cgit.cgi/frm2/sine2020/secop/playground.git + +Files: * +Copyright: 2016-2017 by the SECOP contributors (see AUTHORS) +License: GPL-2 + +Files: debian/* +Copyright: 2015-2017 Enrico Faulhaber +License: GPL-2 + +License: GPL-2 + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + . + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see . + . + On Debian systems, the complete text of the GNU General + Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". diff --git a/debian/docs b/debian/docs new file mode 100644 index 0000000..e69de29 diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..2d3ce94 --- /dev/null +++ b/debian/rules @@ -0,0 +1,19 @@ +#!/usr/bin/make -f +# -*- makefile -*- + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +DEBPYTHON_DEFAULT=2.7 +DEBPYTHON_SUPPORTED=2.7 + +export DEBPYTHON_DEFAULT DEBPYTHON_SUPPORTED + +override_dh_install: + dh_install --list-missing + +override_dh_installinit: + dh_installinit --onlyscripts + +%: + dh $@ --with python2 --buildsystem=python_distutils diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..89ae9db --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/secop/version.py b/secop/version.py new file mode 100644 index 0000000..dbb9dec --- /dev/null +++ b/secop/version.py @@ -0,0 +1,81 @@ +# -*- coding: utf-8 -*- +# ***************************************************************************** +# MLZ library of Tango servers +# Copyright (c) 2015-2017 by the authors, see LICENSE +# +# This program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +# details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Module authors: +# Douglas Creager +# This file is placed into the public domain. +# +# ***************************************************************************** + +from __future__ import print_function + +import os.path +from subprocess import Popen, PIPE + +__all__ = ['get_version'] + +RELEASE_VERSION_FILE = os.path.join(os.path.dirname(__file__), + 'RELEASE-VERSION') +GIT_REPO = os.path.join(os.path.dirname(__file__), '..', '.git') + + +def get_git_version(abbrev=4, cwd=None): + try: + p = Popen(['git', '--git-dir=%s' % GIT_REPO, + 'describe', '--abbrev=%d' % abbrev], + stdout=PIPE, stderr=PIPE) + stdout, _stderr = p.communicate() + return stdout.strip().decode('utf-8', 'ignore') + except Exception: + return None + + +def read_release_version(): + try: + with open(RELEASE_VERSION_FILE) as f: + return f.readline().strip() + except Exception: + return None + + +def write_release_version(version): + with open(RELEASE_VERSION_FILE, 'w') as f: + f.write("%s\n" % version) + + +def get_version(abbrev=4): + # determine the version from git and from RELEASE-VERSION + git_version = get_git_version(abbrev) + release_version = read_release_version() + + # if we have a git version, it is authoritative + if git_version: + if git_version != release_version: + write_release_version(git_version) + return git_version + elif release_version: + return release_version + else: + raise ValueError('Cannot find a version number - make sure that ' + 'git is installed or a RELEASE-VERSION file is ' + 'present!') + + +if __name__ == "__main__": + print(get_version()) diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..ebd181b --- /dev/null +++ b/setup.py @@ -0,0 +1,61 @@ +# -*- coding: utf-8 -*- +# ***************************************************************************** +# MLZ Tango client tool +# Copyright (c) 2015-2016 by the authors, see LICENSE +# +# This program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +# details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Module authors: +# Georg Brandl +# +# ***************************************************************************** + +from setuptools import setup, find_packages +from os import path, listdir +from glob import glob + +import secop.version + + +scripts = glob(path.join('bin', 'secop-*')) + +uidir = path.join(path.dirname(__file__), 'secop', 'gui', 'ui') +uis = [path.join('gui', 'ui', entry) for entry in listdir(uidir)] + +setup( + name = 'secop-core', + version = secop.version.get_version(), + license = 'GPL', + author = 'Enrico Faulhaber', + author_email = 'enrico.faulhaber@frm2.tum.de', + description = 'SECoP Playground core system', + packages = find_packages(), + package_data = {'secop': ['RELEASE-VERSION'] + uis}, + scripts = scripts, + classifiers = [ + 'Development Status :: 6 - Mature', + 'Intended Audience :: Developers', + 'Intended Audience :: Science/Research', + 'Natural Language :: English', + 'License :: OSI Approved :: GPL License', + 'Operating System :: OS Independent', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Topic :: Scientific/Engineering', + 'Topic :: Scientific/Engineering :: Human Machine Interfaces', + 'Topic :: Scientific/Engineering :: Physics', + ], +)