Import debian/ fixes from Dimitri Fontaine
authorMarko Kreen <markokr@gmail.com>
Fri, 30 Sep 2011 12:47:47 +0000 (15:47 +0300)
committerMarko Kreen <markokr@gmail.com>
Fri, 30 Sep 2011 12:54:31 +0000 (15:54 +0300)
Due to some miscommunication the branches got out-ot-sync
and needed squashing now.

changelog:
- Fix known bugs in packaging (Replaces, update-alternatives, prerm scripts)
- Forgot to delete the postrm script in the merge.
- Get rid of example *) cases in postinst scripts.
- Remove debhelper automatic code from the scripts.
- The PostgreSQL extensions should provide the virtual package skytools-modules.
- By producing a clean orig archive, it's possible to avoid the *.o in debian/source/include-binaries
- Another round of review with Christoph Berg
- Remove debian/README.source
- Add some more specific copyright notices, per debian FTP Master
- Reproduce the whole copyright of lib/test/attregex/testregex.c
- The doc/ needs to get realclean'ed, distclean is shy of a brick here.
- Add a build-depend on automake, which provides /usr/bin/aclocal
- Changelog entry for bug #632574, and some cleanup
- Add the pgq upgrade script to the packaging
- Allow for cleanup up the debian tree when the upgrade script never was build before.
- Add a useful debian/README.source
- Better debian/rules orig target (exclude vcs, automatic grabbing of the package version)
- Fix debian/rules for building when postgresql-server-dev-9.1 is installed too.
- Update packaging for postgresql-9.1, make 8.3 8.4 and 9.0 compat optional
- Typo fix in postgresql-9.1-pgq3 depends

20 files changed:
.gitignore
debian/README.source
debian/changelog
debian/control
debian/control.in [new file with mode: 0644]
debian/copyright
debian/pgversions [new file with mode: 0644]
debian/postgresql-8.4-pgq3.install
debian/postgresql-9.0-pgq3.install
debian/postgresql-9.1-pgq3.dirs [new file with mode: 0644]
debian/postgresql-9.1-pgq3.docs [new file with mode: 0644]
debian/postgresql-9.1-pgq3.install [new file with mode: 0644]
debian/rules
debian/skytools3-walmgr.postinst [new file with mode: 0644]
debian/skytools3-walmgr.prerm [new file with mode: 0644]
debian/skytools3.init.d
debian/skytools3.postinst
debian/skytools3.postrm [deleted file]
debian/skytools3.prerm [new file with mode: 0644]
debian/source/include-binaries

index 61236849bc4dc1bdb05906fcfb904e59885bdbb3..e2b092e7f989d2222200beecfb52575913487580 100644 (file)
@@ -37,8 +37,7 @@ debian/*debhelper
 debian/patches
 debian/python-pgq3/*
 debian/python-skytools3/*
-debian/postgresql-8.4-pgq3/*
-debian/postgresql-9.0-pgq3/*
+debian/postgresql-*-pgq3/*
 debian/skytools3*/*
 debian/skytools-pgq*/*
 debian/skytools-londiste*/*
index 618107e11daf7400e918a8507967bea58ed7cc15..07df610310697bcf8377a069a11d100874056250 100644 (file)
@@ -1,9 +1,15 @@
 skytools-3.0 for Debian
 -----------------------
 
-<this file describes information about the source package, see Debian policy
-manual section 4.14. You WILL either need to modify or delete this file>
-
+This package is maintained in git and uses a submodule.  To get a fresh
+checkout and build the packages, follow those steps:
 
+  ## fetch git tree, from dimitri who maintains the debian package
+  ## real upstream is at git://github.com/markokr/skytools-dev.git
+  $ git clone http://github.com/dimitri/skytools.git
 
+  ## fetch libusual submodule
+  $ git submodule update --init
 
+  ## now build
+  $ debuild ...
index a06e0fad490c011168d4c7cd262a27074e058955..61a37b31cd84ee2a812729893943e162f6b74595 100644 (file)
@@ -1,7 +1,13 @@
-skytools3 (3.0~rc1-1) unstable; urgency=low
+skytools3 (3.0~rc1-2) experimental; urgency=low
 
