5 # - rc-inetd file / init script - subpackages
6 Summary: cvsd, a chroot/suid wrapper for running a cvs pserver
7 Summary(pl): cvsd - nak³adka na cvs pserver korzystaj±ca z chroot/suid
12 Group: Development/Version Control
13 Source0: http://tiefighter.et.tudelft.nl/~arthur/cvsd/%{name}-%{version}.tar.gz
14 # Source0-md5: 3403fe3025d6578dffa2abf8a640d846
16 #Source1: %{name}.conf
17 #Source2: %{name}-passwd
18 URL: http://tiefighter.et.tudelft.nl/~arthur/cvsd/
19 BuildRequires: rpmbuild(macros) >= 1.159
21 Requires(post,preun): /sbin/chkconfig
22 Requires(pre): /usr/bin/getgid
23 Requires(pre): /bin/id
24 Requires(pre): /usr/sbin/groupadd
25 Requires(pre): /usr/sbin/groupmod
27 Requires(pre): /usr/bin/ldd
28 Requires(pre): fileutils
29 Requires(pre): textutils
30 Requires(postun): /usr/sbin/userdel
31 Requires(postun): /usr/sbin/groupdel
33 Provides: group(cvsadmin)
34 Provides: user(cvsowner)
35 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
37 %define homedir /home/cvsowner
38 %define rootdir %{homedir}/cvsd-root
41 cvsd is a chroot/suid wrapper for running a cvs pserver more securely.
42 cvs is a version control system for managing projects.
45 cvsd jest nak³adk± s³u¿±c± do bezpieczniejszego uruchamiania programu
46 cvs pserver, korzystaj±c± z chroot/suid. cvs jest systemem kontroli
47 wersji zasobów s³u¿±cym do zarz±dzania projektami.
58 rm -rf $RPM_BUILD_ROOT
59 install -d $RPM_BUILD_ROOT%{rootdir}/{etc,bin,lib,tmp,dev,cvsroot}
62 DESTDIR=$RPM_BUILD_ROOT
64 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
65 #install %{SOURCE2} $RPM_BUILD_ROOT%{rootdir}/etc/passwd
68 rm -rf $RPM_BUILD_ROOT
71 if [ -n "`/usr/bin/getgid cvsadmin`" ]; then
72 if [ "`/usr/bin/getgid cvsadmin`" != "53" ]; then # 2401
73 echo "Error: group cvsadmin doesn't have gid=53. Correct this before installing cvsd." 1>&2
77 /usr/sbin/groupadd -g 53 cvsadmin
79 if [ -n "`/bin/id -u cvsowner 2>/dev/null`" ]; then
80 if [ "`/bin/id -u cvsowner`" != "128" ]; then
81 echo "Error: user cvsowner doesn't have uid=128. Correct this before installing cvsd." 1>&2
85 /usr/sbin/useradd -u 128 -g 53 -c "CVS UID" -d %{homedir} cvsowner
87 if [ ! -f %{rootdir}/bin/cvs ] ; then
88 echo "Setting up %{rootdir}..."
90 install -m755 -o root -g root `ldd /usr/bin/cvs | cut -d " " -f 1` /lib/libnss_files.so.1 \
92 install -m755 /usr/bin/cvs %{rootdir}/bin
96 /sbin/chkconfig --add cvsd
97 if [ -f /var/lock/subsys/cvsd ]; then
98 /etc/rc.d/init.d/cvsd restart 1>&2
100 echo "Type \"/etc/rc.d/init.d/cvsd start\" to start cvsd." 1>&2
103 # TODO: rc-inetd file
104 #if ! grep -q cvspserver /etc/inetd.conf ; then
105 # echo "no existing cvspserver line in /etc/inetd.conf, adding..."
106 # echo -e "cvspserver\tstream\ttcp\tnowait\troot\t/usr/sbin/cvsd\tcvsd" >> /etc/inetd.conf
108 echo "Now check out /etc/cvsd.conf, restart inetd (killall -HUP inetd), and "
109 echo "initialise the repository using: "
110 echo "\"cvs -d :pserver:cvsadmin@localhost:/cvsroot init\" "
111 echo "Also edit/modify/whatever the /home/cvsowner/cvsd-root/etc/passwd file."
112 echo "Default user/passwds are cvs/cvs (for ro anon), user/pass. Change these!"
115 if [ "$1" = "0" ]; then
116 if [ -f /var/lock/subsys/cvsd ]; then
117 /etc/rc.d/init.d/cvsd stop 1>&2
119 /sbin/chkconfig --del cvsd
123 if [ "$1" = "0" ]; then
125 %groupremove cvsadmin
129 %defattr(644,root,root,755)
130 %doc AUTHORS ChangeLog FAQ NEWS README TODO
131 %attr(755,root,root) %{_sbindir}/cvsd
132 %attr(755,root,root) %{_sbindir}/cvsd-buildroot
133 %attr(755,root,root) %{_sbindir}/cvsd-passwd
134 %dir %{_sysconfdir}/cvsd
135 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/cvsd/cvsd.conf
136 %attr(754,root,root) /etc/rc.d/init.d/cvsd
141 %attr(755,cvsowner,cvsadmin) %dir %{rootdir}/cvsroot
143 %dev(c,1,3) %{rootdir}/dev/null
146 #%config(noreplace) %verify(not size mtime md5) %{rootdir}/etc/passwd