avahi: use trigger to (un)register system user/groups, bumprev.

--HG--
extra : convert_revision : 8c510305c7159b48330a72db835ce76be43f13cd
This commit is contained in:
Juan RP 2009-12-11 12:05:56 +01:00
parent d8302b0053
commit f12fb67c20
3 changed files with 4 additions and 52 deletions

View file

@ -1,35 +0,0 @@
#
# This script creates the avahi and netdev system user/group.
#
case "${ACTION}" in
pre)
;;
post)
if ! getent group netdev >/dev/null; then
groupadd -r netdev 2>&1 >/dev/null
[ $? -ne 0 ] && exit $?
echo "Created netdev system group."
fi
if ! getent passwd netdev >/dev/null; then
useradd -c "Network device user" \
-d / -s /sbin/nologin -g netdev -r netdev && \
passwd -l netdev 2>&1 >/dev/null
[ $? -ne 0 ] && exit $?
echo "Created netdev system user."
fi
if ! getent group avahi >/dev/null; then
groupadd -r avahi 2>&1 >/dev/null
[ $? -ne 0 ] && exit $?
echo "Created avahi system group."
fi
if ! getent passwd avahi >/dev/null; then
useradd -c "Avahi daemon" \
-d / -s /sbin/nologin -g avahi -r avahi && \
passwd -l avahi 2>&1 >/dev/null
[ $? -ne 0 ] && exit $?
echo "Created avahi system user."
fi
;;
esac

View file

@ -1,15 +0,0 @@
#
# This script removes the avahi and netdev user/group.
#
case "${ACTION}" in
pre)
if [ "$UPDATE" = "no" ]; then
userdel avahi &>/dev/null
[ $? -eq 0 ] && echo "Removed avahi system user/group."
userdel netdev &>/dev/null
[ $? -eq 0 ] && echo "Removed netdev system user/group."
fi
;;
post)
;;
esac

View file

@ -1,7 +1,7 @@
# Template file for 'avahi'
pkgname=avahi
version=0.6.25
revision=1
revision=2
distfiles="http://www.avahi.org/download/avahi-$version.tar.gz"
build_style=gnu_configure
configure_args="--disable-qt3 --disable-qt4 --disable-mono --disable-monodoc
@ -20,6 +20,8 @@ long_desc="
a network and instantly find printers to print to, files to look at and
people to talk to."
# Create avahi and netdev system accounts.
system_accounts="avahi netdev"
openrc_services="avahi-daemon default avahi-dnsconfd default"
conf_files="/etc/avahi/avahi-daemon.conf /etc/avahi/hosts.conf"
@ -29,7 +31,7 @@ subpackages="$subpackages $pkgname-libs-devel $pkgname-glib-libs"
subpackages="$subpackages $pkgname-glib-libs-devel $pkgname-ui-libs"
subpackages="$subpackages $pkgname-ui-libs-devel $pkgname-utils"
subpackages="$subpackages $pkgname-ui-utils $pkgname-python-utils"
subpackages="$subpackages $pkgname-python"
subpackages="$subpackages $pkgname-python"
Add_dependency run glibc
Add_dependency run dbus