File subversion.spec of Package subversion

#
# spec file for package subversion (Version 1.5.7)
#
# Copyright (c) 2010 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 http://bugs.opensuse.org/
#

# norootforbuild


Name:           subversion
%if 0%{?suse_version} > 910
BuildRequires:  update-alternatives
%endif
BuildRequires:  apache2-devel db-devel gcc-c++ java-devel python-devel swig zlib-devel
%if 0%{?suse_version} > 1030
BuildRequires:  libneon-devel
%else
BuildRequires:  neon-devel openldap2-devel
%endif
BuildRequires:  sqlite-devel
Version:        1.5.7
Release:        0.<RELEASE2>
#
%define _fwdefdir /etc/sysconfig/SuSEfirewall2.d/services
#
%define	apxs	/usr/sbin/apxs2
%define	apache_libexecdir	%(%{apxs} -q LIBEXECDIR)
%define	apache_sysconfdir	%(%{apxs} -q SYSCONFDIR)
#
%define site_python	%(python -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib()")
#
PreReq:         %insserv_prereq %fillup_prereq
#
Summary:        A Concurrent Versioning system similar to but better than CVS
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
License:        "Subversion license, http://subversion.tigris.org/license-1.html ..."; Subversion license, http://subversion.tigris.org/license-1.html
Group:          Development/Tools/Version Control
Url:            http://subversion.tigris.org
Source0:        subversion-%{version}.tar.bz2
Source1:        subversion.conf
Source2:        subversion.README.SuSE
Source9:        subversion.rcsvnserve
Source10:       subversion.sysconfig.svnserve
Source12:       subversion.sysconfig.svnserve.remoteaccess
Source13:       subversion.xinetd.svnserve
Source42:       subversion.svngrep.sh
Source43:       subversion.svndiff.sh
#
Patch11:        subversion.libtool-verbose.patch
# build fixes
Patch20:        subversion-swig-perl-install_vendor.patch
Patch23:        subversion.libtool-pie-flags.patch
Patch31:        subversion.perl.LD_RUN_PATH.patch
Patch33:        subversion.header_wrappers.patch
Patch34:        subversion.allowed-neon.patch
Patch35:        subversion.java14.patch
Patch36:        subversion-1.5.x-no-neon-la.patch
Patch37:        subversion.CVE-2010-3315.diff
#

%description
Subversion does the same thing cvs (CVS (Concurrent Versioning System))
but has major enhancements compared to CVS. The name of the cmdline
client is svn.



%package devel
License:        The Apache Software License
Group:          Development/Libraries/C and C++
Summary:        Development package for Subversion developers
Requires:       subversion = %{version}
# this pulls in libapr1-devel and libexpat-devel
Requires:       libapr-util1-devel

%description devel
The subversion-devel package includes the static libraries and include
files for developers interacting with the subversion package.



%package tools
License:        The Apache Software License; "Subversion License, http://subversion.tigris.org/license-1.html ..."; Subversion License, http://subversion.tigris.org/license-1.html
Group:          Development/Tools/Version Control
Summary:        Tools for Subversion

%description tools
This package contains a lot of tools for subversion server and
   repository admins: * hot-backup makes a backup of a svn repo
   without stopping

* various scripts for client (bash_completion, showchange.pl,
   svn-graph.pl, ...) and server (svn-backup-dumps.py, ...) site

* po file translation scripts

* hook scripts

* xslt example

* some scripts and code examples

An overview of the scripts can be found at:
http://subversion.tigris.org/tools_contrib.html



%package perl
License:        The Apache Software License; "Subversion License, http://subversion.tigris.org/license-1.html ..."; Subversion License, http://subversion.tigris.org/license-1.html
Group:          Development/Tools/Version Control
Summary:        Allows Perl scripts to directly use Subversion repositories.
Requires:       subversion = %{version}
Requires:       perl >= 5.8

%description perl
Provides Perl (SWIG) support for Subversion.



%package python
License:        The Apache Software License; "Subversion License, http://subversion.tigris.org/license-1.html ..."; Subversion License, http://subversion.tigris.org/license-1.html
Group:          Development/Tools/Version Control
Summary:        Allows Python scripts to directly use Subversion repositories.
Requires:       subversion = %{version}

%description python
Provides Pythong (SWIG) support for Subversion.



%package server
License:        The Apache Software License
Group:          Development/Tools/Version Control
Summary:        Apache server module for Subversion server
Requires:       subversion = %{version}
Requires:       apache2

%description server
The subversion-server package adds the Subversion server Apache module
to the Apache directories and configuration.

http://subversion.tigris.org



%prep
swig="`env -i swig -version 2>&1 | awk '/^SWIG Version/{ print $3 }'`"
case "$swig" in
	1.3.21|1.3.1*)
		echo "installed swig $swig too old"
		exit 1
		;;
