From f668f9c6cdc4fcea1c647959feed42359eb78009 Mon Sep 17 00:00:00 2001 From: Simon Lejeune Date: Tue, 2 Sep 2014 12:19:28 +0200 Subject: [PATCH] [FIX] Debian: updated informations and dependencies, refactored debhelpers scripts to allow easy name change, simplified debhelper rules --- debian/changelog | 8 +++++++- debian/compat | 2 +- debian/control | 16 ++++++---------- debian/copyright | 23 ++++++++++------------- debian/init | 2 +- debian/openerp-server.conf | 1 + debian/postinst | 29 ++++++++++++++++++----------- debian/postrm | 16 ++++++++++++---- debian/rules | 14 +------------- 9 files changed, 57 insertions(+), 54 deletions(-) diff --git a/debian/changelog b/debian/changelog index 0ee8e0e3295..a1fb384643a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +openerp (8.0.0~rc1-0) testing; urgency=low + + * Refactored packaging + + -- Simon Lejeune Wed, 23 Jul 2014 14:59:00 +0100 + openerp (6.1-1) testing; urgency=low * New major version, new packaging. @@ -536,4 +542,4 @@ tinyerp-server (3.1.1+debian-1) unstable; urgency=low * Rebuild orig.tar.gz to remove unnecessary files in upstreams debian/. * Added changelog from website. - -- Daniel Baumann Sun, 16 Oct 2005 13:35:00 +0200 + -- Daniel Baumann Sun, 16 Oct 2005 13:35:00 +0200 \ No newline at end of file diff --git a/debian/compat b/debian/compat index 7f8f011eb73..f11c82a4cb6 100644 --- a/debian/compat +++ b/debian/compat @@ -1 +1 @@ -7 +9 \ No newline at end of file diff --git a/debian/control b/debian/control index a20f6628e4e..7f0fb3a5918 100644 --- a/debian/control +++ b/debian/control @@ -1,11 +1,11 @@ Source: openerp Section: net Priority: optional -Maintainer: OpenERP SA -Build-Depends: debhelper (>= 7.0.50~), python, rsync -Standards-Version: 3.9.1 -Homepage: http://www.openerp.com/ -Vcs-Bzr: https://launchpad.net/openobject +Maintainer: Odoo SA +Build-Depends: debhelper (>= 9.0), python, rsync +Standards-Version: 3.9.5.0 +Homepage: http://www.odoo.com/ +Vcs-Git: https://github.com/odoo/odoo Package: openerp Section: net @@ -13,13 +13,12 @@ Architecture: all Depends: ${misc:Depends}, adduser, - python, postgresql-client, + python, python-dateutil, python-decorator, python-docutils, python-feedparser, - python-gdata, python-imaging, python-jinja2, python-ldap, @@ -43,11 +42,9 @@ Depends: python-unittest2, python-vatnumber, python-vobject, - python-webdav, python-werkzeug, python-xlwt, python-yaml, - python-zsi Conflicts: tinyerp-server, openerp-server, openerp-web Replaces: tinyerp-server, openerp-server, openerp-web Recommends: @@ -64,4 +61,3 @@ Description: OpenERP Enterprise Resource Management etc. Technical features include a distributed server, flexible workflows, an object database, a dynamic GUI, customizable reports, and an XML-RPC interface. - diff --git a/debian/copyright b/debian/copyright index b596794dd13..a2e84aafbd3 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,24 +1,21 @@ -Upstream-Contact: OpenERP -Upstream-Homepage: http://www.openerp.com/ +Upstream-Contact: OpenERP +Upstream-Homepage: http://www.odoo.com/ Maintainer-Contact: Debian OpenERP Maintainers Maintainer-Homepage: http://www.odoo.com/ Files: * -Copyright: (C) 2004-2011 OpenERP SA. (www.openerp.com) -License: GPL-3+ +Copyright: (C) 2004-2014 OpenERP SA. (www.openerp.com) +License: AGPL-3+ 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 + it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 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. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero 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 - can be found in /usr/share/common-licenses/GPL-3 file. - + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + \ No newline at end of file diff --git a/debian/init b/debian/init index 98e653298b2..f2dc740b5d0 100644 --- a/debian/init +++ b/debian/init @@ -12,7 +12,7 @@ # Description: Open ERP is a complete ERP and CRM software. ### END INIT INFO -PATH=/sbin:/bin:/usr/sbin:/usr/bin +PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin DAEMON=/usr/bin/openerp-server NAME=openerp-server DESC=openerp-server diff --git a/debian/openerp-server.conf b/debian/openerp-server.conf index ead261e5218..66934bed0f8 100644 --- a/debian/openerp-server.conf +++ b/debian/openerp-server.conf @@ -5,3 +5,4 @@ db_host = False db_port = False db_user = openerp db_password = False +addons_path = /usr/lib/python2.7/dist-packages/openerp/addons \ No newline at end of file diff --git a/debian/postinst b/debian/postinst index 2eccd5111ec..ea91c1d1532 100644 --- a/debian/postinst +++ b/debian/postinst @@ -2,24 +2,31 @@ set -e +ODOO_CONFIGURATION_FILE=/etc/openerp/openerp-server.conf +ODOO_GROUP="openerp" +ODOO_DATA_DIR=/var/lib/openerp +ODOO_LOG_DIR=/var/log/openerp +ODOO_USER="openerp" + case "${1}" in configure) if ! getent passwd | grep -q "^openerp:"; then - adduser --system --no-create-home --quiet --gecos 'OpenERP' --group openerp + adduser --system --no-create-home --quiet --group $ODOO_USER fi # Register "openerp" as a postgres superuser su - postgres -c "createuser -s openerp" 2> /dev/null || true - chown openerp:openerp /etc/openerp/openerp-server.conf - chmod 0640 /etc/openerp/openerp-server.conf - # Creating log file - mkdir -p /var/log/openerp/ - chown openerp:openerp /var/log/openerp - chmod 0750 /var/log/openerp - # Creating local storage directory - mkdir -p /var/lib/openerp/filestore - chown openerp:openerp -R /var/lib/openerp + # Configuration file + chown $ODOO_USER:$ODOO_GROUP $ODOO_CONFIGURATION_FILE + chmod 0640 $ODOO_CONFIGURATION_FILE + # Log + mkdir -p $ODOO_LOG_DIR + chown $ODOO_USER:$ODOO_GROUP $ODOO_LOG_DIR + chmod 0750 $ODOO_LOG_DIR + # Data dir + mkdir -p $ODOO_DATA_DIR + chown $ODOO_USER:$ODOO_GROUP $ODOO_DATA_DIR # update-python-modules NOW otherwise invoke-rc.d openerp start will fail - update-python-modules -p openerp.public + update-python-modules ;; *) ;; diff --git a/debian/postrm b/debian/postrm index bc81ce98b71..f36bb04c0c3 100644 --- a/debian/postrm +++ b/debian/postrm @@ -2,15 +2,23 @@ set -e +ODOO_LIB_DIR=/var/lib/openerp +ODOO_USER="openerp" +ODOO_GROUP="openerp" + case "${1}" in remove) - deluser --quiet --system "openerp" || true - delgroup --quiet --system --only-if-empty "openerp" || true - find /var/lib/openerp -path '/var/lib/openerp/*' ! -path '/var/lib/openerp/filestore*' -delete + deluser --quiet --system $ODOO_USER || true + delgroup --quiet --system --only-if-empty $ODOO_GROUP || true + if [ -d "$ODOO_LIB_DIR" ]; then + rm -rf $ODOO_LIB_DIR + fi ;; purge) - rm -rf /var/lib/openerp + if [ -d "$ODOO_LIB_DIR" ]; then + rm -rf $ODOO_LIB_DIR + fi ;; upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) diff --git a/debian/rules b/debian/rules index 57be1d0442b..2538f9f61e2 100755 --- a/debian/rules +++ b/debian/rules @@ -2,16 +2,4 @@ # vim:noet: %: - dh ${@} - -override_dh_pysupport: - echo "rsync" - sh -c "[ -d debian/openerp/usr/lib/python2.6 ] && rsync -av openerp/ debian/openerp/usr/lib/python2.6/dist-packages/openerp/" || true - sh -c "[ -d debian/openerp/usr/lib/python2.7 ] && rsync -av openerp/ debian/openerp/usr/lib/python2.7/dist-packages/openerp/" || true - rm -Rf debian/openerp/usr/openerp debian/openerp/usr/lib/python2.6/dist-packages/tests debian/openerp/usr/lib/python2.7/dist-packages/tests - dh_pysupport - rm -Rf debian/openerp/usr/lib - -override_dh_installinit: - dh_installinit --update-rcd-params='defaults 21' - + dh ${@} \ No newline at end of file