5 # - rc-inetd file(?) / init script(?)
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
15 #Source1: %{name}.conf
16 #Source2: %{name}-passwd
17 URL: http://tiefighter.et.tudelft.nl/~arthur/cvsd/
18 BuildRequires: rpmbuild(macros) >= 1.159
19 Requires(pre): /usr/bin/getgid
20 Requires(pre): /bin/id
21 Requires(pre): /usr/sbin/groupadd
22 Requires(pre): /usr/sbin/groupmod
24 Requires(pre): /usr/bin/ldd
25 Requires(pre): fileutils
26 Requires(pre): textutils
27 Requires(postun): /usr/sbin/userdel
28 Requires(postun): /usr/sbin/groupdel
30 Provides: group(cvsadmin)
31 Provides: user(cvsowner)
32 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34 %define homedir /home/cvsowner
35 %define rootdir %{homedir}/cvsd-root
38 cvsd is a chroot/suid wrapper for running a cvs pserver more securely.
39 cvs is a version control system for managing projects.
42 cvsd jest nak³adk± s³u¿±c± do bezpieczniejszego uruchamiania programu
43 cvs pserver, korzystaj±c± z chroot/suid. cvs jest systemem kontroli
44 wersji zasobów s³u¿±cym do zarz±dzania projektami.
55 rm -rf $RPM_BUILD_ROOT
56 install -d $RPM_BUILD_ROOT%{rootdir}/{etc,bin,lib,tmp,dev,cvsroot}
59 DESTDIR=$RPM_BUILD_ROOT
61 #install %{SOURCE2} $RPM_BUILD_ROOT%{rootdir}/etc/passwd
64 rm -rf $RPM_BUILD_ROOT
67 if [ -n "`/usr/bin/getgid cvsadmin`" ]; then
68 if [ "`/usr/bin/getgid cvsadmin`" != "53" ]; then # 2401
69 echo "Error: group cvsadmin doesn't have gid=53. Correct this before installing cvsd." 1>&2
73 /usr/sbin/groupadd -g 53 cvsadmin
75 if [ -n "`/bin/id -u cvsowner 2>/dev/null`" ]; then
76 if [ "`/bin/id -u cvsowner`" != "128" ]; then
77 echo "Error: user cvsowner doesn't have uid=128. Correct this before installing cvsd." 1>&2
81 /usr/sbin/useradd -u 128 -g 53 -c "CVS UID" -d %{homedir} cvsowner
83 if [ ! -f %{rootdir}/bin/cvs ] ; then
84 echo "Setting up %{rootdir}..."
86 install -m755 -o root -g root `ldd /usr/bin/cvs | cut -d " " -f 1` /lib/libnss_files.so.1 \
88 install -m755 /usr/bin/cvs %{rootdir}/bin
91 #if ! grep -q cvspserver /etc/inetd.conf ; then
92 # echo "no existing cvspserver line in /etc/inetd.conf, adding..."
93 # echo -e "cvspserver\tstream\ttcp\tnowait\troot\t/usr/sbin/cvsd\tcvsd" >> /etc/inetd.conf
95 echo "Now check out /etc/cvsd.conf, restart inetd (killall -HUP inetd), and "
96 echo "initialise the repository using: "
97 echo "\"cvs -d :pserver:cvsadmin@localhost:/cvsroot init\" "
98 echo "Also edit/modify/whatever the /home/cvsowner/cvsd-root/etc/passwd file."
99 echo "Default user/passwds are cvs/cvs (for ro anon), user/pass. Change these!"
102 if [ "$1" = "0" ]; then
104 %groupremove cvsadmin
108 %defattr(644,root,root,755)
109 %doc AUTHORS ChangeLog FAQ NEWS README TODO
110 %attr(755,root,root) %{_sbindir}/cvsd
111 %attr(755,root,root) %{_sbindir}/cvsd-buildroot
112 %attr(755,root,root) %{_sbindir}/cvsd-passwd
113 %dir %{_sysconfdir}/cvsd
114 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/cvsd/cvsd.conf
115 #%attr(754,root,root) /etc/rc.d/init.d/cvsd
120 %attr(755,cvsowner,cvsadmin) %dir %{rootdir}/cvsroot
122 %dev(c,1,3) %{rootdir}/dev/null
125 #%config(noreplace) %verify(not size mtime md5) %{rootdir}/etc/passwd