esac
%setup -q -n subversion-%{version}
#
#
%patch11 -p1
#
%patch20 -p1
%if 0%{?suse_version} > 930
%patch23 -p1
%endif
%patch31 -p1
%patch33 -p1
%patch34 -p1
%patch35 -p1
%patch36 -p1
%patch37

%build
with_jdk=none
for i in \
/usr/%{_lib}/jvm/java-openjdk \
/usr/%{_lib}/jvm/java-1.4.2-gcj \
/usr/%{_lib}/BEAJava2-1.4.2 \
/usr/%{_lib}/SunJava2-1.4.2 \
/usr/%{_lib}/jvm/java-1.4.2-sun \
/usr/lib/jvm/java-1.4.2-sun \
/usr/%{_lib}/jvm/java-1.5.0-ibm \
/usr/%{_lib}/jvm/java-1.5.0-sun \
/usr/lib/jvm/java-1.5.0-sun \
/usr/%{_lib}/jvm/java-1.4.2-ibm \
/usr/%{_lib}/jvm/IBMJava2-1.4.2 \
/usr/lib/BEAJava2-1.4.2 \
/usr/lib/SunJava2-1.4.2 \
/usr/lib/jvm/java-1.4.2-sun \
/usr/lib/IBMJava2-1.4 \
; do
if [ -d "$i" ] ; then
with_jdk="$i"
break
fi
done
%if 0%{?suse_version} < 1020
	# disable javahl bindings
	with_jdk=none
