From: ankry Date: Wed, 13 Oct 2004 23:21:19 +0000 (+0000) Subject: - %%userremove/%%groupremove support, standardized X-Git-Tag: auto/ac/ntop-3_2-1~27 X-Git-Url: http://git.pld-linux.org/?p=packages%2Fntop.git;a=commitdiff_plain;h=1b68ade4a1ae926934e0d9355f92934125d621cc - %%userremove/%%groupremove support, standardized Changed files: ntop.spec -> 1.58 --- diff --git a/ntop.spec b/ntop.spec index 4d2db2a..7024d96 100644 --- a/ntop.spec +++ b/ntop.spec @@ -24,16 +24,19 @@ BuildRequires: libtool BuildRequires: ncurses-devel >= 5.2 BuildRequires: openssl-devel >= 0.9.7d BuildRequires: readline-devel >= 4.2 +BuildRequires: rpmbuild(macros) >= 1.159 BuildRequires: zlib-devel PreReq: rc-scripts -Requires(pre): /usr/bin/getgid Requires(pre): /bin/id +Requires(pre): /usr/bin/getgid Requires(pre): /usr/sbin/groupadd Requires(pre): /usr/sbin/useradd Requires(post,preun): /sbin/chkconfig Requires(post,postun): /sbin/ldconfig Requires(postun): /usr/sbin/groupdel Requires(postun): /usr/sbin/userdel +Provides: group(ntop) +Provides: user(ntop) BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %description @@ -95,21 +98,22 @@ rm $RPM_BUILD_ROOT%{_libdir}/*.a rm -rf $RPM_BUILD_ROOT %pre -if [ -n "`getgid ntop`" ]; then - if [ "`getgid ntop`" != "120" ]; then +if [ -n "`/usr/bin/getgid ntop`" ]; then + if [ "`/usr/bin/getgid ntop`" != "120" ]; then echo "Error: group ntop doesn't have gid=120. Correct this before installing ntop." 1>&2 exit 1 fi else - /usr/sbin/groupadd -g 120 -r -f ntop + /usr/sbin/groupadd -g 120 ntop fi -if [ -n "`id -u ntop 2>/dev/null`" ]; then - if [ "`id -u ntop`" != "120" ]; then +if [ -n "`/bin/id -u ntop 2>/dev/null`" ]; then + if [ "`/bin/id -u ntop`" != "120" ]; then echo "Error: user ntop doesn't have uid=120. Correct this before installing ntop." 1>&2 exit 1 fi else - /usr/sbin/useradd -u 120 -r -d /var/lib/ntop -s /bin/false -c "ntop User" -g ntop ntop 1>&2 + /usr/sbin/useradd -u 120 -d /var/lib/ntop -s /bin/false \ + -c "ntop User" -g ntop ntop 1>&2 fi %post @@ -132,8 +136,8 @@ fi %postun /sbin/ldconfig if [ "$1" = "0" ]; then - /usr/sbin/userdel ntop - /usr/sbin/groupdel ntop + %userremove ntop + %groupremove ntop fi %files