[arch-commits] Commit in bitlbee/trunk (5 files)
Dave Reisner
dreisner at archlinux.org
Thu Jul 5 23:25:35 UTC 2012
Date: Thursday, July 5, 2012 @ 19:25:34
Author: dreisner
Revision: 163024
upgpkg: bitlbee 3.0.5-4
- add systemd tmpfiles.d fragment
- use pidfile to determined pid in rc.d script
- move pidfile and socket: /var/run/bitlbee -> /run/bitlbee
Added:
bitlbee/trunk/bitlbee.install
bitlbee/trunk/bitlbee.tmpfiles
Modified:
bitlbee/trunk/PKGBUILD
bitlbee/trunk/rc.d
Deleted:
bitlbee/trunk/install
------------------+
PKGBUILD | 39 ++++++++++++++-------------
bitlbee.install | 15 ++++++++++
bitlbee.tmpfiles | 1
install | 14 ---------
rc.d | 75 +++++++++++++++++++++++++++++------------------------
5 files changed, 78 insertions(+), 66 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2012-07-05 21:03:35 UTC (rev 163023)
+++ PKGBUILD 2012-07-05 23:25:34 UTC (rev 163024)
@@ -4,11 +4,12 @@
# Contributor: simo <simo at archlinux.org>
# Contributor: Jeff 'codemac' Mickey <jeff at archlinux.org>
# Contributor: Daniel J Griffiths <ghost1227 at archlinux.us>
-# Maintainer: Gaetan Bisson <bisson at archlinux.org>
+# Contributor: Gaetan Bisson <bisson at archlinux.org>
+# Maintainer: Dave Reisner <dreisner at archlinux.org>
pkgname=bitlbee
pkgver=3.0.5
-pkgrel=3
+pkgrel=4
pkgdesc='Brings instant messaging (XMPP, MSN, Yahoo!, AIM, ICQ, Twitter) to IRC'
url='http://www.bitlbee.org/'
license=('GPL')
@@ -21,42 +22,42 @@
source=("http://get.bitlbee.org/src/${pkgname}-${pkgver}.tar.gz"
'sbindir.patch'
'xinetd'
- 'rc.d')
+ 'rc.d'
+ 'bitlbee.tmpfiles')
sha1sums=('74afdff87be49ce060771a6ae10d7643cd57b9b6'
'9b774e6d85471a4e43e25b8b941cd0e1032a7a6c'
'5e0af27ba9cc4fe455e3381c75fc49a9326e2f17'
- 'be09d29af3853825778331df451f16ca9e452d03')
+ '02423c500ac64f673ba26a3395c7c7036c17343e'
+ '3695ed2fe22436c4d0fc3ead829f7d1f89bc491c')
+backup=('etc/bitlbee/bitlbee.conf'
+ 'etc/bitlbee/motd.txt'
+ 'etc/xinetd.d/bitlbee')
+install=bitlbee.install
-backup=('etc/bitlbee/bitlbee.conf' 'etc/bitlbee/motd.txt' 'etc/xinetd.d/bitlbee')
-install=install
-
build() {
- cd "${srcdir}/${pkgname}-${pkgver}"
+ cd "$pkgname-$pkgver"
patch -p1 -i ../sbindir.patch
./configure \
--prefix=/usr \
--etcdir=/etc/bitlbee \
- --pidfile=/var/run/bitlbee/bitlbee.pid \
- --ipcsocket=/var/run/bitlbee/bitlbee.sock \
+ --pidfile=/run/bitlbee/bitlbee.pid \
+ --ipcsocket=/run/bitlbee/bitlbee.sock \
--systemdsystemunitdir=/usr/lib/systemd/system \
--ssl=openssl \
--strip=0 \
--otr=plugin \
- --skype=plugin \
+ --skype=plugin
make
}
package() {
- cd "${srcdir}/${pkgname}-${pkgver}"
+ make -C "$pkgname-$pkgver" DESTDIR="$pkgdir" install{,-etc,-dev}
- install -o65 -g65 -dm770 "${pkgdir}"/var/lib/bitlbee
- install -Dm644 "${srcdir}"/xinetd "${pkgdir}"/etc/xinetd.d/bitlbee
- install -Dm755 "${srcdir}"/rc.d "${pkgdir}"/etc/rc.d/bitlbee
-
- make DESTDIR="${pkgdir}" install
- make DESTDIR="${pkgdir}" install-etc
- make DESTDIR="${pkgdir}" install-dev
+ install -o65 -g65 -dm770 "$pkgdir/var/lib/bitlbee"
+ install -Dm644 "$srcdir/xinetd" "$pkgdir/etc/xinetd.d/bitlbee"
+ install -Dm755 "$srcdir/rc.d" "$pkgdir/etc/rc.d/bitlbee"
+ install -Dm644 "$srcdir/bitlbee.tmpfiles" "$pkgdir/usr/lib/tmpfiles.d/bitlbee.conf"
}
Added: bitlbee.install
===================================================================
--- bitlbee.install (rev 0)
+++ bitlbee.install 2012-07-05 23:25:34 UTC (rev 163024)
@@ -0,0 +1,15 @@
+post_install() {
+ getent group bitlbee &>/dev/null || groupadd -r -g 65 bitlbee >/dev/null
+ getent passwd bitlbee &>/dev/null || useradd -r -u 65 -g bitlbee -d /var/lib/bitlbee -s /bin/false -c bitlbee bitlbee >/dev/null
+ systemd-tmpfiles --create bitlbee.conf
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ getent passwd bitlbee &>/dev/null && userdel bitlbee >/dev/null
+ getent group bitlbee &>/dev/null && groupdel bitlbee >/dev/null
+ true
+}
Added: bitlbee.tmpfiles
===================================================================
--- bitlbee.tmpfiles (rev 0)
+++ bitlbee.tmpfiles 2012-07-05 23:25:34 UTC (rev 163024)
@@ -0,0 +1 @@
+d /run/bitlbee 0755 bitlbee bitlbee - -
Deleted: install
===================================================================
--- install 2012-07-05 21:03:35 UTC (rev 163023)
+++ install 2012-07-05 23:25:34 UTC (rev 163024)
@@ -1,14 +0,0 @@
-post_install() {
- getent group bitlbee &>/dev/null || groupadd -r -g 65 bitlbee >/dev/null
- getent passwd bitlbee &>/dev/null || useradd -r -u 65 -g bitlbee -d /var/lib/bitlbee -s /bin/false -c bitlbee bitlbee >/dev/null
-}
-
-post_upgrade() {
- post_install
-}
-
-post_remove() {
- getent passwd bitlbee &>/dev/null && userdel bitlbee >/dev/null
- getent group bitlbee &>/dev/null && groupdel bitlbee >/dev/null
- true
-}
Modified: rc.d
===================================================================
--- rc.d 2012-07-05 21:03:35 UTC (rev 163023)
+++ rc.d 2012-07-05 23:25:34 UTC (rev 163024)
@@ -3,38 +3,47 @@
. /etc/rc.conf
. /etc/rc.d/functions
-name=bitlbee
-PID=$(pidof -o %PPID /usr/sbin/bitlbee)
-install -o bitlbee -g bitlbee -d -m 755 /var/run/bitlbee
+pidfile=/run/bitlbee/bitlbee.pid
+if [[ -r $pidfile ]]; then
+ read -r PID < "$pidfile"
+ if [[ ! -d /proc/$PID ]]; then
+ # stale pidfile
+ unset PID
+ rm -f "$pidfile"
+ fi
+fi
-case "$1" in
-start)
- stat_busy "Starting $name daemon"
- [[ -z "$PID" ]] && {
- rm -f /var/run/bitlbee/bitlbee.pid
- su -s /bin/sh -c '/usr/sbin/bitlbee -F' bitlbee
- } && {
- add_daemon $name
- stat_done
- } || { stat_fail; exit 1; }
- ;;
-stop)
- stat_busy "Stopping $name daemon"
- [[ -n "$PID" ]] && {
- kill $PID &>/dev/null
- } && {
- rm -f /var/run/bitlbee/bitlbee.pid
- rm_daemon $name
- stat_done
- } || { stat_fail; exit 1; }
- ;;
-restart)
- $0 stop
- sleep 3
- $0 start
- ;;
-*)
- echo "usage: $0 {start|stop|restart}"
- exit 1
- ;;
+case $1 in
+ start)
+ stat_busy "Starting bitlbee daemon"
+ if [[ $PID ]] || ! su -s /bin/sh -c '/usr/sbin/bitlbee -F' bitlbee; then
+ stat_fail
+ exit 1
+ else
+ add_daemon bitlbee
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping bitlbee daemon"
+ if [[ -z $PID ]] || ! kill $PID &>/dev/null; then
+ stat_fail
+ exit 1
+ else
+ rm -f "$pidfile"
+ rm_daemon bitlbee
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 3
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+ exit 1
+ ;;
esac
+
+# vim: set ft=sh et ts=2 sw=2:
More information about the arch-commits
mailing list