%endif
if [ "$with_jdk" != "none" ] ; then
with_jdk="--with-jdk=$with_jdk --enable-javahl"
echo with_jdk > with_jdk
cat > with_jdk.files <<EOF-JAVA
%{_libdir}/libsvnjavahl*.so.*
%{_libdir}/libsvnjavahl*.so
%dir %{_libdir}/svn-javahl
%{_libdir}/svn-javahl/svn-javahl.jar
EOF-JAVA
else
with_jdk=""
rm -f with_jdk
echo -n '' > with_jdk.files
fi
%ifarch ppc  ppc64
with_jdk=""
rm -f with_jdk
echo -n '' > with_jdk.files
%endif
cat with_jdk.files
# ### these possibly need further discussion
# swig_pydir = @libdir@/svn-python/libsvn
# swig_pydir_extra = @libdir@/svn-python/svn
sed --in-place=~ "
s@^swig_pydir = .*@swig_pydir = %{site_python}/libsvn@
s@^swig_pydir_extra = .*@swig_pydir_extra = %{site_python}/svn@
" Makefile.in
diff -u Makefile.in~ Makefile.in || true
sh -x autogen.sh
for i in subversion/bindings/javahl/native/*.cpp
do
	d=$(sed -n '/^#include "..\/include/{s@^[^/]\+\([^"]\+\).*@subversion/bindings/javahl\1@;H};${x;s@\n@ @gp}' $i)
	echo
	echo "# $i"
	if ! test -z "$d"
	then
		echo ${i%.cpp}.lo: $d
	fi
	echo
done >> build-outputs.mK
export CFLAGS="$(%{apxs} -q CFLAGS) -Wall -g"
%if 0%{?suse_version} > 930
CFLAGS="$CFLAGS -fpie"
export LDFLAGS=-pie
%endif
%if 0%{?suse_version} > 1000
CFLAGS="$CFLAGS -fstack-protector"
%endif
export CXXFLAGS="$CFLAGS"
%configure \
	--with-editor="vim -c 'set tw=72 et' " \
	--with-neon=%{_prefix} \
	--with-apr=%{_prefix} \
	--with-apr-util=%{_prefix} \
	--with-apxs=%{apxs} \
	--with-zlib=%{_prefix} \
	$with_jdk \
	--with-jikes=no \
	--with-swig \
	--disable-mod-activation \
	--disable-static
%if 0%{?suse_version} == 910
sed --in-place=~ "s,\/usr\/lib ,%{_libdir} ,g" Makefile
%endif
make %{?jobs:-j%jobs} SWIG_LDFLAGS=
#
if [ "$with_jdk" != "" ] ; then
with_jdk=javahl
fi
make swig-py swig-pl SWIG_LDFLAGS= $with_jdk
#

%install
if [ -f with_jdk ] ; then
with_jdk=install-javahl
else
with_jdk=
fi
make DESTDIR=$RPM_BUILD_ROOT install install-swig-pl install-swig-py $with_jdk
#
# double check that the essential repository access schemes have been compiled in
#
schemes=$(LD_LIBRARY_PATH=$RPM_BUILD_ROOT%{_libdir} $RPM_BUILD_ROOT/usr/bin/svn --version | grep "'" | cut -d\' -f2)
# reset vim syntax: '
test "$schemes" = "http
https
svn
file"
#
%perl_process_packlist
%find_lang %name
#
cp -Lav %{S:42} $RPM_BUILD_ROOT/usr/bin/svngrep
cp -Lav %{S:43} $RPM_BUILD_ROOT/usr/bin/svndiff
#
mkdir -p $RPM_BUILD_ROOT/usr/share/emacs/site-lisp/
cp -avL contrib/client-side/emacs/*.el $RPM_BUILD_ROOT/usr/share/emacs/site-lisp/
rm -f $RPM_BUILD_ROOT/usr/share/emacs/site-lisp/vc-svn.el
#
cp -avL contrib/client-side/svnmerge/svnmerge.py $RPM_BUILD_ROOT/usr/bin
cp -avL contrib/client-side/svn_apply_autoprops.py $RPM_BUILD_ROOT/usr/bin
#
mkdir -p $RPM_BUILD_ROOT/%{apache_sysconfdir}/conf.d
cp -av %{S:1} $RPM_BUILD_ROOT/%{apache_sysconfdir}/conf.d/subversion.conf
#
cp -avL %{S:2} README.SuSE
cp -avL subversion/mod_authz_svn/INSTALL README.mod_authz_svn
cat %name.lang > files.subversion
cat with_jdk.files >> files.subversion
#
# tools
mkdir -p   $RPM_BUILD_ROOT/usr/share/subversion/
cp -a tools $RPM_BUILD_ROOT/usr/share/subversion/
#m -rf $RPM_BUILD_ROOT/usr/share/subversion/tools/cvs2svn
mkdir $RPM_BUILD_ROOT/usr/share/subversion/tools/svn_load_dirs
cp -aL contrib/client-side/svn_load_dirs/svn_load_dirs.README $RPM_BUILD_ROOT/usr/share/subversion/tools/svn_load_dirs/README
cp -aL contrib/client-side/svn_load_dirs/svn_load_dirs_property_table.example $RPM_BUILD_ROOT/usr/share/subversion/tools/svn_load_dirs/
sed 's:@SVN_BINDIR@:/usr/bin:' contrib/client-side/svn_load_dirs/svn_load_dirs.pl.in > $RPM_BUILD_ROOT/usr/share/subversion/tools/svn_load_dirs/svn_load_dirs.pl
chmod 755 $RPM_BUILD_ROOT/usr/share/subversion/tools/svn_load_dirs/svn_load_dirs.pl
find $RPM_BUILD_ROOT \( -name .svn -o -name CVS -o -name tests \) -type d -print0 | xargs -0 rm -rfv
find $RPM_BUILD_ROOT \( -name "*.a" -o -name "*.c" \) -type f -print0 | xargs -0 rm -rfv
rm -rf $RPM_BUILD_ROOT/usr/share/subversion/tools/buildbot
rm -rf $RPM_BUILD_ROOT/usr/share/subversion/tools/diff
rm -rf $RPM_BUILD_ROOT/usr/share/subversion/tools/dist
rm -rf $RPM_BUILD_ROOT/usr/share/subversion/tools/hook-scripts/verify-po.py
rm -rf $RPM_BUILD_ROOT/usr/share/subversion/tools/po
rm -rf $RPM_BUILD_ROOT/usr/share/subversion/tools/server-side/*svn_dav_log_parse*
rm -rf $RPM_BUILD_ROOT/usr/share/subversion/tools/test-scripts
#
#
#
mkdir -p $RPM_BUILD_ROOT/etc/init.d
mkdir -p $RPM_BUILD_ROOT/etc/xinetd.d
mkdir -p $RPM_BUILD_ROOT/usr/sbin
mkdir -p $RPM_BUILD_ROOT/var/adm/fillup-templates
cp -aL %{S:13} $RPM_BUILD_ROOT/etc/xinetd.d/svnserve
cp -aL %{S:9} $RPM_BUILD_ROOT/etc/init.d/svnserve
ln -sv /etc/init.d/svnserve $RPM_BUILD_ROOT/usr/sbin/rcsvnserve
cp -aL %{S:10} $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.svnserve
mkdir -p $RPM_BUILD_ROOT/%{_fwdefdir}
install -m 644 %{S:12} $RPM_BUILD_ROOT/%{_fwdefdir}/svnserve
#useless libtool stuff
rm -f %{buildroot}%{_libdir}/*.la

%clean
rm -rf $RPM_BUILD_ROOT

%preun
%stop_on_removal svnserve

%post
%{fillup_and_insserv -n svnserve svnserve}
/sbin/ldconfig

%postun
%restart_on_update svnserve
%{insserv_cleanup}
/sbin/ldconfig

%post -n subversion-python -p /sbin/ldconfig

%postun -n subversion-python -p /sbin/ldconfig

%post -n subversion-perl -p /sbin/ldconfig

%postun -n subversion-perl -p /sbin/ldconfig

%files -f files.subversion
%defattr(-,root,root)
%doc README.SuSE BUGS CHANGES COPYING subversion/LICENSE README.mod_authz_svn
#
%config(noreplace) /etc/xinetd.d/svnserve
%attr(754,root,root) /etc/init.d/svnserve
%attr(754,root,root) /usr/sbin/rcsvnserve
/var/adm/fillup-templates/sysconfig.svnserve
%config %{_fwdefdir}/*
#
%attr(755,root,root) /usr/bin/svn
%attr(755,root,root) /usr/bin/svnadmin
%attr(755,root,root) /usr/bin/svndumpfilter
%attr(755,root,root) /usr/bin/svnlook
%attr(755,root,root) /usr/bin/svnserve
%attr(755,root,root) /usr/bin/svnversion
%attr(755,root,root) /usr/bin/svndiff
%attr(755,root,root) /usr/bin/svngrep
%attr(755,root,root) /usr/bin/svnsync
%{_libdir}/libsvn_client*.so.*
%{_libdir}/libsvn_delta*.so.*
%{_libdir}/libsvn_diff*.so.*
%{_libdir}/libsvn_fs*.so.*
%{_libdir}/libsvn_ra*.so.*
%{_libdir}/libsvn_repos*.so.*
%{_libdir}/libsvn_subr*.so.*
%{_libdir}/libsvn_wc*.so.*
%{_mandir}/man?/svn*
#
/usr/share/emacs

%files perl
%defattr(-,root,root)
%doc %{_mandir}/man?/SVN::*
%{_libdir}/libsvn_swig_perl-1.so.*
%perl_vendorarch/SVN
%perl_vendorarch/auto/SVN
/var/adm/perl-modules/subversion

%files python
%defattr(-,root,root)
%dir %{site_python}
%dir %{site_python}/svn
%dir %{site_python}/libsvn
%{_libdir}/libsvn_swig_py-1.so.*
%{site_python}/libsvn/*
%{site_python}/svn/*

%files devel
%defattr(-,root,root)
%dir %{_includedir}/subversion-1
%{_libdir}/libsvn_*.so
%{_includedir}/subversion-1/*

%files tools
%defattr(-,root,root)
%dir /usr/share/subversion
/usr/share/subversion/tools
%attr(755,root,root) /usr/bin/svnmerge.py
%attr(755,root,root) /usr/bin/svn_apply_autoprops.py

%files server
%defattr(-,root,root)
%dir %{apache_sysconfdir}/conf.d
%config (noreplace) %{apache_sysconfdir}/conf.d/subversion.conf
%dir %{apache_libexecdir}
%{apache_libexecdir}/mod_dav_svn.*
%{apache_libexecdir}/mod_authz_svn.*

%changelog
openSUSE Build Service is sponsored by