aboutsummaryrefslogtreecommitdiffstats
path: root/debian
diff options
context:
space:
mode:
Diffstat (limited to 'debian')
-rw-r--r--debian/bitlbee-common.init (renamed from debian/bitlbee.init)0
-rw-r--r--debian/bitlbee-common.postinst (renamed from debian/bitlbee.postinst)23
-rw-r--r--debian/bitlbee-common.postrm (renamed from debian/bitlbee.postrm)0
-rw-r--r--debian/bitlbee-common.prerm13
-rw-r--r--debian/bitlbee.prerm16
-rw-r--r--debian/changelog2
-rwxr-xr-xdebian/rules37
7 files changed, 51 insertions, 40 deletions
diff --git a/debian/bitlbee.init b/debian/bitlbee-common.init
index be1dcd66..be1dcd66 100644
--- a/debian/bitlbee.init
+++ b/debian/bitlbee-common.init
diff --git a/debian/bitlbee.postinst b/debian/bitlbee-common.postinst
index db541f6c..c965e09c 100644
--- a/debian/bitlbee.postinst
+++ b/debian/bitlbee-common.postinst
@@ -63,11 +63,20 @@ if [ -e /usr/share/bitlbee/help.upgrading ]; then
fi
fi
-if [ -n "$2" -a "$BITLBEE_UPGRADE_DONT_RESTART" != "1" ]; then
- if which invoke-rc.d >/dev/null 2>&1; then
- invoke-rc.d bitlbee restart
+# The official way to check if we're upgrading is to check if $2 is
+# non-empty. However, previous versions of BitlBee didn't have a
+# bitlbee-common package so in that case the var will also be empty.
+# Instead, check if the port is in use (if netstat is available). This
+# works since the debconf code will pick a free port on new installs.
+if [ "$BITLBEE_UPGRADE_DONT_RESTART" != "1" ]; then
+ unset IS_UPGRADE
+ if type netstat > /dev/null 2> /dev/null; then
+ netstat -an | grep -q :$PORT\\b.*LISTEN && IS_UPGRADE=1
else
- /etc/init.d/bitlbee restart
+ [ -n "$2" ] && IS_UPGRADE=1
+ fi
+ if [ -n "$IS_UPGRADE" ]; then
+ invoke-rc.d bitlbee restart
fi
fi
@@ -94,9 +103,5 @@ else
fi
if [ -z "$2" ]; then
- if which invoke-rc.d >/dev/null 2>&1; then
- invoke-rc.d bitlbee start
- else
- /etc/init.d/bitlbee start
- fi
+ invoke-rc.d bitlbee start
fi
diff --git a/debian/bitlbee.postrm b/debian/bitlbee-common.postrm
index 5c3b4b2e..5c3b4b2e 100644
--- a/debian/bitlbee.postrm
+++ b/debian/bitlbee-common.postrm
diff --git a/debian/bitlbee-common.prerm b/debian/bitlbee-common.prerm
new file mode 100644
index 00000000..50a49bee
--- /dev/null
+++ b/debian/bitlbee-common.prerm
@@ -0,0 +1,13 @@
+#!/bin/sh -e
+
+if [ "$1" = "upgrade" ]; then
+ ## To prevent the help function from breaking in currently running
+ ## BitlBee processes. Have to do it like this because dpkg-reconfigure
+ ## looks a lot like an upgrade and we don't want to lose help.txt...
+ if [ -e /usr/share/bitlbee/help.txt ]; then
+ rm -f /usr/share/bitlbee/help.upgrading
+ mv /usr/share/bitlbee/help.txt /usr/share/bitlbee/help.upgrading
+ fi
+else
+ invoke-rc.d bitlbee stop || exit 0
+fi
diff --git a/debian/bitlbee.prerm b/debian/bitlbee.prerm
index 687c2cc1..c61db24b 100644
--- a/debian/bitlbee.prerm
+++ b/debian/bitlbee.prerm
@@ -1,17 +1,5 @@
#!/bin/sh -e
-if [ "$1" = "upgrade" ]; then
- ## To prevent the help function from breaking in currently running
- ## BitlBee processes. Have to do it like this because dpkg-reconfigure
- ## looks a lot like an upgrade and we don't want to lose help.txt...
- if [ -e /usr/share/bitlbee/help.txt ]; then
- rm -f /usr/share/bitlbee/help.upgrading
- mv /usr/share/bitlbee/help.txt /usr/share/bitlbee/help.upgrading
- fi
-else
- if which invoke-rc.d >/dev/null 2>&1; then
- invoke-rc.d bitlbee stop || exit 0
- else
- /etc/init.d/bitlbee stop || exit 0
- fi
+if [ "$1" != "upgrade" ]; then
+ invoke-rc.d bitlbee stop || exit 0
fi
diff --git a/debian/changelog b/debian/changelog
index 70f1ed47..8e3cabcb 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,7 +5,7 @@ bitlbee (1.3-0) unstable; urgency=low
* Added a bitlbee-libpurple package, and split off docs and stuff into
bitlbee-common.
- -- Wilmer van der Gaast <wilmer@gaast.net> Sat, 05 Jun 2010 15:16:38 +0100
+ -- Wilmer van der Gaast <wilmer@gaast.net> Wed, 18 Aug 2010 00:53:11 +0100
bitlbee (1.2.8-1) unstable; urgency=low
diff --git a/debian/rules b/debian/rules
index c6edfe2b..c5397085 100755
--- a/debian/rules
+++ b/debian/rules
@@ -7,6 +7,8 @@
# exercise is over now.
#
+# Include the bitlbee-libpurple variant by default
+BITLBEE_LIBPURPLE ?= 1
BITLBEE_CONFIGURE_FLAGS ?=
DEBUG ?= 0
@@ -15,6 +17,10 @@ ifndef BITLBEE_VERSION
BITLBEE_CONFIGURE_VERSION ?= BITLBEE_VERSION=\"$(shell dpkg-parsechangelog | grep ^Version: | awk '{print $$2}')\"
endif
+ifneq ($(BITLBEE_LIBPURPLE),1)
+DH_OPTIONS += -Nbitlbee-libpurple
+endif
+
build: build-stamp
build-stamp:
dh_testdir
@@ -23,9 +29,11 @@ build-stamp:
ROOT=$$PWD; cd debian/build-native; $(BITLBEE_CONFIGURE_VERSION) $$ROOT/configure --debug=$(DEBUG) --prefix=/usr --etcdir=/etc/bitlbee --events=libevent $(BITLBEE_CONFIGURE_FLAGS)
$(MAKE) -C debian/build-native
+ifeq ($(BITLBEE_LIBPURPLE),1)
mkdir -p debian/build-libpurple
ROOT=$$PWD; cd debian/build-libpurple; $(BITLBEE_CONFIGURE_VERSION) $$ROOT/configure --debug=$(DEBUG) --prefix=/usr --etcdir=/etc/bitlbee --purple=1 $(BITLBEE_CONFIGURE_FLAGS)
$(MAKE) -C debian/build-libpurple
+endif
$(MAKE) -C doc
@@ -36,7 +44,7 @@ clean:
dh_testroot
rm -f build-stamp
- rm -rf build-arch-stamp debian/build-*
+ rm -rf build-arch-stamp debian/build-* debian/bitlbee-libpurple.prerm
$(MAKE) distclean
dh_clean
@@ -47,12 +55,15 @@ install: build
dh_clean -k
dh_installdirs
- $(MAKE) -C debian/build-native install install-etc DESTDIR=`pwd`/debian/bitlbee
- $(MAKE) -C debian/build-libpurple install install-etc DESTDIR=`pwd`/debian/bitlbee-libpurple
+ $(MAKE) -C debian/build-native install DESTDIR=`pwd`/debian/bitlbee
+ $(MAKE) -C debian/build-native install-etc DESTDIR=`pwd`/debian/bitlbee-common
$(MAKE) -C debian/build-native install-dev DESTDIR=`pwd`/debian/bitlbee-dev
+ patch debian/bitlbee-common/etc/bitlbee/bitlbee.conf debian/patches/bitlbee.conf.diff
- patch debian/bitlbee/etc/bitlbee/bitlbee.conf debian/patches/bitlbee.conf.diff
- patch debian/bitlbee-libpurple/etc/bitlbee/bitlbee.conf debian/patches/bitlbee.conf.diff
+ifeq ($(BITLBEE_LIBPURPLE),1)
+ $(MAKE) -C debian/build-libpurple install DESTDIR=`pwd`/debian/bitlbee-libpurple
+ ln -sf debian/bitlbee.prerm debian/bitlbee-libpurple.prerm
+endif
mkdir -p debian/bitlbee-common/usr
mv debian/bitlbee/usr/share debian/bitlbee-common/usr
@@ -67,21 +78,15 @@ binary-common:
dh_installdocs #--link-doc=bitlbee-common
# TODO: Restore --link-doc up here and remove the hack below once
# Hardy and Lenny are deprecated.
- for p in bitlbee bitlbee-libpurple bitlbee-dev; do rm -rf debian/$$p/usr/share/doc/$$p; ln -s bitlbee-common debian/$$p/usr/share/doc/$$p; done
+ for p in bitlbee bitlbee-libpurple bitlbee-dev; do rm -r debian/$$p/usr/share/doc/$$p && ln -s bitlbee-common debian/$$p/usr/share/doc/$$p; done
dh_installdebconf
- dh_installinit
-ifeq ($(DH_OPTIONS),-a)
- cp -a debian/bitlbee/etc debian/bitlbee-libpurple
-endif
+ dh_installinit --init-script=bitlbee
dh_installman
dh_strip
dh_link
dh_compress
dh_fixperms
dh_installdeb
-ifeq ($(DH_OPTIONS),-a)
- cp -a debian/bitlbee/DEBIAN/post* debian/bitlbee/DEBIAN/pre* debian/bitlbee-libpurple/DEBIAN
-endif
dh_shlibdeps
ifdef BITLBEE_VERSION
dh_gencontrol -- -v1:$(BITLBEE_VERSION)-0 -Vbee:Version=1:$(BITLBEE_VERSION)-0
@@ -92,13 +97,13 @@ endif
dh_builddeb
binary-indep: build install
- $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
+ DH_OPTIONS=-i $(MAKE) -f debian/rules binary-common
binary-arch: build install
- $(MAKE) -f debian/rules DH_OPTIONS=-a binary-common
+ DH_OPTIONS=-a $(MAKE) -f debian/rules binary-common
binary-%: build install
- make -f debian/rules binary-common DH_OPTIONS=-p$*
+ DH_OPTIONS=-p$* $(MAKE) -f debian/rules binary-common
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary-common binary install