+#
+# TODO:
+# - trigger for upgrade from old cvs - after that package stays without any
+# users and nserver-common is not installed...
Summary: Concurrent Versions System - nserver
Summary(de): Concurrent-Versioning-System - nserver
Summary(fr): Un système pour maintenir à jour des fichiers - nserver
Summary(pl): Concurrent Versions System - nserver
Summary(tr): Sürüm denetim sistemi - nserver
Name: cvs-nserver
-Version: 1.11.1.4
-Release: 1
+Version: 1.11.1.52
+Release: 8
License: GPL
Group: Development/Version Control
-Source0: http://unc.dl.sourceforge.net/sourceforge/cvs-nserver/%{name}-%{version}.tar.gz
+Source0: http://dl.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
+# Source0-md5: 357fb5f37cc556977dad79175e9c2d97
Source1: %{name}.inetd
Source2: cvs-pserver.inetd
Patch0: %{name}-cvspasswd.patch
Patch1: %{name}-info.patch
-# outdated, but maybe will be needed for checkpasswd (outside programs):
-Patch3: %{name}-PAM_fix.patch
-Patch4: %{name}-am_ac.patch
-Patch5: %{name}-zlib.patch
+Patch2: %{name}-am_ac.patch
+Patch3: %{name}-cvspass.patch
+Patch4: %{name}-home_etc.patch
+Patch5: %{name}-ssl-link.patch
+Patch6: %{name}-fix_doc_CVSUSER.patch
+Patch7: %{name}-segv.patch
+Patch8: %{name}-initgroups-rootonly.patch
+Patch9: %{name}-zlibfix.patch
+Patch10: %{name}-home_etc2.patch
+URL: http://cvs-nserver.sourceforge.net/
BuildRequires: autoconf
BuildRequires: automake
+BuildRequires: openssl-devel >= 0.9.7c
BuildRequires: texinfo
+BuildRequires: zlib-devel
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
-%define _cvsroot /home/cvsroot
+%define _cvsroot /srv/cvsroot
%description
CVS is a version control system, which allows you to keep old versions
eþzamanlý olarak yapýlmasýný kontrol etmek için gereken iþlevleri
saðlar.
-%package -n cvs-nclient
-Summary: Concurrent Versions System - common
-Summary(pl): Concurrent Versions System - wspólne
+%package client
+Summary: Concurrent Versions System - client
+Summary(pl): Concurrent Versions System - klient
Group: Development/Version Control
+Obsoletes: cvs-npclient
+Obsoletes: cvs
+Provides: cvs = %{version}
+
+%description client
+CVS client.
-%description -n cvs-nclient
-Client and some common files.
+%description client -l pl
+Klient CVS.
-%description -n cvs-nclient -l pl
-Klient CVS i trochê wspólnych plików.
+%package common
+Summary: Concurrent Versions System - common files
+Summary(pl): Concurrent Versions System - wspólne pliki
+Group: Development/Version Control
+Requires(pre): /bin/id
+Requires(pre): /usr/bin/getgid
+Requires(pre): /usr/sbin/groupadd
+Requires(pre): /usr/sbin/useradd
+Requires(pre): cvs-nserver-client
+Requires(pre): fileutils
+Requires(postun): /usr/sbin/userdel
+Requires(postun): /usr/sbin/groupdel
+Requires: cvs-nserver-client
+Obsoletes: cvs-nserver
-%package -n cvs-npserver
+%description common
+CVS - common server files.
+
+%description common -l pl
+Wspólne pliki serwerów CVS.
+
+%package pserver
Summary: Concurrent Versions System - pserver
Summary(pl): Concurrent Versions System - pserver
Group: Development/Version Control
+PreReq: rc-inetd
+Requires: cvs-nserver-common
+Obsoletes: cvs-npserver
+Obsoletes: cvs-pserver
+
+%description pserver
+CVS server - pserver files.
+
+%description pserver -l pl
+Serwer CVS - pliki pservera.
+
+%package nserver
+Summary: Concurrent Versions System - nserver
+Summary(pl): Concurrent Versions System - nserver
+Group: Development/Version Control
+PreReq: rc-inetd
Requires: cvs-nserver-common
-Obsoletes: cvs
Obsoletes: cvs-nserver
-%description -n cvs-npserver
-Server - pserver.
+%description nserver
+CVS server - nserver files.
-%description -n cvs-npserver -l pl
-Serwer - pserver.
+%description nserver -l pl
+Serwer CVS - pliki nservera.
%prep
%setup -q
%patch0 -p1
%patch1 -p1
+%patch2 -p1
+%patch3 -p1
%patch4 -p1
%patch5 -p1
+%patch6 -p1
+%patch7 -p1
+%patch8 -p1
+%patch9 -p1
+%patch10 -p1
%build
-aclocal
-autoconf
-automake -a -c
+%{__aclocal}
+%{__autoconf}
+%{__automake}
%configure \
--enable-encryption \
--enable-client \
--enable-server \
--enable-setuid \
+ --with-openssl \
--without-gssapi
%{__make}
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT/{etc/sysconfig/rc-inetd,%{_cvsroot}}
+install -d $RPM_BUILD_ROOT{/etc/sysconfig/rc-inetd,%{_cvsroot},/var/lock/cvs}
-%{__make} DESTDIR=$RPM_BUILD_ROOT install
+%{__make} install \
+ DESTDIR=$RPM_BUILD_ROOT
install %{SOURCE1} $RPM_BUILD_ROOT/etc/sysconfig/rc-inetd/cvs-nserver
install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/rc-inetd/cvs-pserver
cat << EOF >$RPM_BUILD_ROOT%{_bindir}/cvs-pserver-script
#!/bin/sh
+REPOSITORY="%{_cvsroot}"
+if [ -f /etc/sysconfig/cvsroot ]; then
+ . /etc/sysconfig/cvs
+fi
+
CVSPASSWD=%{_bindir}/cvspasswd \
-exec %{_bindir}/cvs-pserver %{_cvsroot} -- \
+exec %{_bindir}/cvs-pserver $REPOSITORY -- \
%{_bindir}/cvschkpw %{_bindir}/cvs pserver
EOF
cat << EOF >$RPM_BUILD_ROOT%{_bindir}/cvs-nserver-script
#!/bin/sh
+REPOSITORY="%{_cvsroot}"
+if [ -f /etc/sysconfig/cvsroot ]; then
+ . /etc/sysconfig/cvs
+fi
+
CVSPASSWD=%{_bindir}/cvspasswd \
-exec %{_bindir}/cvs-nserver %{_cvsroot} -- \
+exec %{_bindir}/cvs-nserver $REPOSITORY -- \
%{_bindir}/cvschkpw %{_bindir}/cvs nserver
EOF
+cat << EOF >$RPM_BUILD_ROOT/etc/sysconfig/cvs
+# In this file you can specify additional repositories (separated with space)
+# or just set different location.
+#REPOSITORY="%{_cvsroot}"
+EOF
+
mv -f $RPM_BUILD_ROOT%{_datadir}/cvs-nserver/contrib/rcs2log \
$RPM_BUILD_ROOT%{_bindir}
-gzip -9nf AUTHORS BUGS NEWS NEWS.nserver PROJECTS TODO FAQ FAQ.nserver
-
%clean
rm -rf $RPM_BUILD_ROOT
-%post
+%post client
+[ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
+
+%postun client
+[ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
+
+%pre common
if [ -n "`getgid cvs`" ]; then
if [ "`getgid cvs`" != "52" ]; then
- echo "Warning: group cvs haven't gid=52. Correct this before installing cvs-nserver" 1>&2
+ echo "Error: group cvs doesn't have gid=52. Correct this before installing cvs-nserver." 1>&2
exit 1
fi
else
- echo "Making group cvs GID=52"
+ echo "Adding group cvs GID=52."
/usr/sbin/groupadd -g 52 -r -f cvs
fi
if [ -n "`getgid cvsadmin`" ]; then
if [ "`getgid cvsadmin`" != "53" ]; then
- echo "Warning: group cvsadmin haven't gid=53. Correct this before installing cvs-nserver" 1>&2
+ echo "Error: group cvsadmin doesn't have gid=53. Correct this before installing cvs-nserver." 1>&2
exit 1
fi
else
- echo "Making group cvsadmin GID=53"
+ echo "Adding group cvsadmin GID=53."
/usr/sbin/groupadd -g 53 -r -f cvsadmin
fi
if [ -n "`id -u cvs 2>/dev/null`" ]; then
if [ "`id -u cvs`" != "52" ]; then
- echo "Warning: user cvs haven't uid=52. Correct this before installing cvs-nserver" 1>&2
+ echo "Error: user cvs doesn't have uid=52. Correct this before installing cvs-nserver." 1>&2
exit 1
fi
else
- echo "Making user cvs UID=52"
+ echo "Adding user cvs UID=52."
/usr/sbin/useradd -u 52 -r -d %{_cvsroot} -s /bin/false -c "CVS user" -g cvs cvs 1>&2
fi
if [ -n "`id -u cvsadmin 2>/dev/null`" ]; then
if [ "`id -u cvsadmin`" != "53" ]; then
- echo "Warning: user cvsadmin haven't uid=53. Correct this before installing cvs-nserver" 1>&2
+ echo "Error: user cvsadmin doesn't have uid=53. Correct this before installing cvs-nserver." 1>&2
exit 1
fi
else
- echo "Making user cvsadmin UID=53"
+ echo "Adding user cvsadmin UID=53."
/usr/sbin/useradd -u 53 -r -d %{_cvsroot} -s /bin/false -c "CVS user" -g cvsadmin -G cvs cvsadmin 1>&2
fi
-
if [ "$1" = 1 ]; then
- echo "Initialise repository"
+ echo "Initializing repository..."
%{_bindir}/cvs -d :local:%{_cvsroot} init
- chown -R cvsadmin.cvsadmin %{_cvsroot}/CVSROOT
-fi
-if [ -f /var/lock/subsys/rc-inetd ]; then
- /etc/rc.d/init.d/rc-inetd reload
+ chown -R cvsadmin:cvsadmin %{_cvsroot}/CVSROOT
fi
-%postun
+%postun common
if [ "$1" = "0" ]; then
- echo "Removing group cvs GID=52"
+ echo "Removing user cvs."
/usr/sbin/userdel cvs
- echo "Removing group cvsadmin GID=53"
+ echo "Removing user cvsadmin."
/usr/sbin/userdel cvsadmin
- echo "Removing user cvs UID=52"
+ echo "Removing group cvs."
/usr/sbin/groupdel cvs
- echo "Removing user cvsadmin UID=53"
+ echo "Removing group cvsadmin."
/usr/sbin/groupdel cvsadmin
fi
+
+%post pserver
if [ -f /var/lock/subsys/rc-inetd ]; then
- /etc/rc.d/init.d/rc-inetd reload
+ /etc/rc.d/init.d/rc-inetd reload
fi
-%post -n cvs-nclient
-[ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
-
-%post -n cvs-npserver
-if [ "$1" = 1 ]; then
- echo "Initialise repository"
- %{_bindir}/cvs -d :local:%{_cvsroot} init
- chown -R cvsadmin.cvsadmin %{_cvsroot}/CVSROOT
+%postun pserver
+if [ -f /var/lock/subsys/rc-inetd ]; then
+ /etc/rc.d/init.d/rc-inetd reload
fi
+
+%post nserver
if [ -f /var/lock/subsys/rc-inetd ]; then
- /etc/rc.d/init.d/rc-inetd reload
+ /etc/rc.d/init.d/rc-inetd reload
fi
-%postun -n cvs-npserver
+%postun nserver
if [ -f /var/lock/subsys/rc-inetd ]; then
- /etc/rc.d/init.d/rc-inetd reload
+ /etc/rc.d/init.d/rc-inetd reload
fi
-%postun -n cvs-nclient
-[ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
+%files client
+%defattr(644,root,root,755)
+%doc AUTHORS BUGS ChangeLog FAQ FAQ.nserver NEWS NEWS.nserver PROJECTS
+%doc README README.checkpassword TODO
+%attr(755,root,root) %{_bindir}/cvs
+%attr(755,root,root) %{_bindir}/cvsbug
+%{_infodir}/cvs*
+%{_mandir}/man[15]/cvs.*
+%{_mandir}/man8/cvsbug.8*
-%files
+%files common
%defattr(644,root,root,755)
-%attr(755,root,root) %{_bindir}/cvs-nserver*
-%doc NEWS.nserver.gz FAQ.nserver.gz
-/etc/sysconfig/rc-inetd/cvs-nserver
+%attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/sysconfig/cvs
%attr(4754,cvsadmin,cvs) %{_bindir}/cvspasswd
%attr(755,root,root) %{_bindir}/cvschkpw
%attr(755,root,root) %{_bindir}/rcs2log
-%dir %{_datadir}/cvs-nserver/contrib/*
+%dir %{_datadir}/cvs-nserver
+%dir %{_datadir}/cvs-nserver/contrib
+%{_datadir}/cvs-nserver/contrib/*
%attr(770,cvsadmin,cvs) %dir %{_cvsroot}
%{_mandir}/man8/cvs-server.8*
-%{_mandir}/man8/cvs-nserver.8*
+%attr(770,cvsadmin,cvs) %dir /var/lock/cvs
-%files -n cvs-nclient
-%defattr(644,root,root,755)
-%doc {AUTHORS,BUGS,NEWS,PROJECTS,TODO,FAQ}.gz
-%attr(755,root,root) %{_bindir}/cvs
-%attr(755,root,root) %{_bindir}/cvsbug
-%{_infodir}/cvs*
-%{_mandir}/man[15]/cvs.*
-%{_mandir}/man8/cvsbug.8*
-
-%files -n cvs-npserver
+%files pserver
%defattr(644,root,root,755)
+%config(noreplace) %verify(not size mtime md5) /etc/sysconfig/rc-inetd/cvs-pserver
%attr(755,root,root) %{_bindir}/cvs-pserver*
-/etc/sysconfig/rc-inetd/cvs-pserver
%{_mandir}/man8/cvs-pserver.8*
+
+%files nserver
+%defattr(644,root,root,755)
+%doc NEWS.nserver FAQ.nserver
+%config(noreplace) %verify(not size mtime md5) /etc/sysconfig/rc-inetd/cvs-nserver
+%attr(755,root,root) %{_bindir}/cvs-nserver*
+%{_mandir}/man8/cvs-nserver.8*