-  * Packaging reorg
-  * Fixes: #621115 (ITP)
+  * Add automake to the Build Depends (Closes: #632574)
+  * Merge with upstream
+
+ -- Dimitri Fontaine <dim@tapoueh.org>  Wed, 06 Jul 2011 16:07:12 +0200
+
+skytools3 (3.0~rc1-1) experimental; urgency=low
+
+  * New upstream version of skytools (Closes: #621115)
 
  -- Dimitri Fontaine <dim@tapoueh.org>  Mon, 28 Mar 2011 14:28:13 +0200
 
index 0dd2130d2442e71d0e31e30debd0710f706845ad..6ae71ffaeb7be48945823d9ca546ffda3f8948b4 100644 (file)
@@ -2,7 +2,7 @@ Source: skytools3
 Section: database
 Priority: extra
 Maintainer: Dimitri Fontaine <dim@tapoueh.org>
-Build-Depends: debhelper (>= 7.0.50~), autotools-dev, autoconf (>= 2.65), python-all-dev, python-support, xmlto, asciidoc, libpq-dev, postgresql-server-dev-8.4, postgresql-server-dev-9.0
+Build-Depends: debhelper (>= 7.0.50~), autotools-dev, autoconf (>= 2.65), automake, libevent-dev, python-all-dev, python-support, python-psycopg2, xmlto, asciidoc, libpq-dev, postgresql-server-dev-all
 Standards-Version: 3.9.1
 Homepage: http://wiki.postgresql.org/wiki/Skytools
 Vcs-Git: http://github.com/markokr/skytools.git
@@ -36,7 +36,7 @@ Description: python framework for Skype tools for PostgreSQL replication
 
 Package: skytools3-walmgr
 Architecture: any
-Depends: ${misc:Depends}, ${python:Depends}, python-skytools3, python-psycopg2
+Depends: ${misc:Depends}, ${python:Depends}, python-skytools3, postgresql-8.4 | postgresql-9.0
 Enhances: postgresql-8.4, postgresql-9.0
 Description: Skype tools for PostgreSQL replication and failover
  This is a package of tools in use in Skype for replication and failover.
@@ -51,16 +51,12 @@ Description: Skype tools for PostgreSQL replication, londiste and PGQ
  is based on snapshot based event handling ideas from Slony-I, written for
  general usage.
 
-Package: postgresql-8.4-pgq3
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, postgresql-8.4
-Description: Skype tools for PostgreSQL replication, londiste and PGQ
- This is the PGQ extension used by Skype replication, londiste. It consists
- of PL/pgsql, and C code in database.
-
-Package: postgresql-9.0-pgq3
+Package: postgresql-9.1-pgq3
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, postgresql-9.0
+Depends: ${shlibs:Depends}, ${misc:Depends}, postgresql-9.1
+Provides: skytools-modules
+Conflicts: skytools-modules-9.1
+Replaces: skytools-modules-9.1
 Description: Skype tools for PostgreSQL replication, londiste and PGQ
  This is the PGQ extension used by Skype replication, londiste. It consists
  of PL/pgsql, and C code in database.
diff --git a/debian/control.in b/debian/control.in
new file mode 100644 (file)
index 0000000..540d491
--- /dev/null
@@ -0,0 +1,72 @@
+Source: skytools3
+Section: database
+Priority: extra
+Maintainer: Dimitri Fontaine <dim@tapoueh.org>
+Build-Depends: debhelper (>= 7.0.50~), autotools-dev, autoconf (>= 2.65), automake, libevent-dev, python-all-dev, python-support, python-psycopg2, xmlto, asciidoc, libpq-dev, postgresql-server-dev-all
+Standards-Version: 3.9.1
+Homepage: http://wiki.postgresql.org/wiki/Skytools
+Vcs-Git: http://github.com/markokr/skytools.git
+Vcs-Browser: https://github.com/markokr/skytools
+
+Package: skytools3
+Architecture: any
+Depends: ${misc:Depends}, ${python:Depends}, python-pgq3, adduser
+Description: Skype tools for PostgreSQL replication, londiste and PGQ
+ This is a package of tools in use in Skype for replication and failover. It
+ contains the Londiste and PGQ services and scripts to run.
+
+Package: python-pgq3
+Architecture: any
+Section: python
+Depends: ${misc:Depends}, ${python:Depends}, python-skytools3, python-psycopg2
+Description: python framework for Skype tools for PostgreSQL replication
+ This is a package of tools in use in Skype for replication and failover.
+ It includes a generic queuing mechanism PgQ and utility library for Python
+ scripts.
+
+Package: python-skytools3
+Architecture: any
+Section: python
+Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}
+Suggests: python-psycopg2
+Description: python framework for Skype tools for PostgreSQL replication
+ This is a package of tools in use in Skype for replication and failover.
+ It contains the Skytools' python framework for scripting against a
+ PostgreSQL database, which is used by londiste, walmgr and PGQ.
+
+Package: skytools3-walmgr
+Architecture: any
+Depends: ${misc:Depends}, ${python:Depends}, python-skytools3, postgresql-8.4 | postgresql-9.0
+Enhances: postgresql-8.4, postgresql-9.0
+Description: Skype tools for PostgreSQL replication and failover
+ This is a package of tools in use in Skype for replication and failover.
+ It's the WAL Shipping part of it (binary cluster-wide replication).
+
+Package: skytools3-ticker
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Skype tools for PostgreSQL replication, londiste and PGQ
+ This is the PGQ ticker used by Skype replication, londiste. It consists of
+ PL/pgsql, and C code in database, with Python framework on top of it.  It
+ is based on snapshot based event handling ideas from Slony-I, written for
+ general usage.
+
+Package: postgresql-9.1-pgq3
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, postgresql-9.1
+Provides: skytools-modules
+Conflicts: skytools-modules-9.1
+Replaces: skytools-modules-9.1
+Description: Skype tools for PostgreSQL replication, londiste and PGQ
+ This is the PGQ extension used by Skype replication, londiste. It consists
+ of PL/pgsql, and C code in database.
+
+Package: postgresql-PGVERSION-pgq3
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, postgresql-PGVERSION
+Provides: skytools-modules
+Conflicts: skytools-modules-PGVERSION
+Replaces: skytools-modules-PGVERSION
+Description: Skype tools for PostgreSQL replication, londiste and PGQ
+ This is the PGQ extension used by Skype replication, londiste. It consists
+ of PL/pgsql, and C code in database.
index a2a6b03b84499f4812c12a5c0fb2f2bcde651759..70d1f96690dc223cf27c15a6876652177e3312af 100644 (file)
@@ -31,3 +31,68 @@ License:
 The Debian packaging is:
 
     Copyright (C) 2011 Dimitri Fontaine <dim@tapoueh.org>
+
+The file lib/usual/lookup3.c is public domain
+
+The file lib/test/attregex/testregex.c has its own copyright, reproduced here:
+
+/*
+ * regex(3) test harness
+ *
+ * build:      cc -o testregex testregex.c
+ * help:       testregex --man
+ * note:       REG_* features are detected by #ifdef; if REG_* are enums
+ *             then supply #define REG_foo REG_foo for each enum REG_foo
+ *
+ *     Glenn Fowler <gsf@research.att.com>
+ *     AT&T Research
+ *
+ * PLEASE: publish your tests so everyone can benefit
+ *
+ * The following license covers testregex.c and all associated test data.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of THIS SOFTWARE FILE (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, and/or sell copies of the
+ * Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following disclaimer:
+ *
+ * THIS SOFTWARE IS PROVIDED BY AT&T ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL AT&T BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+The files lib/test/tinytest.[ch] has their own copyright, reproduced here:
+
+/* tinytest.c -- Copyright 2009 Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
diff --git a/debian/pgversions b/debian/pgversions
new file mode 100644 (file)
index 0000000..af97c10
--- /dev/null
@@ -0,0 +1,4 @@
+# don't list here 9.1, it's hard-coded in debian/rules (yes, I know)
+8.3
+8.4
+9.0
index dd505f37bc07018dad2b000667f186f72851458d..133586c84fe72cfed7011f68f380a39f17e724fa 100644 (file)
@@ -13,3 +13,4 @@ usr/share/postgresql/8.4/contrib/pgq.sql
 usr/share/postgresql/8.4/contrib/pgq_coop.sql
 usr/share/postgresql/8.4/contrib/londiste.upgrade.sql
 usr/share/postgresql/8.4/contrib/uninstall_pgq.sql
+pgq_core_upgrade_to_v3.0.sql usr/share/postgresql/8.4/contrib/
index 00426ca14efbd608720376fd26611c214c18c7a9..529419c069499c92e5b9b4bf779fc61cd3949e44 100644 (file)
@@ -13,3 +13,4 @@ usr/share/postgresql/9.0/contrib/pgq.sql
 usr/share/postgresql/9.0/contrib/pgq_coop.sql
 usr/share/postgresql/9.0/contrib/londiste.upgrade.sql
 usr/share/postgresql/9.0/contrib/uninstall_pgq.sql
+pgq_core_upgrade_to_v3.0.sql usr/share/postgresql/9.0/contrib/
diff --git a/debian/postgresql-9.1-pgq3.dirs b/debian/postgresql-9.1-pgq3.dirs
new file mode 100644 (file)
index 0000000..b8bec34
--- /dev/null
@@ -0,0 +1 @@
+usr/share/doc/postgresql-9.1
diff --git a/debian/postgresql-9.1-pgq3.docs b/debian/postgresql-9.1-pgq3.docs
new file mode 100644 (file)
index 0000000..9ce22bb
--- /dev/null
@@ -0,0 +1,2 @@
+sql/pgq/README.pgq
+sql/pgq_ext/README.pgq_ext
diff --git a/debian/postgresql-9.1-pgq3.install b/debian/postgresql-9.1-pgq3.install
new file mode 100644 (file)
index 0000000..c7ddf10
--- /dev/null
@@ -0,0 +1,16 @@
+usr/lib/postgresql/9.1/lib/pgq_triggers.so
+usr/lib/postgresql/9.1/lib/pgq_lowlevel.so
+usr/share/postgresql/9.1/contrib/pgq.upgrade.sql
+usr/share/postgresql/9.1/contrib/txid.sql
+usr/share/postgresql/9.1/contrib/pgq_triggers.sql
+usr/share/postgresql/9.1/contrib/pgq_lowlevel.sql
+usr/share/postgresql/9.1/contrib/pgq_node.sql
+usr/share/postgresql/9.1/contrib/pgq_coop.upgrade.sql
+usr/share/postgresql/9.1/contrib/pgq_ext.sql
+usr/share/postgresql/9.1/contrib/londiste.sql
+usr/share/postgresql/9.1/contrib/pgq_node.upgrade.sql
+usr/share/postgresql/9.1/contrib/pgq.sql
+usr/share/postgresql/9.1/contrib/pgq_coop.sql
+usr/share/postgresql/9.1/contrib/londiste.upgrade.sql
+usr/share/postgresql/9.1/contrib/uninstall_pgq.sql
+pgq_core_upgrade_to_v3.0.sql usr/share/postgresql/9.1/contrib/
index 93547ec778effeb00cd1b4972fcc29ad0589cb54..fbaf596df3a3eb5dcdd7d527ea707965e710623d 100755 (executable)
 # This has to be exported to make some magic below work.
 export DH_OPTIONS
 
-# The build system is averse to VPATH building, so we can't use postgresql-server-dev-all
-PG_CONFIG_84=/usr/lib/postgresql/8.4/bin/pg_config
-PG_CONFIG_90=/usr/lib/postgresql/9.0/bin/pg_config
+# The build system is averse to VPATH building, so we can't properly use
+# postgresql-server-dev-all
+SRCDIR      = $(CURDIR)
+PG_CONFIG_91=/usr/lib/postgresql/9.1/bin/pg_config
+PKGVERS     = $(shell dpkg-parsechangelog | awk -F '[:-]' '/^Version:/ { print substr($$2, 2) }')
+ORIG_EXCLUDE=--exclude-vcs --exclude=debian
+
+include /usr/share/postgresql-common/pgxs_debian_control.mk
 
 config.mak:
        autoreconf -I lib/m4
@@ -26,28 +31,42 @@ config.mak:
 
 override_dh_auto_configure:
 
-override_dh_auto_clean: config.mak
+override_dh_auto_clean: config.mak debian/control
        make -C lib distclean
+       make -C doc realclean
        dh_auto_clean -- distclean
-       rm -rf $(SRCDIR)/debian
+       rm -f upgrade/final/v3.0_pgq_core.sql
+       for version in $$(pg_buildext supported-versions .) ; do \
+               rm -rf debian/postgresql-$$version-pgq3; \
+       done
 
 override_dh_auto_build: config.mak lib/build
-       dh_auto_build -- SQLDIR=/usr/share/skytools3 PG_CONFIG=$(PG_CONFIG_90)
+       dh_auto_build -- SQLDIR=/usr/share/skytools3 PG_CONFIG=$(PG_CONFIG_91)
+       make -C upgrade
 
 # upstream build system will build fine for one given PostgreSQL version,
 # then we build the PostgreSQL module and files for yet another version of
 # it so that we have binary packages for postgresql-8.4-pgq3 and 9.0.
 override_dh_auto_install: 
-       dh_auto_install
-       for d in sql/pgq sql/pgq_node sql/pgq_ext sql/pgq_coop sql/txid sql/londiste; do \
-               make PG_CONFIG=$(PG_CONFIG_84) \
-                     DESTDIR=$(CURDIR)/debian/tmp \
-                     -C $$d clean install \
-                || exit 1 ;\
+       mkdir -p $(CURDIR)/debian/tmp
+       cp -a upgrade/final/v3.0_pgq_core.sql $(CURDIR)/debian/tmp/pgq_core_upgrade_to_v3.0.sql
+       dh_auto_install -- SQLDIR=/usr/share/skytools3 PG_CONFIG=$(PG_CONFIG_91)
+       # now care about any previous supported versions
+       for version in $$(pg_buildext supported-versions .) ; do \
+               echo "### Building for PostgreSQL $$version" && \
+               for d in sql/pgq sql/pgq_node sql/pgq_ext sql/pgq_coop sql/txid sql/londiste; do \
+                       make PG_CONFIG=/usr/lib/postgresql/$$version/bin/pg_config \
+                       DESTDIR=$(CURDIR)/debian/tmp \
+                            -C $$d clean install \
+                       || exit 1 ;\
+               done; \
        done
 
 lib/build:
        chmod +x lib/find_modules.sh
 
+orig: clean
+       cd .. && tar czf skytools3_$(PKGVERS).orig.tar.gz $(ORIG_EXCLUDE) skytools
+
 %:
        dh $@
diff --git a/debian/skytools3-walmgr.postinst b/debian/skytools3-walmgr.postinst
new file mode 100644 (file)
index 0000000..5d5e54a
--- /dev/null
@@ -0,0 +1,39 @@
+#!/bin/sh
+# postinst script for #PACKAGE#
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <postinst> `configure' <most-recently-configured-version>
+#        * <old-postinst> `abort-upgrade' <new version>
+#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+#          <new-version>
+#        * <postinst> `abort-remove'
+#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+#          <failed-install-package> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+    configure)
+       # scripts alternatives
+       bin=/usr/bin
+       man=/usr/share/man/man1
+       for f in walmgr
+       do
+           update-alternatives --install $bin/${f} $f $bin/${f}3 3 \
+               --slave $man/${f}.1.gz $f.1 $man/${f}3.1.gz || exit 1
+       done
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/skytools3-walmgr.prerm b/debian/skytools3-walmgr.prerm
new file mode 100644 (file)
index 0000000..9fa0c9f
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh -e
+
+case $1 in
+    configure)
+       for f in walmgr; do
+           update-alternatives --remove $f /usr/bin/${f}3 || exit 1 ;
+       done;;
+esac
+
+#DEBHELPER#
index b2730713aeba64a0e55c01523aca5503b3ba6025..6501f71255bd0ad3648abb8a5ec923a411624ad0 100644 (file)
@@ -1,6 +1,6 @@
 #!/bin/sh
 ### BEGIN INIT INFO
-# Provides:          skytools-3.0
+# Provides:          skytools3
 # Required-Start:    $network $local_fs $remote_fs
 # Required-Stop:     $network $remote_fs
 # Default-Start:     2 3 4 5
index 7a2812baa08d826689d7a85b579f242a1543bf9f..9a16c525d6bbc079459c783d02870053319060bc 100644 (file)
@@ -23,35 +23,20 @@ case "$1" in
        if getent passwd skytools > /dev/null; then
            echo user skytools already exists
        else
-           adduser --system --no-create-home --group --disabled-login skytools
+           adduser --system --no-create-home --home /var/lib/skytools --group --disabled-login skytools
        fi
 
        # care for transient data directories
        install -o skytools -g skytools -d /var/log/skytools /var/run/skytools
 
        # scripts alternatives
-       for f in /usr/bin/londiste3 /usr/bin/scriptmgr3 \
-           /usr/bin/queue_mover3 /usr/bin/queue_splitter3
+       bin=/usr/bin
+       man=/usr/share/man/man1
+       for f in londiste scriptmgr queue_mover queue_splitter
        do
-           link=`echo $f |cut -d3 -f1`
-           name=`basename $f |cut -d3 -f1`
-           update-alternatives --install $link $name $f 3
+           update-alternatives --install $bin/${f} $f $bin/${f}3 3 \
+               --slave $man/${f}.1.gz $f.1 $man/${f}3.1.gz || exit 1
        done
-
-       # man pages alternatives
-       for m in /usr/share/man/man1/scriptmgr3.1.gz \
-           /usr/share/man/man1/pgqadm3.1.gz /usr/share/man/man1/londiste3.1.gz \
-           /usr/share/man/man1/queue_mover3.1.gz /usr/share/man/man1/queue_splitter3.1.gz
-       do
-           link=`echo $m |cut -d3 -f1`
-           name=`basename $m 3.1.gz`
-           update-alternatives --install $link "$name.1.gz" $m 3
-       done
-    ;;
-
-    *)
-        echo "postinst called with unknown argument \`$1'" >&2
-        exit 1
     ;;
 esac
 
diff --git a/debian/skytools3.postrm b/debian/skytools3.postrm
deleted file mode 100644 (file)
index 421da7e..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-# Automatically added by dh_installinit
-if [ "$1" = "purge" ] ; then
-       update-rc.d skytools3 remove >/dev/null
-fi
-# End automatically added section
-
-
-# scripts alternatives
-for f in /usr/bin/londiste3 /usr/bin/scriptmgr3 \
-    /usr/bin/queue_mover3 /usr/bin/queue_splitter3
-do
-    name=`basename $f |cut -d3 -f1`
-    update-alternatives --remove $name $f
-done
-
-# man pages alternatives
-for m in /usr/share/man/man1/scriptmgr3.1.gz \
-    /usr/share/man/man1/pgqadm3.1.gz /usr/share/man/man1/londiste3.1.gz \
-    /usr/share/man/man1/queue_mover3.1.gz /usr/share/man/man1/queue_splitter3.1.gz
-do
-    name=`basename $m 3.1.gz`
-    update-alternatives --remove $link "$name.1.gz"
-done
diff --git a/debian/skytools3.prerm b/debian/skytools3.prerm
new file mode 100644 (file)
index 0000000..7ec1982
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh -e
+
+case $1 in
+    configure)
+       for f in londiste scriptmgr queue_mover queue_splitter; do
+           update-alternatives --remove $f /usr/bin/${f}3 || exit 1 ;
+       done;;
+esac
+
+#DEBHELPER#
index 5a0d2d49a1213a43c12b5552ddc6b18edc77fec8..073821cc82d13543782510f6ac07c962b2f56ed0 100644 (file)
@@ -1,34 +1,2 @@
 lib/libusual.a
-lib/obj/cxextra.o
-lib/obj/time.o
-lib/obj/base.o
-lib/obj/regex.o
-lib/obj/strpool.o
-lib/obj/cbtree.o
-lib/obj/daemon.o
-lib/obj/netdb.o
-lib/obj/crc32.o
-lib/obj/logging.o
-lib/obj/aatree.o
-lib/obj/list.o
-lib/obj/mempool.o
-lib/obj/socket.o
-lib/obj/lookup3.o
-lib/obj/slab.o
-lib/obj/err.o
-lib/obj/heap.o
-lib/obj/cxalloc.o
-lib/obj/mdict.o
-lib/obj/utf8.o
-lib/obj/pthread.o
-lib/obj/cfparser.o
 lib/obj/testcompile
-lib/obj/pgutil.o
-lib/obj/string.o
-lib/obj/event.o
-lib/obj/md5.o
-lib/obj/sha1.o
-lib/obj/signal.o
-lib/obj/fileutil.o
-lib/obj/mbuf.o
-lib/obj/safeio.o