[debian] various packaging updates and fixes
authorDavid Douard <david.douard@logilab.fr>
Mon, 28 Oct 2013 18:03:54 +0100
changeset 1459 ffe0a265ba3e
parent 1458 2c4842747f04
child 1460 7a72a5b694d2
[debian] various packaging updates and fixes - rename source package into cubicweb-apycot for the sake of consistency - bump debhelper and policy versions - use python-support and add proper dependencies - tell setup.py to move things to debian/tmp and dispatch with dh_install instead of with manual 'mv' calls - add (no-op) build-arch debian/rules target - ensure checkers and preprocessor are installed in usr/share/narval/
__pkginfo__.py
_apycotlib/checkers/jslint.py
debian/compat
debian/control
debian/cubicweb-apycot.install
debian/cubicweb-apycot.prerm
debian/narval-apycot.dirs
debian/narval-apycot.install
debian/rules
doc/apycot_processes_en.dia
setup.py
--- a/__pkginfo__.py	Thu Oct 24 16:46:24 2013 +0200
+++ b/__pkginfo__.py	Mon Oct 28 18:03:54 2013 +0100
@@ -4,7 +4,7 @@
 modname = 'apycot'
 distname = 'apycot'
 
-numversion = (3, 0, 0) 
+numversion = (3, 0, 0)
 version = '.'.join(str(num) for num in numversion)
 
 license = 'GPL'
