-# TODO: rc-inetd file
-#if ! grep -q cvspserver /etc/inetd.conf ; then
-# echo "no existing cvspserver line in /etc/inetd.conf, adding..."
-# echo -e "cvspserver\tstream\ttcp\tnowait\troot\t/usr/sbin/cvsd\tcvsd" >> /etc/inetd.conf
-#fi
-echo "Now check out /etc/cvsd.conf, restart inetd (killall -HUP inetd), and "
-echo "initialise the repository using: "
-echo "\"cvs -d :pserver:cvsadmin@localhost:/cvsroot init\" "
-echo "Also edit/modify/whatever the /home/cvsowner/cvsd-root/etc/passwd file."
-echo "Default user/passwds are cvs/cvs (for ro anon), user/pass. Change these!"
+
+%post
+/sbin/chkconfig --add cvsd
+%service cvsd restart "cvsd"
+
+if [ "$1" = 1 ]; then
+%banner -e %{name} <<EOF
+Now check out %{_sysconfdir}/cvsd.conf and initialise the repository using:
+cvs -d :pserver:cvsadmin@localhost:/cvsroot init
+
+Also edit/modify/whatever the /home/cvsowner/cvsd-root%{_sysconfdir}/passwd file.
+Default user/passwds are cvs/cvs (for ro anon), user/pass. Change these!
+EOF
+fi
+
+%preun
+if [ "$1" = "0" ]; then
+ %service cvsd stop
+ /sbin/chkconfig --del cvsd
+fi