From a9b331f789c412236016303e21b4abfb83f9aa62 Mon Sep 17 00:00:00 2001 From: joey Date: Wed, 29 Sep 1999 00:09:42 +0000 Subject: [PATCH] r284: * Enhanced debconf support -- the database is now cleaned up on package purge. * Broke all debconf support off into a dh_installdebconf script. This seems conceptually a little cleaner. --- autoscripts/postrm-debconf | 4 ++++ debian/changelog | 9 +++++++++ dh_installdeb | 4 ++-- dh_installdeb.1 | 2 -- dh_installdebconf | 31 +++++++++++++++++++++++++++++ dh_installdebconf.1 | 40 ++++++++++++++++++++++++++++++++++++++ examples/rules | 1 + examples/rules.indep | 1 + examples/rules.multi | 2 ++ examples/rules.multi2 | 1 + 10 files changed, 91 insertions(+), 4 deletions(-) create mode 100644 autoscripts/postrm-debconf create mode 100755 dh_installdebconf create mode 100644 dh_installdebconf.1 diff --git a/autoscripts/postrm-debconf b/autoscripts/postrm-debconf new file mode 100644 index 0000000..2b79156 --- /dev/null +++ b/autoscripts/postrm-debconf @@ -0,0 +1,4 @@ +if [ "$1" = purge -a -e /usr/share/debconf/confmodule.sh ]; then + . /usr/share/debconf/confmodule.sh + db_purge +fi diff --git a/debian/changelog b/debian/changelog index 0e96a2e..c5056f8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +debhelper (2.0.54) unstable; urgency=low + + * Enhanced debconf support -- the database is now cleaned up on package + purge. + * Broke all debconf support off into a dh_installdebconf script. This + seems conceptually a little cleaner. + + -- Joey Hess Tue, 28 Sep 1999 16:12:53 -0700 + debhelper (2.0.53) unstable; urgency=low * Minor changes to rules.multi2. diff --git a/dh_installdeb b/dh_installdeb index fa45cd6..d3eebe7 100755 --- a/dh_installdeb +++ b/dh_installdeb @@ -16,7 +16,7 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { # Install debian install scripts. # If any .debhelper files exist, add them into the scripts. - foreach $file (qw{postinst preinst prerm postrm config}) { + foreach $file (qw{postinst preinst prerm postrm}) { $f=pkgfile($PACKAGE,$file); if ($f) { if (-f "debian/$EXT$file.debhelper") { @@ -46,7 +46,7 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { } # Install non-executable files - foreach $file (qw{shlibs conffiles templates}) { + foreach $file (qw{shlibs conffiles}) { $f=pkgfile($PACKAGE,$file); if ($f) { doit("install","-o","root","-g","root","-m",644,"-p",$f,"$TMP/DEBIAN/$file"); diff --git a/dh_installdeb.1 b/dh_installdeb.1 index d0f8148..0ae4564 100644 --- a/dh_installdeb.1 +++ b/dh_installdeb.1 @@ -17,8 +17,6 @@ the DEBIAN directory: prerm shlibs conffiles - config - templates .P (For packages other than the first binary package listed in debian/control, you must prefix these filenames with then name of the "package.", for example, diff --git a/dh_installdebconf b/dh_installdebconf new file mode 100755 index 0000000..489db99 --- /dev/null +++ b/dh_installdebconf @@ -0,0 +1,31 @@ +#!/usr/bin/perl -w +# +# Integration with debconf. + +BEGIN { push @INC, "debian", "/usr/share/debhelper" } +use Dh_Lib; +init(); + +foreach $PACKAGE (@{$dh{DOPACKAGES}}) { + $TMP=tmpdir($PACKAGE); + $config=pkgfile($PACKAGE,"config"); + $templates=pkgfile($PACKAGE,"templates"); + + if (! -d "$TMP/DEBIAN") { + doit("install","-o","root","-g","root","-d","$TMP/DEBIAN"); + } + + if ($config ne '') { + doit("install", "-o", "root", "-g", "root", "-m", 755, "-p", + $config, "$TMP/DEBIAN/config"); + } + + if ($templates ne '') { + doit("install", "-o", "root", "-g", "root", "-m", 644, "-p", + $templates, "$TMP/DEBIAN/templates"); + } + + if (($config ne ''|| $templates ne '') && ! $dh{NOSCRIPTS}) { + autoscript($PACKAGE,"postrm","postrm-debconf"); + } +} diff --git a/dh_installdebconf.1 b/dh_installdebconf.1 new file mode 100644 index 0000000..3249502 --- /dev/null +++ b/dh_installdebconf.1 @@ -0,0 +1,40 @@ +.TH DH_INSTALLDEBCONF 1 "" "Debhelper Commands" "Debhelper Commands" +.SH NAME +dh_installdebconf \- install debconf files into package build directories +.SH SYNOPSIS +.B dh_installdebconf +.I "[debhelper options] [-n]" +.SH "DESCRIPTION" +dh_installdebconf is a debhelper program that is responsible for installing +files used by the debconf package into package build directories. +.P +It also automatically generates the postrm commands needed to +interface with debconf. See +.BR dh_installdeb (1) +for an explanation of how this works. +.P +Files named debian/package.config and debian/package.templates are installed +into the DEBIAN directory in the package build directory. +.P +For the first first binary package listed in the control file, you may use +debian/config and debian/templates instead. +.P +Note that if you use debconf, your package probably needs to depend on it. +.SH OPTIONS +.TP +.B debhelper options +See +.BR debhelper (1) +for a list of options common to all debhelper commands. +.TP +.B \-n, \--noscripts +Do not modify postrm script. +.SH ENVIRONMENT +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. +.SH "SEE ALSO" +.TP +.BR debhelper (1) +.SH AUTHOR +Joey Hess diff --git a/examples/rules b/examples/rules index 926c38c..d24c2b8 100755 --- a/examples/rules +++ b/examples/rules @@ -49,6 +49,7 @@ binary-arch: build install # dh_testversion dh_testdir dh_testroot +# dh_installdebconf dh_installdocs dh_installexamples dh_installmenu diff --git a/examples/rules.indep b/examples/rules.indep index 55802f3..ecda654 100755 --- a/examples/rules.indep +++ b/examples/rules.indep @@ -47,6 +47,7 @@ binary-indep: build install # dh_testversion dh_testdir dh_testroot +# dh_installdebconf dh_installdocs dh_installexamples dh_installmenu diff --git a/examples/rules.multi b/examples/rules.multi index bd8aa31..c3b1bd1 100755 --- a/examples/rules.multi +++ b/examples/rules.multi @@ -57,6 +57,7 @@ binary-indep: build install dh_testversion 1.1.17 dh_testdir dh_testroot +# dh_installdebconf dh_installdocs dh_installexamples dh_installmenu @@ -87,6 +88,7 @@ binary-arch: build install dh_testversion 1.1.17 dh_testdir dh_testroot +# dh_installdebconf dh_installdocs dh_installexamples dh_installmenu diff --git a/examples/rules.multi2 b/examples/rules.multi2 index 803c9ec..871c41c 100755 --- a/examples/rules.multi2 +++ b/examples/rules.multi2 @@ -56,6 +56,7 @@ binary-common: dh_testversion 1.1.17 dh_testdir dh_testroot +# dh_installdebconf dh_installdocs dh_installexamples dh_installmenu -- 2.39.2