@@ -20,7 +20,7 @@
     ]
 
 __depends__ = {'pyro': None,
-               'cubicweb': '>= 3.14.0',
+               'cubicweb': '>= 3.17.0',
                'cubicweb-vcsfile': '>= 1.12',
                'cubicweb-file': None,
                'cubicweb-narval': '>= 4',
@@ -56,5 +56,11 @@
 # Note: here, you'll need to add subdirectories if you want
 # them to be included in the debian package
 
-if isdir('ext'):
-    data_files.append([join('share', 'apycot', 'ext'), listdir('ext')])
+if isdir('_apycotlib'): # test REQUIRED (to beimportable from everywhere)
+    data_files.append([join('share', 'narval', 'checkers', modname),
+                       listdir(join('_apycotlib', 'checkers'))])
+    data_files.append([join('share', 'narval', 'preprocessors', modname),
+                       listdir(join('_apycotlib', 'preprocessors'))])
+if isdir('ext'): # test REQUIRED (to beimportable from everywhere)
+    data_files.append([join('share', 'narval', 'data', modname),
+                       listdir(join('ext',))])
--- a/_apycotlib/checkers/jslint.py	Thu Oct 24 16:46:24 2013 +0200
+++ b/_apycotlib/checkers/jslint.py	Mon Oct 28 18:03:54 2013 +0100
@@ -12,7 +12,7 @@
 # apycot/_apycotlib/checkers
 JSLINT_PATH = join(dirname(dirname(dirname(abspath(__file__)))), 'ext', 'jslint.js')
 if not exists(JSLINT_PATH):
-    JSLINT_PATH = '/usr/share/apycot/ext/jslint.js'
+    JSLINT_PATH = '/usr/share/narval/data/apycot/jslint.js'
 
 class JsLintParser(OutputParser):
     """Simple Parser class interpretting
--- a/debian/compat	Thu Oct 24 16:46:24 2013 +0200
+++ b/debian/compat	Mon Oct 28 18:03:54 2013 +0100
@@ -1,1 +1,1 @@
-5
+7
--- a/debian/control	Thu Oct 24 16:46:24 2013 +0200
+++ b/debian/control	Mon Oct 28 18:03:54 2013 +0100
@@ -1,21 +1,28 @@
-Source: apycot
+Source: cubicweb-apycot
 Section: web
 Priority: optional
 Maintainer: Logilab Packaging Team <contact@logilab.fr>
 Uploaders: Sylvain Thenault <sylvain.thenault@logilab.fr>,
-           Pierre-Yves David <pierre-yves.david@logilab.fr>
-Build-Depends: debhelper (>= 5.0.38), python (>= 2.5), python-central (>= 0.5)
-Build-Depends-Indep: python-support
+           David Douard <david.douard@logilab.fr>
+Build-Depends: debhelper (>= 7), python (>= 2.6), python-support
 Standards-Version: 3.9.1
-XS-Python-Version: >= 2.5, << 3.0
+XS-Python-Version: >= 2.6
 Homepage: http://www.cubicweb.org/project/cubicweb-apycot
 
 Package: cubicweb-apycot
 Architecture: all
-XB-Python-Version: ${python:Versions}
-Depends: ${misc:Depends}, ${python:Depends}, cubicweb-common (>= 3.14.0), cubicweb-vcsfile (>= 1.12), cubicweb-file (>= 1.8.2), cubicweb-narval (>= 4.0.0), pyro, python-pygments
+Depends:
+ cubicweb-common (>= 3.17.0),
+ cubicweb-vcsfile (>= 1.12),
+ cubicweb-file (>= 1.14.0),
+ cubicweb-narval (>= 4.0.0),
+ python-pygments,
+ ${misc:Depends},
+ ${python:Depends},
 Recommends: cubicweb-jqplot (>= 0.1.2)
-Suggests: cubicweb-tracker, cubicweb-nosylist (>= 0.5.0)
+Suggests:
+ cubicweb-tracker,
+ cubicweb-nosylist (>= 0.5.0),
 Description: apycot component for the CubicWeb framework
  This CubicWeb component store data from the Apycot testing framework
  and provides multi-criteria reports.
@@ -24,8 +31,15 @@
 
 Package: narval-apycot
 Architecture: all
-XB-Python-Version: ${python:Versions}
-Depends: ${misc:Depends}, ${python:Depends}, narval-bot (>= 4.0.0)
-Recommends: pylint, python-coverage, logilab-packaging
+Depends:
+ narval-bot (>= 4.0.0),
+ python-unittest2 | python (>= 2.7),
+ mercurial (>= 2.2),
+ ${misc:Depends},
+ ${python:Depends},
+Recommends:
+ pylint,
+ python-coverage,
+ logilab-packaging,
 Description: apycot extensions for the narval agent
- Provides a basic set of Narval actions for Continuous Integration.
+ Provides a basic set of Narval checkers for Continuous Integration.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debian/cubicweb-apycot.install	Mon Oct 28 18:03:54 2013 +0100
@@ -0,0 +1,1 @@
+usr/share/cubicweb/cubes/apycot
--- a/debian/cubicweb-apycot.prerm	Thu Oct 24 16:46:24 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-#!/bin/sh -e
-
-delete_pyo_pyc () {
-  find /usr/share/cubicweb/cubes/apycot -name "*.pyc" | xargs rm -f
-  find /usr/share/cubicweb/cubes/apycot -name "*.pyo" | xargs rm -f
-}
-
-
-case "$1" in
-    failed-upgrade|abort-install|abort-upgrade|disappear)
-    ;;
-    upgrade)
-    delete_pyo_pyc
-    ;;
-    remove)
-    delete_pyo_pyc
-    ;;
-    purge)
-    ;;
-
-    *)
-        echo "postrm called with unknown argument \`$1'" >&2
-        exit 1
-
-esac
-
-#DEBHELPER#
--- a/debian/narval-apycot.dirs	Thu Oct 24 16:46:24 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-usr/lib/
-usr/share/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debian/narval-apycot.install	Mon Oct 28 18:03:54 2013 +0100
@@ -0,0 +1,4 @@
+usr/share/narval/checkers
+usr/share/narval/preprocessors
+usr/share/narval/data
+usr/lib/python*
--- a/debian/rules	Thu Oct 24 16:46:24 2013 +0200
+++ b/debian/rules	Mon Oct 28 18:03:54 2013 +0100
@@ -4,18 +4,21 @@
 
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
-build: build-stamp
+build: build-arch build-indep
+build-arch:
+	# Nothing to do
+
+build-indep: build-stamp
 build-stamp:
 	dh_testdir
 	NO_SETUPTOOLS=1 python setup.py -q build
-	touch build-stamp
+	>$@
 
 clean:
 	dh_testdir
-	dh_testroot
-	rm -f build-stamp configure-stamp
+	rm -f build-stamp
 	rm -rf build
-	find . -name "*.pyc" | xargs rm -f
+	find . -name "*.pyc" -delete
 	dh_clean
 
 install: build
@@ -23,21 +26,17 @@
 	dh_testroot
 	dh_clean -k
 	dh_installdirs -i
-	NO_SETUPTOOLS=1 python setup.py -q install --no-compile --prefix=debian/cubicweb-apycot/usr/
-	mv debian/cubicweb-apycot/usr/share/apycot debian/narval-apycot/usr/share/
-	mv debian/cubicweb-apycot/usr/lib/python* debian/narval-apycot/usr/lib/
-	mv debian/narval-apycot/usr/lib/python*/site-packages/narval debian/narval-apycot/usr/share/
-
+	NO_SETUPTOOLS=1 python setup.py -q install --no-compile --prefix=debian/tmp/usr/
 
 # Build architecture-independent files here.
 binary-indep: build install
 	dh_testdir
 	dh_testroot
-	dh_install -i
-	dh_pycentral -i
+	dh_install -i --list-missing
+	dh_pysupport -i /usr/share/cubicweb /usr/share/narval
 	dh_installchangelogs -i
 	dh_installexamples -i
-	dh_installdocs -i
+	dh_installdocs -i -A README
 	dh_installman -i
 	dh_link -i
 	dh_compress -i -X.py -X.ini -X.xml -Xtest
Binary file doc/apycot_processes_en.dia has changed
--- a/setup.py	Thu Oct 24 16:46:24 2013 +0200
+++ b/setup.py	Mon Oct 28 18:03:54 2013 +0100
@@ -20,7 +20,7 @@
     from distutils.core import setup
     from distutils.command import install_lib
     USE_SETUPTOOLS = 0
-
+from distutils.command import install_data
 
 sys.modules.pop('__pkginfo__', None)
 # import required features
@@ -119,6 +119,16 @@
             raise
     walk(from_dir, make_mirror, None)
 
+# write required share/cubicweb/cubes/__init__.py
+class MyInstallData(install_data.install_data):
+    """A class That manages data files installation"""
+    def run(self):
+        """overridden from install_data class"""
+        install_data.install_data.run(self)
+        path = join(self.install_dir, 'share', 'narval', 'preprocessors', '__init__.py')
+        ini = open(path, 'w')
+        ini.write('# Apycot preprocessors directory\n')
+        ini.close()
 
 class MyInstallLib(install_lib.install_lib):
     """extend install_lib command to handle  package __init__.py and
@@ -145,12 +155,8 @@
     if USE_SETUPTOOLS and install_requires:
         kwargs['install_requires'] = install_requires
         kwargs['dependency_links'] = dependency_links
-    kwargs['packages'] = ('apycotlib',
-                          'apycotlib.preprocessors',
-                          'narval.checkers.apycot')
+    kwargs['packages'] = ('apycotlib',)
     kwargs['package_dir'] = {'apycotlib' : '_apycotlib',
-                             'apycotlib.preprocessors': '_apycotlib/preprocessors',
-                             'narval.checkers.apycot': '_apycotlib/checkers',
                              }
     return setup(name = distname,
                  version = version,
@@ -163,7 +169,8 @@
                  scripts = ensure_scripts(scripts),
                  data_files = data_files,
                  ext_modules = ext_modules,
-                 cmdclass = {'install_lib': MyInstallLib},
+                 cmdclass = {'install_lib': MyInstallLib,
+                             'install_data': MyInstallData,},
                  **kwargs
                  )