zope-debhelper-0.3.15/0000755000000000000000000000000011600075531011371 5ustar zope-debhelper-0.3.15/debian/0000755000000000000000000000000011600075531012613 5ustar zope-debhelper-0.3.15/debian/control0000644000000000000000000000157111600073710014217 0ustar Source: zope-debhelper Section: zope Priority: extra Maintainer: Debian/Ubuntu Zope team Uploaders: Fabio Tranchitella , Andrea Mennucci , martin f. krafft , Matthias Klose , Bernd Zeimetz , Jonas Meurer Build-Depends: debhelper (>= 6.0.0) Build-Depends-Indep: perl (>= 5.6.1) Standards-Version: 3.9.2 Vcs-Browser: http://svn.debian.org/wsvn/pkg-zope/zope-debhelper/trunk Vcs-Svn: svn://svn.debian.org/svn/pkg-zope/zope-debhelper/trunk Package: zope-debhelper Architecture: all Depends: ${perl:Depends}, ${misc:Depends}, debhelper (>= 4.2.32) Suggests: zope-common Description: debhelper script for zope packaging The package contains dh_installzope and dh_installzopeinstance debhelper scripts used for zope packaging tasks. zope-debhelper-0.3.15/debian/rules0000755000000000000000000000311311600074462013673 0ustar #!/usr/bin/make -f # -*- makefile -*- # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 VERSION=$(shell expr "`dpkg-parsechangelog 2>/dev/null |grep Version:`" : '.*Version: \(.*\)') POD2MAN=pod2man -c Debhelper -r "$(VERSION)" build-indep: $(POD2MAN) dh_installzope dh_installzope.1 $(POD2MAN) dh_installzopeinstance dh_installzopeinstance.1 for p in autoscripts/*-dzproduct; do \ e=$$(echo $$p | sed 's/dzproduct/dzextension/'); \ sed 's/product/extension/g' $$p > $$e; \ done build-arch: build: build-indep build-arch clean: dh_testdir dh_testroot rm -f dh_installzope.1 rm -f dh_installzopeinstance.1 rm -f autoscripts/*-dzextension dh_clean install: build dh_testdir dh_testroot dh_clean -k dh_installdirs \ usr/bin \ usr/share/man/man1 \ usr/share/debhelper/autoscripts cp -p dh_installzope debian/zope-debhelper/usr/bin/ cp -p dh_installzope.1 debian/zope-debhelper/usr/share/man/man1/ cp -p dh_installzopeinstance debian/zope-debhelper/usr/bin/ cp -p dh_installzopeinstance.1 debian/zope-debhelper/usr/share/man/man1/ cp -p autoscripts/* debian/zope-debhelper/usr/share/debhelper/autoscripts/ # Build architecture-independent files here. binary-indep: build install dh_testdir dh_testroot dh_installchangelogs dh_installdocs dh_compress dh_fixperms dh_installdeb dh_perl dh_gencontrol dh_md5sums dh_builddeb # Build architecture-dependent files here. binary-arch: build install # We have nothing to do by default. binary: binary-indep binary-arch .PHONY: build-indep build-arch build binary-indep binary-arch binary install clean zope-debhelper-0.3.15/debian/changelog0000644000000000000000000002430711600075437014500 0ustar zope-debhelper (0.3.15) unstable; urgency=low * add zope2.13 and 2.14 to list of known zope versions in dh_installzope * add python2.7 to list of known python versions in dh_installzope * bump standards-version to 3.9.2, no changes needed * migrate the package to "3.0 (native)" format -- Jonas Meurer Tue, 21 Jun 2011 13:05:55 +0200 zope-debhelper (0.3.14) unstable; urgency=high * use 'invoke-rc.d {start|stop} {ZEOSERVER|INSTANCE}=$INSTANCE' in maintainer scripts instead of dzhandle. That is required in order to fix bug #540158 and #540159. * bump dependency on zope-common to 0.5.49 both in dh_installzope and dh_installzopeinstance. * set urgency=high for that reason. -- Jonas Meurer Sun, 09 Aug 2009 15:56:18 +0200 zope-debhelper (0.3.13) unstable; urgency=low * update section to zope. -- Jonas Meurer Mon, 06 Jul 2009 02:06:29 +0200 zope-debhelper (0.3.12) unstable; urgency=low [ Bernd Zeimetz ] * debian/control: - Updating my email address. [ Jonas Meurer ] * add zope2.11 and zope2.12 to known zope versions in dh_installzope * add python2.5 and python2.6 to known python versions in dh_installzope * add myself to uploaders. * bump standards-version to 3.8.2, no changes needed. * bump debian/compat and debconf build-deps to 6. * lintian cleanup: - add utf-8 copyright symbol to debian/copyright - explicitly link to GPL-2 instead of GPL -- Jonas Meurer Mon, 06 Jul 2009 00:34:33 +0200 zope-debhelper (0.3.11) unstable; urgency=high * dh_installzopeinstance: fixed a bug, the default user for the instance should be zope:zope. (Closes: #453180) * autoscripts/postinst-dzinstance: break if something went wrong while creating the instance. * dh_installzope: add a Package field in the multiple dzproduct files mode. * dh_installzope: smartly handle ZopeVersions in a multiple dzproduct files mode. * dh_installzope,dh_installzopeinstance: depends on zope-common (>= 0.5.38). -- Fabio Tranchitella Fri, 30 Nov 2007 18:20:23 +0100 zope-debhelper (0.3.10) unstable; urgency=high * Fixing postinst-dzinstance to start the ZEO database on upgrade if it was configured by dzinstance. * Do not save automativcally generated passwords in the debconf database. High urgency as this is a security related bug. (Closes: #429736) -- Bernd Zeimetz Thu, 21 Jun 2007 17:39:03 +0100 zope-debhelper (0.3.9) experimental; urgency=low * dh_installzopeinstance: added a new field, Zope-User. -- Fabio Tranchitella Sun, 17 Jun 2007 17:16:47 +0200 zope-debhelper (0.3.8) experimental; urgency=low * dh_installzopeinstance: added support for a Zope-Database field in .dzinstance files. -- Fabio Tranchitella Sat, 16 Jun 2007 20:30:56 +0200 zope-debhelper (0.3.7) unstable; urgency=low * dh_installzopeinstance and appropriate autoscripts: - Fixing a few typos - Adding support for the 'Skeleton' option, which allows to provide skeleton dirs with a package, which are different from the default Zope skeleton - Allow a comma seperated list in the 'Products' entry of dzinstance files * Change debian/control to depend on the first version of zope-common which supports the skeleteon option. -- Bernd Zeimetz Fri, 04 May 2007 20:16:32 +0200 zope-debhelper (0.3.6) unstable; urgency=medium * Modified {config,postrm}-dzinstance autoscripts to degrade silently if debconf is not available. This is very important for the postrm script, as it could be called to purge the package without debconf installed on the system. Thanks to Lucas Nussbaum for reporting this problem. -- Fabio Tranchitella Thu, 18 Jan 2007 10:40:46 +0100 zope-debhelper (0.3.5) unstable; urgency=medium * autoscripts/postinst-dzinstance: if we are upgrading an instance which already exists, start it again at postinst time. Otherwise, the instance will be stopped before the upgrade but never restarted. -- Fabio Tranchitella Mon, 8 Jan 2007 09:30:38 +0100 zope-debhelper (0.3.4) unstable; urgency=low * Fixed rewriting of ZopeVersions field when used with a >= operator. -- Fabio Tranchitella Sat, 18 Nov 2006 14:15:25 +0100 zope-debhelper (0.3.3) unstable; urgency=medium * dh_installzope: + Support for zope2.10 by default. + Support for ">= 2.x" ZopeVersions. + Find out the package name if it is not specified by the .dzproduct file. + Support for global zope3 products. * Fix bashism in config-dzinstance (Jérémy Bobbio). * Set urgency to medium, this upload is targetted etch. -- Fabio Tranchitella Thu, 9 Nov 2006 20:22:47 +0100 zope-debhelper (0.3.2.16) unstable; urgency=low * Fixed a typo. (Closes: #385554) -- Fabio Tranchitella Sat, 2 Sep 2006 15:03:31 +0200 zope-debhelper (0.3.2.15) unstable; urgency=low * autoscripts/config-dzinstance: try to get the user debconf answer before automatically set it to "admin". -- Fabio Tranchitella Wed, 22 Mar 2006 13:09:32 +0000 zope-debhelper (0.3.2.14) unstable; urgency=low * Fixed a typo in dh_installzope manpage. (Closes: #350070) -- Fabio Tranchitella Sun, 29 Jan 2006 21:47:28 +0000 zope-debhelper (0.3.2.13) unstable; urgency=low * dh_installzope{instance,}: depends on zope-common (>= 0.5.18), which supports Zope 3.2. -- Fabio Tranchitella Wed, 18 Jan 2006 16:06:51 +0000 zope-debhelper (0.3.2.12) unstable; urgency=low * dh_installzope: add support for Zope 2.9, drop support for Zope 2.6. * dh_installzope{instance,}: depends on zope-common (>= 0.5.17), which supports Zope 2.9. -- Fabio Tranchitella Sun, 15 Jan 2006 20:22:41 +0000 zope-debhelper (0.3.2.11) unstable; urgency=low * autoscripts/config-dzinstance: don't ask for questions about instance creation if it already exists. (Closes: #340543) -- Fabio Tranchitella Thu, 24 Nov 2005 13:32:15 +0000 zope-debhelper (0.3.2.10) unstable; urgency=low * autoscripts/config-dzinstance: new code for automatic password password generation, this time it won't be bash specific. (Closes: #330217) -- Fabio Tranchitella Fri, 30 Sep 2005 13:18:04 +0000 zope-debhelper (0.3.2.9) unstable; urgency=low * Upload to unstable. -- Fabio Tranchitella Wed, 7 Sep 2005 16:07:28 +0000 zope-debhelper (0.3.2.8) experimental; urgency=low * dh_installzope: small fix (check if ZopeVersions field exists). -- Fabio Tranchitella Fri, 19 Aug 2005 13:12:03 +0000 zope-debhelper (0.3.2.7) experimental; urgency=low * dh_installzope{instance}: depend on zope-common (>= 0.5.7). * autoscripts/{config,postinst}-dzinstance: ask for instance HTTP port. * autoscripts/config-dzinstance: if the user can't provide a user or password, generate a random one and use a debconf note to show it to him. -- Fabio Tranchitella Thu, 18 Aug 2005 22:03:55 +0000 zope-debhelper (0.3.2.6) experimental; urgency=low * dh_installzope: handle dzconfigure files for Zope3 products. * dh_installzope{instance}: depend on zope-common (>= 0.5.6), or we'll have broken Zope3 products. * autoscripts/config-dzinstance: try to substitute zver variables in templates (available from zope-common 0.5.6). -- Fabio Tranchitella Wed, 17 Aug 2005 11:48:02 +0000 zope-debhelper (0.3.2.5) experimental; urgency=low * autoscripts/*: added "|| true" for some commands inside {pre,post}rm-dzinstance to allow removal/purge of broken instances. * dh_installzope{instance}: depend on zope-common (>= 0.5.5), or we'll have broken pre-packaged instances. -- Fabio Tranchitella Mon, 15 Aug 2005 08:31:50 +0000 zope-debhelper (0.3.2.4) experimental; urgency=low * debian/control: set priority to extra. * dh_installzope: small fixes to handle multiple directories as argument without installing everything in one directory and adding multiple time the same text to the substitution variables. -- Fabio Tranchitella Thu, 11 Aug 2005 16:00:10 +0000 zope-debhelper (0.3.2.3) experimental; urgency=low [dh_installzope] * Write .dzfiles with ordered keys * Use ZopeVersions (if available) while setting up zope:Depends * Allow '.' as product argument (there are a lot of products that don't unpack into a product directory), and look for a Name field in this case [autoscripts/*] * removed "test -a" and "test -o" bashisms * really call dzhandle remove-instance / purge-instance since zope-common now supports them -- Fabio Tranchitella Sun, 7 Aug 2005 15:27:13 +0000 zope-debhelper (0.3.2.2) experimental; urgency=low * autoscripts/*-dzinstances: use "-z" instead of "-Z", the man page of dzhandle is wrong. -- Fabio Tranchitella Thu, 14 Jul 2005 08:20:25 +0000 zope-debhelper (0.3.2.1) experimental; urgency=low * debian/rules: install dh_installzopeinstance, too. -- Fabio Tranchitella Tue, 28 Jun 2005 12:41:52 +0000 zope-debhelper (0.3.2) experimental; urgency=low * First release for Debian. (Closes: #299024, #120499) * Added dh_installzopeinstance and related autoscripts. * debian/control: modified dependency on debhelper, we need at least 4.2.32 for dh_installzopeinstance. -- Fabio Tranchitella Mon, 27 Jun 2005 15:35:19 +0000 zope-debhelper (0.3.1) hoary; urgency=low * Fix installation of extensions. -- Matthias Klose Tue, 29 Mar 2005 19:22:55 +0200 zope-debhelper (0.3) hoary; urgency=low * Fix example in dh_installzope(1). -- Matthias Klose Sat, 26 Feb 2005 21:12:18 +0100 zope-debhelper (0.2) hoary; urgency=low * Add autoscripts for preinst and postrm. -- Matthias Klose Thu, 24 Feb 2005 13:59:42 +0100 zope-debhelper (0.1) unstable; urgency=low * Initial Release. -- Matthias Klose Sun, 13 Feb 2005 23:31:07 +0100 zope-debhelper-0.3.15/debian/source/0000755000000000000000000000000011600075531014113 5ustar zope-debhelper-0.3.15/debian/source/format0000644000000000000000000000001511600073330015315 0ustar 3.0 (native) zope-debhelper-0.3.15/debian/compat0000644000000000000000000000000211224223364014012 0ustar 6 zope-debhelper-0.3.15/debian/copyright0000644000000000000000000000134611224234152014550 0ustar This package has been put together by Matthias Klose on Sun, 13 Feb 2005 23:31:07 +0100. Copyright: © 2005-2009 Debian Zope team Upstream Authors: Matthias Klose martin f. krafft Fabio Tranchitella Bernd Zeimetz License: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. On Debian GNU/Linux systems, the complete text of the GNU General Public License can be found in `/usr/share/common-licenses/GPL-2'. zope-debhelper-0.3.15/dh_installzopeinstance0000755000000000000000000001422711600073101016060 0ustar #!/usr/bin/perl -w =head1 NAME dh_installzopeinstance - install a zope instance into package build directories =cut use strict; use Debian::Debhelper::Dh_Lib; =head1 SYNOPSIS B [S>] [B<-n>] [S>] =head1 DESCRIPTION dh_installzopeinstance is a debhelper program that is responsible for installing zope instances into package build directories. The argument is interpreted as zope instance and will be created within the first package dh_installzopeinstance is told to act on. By default, this is the first binary package in debian/control, but if you use B<-p>, B<-i>, or B<-a> flags, it will be the first package specified by those flags. dh_installzopeinstance automatically install debian/dzinstance if it exists. If dh_installzopeinstance is acting on multiple packages, debian/dzinstance file will be installed into the first package. Use debian/package.dzinstance for different binary packages. The substitution variable zope:Depends is replaced by a list of the available zope versions. =head1 OPTIONS =over 4 =item B<-n>, B<--noscripts> Do not modify postinst/prerm scripts. =item I This parameter will be considered as an instance name which will be installed into the first package acted on. =back =head1 EXAMPLES This is an example of a debian/package.dzinstance file: Package: plone-site ZopeVersion: 2.9 Name: plone-site Addon-Mode: manual Addon-Technique: tree-linked Restart-Policy: end Products: CMFPlone Skeleton: /usr/lib/zope2.9/skel-with-magic The Products field specify a list of comma separated products that will be automatically installed into the instance. Obviously, it has no sense if the Addon-Mode field contains 'all'. The optional Skeleton field specifies a path which is used as skeleton for the new zope instance. =head1 NOTES Note that this command is not idempotent. "dh_clean B<-k>" should be called between invocations of this command. Otherwise, it may cause multiple instances of the same text to be added to maintainer scripts. =cut init(); sub read_dzfile { my $fn = shift; my %fields=(); open (DZ, "debian/$fn") || error("cannot read debian/$fn: $!\n"); while () { chomp; s/\s+$//; if (/^([^:]+):\s*(.*)/) { $fields{$1} = $2; } } close DZ; return %fields; } sub write_dzfile { my ($fn, %fields) = @_; my ($out) = ""; open (DZ, ">$fn") || error("cannot write $fn: $!\n"); foreach (keys %fields) { $out = "$_: $fields{$_}\n" . $out; } print DZ $out; close DZ; } sub addzopesubstvars { my ($package, %fields) = @_; addsubstvar($package, "zope:Depends", "zope-common (>= 0.5.49), zope" . $fields{'ZopeVersion'}); } my @autoscripts = ('config', 'preinst', 'postinst', 'prerm', 'postrm'); foreach my $package (@{$dh{DOPACKAGES}}) { next if is_udeb($package); my $tmp=tmpdir($package); my $dzinstancefile=pkgfile($package,"dzinstance"); my $archdir=package_arch($package) eq 'all' ? 'share' : 'lib'; # needed to get $dh{VERSION} my $isnative = isnative($package); my $addon_version; my @instances; if ($package eq $dh{FIRSTPACKAGE} && @ARGV) { push @instances, @ARGV; } if ($dh{V_FLAG}) { $addon_version = $dh{V_FLAG}; } # Handle dzinstance files. There are two filename formats, # the usual plus an extended format (debian/package.*). my @dzin_files; opendir(DEB,"debian/") || error("can't read debian directory: $!"); # If this is the main package, we need to handle unprefixed filenames. # For all packages, we must support both the usual filename format plus # that format with a period an something appended. my $regexp="\Q$package\E\."; if ($package eq $dh{MAINPACKAGE}) { $regexp="(|$regexp)"; } foreach my $fn (grep {/^${regexp}dzinstance(\..*)?$/} readdir(DEB)) { # .EX are example files, generated by eg, dh-make next if $fn=~/\.EX$/; push @dzin_files, $fn; } closedir(DEB); if (@instances == 0 || @dzin_files == 0) { error("missing instance name or dzinstance files"); } if (@instances > 1) { error("unable to handle multiple instances"); } if (@instances) { my %dzinstance; if (@dzin_files) { %dzinstance = read_dzfile(shift @dzin_files); } else { $dzinstance{'Package'} = $package; } $dzinstance{'Version'} = $dh{VERSION}; foreach my $instance (@instances) { if (!$dzinstance{'Name'}) { error("you have to specify the instance name in the dzinstance file"); } elsif (!$dzinstance{'ZopeVersion'}) { error("you have to specify the zope version in the dzinstance file"); } $dzinstance{'Addon-Mode'} = 'manual' if (!$dzinstance{'Addon-Mode'}); $dzinstance{'Addon-Technique'} = 'tree-linked' if (!$dzinstance{'Addon-Technique'}); $dzinstance{'RestartPolicy'} = 'end' if (!$dzinstance{'RestartPolicy'}); if ($dzinstance{'Products'}) { $dzinstance{'Products'} =~ s/,//g; } else { $dzinstance{'Products'} = ''; } $dzinstance{'Port'} = '9673' if (!$dzinstance{'Port'}); if ($dzinstance{'Skeleton'}) { $dzinstance{'Skeleton'} = '--skelsrc ' . $dzinstance{'Skeleton'}; } else { $dzinstance{'Skeleton'} = ''; } if (!$dzinstance{'Zope-Database'}) { $dzinstance{'Zope-Database'} = 'ZODB'; } if (!$dzinstance{'Zope-User'}) { $dzinstance{'Zope-User'} = 'zope:zope'; } if (!$dh{NOSCRIPTS}) { foreach my $script (@autoscripts) { autoscript($package,$script,"$script-dzinstance", "s,#DZ-PKG#,$package,;" . "s,#DZ-PORT#,$dzinstance{'Port'},;" . "s,#DZ-ZVER#,$dzinstance{'ZopeVersion'},;" . "s,#DZ-INSTANCE#,$dzinstance{'Name'},;" . "s,#DZ-ADDON-MODE#,$dzinstance{'Addon-Mode'},;" . "s,#DZ-ADDON-TECHNIQUE#,$dzinstance{'Addon-Technique'},;" . "s,#DZ-RESTARTPOLICY#,$dzinstance{'RestartPolicy'},;" . "s,#DZ-PRODUCTS#,$dzinstance{'Products'},;" . "s,#DZ-SKELETON#,$dzinstance{'Skeleton'},;". "s,#DZ-DATABASE#,$dzinstance{'Zope-Database'},;". "s,#DZ-USER#,$dzinstance{'Zope-User'},;", ); } } addzopesubstvars($package, %dzinstance); } } } =head1 SEE ALSO L This program is a part of zope-debhelper. =head1 AUTHOR Fabio Tranchitella Bernd Zeimetz =cut zope-debhelper-0.3.15/dh_installzope0000755000000000000000000003031311600075462014341 0ustar #!/usr/bin/perl -w =head1 NAME dh_installzope - install zope product and extension files into package build directories =cut use strict; use Debian::Debhelper::Dh_Lib; =head1 SYNOPSIS B [S>] [B<-n>] [B<-X>I] [S>] =head1 DESCRIPTION dh_installzope is a debhelper program that is responsible for installing zope products and extensions into package build directories. Directory names are interpreted as zope product names and will be installed into the first package dh_installzope is told to act on. By default, this is the first binary package in debian/control, but if you use B<-p>, B<-i>, or B<-a> flags, it will be the first package specified by those flags. dh_installzope automatically installs debian/dzproduct and debian/dzextension if it exists. If dh_installzope is acting on multiple packages, debian/dzproduct and debian/dzextension files will be installed into the first package. Use debian/package.dzproduct and debian/package.dzextension for different binary packages. If your package needs to register more than one product or extension, you need multiple files. To accomplish this, you can use files named debian/package.dzproduct.* and debian/package.dzextension.* Missing dzproduct and dzextension files for the first package dh_installzope is told to act on are generated and installed automatically. The substitution variable zope:Depends is replaced by a list of the available zope versions. =head1 OPTIONS =over 4 =item B<-n>, B<--noscripts> Do not modify postinst/prerm scripts. =item B<-Xitem>, B<--exclude=item> Exclude files that contain "item" anywhere in their filename from being installed. =item I Install these directories as products into the first package acted on. =back =head1 EXAMPLES This is an example of a debian/package.dzproduct file: Package: zope-cmfdefault1.4 Name: CMFDefault Directory: CMFDefault:1.4 Depends: CMFTopic:1.4 Version: 1.4.7-1 ZopeVersions: 2.9 2.8 The Version field is added or updated by dh_installzope. If Name and Directory match, the latter can be omitted. A deviating Directory is used to install different product versions. A Directory has the form [:]. It is possible to specify the list of zope versions for the 2.x serie using a >= relation, like in this example: Package: zope-psycopgda ZopeVersions: >= 2.7 This allows bin-NMUs of zope products on new Zope 2.x major versions, and for this reason it should be the preferred syntax. =head1 NOTES Note that this command is not idempotent. "dh_clean B<-k>" should be called between invocations of this command. Otherwise, it may cause multiple instances of the same text to be added to maintainer scripts. =cut init(); my @zope_versions = ('2.6', '2.7', '2.8', '2.9', '2.10', '2.11', '2.12', '2.13', '2.14', '3'); my %python_versions = ('3', '2.4', '2.5', '2.6', '2.7'); sub read_dzfile { my $fn = shift; my %fields=(); open (DZ, "debian/$fn") || error("cannot read debian/$fn: $!\n"); while () { chomp; s/\s+$//; if (/^([^:]+):\s*(.*)/) { $fields{$1} = $2; } } close DZ; return %fields; } sub write_dzfile { my ($fn, %fields) = @_; my ($out) = ""; open (DZ, ">$fn") || error("cannot write $fn: $!\n"); foreach (keys %fields) { $out = "$_: $fields{$_}\n" . $out; } print DZ $out; close DZ; } sub addzopesubstvars { my ($package, %fields) = @_; my ($var) = "zope-common (>= 0.5.49), "; my (@versions) = (); my ($minor) = "0"; if ($fields{'ZopeVersions'}) { my (@vers) = split(/ /, $fields{'ZopeVersions'}); if ($vers[0] eq '>=') { @versions = (); if ($vers[1] =~ m/^[0-9]\.([0-9]+)$/) { $minor = $1; } foreach (@zope_versions) { if ($_ =~ m/[0-9]\.([0-9]+)/ && int($1) >= int($minor)) { push(@versions, $_); } } } else { @versions = @vers; } } else { @versions = @zope_versions; } foreach (reverse(@versions)) { $var .= "zope" . $_ . " | "; } $var = substr($var, 0, length($var)-3); addsubstvar($package, "zope:Depends", $var); return join(" ", reverse(@versions)); } my @autoscripts = ('preinst', 'postinst', 'prerm', 'postrm'); foreach my $package (@{$dh{DOPACKAGES}}) { next if is_udeb($package); my $tmp=tmpdir($package); my $dzproductfile=pkgfile($package,"dzproduct"); my $dzextensionfile=pkgfile($package,"dzextension"); my $archdir=package_arch($package) eq 'all' ? 'share' : 'lib'; # needed to get $dh{VERSION} my $isnative = isnative($package); my $addon_version; my @dirs; if ($package eq $dh{FIRSTPACKAGE} && @ARGV) { push @dirs, @ARGV; } if ($dh{V_FLAG}) { $addon_version = $dh{V_FLAG}; } # Handle dzproduct and dzextension files. There are two filename formats, # the usual plus an extended format (debian/package.*). my @dzpr_files; my @dzex_files; opendir(DEB,"debian/") || error("can't read debian directory: $!"); # If this is the main package, we need to handle unprefixed filenames. # For all packages, we must support both the usual filename format plus # that format with a period an something appended. my $regexp="\Q$package\E\."; if ($package eq $dh{MAINPACKAGE}) { $regexp="(|$regexp)"; } foreach my $fn (grep {/^${regexp}dz(product|extension)(\..*)?$/} readdir(DEB)) { # .EX are example files, generated by eg, dh-make next if $fn=~/\.EX$/; if ($fn=~/dzproduct/) { push @dzpr_files, $fn; } else { push @dzex_files, $fn; } } closedir(DEB); if (@dirs > 0 && @dzpr_files > 1) { error("unable to handle directories and multiple dzproduct/dzextension files"); } if (@dirs > 1 && @dzpr_files > 0) { error("unable to handle multiple directories and dzproduct/dzextension files"); } if (@dirs) { my %tdzproduct; if (@dzpr_files) { %tdzproduct = read_dzfile(shift @dzpr_files); if (not exists $tdzproduct{'Package'}) { $tdzproduct{'Package'} = $package; } } else { $tdzproduct{'Package'} = $package; } $tdzproduct{'Version'} = $dh{VERSION}; $tdzproduct{'ZopeVersions'} = addzopesubstvars($package, %tdzproduct); my $exclude = ''; if ($dh{EXCLUDE_FIND}) { $exclude = ' -and -not \( '.$dh{EXCLUDE_FIND}.' \)'; } doit("install","-d","$tmp/usr/$archdir/zope/Products"); foreach my $dir (@dirs) { my %dzproduct = %tdzproduct; my ($dir_basename) = basename($dir); if (!$dzproduct{'Name'}) { if ($dir ne '.') { $dzproduct{'Name'} = $dir_basename; } else { error("you have to specify the product name in the dzproduct file"); } } my $target; if ($dzproduct{'Directory'}) { $target = $dzproduct{'Directory'}; } else { $target = $dzproduct{'Name'}; if ($addon_version) { $dzproduct{'Directory'} = $package; } } my ($exclude_debian) = ''; $exclude_debian = ' -and -not \( -path \'*/debian/*\' -or -path \'*-stamp\' \)' if ($dir eq "."); doit("install","-d","$tmp/usr/$archdir/zope/Products/$target"); my $pwd=`pwd`; chop($pwd); if (exists $dzproduct{'Global'} && $dzproduct{'Global'} eq 'yes') { if ($dzproduct{'ZopeVersions'} != '3') { error("global products are supported only for zope3"); } my ($pyver) = $python_versions{$dzproduct{'ZopeVersions'}}; addsubstvar($package, "zope:PythonVersion", $pyver); complex_doit("cd $dir && find -type f$exclude$exclude_debian " . "-exec install -D --mode=644 {} $pwd/$tmp/usr/lib/python$pyver/" . "site-packages/$target/{} \\;"); complex_doit("mkdir -p $pwd/$tmp/usr/$archdir/zope/Products/$target"); complex_doit("find $pwd/$tmp/usr/lib/python$pyver/site-packages/$target". " \\( -name \\*-configure.zcml -o -name \\*-ftesting.meta -o -name " . "\\*-meta.zcml \\) -exec mv {} $pwd/$tmp/usr/$archdir/zope/Products" . "/$target/ \\;"); } else { complex_doit("cd $dir && find -type f$exclude$exclude_debian -exec install -D ". "--mode=644 {} $pwd/$tmp/usr/$archdir/zope/Products/$target/{} \\;"); } write_dzfile("$tmp/usr/$archdir/zope/Products/$target/.dzproduct", %dzproduct); if (! $dh{NOSCRIPTS}) { foreach my $script (@autoscripts) { autoscript($package,$script,"$script-dzproduct", "s,#DZ-DIR#,/usr/$archdir/zope/Products/$target,;" . "s,#DZ-ADDON#,$dzproduct{'Name'},;" . "s,#PACKAGE#,$package,", ); } } } doit("chown","-R","0:0","$tmp/usr/$archdir/zope/Products"); doit("chmod","-R","go=rX","$tmp/usr/$archdir/zope/Products"); doit("chmod","-R","u+rw","$tmp/usr/$archdir/zope/Products"); } foreach my $fn (@dzpr_files) { my %dzproduct = read_dzfile($fn); my $target = $dzproduct{'Directory'} ? $dzproduct{'Directory'} : $dzproduct{'Name'}; if (! $target) { error("no Name or Directory key in debian/$fn") } if (not exists $dzproduct{'Package'}) { $dzproduct{'Package'} = $package; } if (! -d "$tmp/usr/$archdir/zope/Products/$target") { doit("install","-g",0,"-o",0,"-d","$tmp/usr/$archdir/zope/Products/$target"); } doit("install","-g",0,"-o",0,"-m644","-p","debian/$fn", "$tmp/usr/$archdir/zope/Products/$target/.dzproduct"); $dzproduct{'Version'} = $dh{VERSION}; $dzproduct{'ZopeVersions'} = addzopesubstvars($package, %dzproduct) if exists $dzproduct{'ZopeVersions'}; write_dzfile("$tmp/usr/$archdir/zope/Products/$target/.dzproduct", %dzproduct); if (! $dh{NOSCRIPTS}) { foreach my $script (@autoscripts) { autoscript($package,$script,"$script-dzproduct", "s,#DZ-DIR#,/usr/$archdir/zope/Products/$target,;" . "s,#DZ-ADDON#,$dzproduct{'Name'},;" . "s,#PACKAGE#,$package,", ); } } } foreach my $fn (@dzex_files) { my %dzext = read_dzfile($fn); my $target = $dzext{'Directory'} ? $dzext{'Directory'} : $dzext{'Name'}; if (! $target) { error("no Extension or Directory key in debian/$fn") } if (not exists $dzext{'Package'}) { $dzext{'Package'} = $package; } if (! -d "$tmp/usr/$archdir/zope/Extensions/$target") { doit("install","-g",0,"-o",0,"-d","$tmp/usr/$archdir/zope/Extensions/$target"); } doit("install","-g",0,"-o",0,"-m644","-p","debian/$fn", "$tmp/usr/$archdir/zope/Extensions/$target/.dzextension"); $dzext{'Version'} = $dh{VERSION}; $dzext{'ZopeVersions'} = addzopesubstvars($package, %dzext) if exists $dzext{'ZopeVersions'}; write_dzfile("$tmp/usr/$archdir/zope/Extensions/$target/.dzextension", %dzext); if (! $dh{NOSCRIPTS}) { foreach my $script (@autoscripts) { autoscript($package,$script,"$script-dzextension", "s,#DZ-DIR#,/usr/$archdir/zope/Extensions/$target,;" . "s,#DZ-ADDON#,$dzext{'Name'},;" . "s,#PACKAGE#,$package,", ); } } } } =head1 SEE ALSO L This program is a part of zope-debhelper. =head1 AUTHOR Matthias Klose Fabio Tranchitella =cut zope-debhelper-0.3.15/autoscripts/0000755000000000000000000000000011600075531013751 5ustar zope-debhelper-0.3.15/autoscripts/prerm-dzproduct0000644000000000000000000000075510522153072017043 0ustar if which dzhandle >/dev/null; then case "$1" in upgrade|remove) # upgrade: # - register instances, in which product is upgraded # - remove product from instances # remove: # - register instances, in which product is removed, needed # for recovery in postinst abort-remove # - remove product from instances # - maybe fail if product installed in instance with addon policy # all and addon-mode linked or tree-linked dzhandle prerm-product -m "$*" #DZ-DIR# esac fi zope-debhelper-0.3.15/autoscripts/prerm-dzinstance0000644000000000000000000000131511237564404017171 0ustar PKG=#DZ-PKG# INSTANCE=#DZ-INSTANCE# ZVER=#DZ-ZVER# DATABASE=#DZ-DATABASE# [ -n "$(echo $INSTANCE)" ] || exit 1 if command -v invoke-rc.d >/dev/null 2>&1; then INVOKE="invoke-rc.d zope$ZVER" else INVOKE="/etc/init.d/zope$ZVER" fi remove_products() { products="#DZ-PRODUCTS#" if [ -n "$products" ]; then dzhandle -z $ZVER remove-product --lazy --force $INSTANCE $products fi } case "$1" in remove|upgrade) if [ "$DATABASE" = "ZEO" ]; then $INVOKE stop "ZEOSERVER=$INSTANCE" || true fi $INVOKE stop "INSTANCE=$INSTANCE" || true remove_products || true ;; failed-upgrade|deconfigure) ;; *) echo "prerm called with unknown argument \`$1'" >&2 exit 1 ;; esac zope-debhelper-0.3.15/autoscripts/postinst-dzinstance0000644000000000000000000000732511237564405017737 0ustar PKG=#DZ-PKG# INSTANCE=#DZ-INSTANCE# ZVER=#DZ-ZVER# DATABASE=#DZ-DATABASE# USER=#DZ-USER# add_products() { products="#DZ-PRODUCTS#" if [ -n "$products" ]; then dzhandle -z $ZVER add-product --lazy $INSTANCE $products fi } if command -v invoke-rc.d >/dev/null 2>&1; then INVOKE="invoke-rc.d zope$ZVER" else INVOKE="/etc/init.d/zope$ZVER" fi case "$1" in abort-deconfigure|abort-remove|abort-upgrade) ;; configure) if dzhandle -z $ZVER show-instance $INSTANCE >/dev/null 2>&1; then # instance already exists echo "Zope$ZVER instance '$INSTANCE' already exists." add_products if [ "$DATABASE" = "ZEO" ]; then if ! $INVOKE start "ZEOSERVER=$INSTANCE"; then echo "Could not start the zeo database which was" echo "configured for the zope instance. Please" echo "check for errors by running zeo by hand" echo "and start the zope instance afterwards." ZEOFAILURE="yes" fi fi if [ -z "$ZEOFAILURE" ]; then if ! $INVOKE start "INSTANCE=$INSTANCE"; then echo "Could not start zope instance $INSTANCE. Please check" echo "for errors running the instance by hand:" echo " /var/lib/zope$ZVER/instance/$INSTANCE/runzope" fi fi else if [ -d /var/lib/zope$ZVER/instance/$INSTANCE ] && \ [ "$DATABASE" != "ZEO" ] && \ [ ! -f /var/lib/zope$ZVER/instance/$INSTANCE/var/Data.fs ]; then db_get $PKG/remove-instance-without-data removal="$RET" if [ "$removal" = abort ]; then echo >&2 "don't touch /var/lib/zope$ZVER/instance/$INSTANCE" exit 1 fi else clean_install=yes fi db_get $PKG/admin-user user="$RET" db_get $PKG/admin-password password="$RET" if echo "$user:$password" | grep -vq '^[a-zA-Z][a-zA-Z0-9]*:[^:][^:]*$'; then echo >&2 "found invalid user and/or password" exit 1 fi db_get $PKG/instance-http-port port="$RET" if [ "$DATABASE" = "ZEO" ]; then db_get $PKG/instance-zeo-port zeoport="$RET" dzhandle -z $ZVER make-zeoinstance $INSTANCE $zeoport $INVOKE start "ZEOSERVER=$INSTANCE" ZEOSERVER="--zeo-server=localhost:$zeoport" else ZEOSERVER="" fi # set the install policy to manual if dzhandle -z $ZVER make-instance -u "$user:$password" $INSTANCE \ --addon-mode=#DZ-ADDON-MODE# --restart=#DZ-RESTARTPOLICY# -t #DZ-ADDON-TECHNIQUE# \ --service-port=$port --service-user=#DZ-USER# #DZ-SKELETON# $ZEOSERVER then # overwrite password in debconf database db_set $PKG/admin-password "" db_set $PKG/admin-password-confirmation "" add_products if ! $INVOKE start "INSTANCE=$INSTANCE"; then echo "Could not start zope instance $INSTANCE. Please check" echo "for errors running the instance by hand:" echo " /var/lib/zope$ZVER/instance/$INSTANCE/runzope" fi else # remove, what we created if [ "$clean_install" = yes ] && [ "$removal" != abort ]; then rm -rf "/var/lib/zope$ZVER/instance/$INSTANCE" fi if [ "$clean_install" = yes ]; then rm -rf "/var/log/zope$ZVER/$INSTANCE" rm -rf "/etc/zope$ZVER/$INSTANCE" fi # something wrong happened, exit with a status error exit 201 fi fi ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac zope-debhelper-0.3.15/autoscripts/preinst-dzinstance0000644000000000000000000000100111237564402017516 0ustar PKG=#DZ-PKG# INSTANCE=#DZ-INSTANCE# ZVER=#DZ-ZVER# DATABASE=#DZ-DATABASE# if command -v invoke-rc.d >/dev/null 2>&1; then INVOKE="invoke-rc.d zope$ZVER" else INVOKE="/etc/init.d/zope$ZVER" fi case "$1" in install|upgrade) if [ "$1" = "upgrade" ]; then if [ "$DATABASE" = "ZEO" ]; then $INVOKE stop "ZEOSERVER=$INSTANCE" || true fi $INVOKE stop "INSTANCE=$INSTANCE" || true fi ;; failed-upgrade) ;; *) echo "preinst called with unknown argument \`$1'" >&2 exit 1 ;; esac zope-debhelper-0.3.15/autoscripts/postrm-dzinstance0000644000000000000000000000227711237564404017400 0ustar PKG=#DZ-PKG# INSTANCE=#DZ-INSTANCE# ZVER=#DZ-ZVER# DATABASE=#DZ-DATABASE# if [ -e /usr/share/debconf/confmodule ]; then . /usr/share/debconf/confmodule fi [ -n "$(echo $INSTANCE)" ] || exit 1 if command -v invoke-rc.d >/dev/null 2>&1; then INVOKE="invoke-rc.d zope$ZVER" else INVOKE="/etc/init.d/zope$ZVER" fi case "$1" in failed-upgrade|abort-install|abort-upgrade|disappear) ;; upgrade) ;; remove) $INVOKE stop "INSTANCE=$INSTANCE" || true dzhandle -z $ZVER remove-instance $INSTANCE || true if [ "$DATABASE" = "ZEO" ]; then $INVOKE stop "ZEOSERVER=$INSTANCE" || true dzhandle -z $ZVER remove-zeoinstance $INSTANCE || true fi ;; purge) db_get $PKG/keep-data-on-purge 2>/dev/null || true if [ "$RET" = yes ]; then echo >&2 "$PKG is configured to keep the data file on purge" else if [ "$DATABASE" = "ZEO" ]; then dzhandle -z $ZVER purge-zeoinstance $INSTANCE || true fi rm -rf "/var/lib/zope$ZVER/instance/$INSTANCE" \ "/var/log/zope$ZVER/$INSTANCE" \ "/etc/zope$ZVER/$INSTANCE" fi ;; *) echo "postrm called with unknown argument \`$1'" >&2 exit 1 esac zope-debhelper-0.3.15/autoscripts/postinst-dzproduct0000644000000000000000000000107010522153072017570 0ustar if which dzhandle >/dev/null; then case "$1" in configure|abort-upgrade|abort-remove) # configure: # - install product in instances with addon-mode all, # and in which the product is upgraded # - unregister product as beeing upgraded # abort-upgrade: (from old postinst) # - re-add product to instances, where it was removed from # - unregister product as beeing upgraded # abort-remove: # - re-add product to instances, where it was removed from # - unregister product as beeing removed dzhandle postinst-product -m "$*" #DZ-DIR# esac fi zope-debhelper-0.3.15/autoscripts/postrm-dzproduct0000644000000000000000000000027710522153072017241 0ustar if which dzhandle >/dev/null; then case "$1" in remove) # remove: # - unregister sucessfully removed product dzhandle postrm-product -m "$*" #PACKAGE# #DZ-DIR# #DZ-ADDON# esac fi zope-debhelper-0.3.15/autoscripts/config-dzinstance0000644000000000000000000001405411224144300017276 0ustar PKG=#DZ-PKG# INSTANCE=#DZ-INSTANCE# ZVER=#DZ-ZVER# PORT=#DZ-PORT# DATABASE=#DZ-DATABASE# # if we do not have debconf, we just skip this test -f /usr/share/debconf/confmodule || exit 0 . /usr/share/debconf/confmodule db_capb backup LAST_STATE=0 STATE=1 TRIES=0 if [ -d /var/lib/zope$ZVER/instance/$INSTANCE ] && \ [ -f /var/lib/zope$ZVER/instance/$INSTANCE/var/Data.fs ]; then exit 0 fi while true; do if [ -d /var/lib/zope$ZVER/instance/$INSTANCE ] && \ [ "$DATABASE" != "ZEO" ] && \ [ ! -f /var/lib/zope$ZVER/instance/$INSTANCE/var/Data.fs ]; then FIRST_STATE=1 else FIRST_STATE=2 fi [ $STATE -ge $FIRST_STATE ] || STATE=$FIRST_STATE case "$STATE" in 1) # directory exists, but no data file db_register zope-common/remove-instance-without-data $PKG/remove-instance-without-data || true db_subst $PKG/remove-instance-without-data instance "$INSTANCE" || true db_subst $PKG/remove-instance-without-data zver "$ZVER" || true if db_go; then db_get $PKG/remove-instance-without-data if [ "$RET" = abort ]; then exit 10 fi STATE=2 else STATE=1 fi ;; 2) RET="" db_get $PKG/admin-user || true USER="$RET" db_register zope-common/admin-user $PKG/admin-user db_subst $PKG/admin-user instance "$INSTANCE" || true db_subst $PKG/admin-user zver "$ZVER" || true if ! db_input high $PKG/admin-user && [ "$USER" = "" ]; then db_set $PKG/admin-user "admin" fi if db_go; then db_get $PKG/admin-user if echo "$RET" | grep -q '^[a-zA-Z][a-zA-Z0-9]*$'; then STATE=3 else STATE=2 fi else STATE=1 fi ;; 3) RET="" db_get $PKG/admin-password || true PWD="$RET" db_register zope-common/admin-password $PKG/admin-password db_subst $PKG/admin-password instance "$INSTANCE" || true db_subst $PKG/admin-password zver "$ZVER" || true if ! db_input high $PKG/admin-password && [ "$PWD" = "" ]; then rpassword=`head -c 4 /dev/urandom | od -x | awk '{print $2$3}' | head -n 1` db_register zope-common/admin-password-confirmation $PKG/admin-password-confirmation || true db_set $PKG/admin-password "$rpassword" db_set $PKG/admin-password-confirmation "$rpassword" db_register zope-common/admin-automatic-password $PKG/admin-automatic-password || true db_subst $PKG/admin-automatic-password instance "$INSTANCE" || true db_subst $PKG/admin-automatic-password zver "$ZVER" || true db_subst $PKG/admin-automatic-password user "admin" || true db_subst $PKG/admin-automatic-password password "$rpassword" || true db_input high $PKG/admin-automatic-password || true db_go || true db_unregister $PKG/admin-automatic-password || true STATE=4 continue fi if db_go; then db_get $PKG/admin-password if [ -n "$RET" ]; then PASS="$RET" db_register zope-common/admin-password-confirmation $PKG/admin-password-confirmation || true db_subst $PKG/admin-password-confirmation instance "$INSTANCE" || true db_subst $PKG/admin-password-confirmation zver "$ZVER" || true db_input high $PKG/admin-password-confirmation || true db_go db_get $PKG/admin-password-confirmation if [ "$PASS" = "$RET" ]; then STATE=4 else STATE=3 fi else STATE=3 fi else STATE=2 fi ;; 4) db_register zope-common/instance-http-port $PKG/instance-http-port db_subst $PKG/instance-http-port instance "$INSTANCE" || true db_subst $PKG/instance-http-port zver "$ZVER" || true db_fget $PKG/instance-http-port seen if [ "$RET" = false ]; then db_set $PKG/instance-http-port "$PORT" || true fi db_input high $PKG/instance-http-port || true if db_go; then STATE=5 else STATE=3 fi ;; 5) if [ "$DATABASE" = "ZEO" ]; then db_register zope-common/instance-zeo-port $PKG/instance-zeo-port db_subst $PKG/instance-zeo-port instance "$INSTANCE" || true db_fget $PKG/instance-zeo-port seen if [ "$RET" = false ]; then db_set $PKG/instance-zeo-port "8100" || true fi db_input high $PKG/instance-zeo-port || true if db_go; then STATE=6 else STATE=4 fi else STATE=6 fi ;; 6) db_register zope-common/keep-data-on-purge $PKG/keep-data-on-purge db_subst $PKG/keep-data-on-purge instance "$INSTANCE" || true db_subst $PKG/keep-data-on-purge zver "$ZVER" || true db_input high $PKG/keep-data-on-purge || true if db_go; then STATE=7 else STATE=5 fi ;; *) break esac if [ $LAST_STATE -eq $STATE ]; then TRIES=$(($TRIES + 1)) if [ $TRIES -gt 3 ]; then exit $((20 + $STATE)) fi fi LAST_STATE=$STATE done if [ $STATE -le $FIRST_STATE ]; then exit 30 fi zope-debhelper-0.3.15/autoscripts/preinst-dzproduct0000644000000000000000000000037710522153072017402 0ustar if which dzhandle >/dev/null; then case "$1" in install|upgrade) # install, upgrade # - check, if product will be installed in an instance, # where it already exists? dzhandle preinst-product -m "$*" #PACKAGE# #DZ-DIR# #DZ-ADDON# esac fi