From 88b41c461d634c95a8023b4a8e36e51b126faa2c Mon Sep 17 00:00:00 2001 From: saq Date: Wed, 25 Jul 2001 16:30:40 +0000 Subject: [PATCH] - use macros in %{pre,post}{,un} - need rebuilt rpm (with new macros.pld) to build these Changed files: PowerChutePlus.spec -> 1.4 --- PowerChutePlus.spec | 29 +++++++---------------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/PowerChutePlus.spec b/PowerChutePlus.spec index 5b7305c..062b8f3 100644 --- a/PowerChutePlus.spec +++ b/PowerChutePlus.spec @@ -81,38 +81,23 @@ ln -s /var/run/bkupsd.pid $RPM_BUILD_ROOT%{_libdir}/powerchute/ gzip -9nf language.txt readme_apache %pre -if ! id -g pwrchute > /dev/null 2>&1 ; then - %{_sbindir}/groupadd -g 68 pwrchute -fi -if ! id -u pwrchute > /dev/null 2>&1 ; then - %{_sbindir}/useradd -u 68 -g 68 -d /dev/null -s /bin/false -c "PowerChute Plus" pwrchute -fi +GROUP=pwrchute; GID=68; %groupadd +USER=pwrchute; UID=68; HOMEDIR=/dev/null; COMMENT="PowerChute Plus" +%useradd %post -/sbin/chkconfig --add upsd -if [ -f /var/lock/subsys/upsd ]; then - /etc/rc.d/init.d/upsd restart 1>&2 -else - echo "Type \"/etc/rc.d/init.d/upsd start\" to start UPSd server" 1>&2 -fi +NAME=upsd; DESC="UPSd server"; %chkconfig_post cd %{_libdir}/powerchute ./machine_id echo "You should run %{_libdir}/powerchute/Config.sh to configure PowerChute plus" echo "Remember to set the password for pwrchute account" %preun -if [ "$1" = "0" ]; then - if [ -f /var/lock/subsys/upsd ]; then - /etc/rc.d/init.d/upsd stop 1>&2 - fi - /sbin/chkconfig --del upsd -fi +NAME=upsd; %chkconfig_preun %postun -if [ "$1" = "0" ]; then - %{_sbindir}/userdel pwrchute - %{_sbindir}/groupdel pwrchute -fi +USER=pwrchute; %userdel +GROUP=pwrchute; %groupdel %clean rm -rf $RPM_BUILD_ROOT -- 2.43.0