From b5b40ffd38e315223c6e38e4a291cbd58e471062 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sat, 24 Apr 2010 17:57:34 +0100 Subject: Added BITLBEE_CONFIGURE_FLAGS variable so configure flags can be overridden when generating debs. --- debian/rules | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/rules b/debian/rules index 788e5006..56a02fbb 100755 --- a/debian/rules +++ b/debian/rules @@ -1,5 +1,6 @@ #!/usr/bin/make -f +BITLBEE_CONFIGURE_FLAGS ?= DEBUG ?= 0 ifdef BITLBEE_VERSION @@ -13,7 +14,7 @@ endif build-arch: build-arch-stamp build-arch-stamp: [ -d debian ] - ./configure --debug=$(DEBUG) --prefix=/usr --etcdir=/etc/bitlbee --events=libevent + ./configure --debug=$(DEBUG) --prefix=/usr --etcdir=/etc/bitlbee --events=libevent $(BITLBEE_CONFIGURE_FLAGS) $(MAKE) # $(MAKE) -C doc/ all touch build-arch-stamp -- cgit v1.2.3 From c5213622819e578c577158be6b0610ef9486fe45 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sat, 24 Apr 2010 18:04:28 +0100 Subject: libpurple-dev build dependency. --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/control b/debian/control index 86488c8a..8f861aeb 100644 --- a/debian/control +++ b/debian/control @@ -4,7 +4,7 @@ Priority: optional Maintainer: Wilmer van der Gaast Uploaders: Jelmer Vernooij Standards-Version: 3.8.0 -Build-Depends: libglib2.0-dev (>= 2.4), libevent-dev, libgnutls-dev | libnss-dev (>= 1.6), debconf-2.0, po-debconf +Build-Depends: libglib2.0-dev (>= 2.4), libevent-dev, libgnutls-dev | libnss-dev (>= 1.6), debconf-2.0, po-debconf, libpurple-dev Homepage: http://www.bitlbee.org/ Vcs-Bzr: http://code.bitlbee.org/bitlbee/ DM-Upload-Allowed: yes -- cgit v1.2.3 From 095a5f046c36c4cff689305fef81533a9e9603fc Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sat, 5 Jun 2010 15:47:54 +0100 Subject: Redid debian/rules using debhelper, with good results. This creates mostly fine debs. Need to do some more checks, and make sure bitlbee-libpurple gets the same maintainer scripts as bitlbee. --- debian/bitlbee-common.docs | 6 ++ debian/bitlbee-common.examples | 1 + debian/changelog | 9 +++ debian/compat | 1 + debian/conffiles | 3 - debian/control | 29 ++++++- debian/patches/bitlbee.conf.diff | 4 +- debian/rules | 163 ++++++++++++++++++--------------------- 8 files changed, 120 insertions(+), 96 deletions(-) create mode 100644 debian/bitlbee-common.docs create mode 100644 debian/bitlbee-common.examples create mode 100644 debian/compat delete mode 100644 debian/conffiles (limited to 'debian') diff --git a/debian/bitlbee-common.docs b/debian/bitlbee-common.docs new file mode 100644 index 00000000..72ff657c --- /dev/null +++ b/debian/bitlbee-common.docs @@ -0,0 +1,6 @@ +doc/user-guide/user-guide.txt +doc/user-guide/user-guide.html +doc/AUTHORS +doc/CREDITS +doc/FAQ +doc/README diff --git a/debian/bitlbee-common.examples b/debian/bitlbee-common.examples new file mode 100644 index 00000000..81562b9e --- /dev/null +++ b/debian/bitlbee-common.examples @@ -0,0 +1 @@ +utils/* diff --git a/debian/changelog b/debian/changelog index 56d0a551..ffb23ed8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +bitlbee (1.3-0) unstable; urgency=low + + * Setting some bogus version number, fix that later. + * Now using debhelper to improve maintainability. + * Added a bitlbee-libpurple package, and split off docs and stuff into + bitlbee-common. + + -- Wilmer van der Gaast Sat, 05 Jun 2010 15:16:38 +0100 + bitlbee (1.2.6a-1) unstable; urgency=low * New upstream version. diff --git a/debian/compat b/debian/compat new file mode 100644 index 00000000..7f8f011e --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +7 diff --git a/debian/conffiles b/debian/conffiles deleted file mode 100644 index dcb4078e..00000000 --- a/debian/conffiles +++ /dev/null @@ -1,3 +0,0 @@ -/etc/bitlbee/motd.txt -/etc/bitlbee/bitlbee.conf -/etc/init.d/bitlbee diff --git a/debian/control b/debian/control index 8f861aeb..dfef8e39 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,7 @@ Section: net Priority: optional Maintainer: Wilmer van der Gaast Uploaders: Jelmer Vernooij -Standards-Version: 3.8.0 +Standards-Version: 3.8.4 Build-Depends: libglib2.0-dev (>= 2.4), libevent-dev, libgnutls-dev | libnss-dev (>= 1.6), debconf-2.0, po-debconf, libpurple-dev Homepage: http://www.bitlbee.org/ Vcs-Bzr: http://code.bitlbee.org/bitlbee/ @@ -11,11 +11,36 @@ DM-Upload-Allowed: yes Package: bitlbee Architecture: any -Depends: ${shlibs:Depends}, adduser, net-tools, ${debconf-depends}, debianutils (>= 1.16) +Depends: ${shlibs:Depends}, adduser, net-tools, debianutils (>= 1.16), bitlbee-common (>= ${source:Version}), bitlbee-common (<< ${source:Version}.1~) Description: An IRC to other chat networks gateway This program can be used as an IRC server which forwards everything you say to people on other chat networks: Jabber, ICQ, AIM, MSN and Yahoo. +Package: bitlbee-libpurple +Architecture: any +Depends: ${shlibs:Depends}, adduser, net-tools, debianutils (>= 1.16), bitlbee-common (>= ${source:Version}), bitlbee-common (<< ${source:Version}.1~) +Description: An IRC to other chat networks gateway + This program can be used as an IRC server which forwards everything you + say to people on other chat networks: Jabber, ICQ, AIM, MSN and Yahoo. + . + This package contains a version of BitlBee that uses the libpurple instant + messaging library instead of built-in code, which adds support for more IM + protocols (all protocols supported by Pidgin/Finch) and features (like file + transfers), at the price of being less lightweight. + . + This variant may not be very suitable for BitlBee instances used by many + (tens or hundreds) of clients. + +Package: bitlbee-common +Architecture: all +Replaces: bitlbee (<= 1.3) +Description: An IRC to other chat networks gateway + This program can be used as an IRC server which forwards everything you + say to people on other chat networks: Jabber, ICQ, AIM, MSN and Yahoo. + . + This package contains common files (mostly documentation) for bitlbee and + bitlbee-libpurple. + Package: bitlbee-dev Architecture: all Depends: bitlbee (>= ${source:Version}), bitlbee (<< ${source:Version}.1~) diff --git a/debian/patches/bitlbee.conf.diff b/debian/patches/bitlbee.conf.diff index c98fa546..339ccd4a 100644 --- a/debian/patches/bitlbee.conf.diff +++ b/debian/patches/bitlbee.conf.diff @@ -1,5 +1,5 @@ ---- debian/bitlbee/etc/bitlbee/bitlbee.conf 2009-06-01 00:20:24.000000000 +0100 -+++ debian/bitlbee/etc/bitlbee/bitlbee.conf 2009-06-07 21:16:19.000000000 +0100 +--- bitlbee.conf 2009-06-01 00:20:24.000000000 +0100 ++++ bitlbee.conf 2009-06-07 21:16:19.000000000 +0100 @@ -23,13 +23,18 @@ ## If BitlBee is started by root as a daemon, it can drop root privileges, ## and change to the specified user. diff --git a/debian/rules b/debian/rules index df129f98..bbb368f9 100755 --- a/debian/rules +++ b/debian/rules @@ -1,4 +1,11 @@ #!/usr/bin/make -f +# +# Finally switching to debhelper. +# +# Not using debhelper was an exercise suggested to me by my AM (Gergely +# Nagy). It was educating at the time but I finally decided that the +# exercise is over now. +# BITLBEE_CONFIGURE_FLAGS ?= DEBUG ?= 0 @@ -7,104 +14,82 @@ ifdef BITLBEE_VERSION BITLBEE_FORCE_VERSION=1 else # Want to use the full package version number instead of just the release. -BITLBEE_VERSION ?= "$(shell dpkg-parsechangelog | grep ^Version: | awk '{print $$2}')" -export BITLBEE_VERSION +BITLBEE_CONFIGURE_VERSION ?= BITLBEE_VERSION=\"$(shell dpkg-parsechangelog | grep ^Version: | awk '{print $$2}')\" endif -build-arch: build-arch-stamp -build-arch-stamp: - [ -d debian ] - ./configure --debug=$(DEBUG) --prefix=/usr --etcdir=/etc/bitlbee --events=libevent $(BITLBEE_CONFIGURE_FLAGS) - $(MAKE) -# $(MAKE) -C doc/ all - touch build-arch-stamp +build: build-stamp +build-stamp: + dh_testdir -clean: - [ "`whoami`" = "root" -a -d debian ] - rm -rf build-arch-stamp debian/bitlbee debian/*.substvars debian/files debian/bitlbee-dev - $(MAKE) distclean -# -$(MAKE) -C doc/ clean - - -install-arch: build-arch - [ "`whoami`" = "root" -a -d debian ] - mkdir -p debian/bitlbee/DEBIAN/ - $(MAKE) install install-etc DESTDIR=`pwd`/debian/bitlbee - - mkdir -p debian/bitlbee/usr/share/doc/bitlbee/ - cp doc/user-guide/user-guide.txt debian/bitlbee/usr/share/doc/bitlbee/ - cp doc/user-guide/user-guide.html debian/bitlbee/usr/share/doc/bitlbee/ - -install-indep: install-arch - [ "`whoami`" = "root" -a -d debian ] - mkdir -p debian/bitlbee-dev/DEBIAN/ - $(MAKE) install-dev DESTDIR=`pwd`/debian/bitlbee-dev - - mkdir -p debian/bitlbee-dev/usr/share/doc/bitlbee-dev/ - -binary-arch: build-arch install-arch - [ "`whoami`" = "root" -a -d debian ] - - chmod 755 debian/post* debian/pre* debian/config debian/bitlbee.init - - mkdir -p debian/bitlbee/usr/share/doc/bitlbee/examples/ debian/bitlbee/etc/init.d/ - -cp doc/RELEASE-SPEECH* debian/bitlbee/usr/share/doc/bitlbee/ && gzip -9 debian/bitlbee/usr/share/doc/bitlbee/RELEASE-SPEECH* - cp doc/CREDITS doc/AUTHORS doc/README doc/FAQ debian/README.Debian debian/bitlbee/usr/share/doc/bitlbee/ - cp debian/changelog debian/bitlbee/usr/share/doc/bitlbee/changelog.Debian - cp debian/copyright debian/bitlbee/usr/share/doc/bitlbee/copyright - cp doc/CHANGES debian/bitlbee/usr/share/doc/bitlbee/changelog - cp utils/* debian/bitlbee/usr/share/doc/bitlbee/examples/ - cp debian/bitlbee.init debian/bitlbee/etc/init.d/bitlbee - patch -p0 < debian/patches/bitlbee.conf.diff - cd debian/bitlbee/usr/share/; \ - gzip -9 doc/bitlbee/changelog.Debian doc/bitlbee/changelog doc/bitlbee/user-guide.txt \ - doc/bitlbee/examples/* man/man8/bitlbee.8 man/man5/bitlbee.conf.5 - - chown -R root:root debian/bitlbee/ - find debian/bitlbee/usr/share/ -type d -exec chmod 755 {} \; - find debian/bitlbee/usr/share/ -type f -exec chmod 644 {} \; - - cp debian/prerm debian/bitlbee/DEBIAN/ - cp debian/postinst debian/bitlbee/DEBIAN/ - cp debian/postrm debian/bitlbee/DEBIAN/ - cp debian/config debian/bitlbee/DEBIAN/ - - po2debconf debian/templates > debian/bitlbee/DEBIAN/templates - cp debian/conffiles debian/bitlbee/DEBIAN/ - - if [ "$(DEBUG)" = "0" ]; then strip -R .comment -R .note debian/bitlbee/usr/sbin/bitlbee; fi - - cd debian/bitlbee; \ - find usr -type f -exec md5sum {} \; > DEBIAN/md5sums - dpkg-shlibdeps -Tdebian/bitlbee.substvars -dDepends debian/bitlbee/usr/sbin/bitlbee -ifdef BITLBEE_FORCE_VERSION - dpkg-gencontrol -ldebian/changelog -isp -pbitlbee -Tdebian/bitlbee.substvars -Pdebian/bitlbee -v1:$(BITLBEE_VERSION)-0 -V'debconf-depends=debconf (>= 1.2.0) | debconf-2.0' -else - dpkg-gencontrol -ldebian/changelog -isp -pbitlbee -Tdebian/bitlbee.substvars -Pdebian/bitlbee -V'debconf-depends=debconf (>= 1.2.0) | debconf-2.0' -endif + mkdir debian/build-native + 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 - dpkg --build debian/bitlbee .. + mkdir 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 -binary-indep: install-indep - [ "`whoami`" = "root" -a -d debian ] + touch build-stamp - chown -R root.root debian/bitlbee-dev/ - find debian/bitlbee-dev/usr/share/ -type d -exec chmod 755 {} \; - find debian/bitlbee-dev/usr/share/ -type f -exec chmod 644 {} \; +clean: + dh_testdir + dh_testroot + rm -f build-stamp - cp debian/changelog debian/bitlbee-dev/usr/share/doc/bitlbee-dev/changelog.Debian - gzip -9 debian/bitlbee-dev/usr/share/doc/bitlbee-dev/changelog.Debian - cp debian/copyright debian/bitlbee-dev/usr/share/doc/bitlbee-dev/copyright + rm -rf build-arch-stamp debian/build-* + $(MAKE) distclean - cd debian/bitlbee-dev; \ - find usr -type f -exec md5sum {} \; > DEBIAN/md5sums + dh_clean + +install: build + dh_testdir + dh_testroot + dh_prep + 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-dev DESTDIR=`pwd`/debian/bitlbee-dev + + 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 + + mkdir -p debian/bitlbee-common/usr + mv debian/bitlbee/usr/share debian/bitlbee-common/usr + rm -rf debian/bitlbee-libpurple/usr/share + +binary-common: + dh_testdir + dh_testroot + + dh_installdocs --link-doc=bitlbee-common + dh_installchangelogs + dh_installexamples + dh_installdebconf + dh_installinit + dh_installman + dh_strip + dh_link + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps +ifdef BITLBEE_FORCE_VERSION + dh_gencontrol -- -v1:$(BITLBEE_VERSION)-0 +else + dh_gencontrol +endif + dh_md5sums + dh_builddeb - dpkg-gencontrol -ldebian/changelog -isp -pbitlbee-dev -Pdebian/bitlbee-dev -v1:$(BITLBEE_VERSION)-0 +binary-indep: build install + $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common - dpkg --build debian/bitlbee-dev .. +binary-arch: build install + $(MAKE) -f debian/rules DH_OPTIONS=-a binary-common -binary: binary-arch binary-indep -build: build-arch -install: install-arch install-indep +binary-%: build install + make -f debian/rules binary-common DH_OPTIONS=-p$* -.PHONY: build-arch build clean binary-arch binary install-arch install binary-indep install-indep +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary-common binary install -- cgit v1.2.3 From 4c0388134ff88b72e343bd07013554480c2a4ef7 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sat, 5 Jun 2010 17:39:58 +0100 Subject: Remaining fixes: All looks good now, apt and dpkg seem to do the right thing with the -common transition, etc. --- debian/bitlbee-common.config | 25 ++++++++++ debian/bitlbee-common.templates | 8 ++++ debian/bitlbee.init | 0 debian/bitlbee.postinst | 102 ++++++++++++++++++++++++++++++++++++++++ debian/bitlbee.postrm | 14 ++++++ debian/bitlbee.prerm | 17 +++++++ debian/config | 25 ---------- debian/control | 15 ++++-- debian/postinst | 102 ---------------------------------------- debian/postrm | 14 ------ debian/prerm | 17 ------- debian/rules | 12 +++-- debian/templates | 8 ---- 13 files changed, 184 insertions(+), 175 deletions(-) create mode 100644 debian/bitlbee-common.config create mode 100644 debian/bitlbee-common.templates mode change 100755 => 100644 debian/bitlbee.init create mode 100644 debian/bitlbee.postinst create mode 100644 debian/bitlbee.postrm create mode 100644 debian/bitlbee.prerm delete mode 100755 debian/config delete mode 100755 debian/postinst delete mode 100755 debian/postrm delete mode 100755 debian/prerm delete mode 100644 debian/templates (limited to 'debian') diff --git a/debian/bitlbee-common.config b/debian/bitlbee-common.config new file mode 100644 index 00000000..9bb78237 --- /dev/null +++ b/debian/bitlbee-common.config @@ -0,0 +1,25 @@ +#!/bin/sh -e + +. /usr/share/debconf/confmodule +[ -f /etc/default/bitlbee ] && . /etc/default/bitlbee + +db_title BitlBee + +if [ -n "$BITLBEE_PORT" ]; then + db_set bitlbee/serveport "$BITLBEE_PORT" +else + db_get bitlbee/serveport + if [ "$RET" = "stillhavetoask" ]; then + listens=$(netstat -ltn | awk '{print $4}') + for port in 6667 6666 6668 6669; do + if [ $(expr "$listens " : ".*:$port\s") = "0" ]; then + break + fi + done + db_set bitlbee/serveport $port; + fi +fi + +if db_input medium bitlbee/serveport; then + db_go; +fi diff --git a/debian/bitlbee-common.templates b/debian/bitlbee-common.templates new file mode 100644 index 00000000..0cd04426 --- /dev/null +++ b/debian/bitlbee-common.templates @@ -0,0 +1,8 @@ +Template: bitlbee/serveport +Type: string +Default: stillhavetoask +_Description: On what TCP port should BitlBee listen for connections? + BitlBee normally listens on the regular IRC port, 6667. This might not be + a very good idea when you're running a real IRC daemon as well. 6668 might + be a good alternative. Leaving this value blank means that BitlBee will not + be run automatically. diff --git a/debian/bitlbee.init b/debian/bitlbee.init old mode 100755 new mode 100644 diff --git a/debian/bitlbee.postinst b/debian/bitlbee.postinst new file mode 100644 index 00000000..db541f6c --- /dev/null +++ b/debian/bitlbee.postinst @@ -0,0 +1,102 @@ +#!/bin/sh -e + +. /usr/share/debconf/confmodule + +db_get bitlbee/serveport +PORT="$RET" + +CONFDIR=/var/lib/bitlbee/ + +update-rc.d bitlbee defaults > /dev/null 2>&1 + +## Load default option. Don't want to put this in debconf (yet?) +BITLBEE_OPTS=-F +BITLBEE_DISABLED=0 +BITLBEE_UPGRADE_DONT_RESTART=0 +[ -r /etc/default/bitlbee ] && . /etc/default/bitlbee + +if [ "$BITLBEE_DISABLED" = "0" ] && type update-inetd > /dev/null 2> /dev/null && + ( expr "$2" : '0\..*' > /dev/null || expr "$2" : '1\.0\..*' > /dev/null ); then + ## Make sure the inetd entry is gone (can still be there from a + ## previous version. + update-inetd --remove '.*/usr/sbin/bitlbee' + if grep -q /usr/sbin/bitlbee /etc/inetd.conf 2> /dev/null; then + # Thanks for breaking update-inetd! (bugs.debian.org/311111) + # I hope that it works at least with xinetd, because this + # emergency hack doesn't: + perl -pi -e 's:^[^#].*/usr/sbin/bitlbee$:## Now using daemon mode\: # $&:' /etc/inetd.conf + killall -HUP inetd || true + fi +fi + +cat</etc/default/bitlbee +## /etc/default/bitlbee: Auto-generated/updated script. +## +## If running in (fork)daemon mode, listen on this TCP port. +BITLBEE_PORT="$PORT" + +## Use single-process or forking daemon mode? Can't be changed from debconf, +## but maintainer scripts will save your changes here. +BITLBEE_OPTS="$BITLBEE_OPTS" + +## In case you want to stick with inetd mode (or if you just want to disable +## the init scripts for some other reason), you can disable the init script +## here. (Just set it to 1) +BITLBEE_DISABLED=$BITLBEE_DISABLED + +## As a server operator, you can use the RESTART command to restart only the +## master process while keeping all the child processes and their IPC +## connections. By enabling this, the maintainer scripts won't restart +## BitlBee during upgrades so you can restart the master process by hand. +BITLBEE_UPGRADE_DONT_RESTART=$BITLBEE_UPGRADE_DONT_RESTART +EOF + +## Bye-bye DebConf, we don't need you anymore. +db_stop + +## Restore the helpfile in case we weren't upgrading but just reconfiguring: +if [ -e /usr/share/bitlbee/help.upgrading ]; then + if [ -e /usr/share/bitlbee/help.txt ]; then + rm -f /usr/share/bitlbee/help.upgrading + else + mv /usr/share/bitlbee/help.upgrading /usr/share/bitlbee/help.txt + 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 + else + /etc/init.d/bitlbee restart + fi +fi + +## If we're upgrading, we'll probably skip this next part +if [ -d $CONFDIR ] && chown -R bitlbee: $CONFDIR; then + echo 'BitlBee (probably) already installed, skipping user/configdir installation' + exit 0 +fi + +adduser --system --group --disabled-login --disabled-password --home /var/lib/bitlbee/ bitlbee +chmod 700 /var/lib/bitlbee/ + +## Can't do this in packaging phase: Don't know the UID yet. Access to +## the file should be limited, now that it stores passwords. Added +## --group later for a little more security, but have to see if I can +## apply this change to existing installations on upgrades. Will think +## about that later. +if getent group bitlbee > /dev/null; then + chmod 640 /etc/bitlbee/bitlbee.conf + chown root:bitlbee /etc/bitlbee/bitlbee.conf +else + chmod 600 /etc/bitlbee/bitlbee.conf + chown bitlbee /etc/bitlbee/bitlbee.conf +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 +fi diff --git a/debian/bitlbee.postrm b/debian/bitlbee.postrm new file mode 100644 index 00000000..5c3b4b2e --- /dev/null +++ b/debian/bitlbee.postrm @@ -0,0 +1,14 @@ +#!/bin/sh -e + +[ "$1" = "purge" ] || exit 0 + +if [ -e /usr/share/debconf/confmodule ]; then + . /usr/share/debconf/confmodule; + db_purge; +fi + +update-rc.d bitlbee remove > /dev/null 2>&1 || true +rm -f /etc/default/bitlbee + +deluser --system --remove-home bitlbee || true +rm -rf /var/lib/bitlbee ## deluser doesn't seem to do this for homedirs in /var diff --git a/debian/bitlbee.prerm b/debian/bitlbee.prerm new file mode 100644 index 00000000..687c2cc1 --- /dev/null +++ b/debian/bitlbee.prerm @@ -0,0 +1,17 @@ +#!/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 +fi diff --git a/debian/config b/debian/config deleted file mode 100755 index 9bb78237..00000000 --- a/debian/config +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh -e - -. /usr/share/debconf/confmodule -[ -f /etc/default/bitlbee ] && . /etc/default/bitlbee - -db_title BitlBee - -if [ -n "$BITLBEE_PORT" ]; then - db_set bitlbee/serveport "$BITLBEE_PORT" -else - db_get bitlbee/serveport - if [ "$RET" = "stillhavetoask" ]; then - listens=$(netstat -ltn | awk '{print $4}') - for port in 6667 6666 6668 6669; do - if [ $(expr "$listens " : ".*:$port\s") = "0" ]; then - break - fi - done - db_set bitlbee/serveport $port; - fi -fi - -if db_input medium bitlbee/serveport; then - db_go; -fi diff --git a/debian/control b/debian/control index dfef8e39..62cb2ec0 100644 --- a/debian/control +++ b/debian/control @@ -4,21 +4,25 @@ Priority: optional Maintainer: Wilmer van der Gaast Uploaders: Jelmer Vernooij Standards-Version: 3.8.4 -Build-Depends: libglib2.0-dev (>= 2.4), libevent-dev, libgnutls-dev | libnss-dev (>= 1.6), debconf-2.0, po-debconf, libpurple-dev +Build-Depends: libglib2.0-dev (>= 2.4), libevent-dev, libgnutls-dev | libnss-dev (>= 1.6), po-debconf, libpurple-dev, debhelper (>= 7) Homepage: http://www.bitlbee.org/ Vcs-Bzr: http://code.bitlbee.org/bitlbee/ DM-Upload-Allowed: yes Package: bitlbee Architecture: any -Depends: ${shlibs:Depends}, adduser, net-tools, debianutils (>= 1.16), bitlbee-common (>= ${source:Version}), bitlbee-common (<< ${source:Version}.1~) +Depends: ${shlibs:Depends}, adduser, debianutils (>= 1.16), bitlbee-common (= ${source:Version}) +Conflicts: bitlbee-libpurple +Replaces: bitlbee-libpurple Description: An IRC to other chat networks gateway This program can be used as an IRC server which forwards everything you say to people on other chat networks: Jabber, ICQ, AIM, MSN and Yahoo. Package: bitlbee-libpurple Architecture: any -Depends: ${shlibs:Depends}, adduser, net-tools, debianutils (>= 1.16), bitlbee-common (>= ${source:Version}), bitlbee-common (<< ${source:Version}.1~) +Depends: ${shlibs:Depends}, adduser, debianutils (>= 1.16), bitlbee-common (= ${source:Version}) +Conflicts: bitlbee +Replaces: bitlbee Description: An IRC to other chat networks gateway This program can be used as an IRC server which forwards everything you say to people on other chat networks: Jabber, ICQ, AIM, MSN and Yahoo. @@ -33,7 +37,8 @@ Description: An IRC to other chat networks gateway Package: bitlbee-common Architecture: all -Replaces: bitlbee (<= 1.3) +Depends: ${misc:Depends}, net-tools +Replaces: bitlbee Description: An IRC to other chat networks gateway This program can be used as an IRC server which forwards everything you say to people on other chat networks: Jabber, ICQ, AIM, MSN and Yahoo. @@ -43,7 +48,7 @@ Description: An IRC to other chat networks gateway Package: bitlbee-dev Architecture: all -Depends: bitlbee (>= ${source:Version}), bitlbee (<< ${source:Version}.1~) +Depends: ${misc:Depends}, bitlbee (>= ${source:Version}), bitlbee (<< ${source:Version}.1~) Description: An IRC to other chat networks gateway This program can be used as an IRC server which forwards everything you say to people on other chat networks: Jabber, ICQ, AIM, MSN and Yahoo. diff --git a/debian/postinst b/debian/postinst deleted file mode 100755 index db541f6c..00000000 --- a/debian/postinst +++ /dev/null @@ -1,102 +0,0 @@ -#!/bin/sh -e - -. /usr/share/debconf/confmodule - -db_get bitlbee/serveport -PORT="$RET" - -CONFDIR=/var/lib/bitlbee/ - -update-rc.d bitlbee defaults > /dev/null 2>&1 - -## Load default option. Don't want to put this in debconf (yet?) -BITLBEE_OPTS=-F -BITLBEE_DISABLED=0 -BITLBEE_UPGRADE_DONT_RESTART=0 -[ -r /etc/default/bitlbee ] && . /etc/default/bitlbee - -if [ "$BITLBEE_DISABLED" = "0" ] && type update-inetd > /dev/null 2> /dev/null && - ( expr "$2" : '0\..*' > /dev/null || expr "$2" : '1\.0\..*' > /dev/null ); then - ## Make sure the inetd entry is gone (can still be there from a - ## previous version. - update-inetd --remove '.*/usr/sbin/bitlbee' - if grep -q /usr/sbin/bitlbee /etc/inetd.conf 2> /dev/null; then - # Thanks for breaking update-inetd! (bugs.debian.org/311111) - # I hope that it works at least with xinetd, because this - # emergency hack doesn't: - perl -pi -e 's:^[^#].*/usr/sbin/bitlbee$:## Now using daemon mode\: # $&:' /etc/inetd.conf - killall -HUP inetd || true - fi -fi - -cat</etc/default/bitlbee -## /etc/default/bitlbee: Auto-generated/updated script. -## -## If running in (fork)daemon mode, listen on this TCP port. -BITLBEE_PORT="$PORT" - -## Use single-process or forking daemon mode? Can't be changed from debconf, -## but maintainer scripts will save your changes here. -BITLBEE_OPTS="$BITLBEE_OPTS" - -## In case you want to stick with inetd mode (or if you just want to disable -## the init scripts for some other reason), you can disable the init script -## here. (Just set it to 1) -BITLBEE_DISABLED=$BITLBEE_DISABLED - -## As a server operator, you can use the RESTART command to restart only the -## master process while keeping all the child processes and their IPC -## connections. By enabling this, the maintainer scripts won't restart -## BitlBee during upgrades so you can restart the master process by hand. -BITLBEE_UPGRADE_DONT_RESTART=$BITLBEE_UPGRADE_DONT_RESTART -EOF - -## Bye-bye DebConf, we don't need you anymore. -db_stop - -## Restore the helpfile in case we weren't upgrading but just reconfiguring: -if [ -e /usr/share/bitlbee/help.upgrading ]; then - if [ -e /usr/share/bitlbee/help.txt ]; then - rm -f /usr/share/bitlbee/help.upgrading - else - mv /usr/share/bitlbee/help.upgrading /usr/share/bitlbee/help.txt - 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 - else - /etc/init.d/bitlbee restart - fi -fi - -## If we're upgrading, we'll probably skip this next part -if [ -d $CONFDIR ] && chown -R bitlbee: $CONFDIR; then - echo 'BitlBee (probably) already installed, skipping user/configdir installation' - exit 0 -fi - -adduser --system --group --disabled-login --disabled-password --home /var/lib/bitlbee/ bitlbee -chmod 700 /var/lib/bitlbee/ - -## Can't do this in packaging phase: Don't know the UID yet. Access to -## the file should be limited, now that it stores passwords. Added -## --group later for a little more security, but have to see if I can -## apply this change to existing installations on upgrades. Will think -## about that later. -if getent group bitlbee > /dev/null; then - chmod 640 /etc/bitlbee/bitlbee.conf - chown root:bitlbee /etc/bitlbee/bitlbee.conf -else - chmod 600 /etc/bitlbee/bitlbee.conf - chown bitlbee /etc/bitlbee/bitlbee.conf -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 -fi diff --git a/debian/postrm b/debian/postrm deleted file mode 100755 index 5c3b4b2e..00000000 --- a/debian/postrm +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -e - -[ "$1" = "purge" ] || exit 0 - -if [ -e /usr/share/debconf/confmodule ]; then - . /usr/share/debconf/confmodule; - db_purge; -fi - -update-rc.d bitlbee remove > /dev/null 2>&1 || true -rm -f /etc/default/bitlbee - -deluser --system --remove-home bitlbee || true -rm -rf /var/lib/bitlbee ## deluser doesn't seem to do this for homedirs in /var diff --git a/debian/prerm b/debian/prerm deleted file mode 100755 index 687c2cc1..00000000 --- a/debian/prerm +++ /dev/null @@ -1,17 +0,0 @@ -#!/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 -fi diff --git a/debian/rules b/debian/rules index bbb368f9..8ccb181b 100755 --- a/debian/rules +++ b/debian/rules @@ -10,9 +10,7 @@ BITLBEE_CONFIGURE_FLAGS ?= DEBUG ?= 0 -ifdef BITLBEE_VERSION -BITLBEE_FORCE_VERSION=1 -else +ifndef BITLBEE_VERSION # Want to use the full package version number instead of just the release. BITLBEE_CONFIGURE_VERSION ?= BITLBEE_VERSION=\"$(shell dpkg-parsechangelog | grep ^Version: | awk '{print $$2}')\" endif @@ -67,14 +65,20 @@ binary-common: dh_installexamples dh_installdebconf dh_installinit +ifeq ($(DH_OPTIONS),-a) + cp -a debian/bitlbee/etc debian/bitlbee-libpurple +endif dh_installman dh_strip dh_link dh_compress dh_fixperms dh_installdeb +ifeq ($(DH_OPTIONS),-a) + cp -a debian/bitlbee/DEBIAN/{post,pre}* debian/bitlbee-libpurple/DEBIAN +endif dh_shlibdeps -ifdef BITLBEE_FORCE_VERSION +ifdef BITLBEE_VERSION dh_gencontrol -- -v1:$(BITLBEE_VERSION)-0 else dh_gencontrol diff --git a/debian/templates b/debian/templates deleted file mode 100644 index 0cd04426..00000000 --- a/debian/templates +++ /dev/null @@ -1,8 +0,0 @@ -Template: bitlbee/serveport -Type: string -Default: stillhavetoask -_Description: On what TCP port should BitlBee listen for connections? - BitlBee normally listens on the regular IRC port, 6667. This might not be - a very good idea when you're running a real IRC daemon as well. 6668 might - be a good alternative. Leaving this value blank means that BitlBee will not - be run automatically. -- cgit v1.2.3 From 477250038a91c6877838cbd7f0d32b839f64824d Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sat, 5 Jun 2010 18:35:39 +0100 Subject: Put in the necessary hacks to make version number spoofing work again. --- debian/control | 6 +++--- debian/rules | 11 ++++++----- 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 'debian') diff --git a/debian/control b/debian/control index 62cb2ec0..d197dcdd 100644 --- a/debian/control +++ b/debian/control @@ -11,7 +11,7 @@ DM-Upload-Allowed: yes Package: bitlbee Architecture: any -Depends: ${shlibs:Depends}, adduser, debianutils (>= 1.16), bitlbee-common (= ${source:Version}) +Depends: ${shlibs:Depends}, adduser, debianutils (>= 1.16), bitlbee-common (= ${bee:Version}) Conflicts: bitlbee-libpurple Replaces: bitlbee-libpurple Description: An IRC to other chat networks gateway @@ -20,7 +20,7 @@ Description: An IRC to other chat networks gateway Package: bitlbee-libpurple Architecture: any -Depends: ${shlibs:Depends}, adduser, debianutils (>= 1.16), bitlbee-common (= ${source:Version}) +Depends: ${shlibs:Depends}, adduser, debianutils (>= 1.16), bitlbee-common (= ${bee:Version}) Conflicts: bitlbee Replaces: bitlbee Description: An IRC to other chat networks gateway @@ -48,7 +48,7 @@ Description: An IRC to other chat networks gateway Package: bitlbee-dev Architecture: all -Depends: ${misc:Depends}, bitlbee (>= ${source:Version}), bitlbee (<< ${source:Version}.1~) +Depends: ${misc:Depends}, bitlbee (>= ${bee:Version}), bitlbee (<< ${bee:Version}.1~) Description: An IRC to other chat networks gateway This program can be used as an IRC server which forwards everything you say to people on other chat networks: Jabber, ICQ, AIM, MSN and Yahoo. diff --git a/debian/rules b/debian/rules index 8ccb181b..f2ede2cf 100755 --- a/debian/rules +++ b/debian/rules @@ -19,11 +19,11 @@ build: build-stamp build-stamp: dh_testdir - mkdir debian/build-native + mkdir -p debian/build-native 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 - mkdir debian/build-libpurple + 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 @@ -61,7 +61,7 @@ binary-common: dh_testroot dh_installdocs --link-doc=bitlbee-common - dh_installchangelogs + dh_installchangelogs doc/CHANGES dh_installexamples dh_installdebconf dh_installinit @@ -79,9 +79,10 @@ ifeq ($(DH_OPTIONS),-a) endif dh_shlibdeps ifdef BITLBEE_VERSION - dh_gencontrol -- -v1:$(BITLBEE_VERSION)-0 + echo source:Version=1:$(BITLBEE_VERSION)-0 > debian/substvars + dh_gencontrol -- -v1:$(BITLBEE_VERSION)-0 -Vbee:Version=1:$(BITLBEE_VERSION)-0 else - dh_gencontrol + dh_gencontrol -- -Vbee:Version=$(shell dpkg-parsechangelog | grep ^Version: | awk '{print $$2}' | sed -e 's/+[^+]*$$//') endif dh_md5sums dh_builddeb -- cgit v1.2.3 From e774815bc621af90bb64ca314b84367659c5a005 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sat, 5 Jun 2010 18:43:38 +0100 Subject: Updated short descriptions and fixed po-debconf files. --- debian/control | 8 ++++---- debian/po/POTFILES.in | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'debian') diff --git a/debian/control b/debian/control index d197dcdd..05689940 100644 --- a/debian/control +++ b/debian/control @@ -14,7 +14,7 @@ Architecture: any Depends: ${shlibs:Depends}, adduser, debianutils (>= 1.16), bitlbee-common (= ${bee:Version}) Conflicts: bitlbee-libpurple Replaces: bitlbee-libpurple -Description: An IRC to other chat networks gateway +Description: An IRC to other chat networks gateway (default version) This program can be used as an IRC server which forwards everything you say to people on other chat networks: Jabber, ICQ, AIM, MSN and Yahoo. @@ -23,7 +23,7 @@ Architecture: any Depends: ${shlibs:Depends}, adduser, debianutils (>= 1.16), bitlbee-common (= ${bee:Version}) Conflicts: bitlbee Replaces: bitlbee -Description: An IRC to other chat networks gateway +Description: An IRC to other chat networks gateway (using libpurple) This program can be used as an IRC server which forwards everything you say to people on other chat networks: Jabber, ICQ, AIM, MSN and Yahoo. . @@ -39,7 +39,7 @@ Package: bitlbee-common Architecture: all Depends: ${misc:Depends}, net-tools Replaces: bitlbee -Description: An IRC to other chat networks gateway +Description: An IRC to other chat networks gateway (common files/docs) This program can be used as an IRC server which forwards everything you say to people on other chat networks: Jabber, ICQ, AIM, MSN and Yahoo. . @@ -49,7 +49,7 @@ Description: An IRC to other chat networks gateway Package: bitlbee-dev Architecture: all Depends: ${misc:Depends}, bitlbee (>= ${bee:Version}), bitlbee (<< ${bee:Version}.1~) -Description: An IRC to other chat networks gateway +Description: An IRC to other chat networks gateway (dev files) This program can be used as an IRC server which forwards everything you say to people on other chat networks: Jabber, ICQ, AIM, MSN and Yahoo. . diff --git a/debian/po/POTFILES.in b/debian/po/POTFILES.in index cef83a34..8d2b570f 100644 --- a/debian/po/POTFILES.in +++ b/debian/po/POTFILES.in @@ -1 +1 @@ -[type: gettext/rfc822deb] templates +[type: gettext/rfc822deb] bitlbee-common.templates -- cgit v1.2.3