]> git.pld-linux.org Git - packages/cvsd.git/blob - cvsd.spec
- rel 0.2
[packages/cvsd.git] / cvsd.spec
1 # TODO:
2 # - cvsadmin uid,gid
3 # - check permissions
4 # - missing files
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
8 Name:           cvsd
9 Version:        1.0.7
10 Release:        0.2
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}.init
16 #Source1:       %{name}.conf
17 #Source2:       %{name}-passwd
18 URL:            http://tiefighter.et.tudelft.nl/~arthur/cvsd/
19 BuildRequires:  rpmbuild(macros) >= 1.159
20 PreReq:         rc-scripts
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
26 Requires(pre):  cvs
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
32 Requires:       cvs
33 Provides:       group(cvsadmin)
34 Provides:       user(cvsowner)
35 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
36
37 %define         homedir         /home/cvsowner
38 %define         rootdir         %{homedir}/cvsd-root
39
40 %description
41 cvsd is a chroot/suid wrapper for running a cvs pserver more securely.
42 cvs is a version control system for managing projects.
43
44 %description -l pl
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.
48
49 %prep
50 %setup -q
51
52 %build
53 %configure
54
55 %{__make}
56
57 %install
58 rm -rf $RPM_BUILD_ROOT
59 install -d $RPM_BUILD_ROOT%{rootdir}/{etc,bin,lib,tmp,dev,cvsroot}
60
61 %{__make} install \
62         DESTDIR=$RPM_BUILD_ROOT
63
64 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
65 #install %{SOURCE2} $RPM_BUILD_ROOT%{rootdir}/etc/passwd
66
67 %clean
68 rm -rf $RPM_BUILD_ROOT
69
70 %pre
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
74                 exit 1
75         fi
76 else
77         /usr/sbin/groupadd -g 53 cvsadmin
78 fi
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
82                 exit 1
83         fi
84 else
85         /usr/sbin/useradd -u 128 -g 53 -c "CVS UID" -d %{homedir} cvsowner
86 fi
87 if [ ! -f %{rootdir}/bin/cvs ] ; then
88         echo "Setting up %{rootdir}..."
89         cd /lib
90         install -m755 -o root -g root `ldd /usr/bin/cvs | cut -d " " -f 1` /lib/libnss_files.so.1 \
91                 %{rootdir}/lib
92         install -m755 /usr/bin/cvs %{rootdir}/bin
93 fi
94
95 %post
96 /sbin/chkconfig --add cvsd
97 if [ -f /var/lock/subsys/cvsd ]; then
98         /etc/rc.d/init.d/cvsd restart 1>&2
99 else
100         echo "Type \"/etc/rc.d/init.d/cvsd start\" to start cvsd." 1>&2
101 fi
102
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
107 #fi
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!"
113
114 %preun
115 if [ "$1" = "0" ]; then
116         if [ -f /var/lock/subsys/cvsd ]; then
117                 /etc/rc.d/init.d/cvsd stop 1>&2
118         fi
119         /sbin/chkconfig --del cvsd
120 fi
121
122 %postun
123 if [ "$1" = "0" ]; then
124         %userremove cvsowner
125         %groupremove cvsadmin
126 fi
127
128 %files
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
137 %{_mandir}/man[58]/*
138 %dir %{homedir}
139 %dir %{rootdir}
140 %dir %{rootdir}/bin
141 %attr(755,cvsowner,cvsadmin) %dir %{rootdir}/cvsroot
142 %dir %{rootdir}/dev
143 %dev(c,1,3) %{rootdir}/dev/null
144 %dir %{rootdir}/lib
145 %dir %{rootdir}/tmp
146 #%config(noreplace) %verify(not size mtime md5) %{rootdir}/etc/passwd
This page took 0.06844 seconds and 3 git commands to generate.