fi
%pre -n xfs
-if [ -n "`/usr/bin/getgid xfs`" ]; then
- if [ "`/usr/bin/getgid xfs`" != "56" ]; then
- echo "Warning: group xfs hasn't gid=56. Correct this before installing xfs." 1>&2
- exit 1
- fi
-else
- /usr/sbin/groupadd -g 56 -r -f xfs
-fi
-if [ -n "`/bin/id -u xfs 2>/dev/null`" ]; then
- if [ "`/bin/id -u xfs`" != "56" ]; then
- echo "Warning: user xfs hasn't uid=56. Corrent this before installing xfs." 1>&2
- exit 1
- fi
-else
- /usr/sbin/useradd -u 56 -r -d /etc/X11/fs -s /bin/false -c "X Font Server" -g xfs xfs 1>&2
-fi
+GROUP=xfs; GID=56; NAME=xfs; %groupadd
+USER=xfs; UID=56; HOMEDIR=/etc/X11/fs; COMMENT="X Font Server"; %useradd
%post -n xfs
-/sbin/chkconfig --add xfs
-if [ -f /var/lock/subsys/xfs ]; then
- /etc/rc.d/init.d/xfs restart >&2
-else
- echo "Run \"/etc/rc.d/init.d/xfs start\" to start font server." >&2
-fi
+NAME=xfs; DESC="font server"; %chkconfig_post
%preun -n xfs
-if [ "$1" = "0" ]; then
- if [ -f /var/lock/subsys/xfs ]; then
- /etc/rc.d/init.d/xfs stop >&2
- fi
- /sbin/chkconfig --del xfs
-fi
+NAME=xfs; %chkconfig_preun
%postun -n xfs
-if [ $1 = 0 ]; then
- /usr/sbin/userdel xfs 2>/dev/null
- /usr/sbin/groupdel xfs 2>/dev/null
-fi
+USER=xfs; %userdel
+GROUP=xfs; %groupdel
%post -n xdm
-/sbin/chkconfig --add xdm
-if [ -f /var/lock/subsys/xdm ]; then
- /etc/rc.d/init.d/xdm restart >&2
-else
- echo "Run \"/etc/rc.d/init.d/xdm start\" to start xdm." >&2
-fi
+NAME=xdm; %chkconfig_post
%preun -n xdm
-if [ "$1" = "0" ]; then
- if [ -f /var/lock/subsys/xdm ]; then
- /etc/rc.d/init.d/xdm stop >&2
- fi
- /sbin/chkconfig --del xdm
-fi
+NAME=xdm; %chkconfig_preun
%post DPS -p /sbin/ldconfig
%postun DPS -p /sbin/ldconfig