[pkg] various debian packaging fixes
- stop using *.install.in files, just use wildcards in *.install
- switch to X-Python-Version (preferred for dh_python2)
- also call dh_python2 for /usr/share/cubicweb, not just public modules
- drop long obsolete ginco and erudi migration code from cubicweb-ctl.postinst
- fix cubicweb-ctl cleanup: purge code belongs in postrm, not prerm
- don't compress changelog.html
--- a/debian/control Tue Jul 28 18:06:46 2015 +0200
+++ b/debian/control Tue Jul 28 18:57:21 2015 +0200
@@ -20,7 +20,7 @@
python-lxml,
Standards-Version: 3.9.1
Homepage: http://www.cubicweb.org
-XS-Python-Version: >= 2.6
+X-Python-Version: >= 2.6
Package: cubicweb
Architecture: all
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/debian/cubicweb-common.install Tue Jul 28 18:57:21 2015 +0200
@@ -0,0 +1,4 @@
+usr/lib/python2*/*-packages/cubicweb/entities/
+usr/lib/python2*/*-packages/cubicweb/ext/
+usr/share/cubicweb/cubes/
+usr/lib/python2*/*-packages/cubicweb/*.py
--- a/debian/cubicweb-common.install.in Tue Jul 28 18:06:46 2015 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-usr/lib/PY_VERSION/*-packages/cubicweb/entities/
-usr/lib/PY_VERSION/*-packages/cubicweb/ext/
-usr/share/cubicweb/cubes/
-usr/lib/PY_VERSION/*-packages/cubicweb/*.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/debian/cubicweb-ctl.install Tue Jul 28 18:57:21 2015 +0200
@@ -0,0 +1,3 @@
+usr/bin/cubicweb-ctl usr/bin/
+usr/lib/python2*/*-packages/cubicweb/cwctl.py
+../cubicweb-ctl.bash_completion etc/bash_completion.d/cubicweb-ctl
--- a/debian/cubicweb-ctl.install.in Tue Jul 28 18:06:46 2015 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-usr/bin/cubicweb-ctl usr/bin/
-usr/lib/PY_VERSION/*-packages/cubicweb/cwctl.py
-../cubicweb-ctl.bash_completion etc/bash_completion.d/cubicweb-ctl
--- a/debian/cubicweb-ctl.postinst Tue Jul 28 18:06:46 2015 +0200
+++ b/debian/cubicweb-ctl.postinst Tue Jul 28 18:57:21 2015 +0200
@@ -10,32 +10,6 @@
;;
esac
-if [ "$1" = configure ]; then
- # XXX bw compat: erudi -> cubicweb migration
- if [ -e "/etc/erudi.d/" ]; then
- mv /etc/erudi.d/* /etc/cubicweb.d/ && (
- echo 'moved /etc/erudi.d/* to /etc/cubicweb.d/'
- sed -i s/ginco/cubicweb/g /etc/*/*.py
- sed -i s/erudi/cubicweb/ */*.conf
- ) || true # empty dir
- fi
- if [ -e "/var/log/erudi/" ]; then
- mv /var/log/erudi/* /var/log/cubicweb/ && (
- echo 'moved /var/log/erudi/* to /var/log/cubicweb/'
- ) || true # empty dir
- fi
- if [ -e "/var/lib/erudi/backup" ]; then
- mv /var/lib/erudi/backup/* /var/lib/cubicweb/backup/ && (
- echo 'moved /var/lib/erudi/backup/* to /var/lib/cubicweb/backup/'
- ) || true # empty dir
- fi
- if [ -e "/var/lib/erudi/instances" ]; then
- mv /var/lib/erudi/instances/* /var/lib/cubicweb/instances/ && (
- echo 'moved /var/lib/erudi/instances/* to /var/lib/cubicweb/instances/'
- ) || true # empty dir
- fi
-fi
-
#DEBHELPER#
exit 0
--- a/debian/cubicweb-ctl.postrm Tue Jul 28 18:06:46 2015 +0200
+++ b/debian/cubicweb-ctl.postrm Tue Jul 28 18:57:21 2015 +0200
@@ -1,8 +1,15 @@
#!/bin/sh -e
-if [ "$1" = "purge" ] ; then
+
+if [ "$1" = "remove" ]; then
update-rc.d cubicweb remove >/dev/null
fi
+if [ "$1" = "purge" ] ; then
+ rm -rf /etc/cubicweb.d/
+ rm -rf /var/log/cubicweb/
+ rm -rf /var/lib/cubicweb/
+fi
+
#DEBHELPER#
exit 0
--- a/debian/cubicweb-ctl.prerm Tue Jul 28 18:06:46 2015 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-#! /bin/sh -e
-
-case "$1" in
- purge)
- rm -rf /etc/cubicweb.d/
- rm -rf /var/log/cubicweb/
- rm -rf /var/lib/cubicweb/
- ;;
-esac
-
-#DEBHELPER#
-
-exit 0
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/debian/cubicweb-dev.install Tue Jul 28 18:57:21 2015 +0200
@@ -0,0 +1,10 @@
+usr/lib/python2*/*-packages/cubicweb/devtools/
+usr/lib/python2*/*-packages/cubicweb/skeleton/
+usr/lib/python2*/*-packages/cubicweb/test
+usr/lib/python2*/*-packages/cubicweb/entities/test
+usr/lib/python2*/*-packages/cubicweb/ext/test
+usr/lib/python2*/*-packages/cubicweb/server/test
+usr/lib/python2*/*-packages/cubicweb/sobjects/test
+usr/lib/python2*/*-packages/cubicweb/hooks/test
+usr/lib/python2*/*-packages/cubicweb/web/test
+usr/lib/python2*/*-packages/cubicweb/etwist/test
--- a/debian/cubicweb-dev.install.in Tue Jul 28 18:06:46 2015 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-usr/lib/PY_VERSION/*-packages/cubicweb/devtools/
-usr/lib/PY_VERSION/*-packages/cubicweb/skeleton/
-usr/lib/PY_VERSION/*-packages/cubicweb/test
-usr/lib/PY_VERSION/*-packages/cubicweb/entities/test
-usr/lib/PY_VERSION/*-packages/cubicweb/ext/test
-usr/lib/PY_VERSION/*-packages/cubicweb/server/test
-usr/lib/PY_VERSION/*-packages/cubicweb/sobjects/test
-usr/lib/PY_VERSION/*-packages/cubicweb/hooks/test
-usr/lib/PY_VERSION/*-packages/cubicweb/web/test
-usr/lib/PY_VERSION/*-packages/cubicweb/etwist/test
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/debian/cubicweb-documentation.install Tue Jul 28 18:57:21 2015 +0200
@@ -0,0 +1,3 @@
+../../doc/book usr/share/doc/cubicweb-documentation
+../../doc/_build/html usr/share/doc/cubicweb-documentation
+../../debian/cubicweb-doc usr/share/doc-base/cubicweb-doc
--- a/debian/cubicweb-documentation.install.in Tue Jul 28 18:06:46 2015 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-../../doc/book usr/share/doc/cubicweb-documentation
-../../doc/_build/html usr/share/doc/cubicweb-documentation
-../../debian/cubicweb-doc usr/share/doc-base/cubicweb-doc
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/debian/cubicweb-server.install Tue Jul 28 18:57:21 2015 +0200
@@ -0,0 +1,5 @@
+usr/lib/python2*/*-packages/cubicweb/server/
+usr/lib/python2*/*-packages/cubicweb/hooks/
+usr/lib/python2*/*-packages/cubicweb/sobjects/
+usr/lib/python2*/*-packages/cubicweb/schemas/
+usr/share/cubicweb/migration/
--- a/debian/cubicweb-server.install.in Tue Jul 28 18:06:46 2015 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-usr/lib/PY_VERSION/*-packages/cubicweb/server/
-usr/lib/PY_VERSION/*-packages/cubicweb/hooks/
-usr/lib/PY_VERSION/*-packages/cubicweb/sobjects/
-usr/lib/PY_VERSION/*-packages/cubicweb/schemas/
-usr/share/cubicweb/migration/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/debian/cubicweb-twisted.install Tue Jul 28 18:57:21 2015 +0200
@@ -0,0 +1,1 @@
+usr/lib/python2*/*-packages/cubicweb/etwist/
--- a/debian/cubicweb-twisted.install.in Tue Jul 28 18:06:46 2015 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-usr/lib/PY_VERSION/*-packages/cubicweb/etwist/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/debian/cubicweb-web.install Tue Jul 28 18:57:21 2015 +0200
@@ -0,0 +1,4 @@
+usr/lib/python2*/*-packages/cubicweb/web
+usr/lib/python2*/*-packages/cubicweb/wsgi
+usr/share/cubicweb/cubes/shared/data
+usr/share/cubicweb/cubes/shared/wdoc
--- a/debian/cubicweb-web.install.in Tue Jul 28 18:06:46 2015 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-usr/lib/PY_VERSION/*-packages/cubicweb/web
-usr/lib/PY_VERSION/*-packages/cubicweb/wsgi
-usr/share/cubicweb/cubes/shared/data
-usr/share/cubicweb/cubes/shared/wdoc
--- a/debian/pycompat Tue Jul 28 18:06:46 2015 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-2
--- a/debian/rules Tue Jul 28 18:06:46 2015 +0200
+++ b/debian/rules Tue Jul 28 18:57:21 2015 +0200
@@ -5,8 +5,6 @@
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
-PY_VERSION:=$(shell pyversions -d)
-
build: build-stamp
build-stamp:
dh_testdir
@@ -28,10 +26,9 @@
#rm -rf debian/cubicweb-*/
find . -name "*.pyc" -delete
-$(MAKE) -C doc clean
- rm -f $(basename $(wildcard debian/*.in))
dh_clean
-install: build $(basename $(wildcard debian/*.in))
+install: build
dh_testdir
dh_testroot
dh_clean
@@ -50,30 +47,28 @@
dh_lintian
# Remove unittests directory (should be available in cubicweb-dev only)
- rm -rf debian/cubicweb-server/usr/lib/${PY_VERSION}/*-packages/cubicweb/server/test
- rm -rf debian/cubicweb-server/usr/lib/${PY_VERSION}/*-packages/cubicweb/hooks/test
- rm -rf debian/cubicweb-server/usr/lib/${PY_VERSION}/*-packages/cubicweb/sobjects/test
- rm -rf debian/cubicweb-web/usr/lib/${PY_VERSION}/*-packages/cubicweb/web/test
- rm -rf debian/cubicweb-twisted/usr/lib/${PY_VERSION}/*-packages/cubicweb/etwist/test
- rm -rf debian/cubicweb-common/usr/lib/${PY_VERSION}/*-packages/cubicweb/ext/test
- rm -rf debian/cubicweb-common/usr/lib/${PY_VERSION}/*-packages/cubicweb/entities/test
+ rm -rf debian/cubicweb-server/usr/lib/python2*/*-packages/cubicweb/server/test
+ rm -rf debian/cubicweb-server/usr/lib/python2*/*-packages/cubicweb/hooks/test
+ rm -rf debian/cubicweb-server/usr/lib/python2*/*-packages/cubicweb/sobjects/test
+ rm -rf debian/cubicweb-web/usr/lib/python2*/*-packages/cubicweb/web/test
+ rm -rf debian/cubicweb-twisted/usr/lib/python2*/*-packages/cubicweb/etwist/test
+ rm -rf debian/cubicweb-common/usr/lib/python2*/*-packages/cubicweb/ext/test
+ rm -rf debian/cubicweb-common/usr/lib/python2*/*-packages/cubicweb/entities/test
-%: %.in
- sed "s/PY_VERSION/${PY_VERSION}/g" < $< > $@
-
# Build architecture-independent files here.
binary-indep: build install
dh_testdir
dh_testroot -i
dh_python2 -i
+ dh_python2 -i /usr/share/cubicweb
dh_installinit -i -n --name cubicweb -u"defaults 99"
dh_installlogrotate -i
dh_installdocs -i -A README
dh_installman -i
dh_installchangelogs -i -Xdoc/changes
dh_link -i
- dh_compress -i -X.py -X.ini -X.xml -X.js -X.rst -X.txt
+ dh_compress -i -X.py -X.ini -X.xml -X.js -X.rst -X.txt -Xchangelog.html
dh_fixperms -i
dh_installdeb -i
dh_gencontrol -i