From 7ee3f95149d553eb1d383d36dad1e4653a2d7e84 Mon Sep 17 00:00:00 2001 From: Brecht Hoflack Date: Tue, 18 Sep 2012 14:00:49 +0200 Subject: [PATCH 1/6] Allow to configure debian files Add possibility to define init, default, preinst, prerm, postinst and postrm files. --- stdeb/util.py | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/stdeb/util.py b/stdeb/util.py index 32e23935..6f24157d 100644 --- a/stdeb/util.py +++ b/stdeb/util.py @@ -126,6 +126,12 @@ def check_call(*popenargs, **kwargs): ('shared-mime-file=',None,'shared MIME file'), ('setup-env-vars=',None,'environment variables passed to setup.py'), ('udev-rules=',None,'file with rules to install to udev'), + ('init=',None,'the package init script'), + ('default=',None,'the package default file'), + ('preinst=',None,'the script to execute before installation'), + ('postinst=',None,'the script to execute after installation'), + ('prerm=',None,'the script to execute before remove'), + ('postrm=',None,'the script to execute after remove'), ] stdeb_cmd_bool_opts = [ @@ -747,6 +753,14 @@ def __init__(self, self.architecture = 'all' self.copyright_file = parse_val(cfg,module_name,'Copyright-File') + self.init_file = parse_val(cfg, module_name, 'init') + + self.default_file = parse_val(cfg, module_name, 'default') + self.preinst = parse_val(cfg, module_name, 'preinst') + self.postinst = parse_val(cfg, module_name, 'postinst') + self.prerm = parse_val(cfg, module_name, 'prerm') + self.postrm = parse_val(cfg, module_name, 'postrm') + self.mime_file = parse_val(cfg,module_name,'MIME-File') self.shared_mime_file = parse_val(cfg,module_name,'Shared-MIME-File') @@ -1194,6 +1208,37 @@ def build_dsc(debinfo, fd.write('1.0\n') fd.close() + # debian/.init + print debinfo.init_file + if debinfo.init_file != '': + link_func(debinfo.init_file, + os.path.join(debian_dir, '%s.init' % debinfo.package)) + + # debian/.default + if debinfo.default_file != '': + link_func(debinfo.default_file, + os.path.join(debian_dir, '%s.default' % debinfo.package)) + + # debian/preinst + if debinfo.preinst != '': + link_func(debinfo.preinst, + os.path.join(debian_dir, 'preinst')) + + # debian/postinst + if debinfo.postinst != '': + link_func(debinfo.postinst, + os.path.join(debian_dir, 'postinst')) + + # debian/prerm + if debinfo.prerm != '': + link_func(debinfo.prerm, + os.path.join(debian_dir, 'prerm')) + + # debian/postrm + if debinfo.postrm != '': + link_func(debinfo.postrm, + os.path.join(debian_dir, 'postrm')) + if debian_dir_only: return From 3585c1942ad23fae396c415e467b97bc0f9278d0 Mon Sep 17 00:00:00 2001 From: Brecht Hoflack Date: Wed, 19 Sep 2012 13:35:18 +0200 Subject: [PATCH 2/6] Change debhelper version to work on Lenny --- stdeb/util.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/stdeb/util.py b/stdeb/util.py index 6f24157d..25976e8a 100644 --- a/stdeb/util.py +++ b/stdeb/util.py @@ -20,7 +20,7 @@ 'expand_sdist_file','stdeb_cfg_options'] DH_MIN_VERS = '7' # Fundamental to stdeb >= 0.4 -DH_IDEAL_VERS = '7.4.3' # fixes Debian bug 548392 +DH_IDEAL_VERS = '7.0.15' # fixes Debian bug 548392 PYSUPPORT_MIN_VERS = '0.8.4' # Namespace package support was added # sometime between 0.7.5ubuntu1 and @@ -1208,8 +1208,17 @@ def build_dsc(debinfo, fd.write('1.0\n') fd.close() + print """DEBINFO + init: %s + default: %s + preinst: %s + postinst: %s + prerm: %s + postrm: %s""" % (debinfo.init_file, debinfo.default_file, debinfo.preinst, + debinfo.postinst, debinfo.prerm, debinfo.postrm) + + # debian/.init - print debinfo.init_file if debinfo.init_file != '': link_func(debinfo.init_file, os.path.join(debian_dir, '%s.init' % debinfo.package)) From 8092ccc80482c5955d049babaac5325e1bdf2c0e Mon Sep 17 00:00:00 2001 From: Brecht Hoflack Date: Wed, 19 Sep 2012 13:40:20 +0200 Subject: [PATCH 3/6] Don't set the buildsystem --- stdeb/util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdeb/util.py b/stdeb/util.py index 25976e8a..e66ad347 100644 --- a/stdeb/util.py +++ b/stdeb/util.py @@ -979,8 +979,8 @@ def __init__(self, self.dirlist = "" setup_env_vars = parse_vals(cfg,module_name,'Setup-Env-Vars') - if force_buildsystem: - setup_env_vars.append('DH_OPTIONS=--buildsystem=python_distutils') + #if force_buildsystem: + # setup_env_vars.append('DH_OPTIONS=--buildsystem=python_distutils') self.force_buildsystem = force_buildsystem self.exports = "" if len(setup_env_vars): From 920cd1f3593b7f5e2747979a9cd29ceabb3c64dd Mon Sep 17 00:00:00 2001 From: Brecht Hoflack Date: Wed, 19 Sep 2012 13:55:31 +0200 Subject: [PATCH 4/6] Revert "Don't set the buildsystem" This reverts commit 8092ccc80482c5955d049babaac5325e1bdf2c0e. --- stdeb/util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdeb/util.py b/stdeb/util.py index e66ad347..25976e8a 100644 --- a/stdeb/util.py +++ b/stdeb/util.py @@ -979,8 +979,8 @@ def __init__(self, self.dirlist = "" setup_env_vars = parse_vals(cfg,module_name,'Setup-Env-Vars') - #if force_buildsystem: - # setup_env_vars.append('DH_OPTIONS=--buildsystem=python_distutils') + if force_buildsystem: + setup_env_vars.append('DH_OPTIONS=--buildsystem=python_distutils') self.force_buildsystem = force_buildsystem self.exports = "" if len(setup_env_vars): From ebc2856eee5a4dd3e22e31698a1e11f1e7a93062 Mon Sep 17 00:00:00 2001 From: Brecht Hoflack Date: Wed, 19 Sep 2012 13:58:07 +0200 Subject: [PATCH 5/6] Don't force the buildsystem --- stdeb/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdeb/util.py b/stdeb/util.py index 25976e8a..1397efc5 100644 --- a/stdeb/util.py +++ b/stdeb/util.py @@ -645,7 +645,7 @@ def __init__(self, setup_requires=None, debian_version=None, workaround_548392=None, - force_buildsystem=None, + force_buildsystem=False, have_script_entry_points = None, pycentral_backwards_compatibility=None, use_setuptools = False, From ea808f4f07e85003d4029e3f6b93851dbd680d35 Mon Sep 17 00:00:00 2001 From: Brecht Hoflack Date: Fri, 14 Dec 2012 11:37:09 +0100 Subject: [PATCH 6/6] Merged with code on -test --- stdeb/util.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/stdeb/util.py b/stdeb/util.py index 1397efc5..28e1e370 100644 --- a/stdeb/util.py +++ b/stdeb/util.py @@ -979,8 +979,6 @@ def __init__(self, self.dirlist = "" setup_env_vars = parse_vals(cfg,module_name,'Setup-Env-Vars') - if force_buildsystem: - setup_env_vars.append('DH_OPTIONS=--buildsystem=python_distutils') self.force_buildsystem = force_buildsystem self.exports = "" if len(setup_env_vars):