File cvs.spec of Package cvs

# spec file for package cvs
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

Name:           cvs
BuildRequires:  automake
BuildRequires:  gdbm-devel
BuildRequires:  zlib-devel
Version:        1.12.12
Release:        0
Summary:        Concurrent Versions System
License:        GPL-2.0+ ; LGPL-2.1+
Group:          Development/Tools/Version Control
Requires:       /bin/mktemp, /usr/bin/csh
Source:         %name-%version.tar.bz2
Source1:        cvslock-0.2.tar.bz2
Source2:        xinetd.conf
Source4:        cvs.csh
Source10:       OpenSourceDevWithCVS_2E.tar.bz2
Patch:          cvs.diff
Patch2:         diff-k.possible.patch
Patch5:         cvs-fix_sigpipe_flowcontrol.diff
#Patch6:         allow_trailing_dir_slash.diff
#Patch7:         use_system_zlib.diff
Patch8:         cvs-use_vitmp.diff
Patch10:        cvs-new-sort-option.diff
Patch11:        cvs-1.11.9-nocsh.patch
Patch12:        03cvs-client-exploit-fix.diff
Patch16:        cvs_readd_l_option.diff
Patch17:        cvs-silence_option_r_warning.diff
Patch18:        cvs-silence_old_format_strings.diff
Patch19:        cvs-1.12.9-null.patch
Patch20:        cvs-format.patch
Patch21:        cvs-useless-asnprintf.diff
Patch22:        cvs-1.12.12_cvsbug-tmp.diff
Patch23:        cvs-1.12.12-rcsfile-sanity.diff
Patch24:        cvs-1.12.12-type_punning.diff
Patch25:        cvs-no_AM_GETTEXT_VERSION.diff
Patch26:        cvs-request_rcs_installation.diff
Patch27:        cvs-fix_printf_format.diff
Patch28:        cvs-gnulib.diff
Patch29:        cvs-CVE-2012-0804.patch
PreReq:         %install_info_prereq 
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

CVS is a front-end to the rcs (Revision Control System) included in the
standard Linux distributions. PCL-CVS, an emacs (Emacs) front-end for
CVS, is also included.

%package doc
Summary:        Info pages and Open Source Development with CVS, 2nd Edition Book
Group:          Development/Tools/Version Control
%if 0%{?suse_version} >= 1120
BuildArch:      noarch

%description doc
Info pages for cvs, an introduction to cvs
(%{_datadir}/%{name}/contrib/intro.doc) and the complete book "Open Source
Development with CVS, 2nd Edition".

%setup -q -a 1 -a 10
#%patch7 -p1
%patch8 -p1
%patch11 -p1
%patch20 -p1
%patch22 -p1

autoreconf -fi 
#aclocal -I m4
export CFLAGS="$RPM_OPT_FLAGS -pipe -D_GNU_SOURCE -std=gnu99" 
%configure \
   --with-external-zlib \
   --with-editor=/usr/bin/vitmp \
cd cvslock-* 
cd -
make %{?_smp_mflags}
cd cvslock-*
make %{?_smp_mflags}
cd -

%makeinstall install-info
mkdir -p %{buildroot}%{_sysconfdir}/profile.d
install -m 0644 %SOURCE3 %SOURCE4 %{buildroot}%{_sysconfdir}/profile.d
# hack to avoid csh in requires
chmod 644 %{buildroot}/usr/share/cvs/contrib/sccs2rcs
mkdir -p %{buildroot}%{_sysconfdir}/xinetd.d
cp -ai $RPM_SOURCE_DIR/xinetd.conf %{buildroot}%{_sysconfdir}/xinetd.d/cvs
# install cvslock
cd cvslock-* 
cd -
# documentation
mkdir -p %{buildroot}/%_defaultdocdir/%name/
install -m 0644 */OpenSourceDevWithCVS_2E.pdf \
install -m 0644 contrib/rcs2log.1 %{buildroot}/%{_mandir}/man1

%post doc
%install_info --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz
%install_info --info-dir=%{_infodir} %{_infodir}/%{name}

%postun doc
%install_info_delete --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz
%install_info_delete --info-dir=%{_infodir} %{_infodir}/%{name}

%dir %{_datadir}/%{name}
%dir %{_datadir}/%{name}/contrib
%config(noreplace) %{_sysconfdir}/xinetd.d/cvs
%config(noreplace) %{_sysconfdir}/profile.d/
%config(noreplace) %{_sysconfdir}/profile.d/cvs.csh
%attr(755,root,root) %{_datadir}/%{name}/contrib/sccs2rcs
%doc %{_mandir}/man1/*.gz
%doc %{_mandir}/man5/*.gz
%doc %{_mandir}/man8/*.gz

%files doc
%dir %_defaultdocdir/%name
%doc %_infodir/*.gz
%doc %_infodir/
%doc %_infodir/*.gz
%doc %_infodir/
%doc %{_datadir}/%{name}/contrib/intro.doc
%doc %_defaultdocdir/%name/OpenSourceDevWithCVS_2E.pdf