]> git.pld-linux.org Git - packages/arpd.git/commitdiff
- use macros in %{pre,post}{,un}
authorsaq <saq@pld-linux.org>
Wed, 25 Jul 2001 16:30:41 +0000 (16:30 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
- need rebuilt rpm (with new macros.pld) to build these

Changed files:
    arpd.spec -> 1.10

arpd.spec

index 71b3e8aeb6252db72721f73c969cede10149ddd2..de3d3fb7c3631d75c00e52c4eb9bff5e20839733 100644 (file)
--- a/arpd.spec
+++ b/arpd.spec
@@ -60,18 +60,10 @@ install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/arpd
 gzip -9nf CHANGES
 
 %pre
-if [ -n "`id -u arpd 2>/dev/null`" ]; then
-       if [ "`id -u arpd`" != "40" ]; then
-               echo "Warning: user arpd haven't uid=40. Correct this before installing arpd." 1>&2
-               exit 1
-       fi
-else
-       echo "Adding arpd user (UID=40)"
-       /usr/sbin/useradd -u 40 -r -d /var/lib/arpd -s /bin/false -c "arpd user" -g daemon arpd 1>&2
-fi
+USER=arpd; UID=40; HOMEDIR=/var/lib/arpd; COMMENT="arpd user"
+GROUP=daemon; %useradd
 
 %post
-/sbin/chkconfig --add arpd
 if [ ! -L /dev/arpd ]; then
        echo "Moving /dev/arpd to /var/lib/arpd/arpd and making symlink"
        mv -f /dev/arpd /var/lib/arpd
@@ -79,20 +71,11 @@ if [ ! -L /dev/arpd ]; then
        ln -s /var/lib/arpd/arpd dev/arpd
 fi
 echo "You need arpd kernel support. The standard kernels of PLD lack this support!!"
-if [ -f /var/lock/subsys/arpd ]; then
-       /etc/rc.d/init.d/arpd restart 1>&2
-else
-       echo "Run \"/etc/rc.d/init.d/arpd start\" to start arpd daemon."
-fi
-
+DESC="arpd daemon"; %chkconfig_post
 
 %preun
-/sbin/chkconfig --del arpd
+%chkconfig_preun
 if [ "$1" = "0" ]; then
-       if [ -f /var/lock/subsys/arpd ]; then
-               /etc/rc.d/init.d/arpd stop 1>&2
-       fi
-       /sbin/chkconfig --del arpd
        echo "Moving /var/lib/arpd/arpd to /dev/arpd and removing symlink"
        rm -f /dev/arpd
        mv -f /var/lib/arpd/arpd /dev/arpd
@@ -100,10 +83,7 @@ if [ "$1" = "0" ]; then
 fi
 
 %postun
-if [ "$1" = "0" ]; then
-       echo "Removing arpd user (UID=40)"
-       /usr/sbin/userdel arpd
-fi
+USER=arpd; %userdel
 
 %clean
 rm -rf $RPM_BUILD_ROOT
This page took 0.130792 seconds and 4 git commands to generate.