]> git.pld-linux.org Git - packages/cvsd.git/blob - cvsd.spec
fbee72f3fcb8e0c64d8ebaa5abeb60987081bf16
[packages/cvsd.git] / cvsd.spec
1 # TODO:
2 # - cvsadmin uid,gid
3 # - check permissions
4 # - missing files
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
8 Name:           cvsd
9 Version:        1.0.7
10 Release:        0.1
11 License:        GPL
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
23 Requires(pre):  cvs
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
29 Requires:       cvs
30 Provides:       group(cvsadmin)
31 Provides:       user(cvsowner)
32 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33
34 %define         homedir         /home/cvsowner
35 %define         rootdir         %{homedir}/cvsd-root
36
37 %description
38 cvsd is a chroot/suid wrapper for running a cvs pserver more securely.
39 cvs is a version control system for managing projects.
40
41 %description -l pl
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.
45
46 %prep
47 %setup -q
48
49 %build
50 %configure
51
52 %{__make}
53
54 %install
55 rm -rf $RPM_BUILD_ROOT
56 install -d $RPM_BUILD_ROOT%{rootdir}/{etc,bin,lib,tmp,dev,cvsroot}
57
58 %{__make} install \
59         DESTDIR=$RPM_BUILD_ROOT
60
61 #install %{SOURCE2} $RPM_BUILD_ROOT%{rootdir}/etc/passwd
62
63 %clean
64 rm -rf $RPM_BUILD_ROOT
65
66 %pre
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
70                 exit 1
71         fi
72 else
73         /usr/sbin/groupadd -g 53 cvsadmin
74 fi
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
78                 exit 1
79         fi
80 else
81         /usr/sbin/useradd -u 128 -g 53 -c "CVS UID" -d %{homedir} cvsowner
82 fi
83 if [ ! -f %{rootdir}/bin/cvs ] ; then
84         echo "Setting up %{rootdir}..."
85         cd /lib
86         install -m755 -o root -g root `ldd /usr/bin/cvs | cut -d " " -f 1` /lib/libnss_files.so.1 \
87                 %{rootdir}/lib
88         install -m755 /usr/bin/cvs %{rootdir}/bin
89 fi
90 # TODO: rc-inetd file
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
94 #fi
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!"
100
101 %postun
102 if [ "$1" = "0" ]; then
103         %userremove cvsowner
104         %groupremove cvsadmin
105 fi
106
107 %files
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
116 %{_mandir}/man[58]/*
117 %dir %{homedir}
118 %dir %{rootdir}
119 %dir %{rootdir}/bin
120 %attr(755,cvsowner,cvsadmin) %dir %{rootdir}/cvsroot
121 %dir %{rootdir}/dev
122 %dev(c,1,3) %{rootdir}/dev/null
123 %dir %{rootdir}/lib
124 %dir %{rootdir}/tmp
125 #%config(noreplace) %verify(not size mtime md5) %{rootdir}/etc/passwd
This page took 0.619714 seconds and 2 git commands to generate.