]> git.pld-linux.org Git - packages/cvsd.git/blobdiff - cvsd.spec
- rel 0.3
[packages/cvsd.git] / cvsd.spec
index 0a99c7ba8d09f29b21c12a419ec1dd1ee067f358..5aa7981c1210329f4b6aadbba641a4c8ca0f7c13 100644 (file)
--- a/cvsd.spec
+++ b/cvsd.spec
@@ -1,24 +1,26 @@
 # TODO:
 # - cvsadmin uid,gid
 # - check permissions
-# - missing files
-# - rc-inetd file(?) / init script(?)
 Summary:       cvsd, a chroot/suid wrapper for running a cvs pserver
 Summary(pl):   cvsd - nak³adka na cvs pserver korzystaj±ca z chroot/suid
 Name:          cvsd
-Version:       0.9.19
-Release:       0.1
+Version:       1.0.7
+Release:       0.3
 License:       GPL
 Group:         Development/Version Control
-Source0:       http://tiefighter.et.tudelft.nl/~arthur/cvsd/%{name}-%{version}.tar.gz
-# Source0-md5: 2757c59517e59771bd9d249aea760b41
+Source0:       http://tiefighter.et.tudelft.nl/~arthur/%{name}/%{name}-%{version}.tar.gz
+# Source0-md5: 3403fe3025d6578dffa2abf8a640d846
+Source1:       %{name}.init
 #Source1:      %{name}.conf
 #Source2:      %{name}-passwd
 URL:           http://tiefighter.et.tudelft.nl/~arthur/cvsd/
+BuildRequires: rpmbuild(macros) >= 1.159
+PreReq:         rc-scripts
+Requires(post,preun):   /sbin/chkconfig
 Requires(pre): /usr/bin/getgid
 Requires(pre): /bin/id
 Requires(pre): /usr/sbin/groupadd
-Requires(pre): /usr/sbin/useradd
+Requires(pre): /usr/sbin/groupmod
 Requires(pre): cvs
 Requires(pre): /usr/bin/ldd
 Requires(pre): fileutils
@@ -26,13 +28,14 @@ Requires(pre):      textutils
 Requires(postun):      /usr/sbin/userdel
 Requires(postun):      /usr/sbin/groupdel
 Requires:      cvs
+Obsoletes:      cvs-pserver
+Obsoletes:      cvs-nserver-pserver
+Provides:      group(cvsadmin)
+Provides:      user(cvsowner)
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-%define                homedir         /home/cvsowner
+%define                homedir         /var/lib/cvsowner
 %define                rootdir         %{homedir}/cvsd-root
-# TODO: change
-%define                cgid            2401
-%define                cuid            2401
 
 %description
 cvsd is a chroot/suid wrapper for running a cvs pserver more securely.
@@ -53,11 +56,13 @@ wersji zasob
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT%{rootdir}/{etc,bin,lib,tmp,dev,cvsroot}
+install -d $RPM_BUILD_ROOT%{rootdir}/{etc,bin,lib,tmp,dev,cvsroot} \
+          $RPM_BUILD_ROOT/etc/rc.d/init.d
 
 %{__make} install \
        DESTDIR=$RPM_BUILD_ROOT
 
+install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
 #install %{SOURCE2} $RPM_BUILD_ROOT%{rootdir}/etc/passwd
 
 %clean
@@ -65,20 +70,20 @@ rm -rf $RPM_BUILD_ROOT
 
 %pre
 if [ -n "`/usr/bin/getgid cvsadmin`" ]; then
-       if [ "`/usr/bin/getgid cvsadmin`" != "%{cgid}" ]; then
-               echo "Error: group cvsadmin doesn't have gid=%{cgid}. Correct this before installing cvsd." 1>&2
+       if [ "`/usr/bin/getgid cvsadmin`" != "53" ]; then # 2401
+               echo "Error: group cvsadmin doesn't have gid=53. Correct this before installing cvsd." 1>&2
                exit 1
        fi
 else
-       /usr/sbin/groupadd -g %{cgid} cvsadmin
+       /usr/sbin/groupadd -g 53 cvsadmin
 fi
 if [ -n "`/bin/id -u cvsowner 2>/dev/null`" ]; then
-       if [ "`/bin/id -u cvsowner`" != "%{cuid}" ]; then
-               echo "Error: user cvsowner doesn't have uid=%{cuid}. Correct this before installing cvsd." 1>&2
+       if [ "`/bin/id -u cvsowner`" != "128" ]; then
+               echo "Error: user cvsowner doesn't have uid=128. Correct this before installing cvsd." 1>&2
                exit 1
        fi
 else
-       /usr/sbin/useradd -u %{cuid} -g %{cgid} -c "CVS UID" -d %{homedir} cvsowner
+       /usr/sbin/useradd -u 128 -g 53 -c "CVS UID" -d %{homedir} cvsowner
 fi
 if [ ! -f %{rootdir}/bin/cvs ] ; then
        echo "Setting up %{rootdir}..."
@@ -87,21 +92,32 @@ if [ ! -f %{rootdir}/bin/cvs ] ; then
                %{rootdir}/lib
        install -m755 /usr/bin/cvs %{rootdir}/bin
 fi
-# 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: "
+
+%post
+/sbin/chkconfig --add cvsd
+if [ -f /var/lock/subsys/cvsd ]; then
+        /etc/rc.d/init.d/cvsd restart 1>&2
+else
+        echo "Type \"/etc/rc.d/init.d/cvsd start\" to start cvsd." 1>&2
+fi
+
+echo "Now check out /etc/cvsd.conf and 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!"
 
+%preun
+if [ "$1" = "0" ]; then
+        if [ -f /var/lock/subsys/cvsd ]; then
+                /etc/rc.d/init.d/cvsd stop 1>&2
+        fi
+        /sbin/chkconfig --del cvsd
+fi
+
 %postun
 if [ "$1" = "0" ]; then
-       /usr/sbin/userdel cvsowner
-       /usr/sbin/groupdel cvsadmin
+       %userremove cvsowner
+       %groupremove cvsadmin
 fi
 
 %files
@@ -112,7 +128,7 @@ fi
 %attr(755,root,root) %{_sbindir}/cvsd-passwd
 %dir %{_sysconfdir}/cvsd
 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/cvsd/cvsd.conf
-#%attr(754,root,root) /etc/rc.d/init.d/cvsd
+%attr(754,root,root) /etc/rc.d/init.d/cvsd
 %{_mandir}/man[58]/*
 %dir %{homedir}
 %dir %{rootdir}
This page took 0.0643 seconds and 4 git commands to generate.