Merged from SVN repos fedora and centos

This commit is contained in:
Daniel Steiner
2017-02-22 18:21:37 +01:00
commit 49d82f1798
37 changed files with 6757 additions and 0 deletions

View File

@@ -0,0 +1,478 @@
# set to zero to avoid running test suite
%define make_check 0
%define with_java 1
%define with_kwallet 1
# set JDK path to build javahl; default for JPackage
%define jdk_path /usr/lib/jvm/java
%define perl_vendorarch %(eval "`%{__perl} -V:installvendorarch`"; echo $installvendorarch)
%if 0%{?fedora} < 18
%define dbdevel db4-devel
%else
%define dbdevel libdb-devel
%endif
%global sqlite_minver 3.7.12
%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
%{!?_httpd_apxs: %{expand: %%global _httpd_apxs %%{_sbindir}/apxs}}
%{!?_httpd_mmn: %{expand: %%global _httpd_mmn %%(cat %{_includedir}/httpd/.mmn 2>/dev/null || echo missing-httpd-devel)}}
%{!?_httpd_confdir: %{expand: %%global _httpd_confdir %%{_sysconfdir}/httpd/conf.d}}
# /etc/httpd/conf.d with httpd < 2.4 and defined as /etc/httpd/conf.modules.d with httpd >= 2.4
%{!?_httpd_modconfdir: %{expand: %%global _httpd_modconfdir %%{_sysconfdir}/httpd/conf.d}}
Summary: A Modern Concurrent Version Control System
Name: subversion
Version: 1.8.8
Release: 1%{?dist}
License: ASL 2.0
Group: Development/Tools
URL: http://subversion.apache.org/
Source0: http://www.apache.org/dist/subversion/subversion-%{version}.tar.bz2
Source1: subversion.conf
Source3: filter-requires.sh
Source4: http://www.xsteve.at/prg/emacs/psvn.el
Source5: psvn-init.el
Source6: svnserve.service
Source7: svnserve.tmpfiles
Source8: svnserve.sysconf
Patch1: subversion-1.8.0-rpath.patch
Patch2: subversion-1.8.0-pie.patch
Patch3: subversion-1.8.0-kwallet.patch
Patch4: subversion-1.8.0-rubybind.patch
Patch5: subversion-1.8.0-aarch64.patch
BuildRequires: autoconf, libtool, python, python-devel, texinfo, which
BuildRequires: %{dbdevel} >= 4.1.25, swig >= 1.3.24, gettext
BuildRequires: apr-devel >= 1.3.0, apr-util-devel >= 1.3.0
BuildRequires: libserf-devel >= 1.2.1, cyrus-sasl-devel
BuildRequires: sqlite-devel >= %{sqlite_minver}, file-devel, systemd-units
# Any apr-util crypto backend needed
BuildRequires: apr-util-openssl
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Provides: svn = %{version}-%{release}
Requires: subversion-libs%{?_isa} = %{version}-%{release}
Requires(post): systemd-sysv, /sbin/chkconfig
%define __perl_requires %{SOURCE3}
# Put Python bindings in site-packages
%define swigdirs swig_pydir=%{python_sitearch}/libsvn swig_pydir_extra=%{python_sitearch}/svn
%description
Subversion is a concurrent version control system which enables one
or more users to collaborate in developing and maintaining a
hierarchy of files and directories while keeping a history of all
changes. Subversion only stores the differences between versions,
instead of every complete file. Subversion is intended to be a
compelling replacement for CVS.
%package libs
Group: Development/Tools
Summary: Libraries for Subversion Version Control system
# APR 1.3.x interfaces are required
Conflicts: apr%{?_isa} < 1.3.0
%description libs
The subversion-libs package includes the essential shared libraries
used by the Subversion version control tools.
%package python
Group: Development/Libraries
Summary: Python bindings for Subversion Version Control system
%description python
The subversion-python package includes the Python bindings to the
Subversion libraries.
%package devel
Group: Development/Tools
Summary: Development package for the Subversion libraries
Requires: subversion%{?_isa} = %{version}-%{release}
Requires: apr-devel%{?_isa}, apr-util-devel%{?_isa}
%description devel
The subversion-devel package includes the libraries and include files
for developers interacting with the subversion package.
%package gnome
Group: Development/Tools
Summary: GNOME Keyring support for Subversion
Requires: subversion%{?_isa} = %{version}-%{release}
BuildRequires: libgnome-keyring-devel, dbus-devel
%description gnome
The subversion-gnome package adds support for storing Subversion
passwords in the GNOME Keyring.
%if %{with_kwallet}
%package kde
Group: Development/Tools
Summary: KDE Wallet support for Subversion
Requires: subversion%{?_isa} = %{version}-%{release}
BuildRequires: kdelibs-devel >= 4.0.0
%description kde
The subversion-kde package adds support for storing Subversion
passwords in the KDE Wallet.
%endif
%package -n mod_dav_svn
Group: System Environment/Daemons
Summary: Apache httpd module for Subversion server
Requires: subversion-libs%{?_isa} = %{version}-%{release}
BuildRequires: httpd-devel >= 2.0.45
%description -n mod_dav_svn
The mod_dav_svn package allows access to a Subversion repository
using HTTP, via the Apache httpd server.
%package perl
Group: Development/Libraries
Summary: Perl bindings to the Subversion libraries
BuildRequires: perl-devel >= 2:5.8.0, perl(ExtUtils::MakeMaker)
BuildRequires: perl(Test::More), perl(ExtUtils::Embed)
Requires: %(eval `perl -V:version`; echo "perl(:MODULE_COMPAT_$version)")
Requires: subversion%{?_isa} = %{version}-%{release}
%description perl
This package includes the Perl bindings to the Subversion libraries.
%if %{with_java}
%package javahl
Group: Development/Libraries
Summary: JNI bindings to the Subversion libraries
Requires: subversion%{?_isa} = %{version}-%{release}
BuildRequires: java-devel-openjdk
# JAR repacking requires both zip and unzip in the buildroot
BuildRequires: zip, unzip
# For the tests
BuildRequires: junit
%description javahl
This package includes the JNI bindings to the Subversion libraries.
%endif
%package ruby
Group: Development/Libraries
Summary: Ruby bindings to the Subversion libraries
BuildRequires: ruby-devel >= 1.9.1, ruby >= 1.9.1
BuildRequires: rubygem(minitest)
Requires: subversion%{?_isa} = %{version}-%{release}
Conflicts: ruby-libs%{?_isa} < 1.8.2
%description ruby
This package includes the Ruby bindings to the Subversion libraries.
%package tools
Group: Development/Tools
Summary: Supplementary tools for Subversion
Requires: subversion%{?_isa} = %{version}-%{release}
%description tools
This package includes supplementary tools for use with Subversion.
%prep
%setup -q
%patch1 -p1 -b .rpath
%patch2 -p1 -b .pie
%patch3 -p1 -b .kwallet
%patch4 -p1 -b .rubybind
%patch5 -p1 -b .aarch64
%build
# Regenerate the buildsystem, so that:
# 1) patches applied to configure.in take effect
# 2) the swig bindings are regenerated using the system swig
# (2) is not ideal since typically upstream test with a different
# swig version
# This PATH order makes the fugly test for libtoolize work...
PATH=/usr/bin:$PATH ./autogen.sh --release
# fix shebang lines, #111498
perl -pi -e 's|/usr/bin/env perl -w|/usr/bin/perl -w|' tools/hook-scripts/*.pl.in
# override weird -shrext from ruby
export svn_cv_ruby_link="%{__cc} -shared"
export svn_cv_ruby_sitedir_libsuffix=""
export svn_cv_ruby_sitedir_archsuffix=""
%ifarch sparc64
sed -i 's/-fpie/-fPIE/' Makefile.in
%endif
export CFLAGS="$RPM_OPT_FLAGS"
export APACHE_LDFLAGS="-Wl,-z,relro,-z,now"
export CC=gcc CXX=g++ JAVA_HOME=%{jdk_path}
%configure --with-apr=%{_prefix} --with-apr-util=%{_prefix} \
--with-swig --with-serf=%{_prefix} \
--with-ruby-sitedir=%{ruby_vendorarchdir} \
--with-ruby-test-verbose=verbose \
--with-apxs=%{_httpd_apxs} --disable-mod-activation \
--with-apache-libexecdir=%{_httpd_moddir} \
--disable-static --with-sasl=%{_prefix} \
--with-libmagic=%{_prefix} \
--with-gnome-keyring \
%if %{with_java}
--enable-javahl \
--with-junit=%{_prefix}/share/java/junit.jar \
%endif
%if %{with_kwallet}
--with-kwallet \
%endif
--with-berkeley-db || (cat config.log; exit 1)
make %{?_smp_mflags} all tools
make swig-py swig-py-lib %{swigdirs}
make swig-pl swig-pl-lib swig-rb swig-rb-lib
%if %{with_java}
# javahl-javah does not parallel-make with javahl
#make javahl-java javahl-javah
make javahl
%endif
%install
rm -rf ${RPM_BUILD_ROOT}
make install install-swig-py install-swig-pl-lib install-swig-rb \
DESTDIR=$RPM_BUILD_ROOT %{swigdirs}
%if %{with_java}
make install-javahl-java install-javahl-lib javahl_javadir=%{_javadir} DESTDIR=$RPM_BUILD_ROOT
%endif
make pure_vendor_install -C subversion/bindings/swig/perl/native \
PERL_INSTALL_ROOT=$RPM_BUILD_ROOT
install -m 755 -d ${RPM_BUILD_ROOT}%{_sysconfdir}/subversion
mkdir -p ${RPM_BUILD_ROOT}{%{_httpd_modconfdir},%{_httpd_confdir}}
%if "%{_httpd_modconfdir}" == "%{_httpd_confdir}"
# httpd <= 2.2.x
install -p -m 644 %{SOURCE1} ${RPM_BUILD_ROOT}%{_httpd_confdir}
%else
sed -n /^LoadModule/p %{SOURCE1} > 10-subversion.conf
sed /^LoadModule/d %{SOURCE1} > example.conf
touch -r %{SOURCE1} 10-subversion.conf example.conf
install -p -m 644 10-subversion.conf ${RPM_BUILD_ROOT}%{_httpd_modconfdir}
%endif
# Remove unpackaged files
rm -rf ${RPM_BUILD_ROOT}%{_includedir}/subversion-*/*.txt \
${RPM_BUILD_ROOT}%{python_sitearch}/*/*.{a,la}
# The SVN build system is broken w.r.t. DSO support; it treats
# normal libraries as DSOs and puts them in $libdir, whereas they
# should go in some subdir somewhere, and be linked using -module,
# etc. So, forcibly nuke the .so's for libsvn_auth_{gnome,kde},
# since nothing should ever link against them directly.
rm -f ${RPM_BUILD_ROOT}%{_libdir}/libsvn_auth_*.so
# remove stuff produced with Perl modules
find $RPM_BUILD_ROOT -type f \
-a \( -name .packlist -o \( -name '*.bs' -a -empty \) \) \
-print0 | xargs -0 rm -f
# make Perl modules writable so they get stripped
find $RPM_BUILD_ROOT%{_libdir}/perl5 -type f -perm 555 -print0 |
xargs -0 chmod 755
# unnecessary libraries for swig bindings
rm -f ${RPM_BUILD_ROOT}%{_libdir}/libsvn_swig_*.{so,la,a}
# Remove unnecessary ruby libraries
rm -f ${RPM_BUILD_ROOT}%{ruby_vendorarchdir}/svn/ext/*.*a
# Trim what goes in docdir
rm -rf tools/*/*.in
# Install psvn for emacs and xemacs
for f in emacs/site-lisp xemacs/site-packages/lisp; do
install -m 755 -d ${RPM_BUILD_ROOT}%{_datadir}/$f
install -m 644 $RPM_SOURCE_DIR/psvn.el ${RPM_BUILD_ROOT}%{_datadir}/$f
done
install -m 644 $RPM_SOURCE_DIR/psvn-init.el \
${RPM_BUILD_ROOT}%{_datadir}/emacs/site-lisp
# Rename authz_svn INSTALL doc for docdir
ln -f subversion/mod_authz_svn/INSTALL mod_authz_svn-INSTALL
# Trim exported dependencies to APR libraries only:
sed -i "/^dependency_libs/{
s, -l[^ ']*, ,g;
s, -L[^ ']*, ,g;
s,%{_libdir}/lib[^a][^p][^r][^ ']*.la, ,g;
}" $RPM_BUILD_ROOT%{_libdir}/*.la
# Install bash completion
install -Dpm 644 tools/client-side/bash_completion \
$RPM_BUILD_ROOT%{_datadir}/bash-completion/completions/svn
for comp in svnadmin svndumpfilter svnlook svnsync svnversion; do
ln -s svn \
$RPM_BUILD_ROOT%{_datadir}/bash-completion/completions/${comp}
done
# Install svnserve bits
mkdir -p %{buildroot}%{_unitdir} \
%{buildroot}/run/svnserve \
%{buildroot}%{_prefix}/lib/tmpfiles.d \
%{buildroot}%{_sysconfdir}/sysconfig
install -p -m 644 $RPM_SOURCE_DIR/svnserve.service \
%{buildroot}%{_unitdir}/svnserve.service
install -p -m 644 $RPM_SOURCE_DIR/svnserve.tmpfiles \
%{buildroot}%{_prefix}/lib/tmpfiles.d/svnserve.conf
install -p -m 644 $RPM_SOURCE_DIR/svnserve.sysconf \
%{buildroot}%{_sysconfdir}/sysconfig/svnserve
# Install tools ex diff*
make install-tools DESTDIR=$RPM_BUILD_ROOT toolsdir=%{_bindir}
rm -f $RPM_BUILD_ROOT%{_bindir}/diff*
for f in svn-populate-node-origins-index svn-rep-sharing-stats svnauthz-validate svnmucc svnraisetreeconflict; do
echo %{_bindir}/$f
done | tee tools.files | sed 's/^/%%exclude /' > exclude.tools.files
%find_lang %{name}
cat %{name}.lang exclude.tools.files >> %{name}.files
%if %{make_check}
%check
export LANG=C LC_ALL=C
export LD_LIBRARY_PATH=$RPM_BUILD_ROOT%{_libdir}
export MALLOC_PERTURB_=171 MALLOC_CHECK_=3
export LIBC_FATAL_STDERR_=1
if ! make check check-swig-pl check-swig-py check-swig-rb CLEANUP=yes; then
: Test suite failure.
cat fails.log
exit 1
fi
# check-swig-rb omitted: it runs svnserve
%if %{with_java}
make check-javahl
%endif
%endif
%clean
rm -rf ${RPM_BUILD_ROOT}
%post
%systemd_post svnserve.service
%preun
%systemd_preun svnserve.service
%postun
%systemd_postun_with_restart svnserve.service
%triggerun -- subversion < 1.7.3-2
/usr/bin/systemd-sysv-convert --save svnserve >/dev/null 2>&1 ||:
/sbin/chkconfig --del svnserve >/dev/null 2>&1 || :
/bin/systemctl try-restart svnserve.service >/dev/null 2>&1 || :
%post libs -p /sbin/ldconfig
%postun libs -p /sbin/ldconfig
%post perl -p /sbin/ldconfig
%postun perl -p /sbin/ldconfig
%post ruby -p /sbin/ldconfig
%postun ruby -p /sbin/ldconfig
%if %{with_java}
%post javahl -p /sbin/ldconfig
%postun javahl -p /sbin/ldconfig
%endif
%files -f %{name}.files
%defattr(-,root,root)
%doc BUGS COMMITTERS LICENSE NOTICE INSTALL README CHANGES
%doc tools/hook-scripts tools/backup tools/bdb tools/examples tools/xslt
%doc mod_authz_svn-INSTALL
%{_bindir}/*
%{_mandir}/man*/*
%{_datadir}/emacs/site-lisp/*.el
%{_datadir}/xemacs/site-packages/lisp/*.el
%{_datadir}/bash-completion/completions/*
%config(noreplace) %{_sysconfdir}/sysconfig/svnserve
%dir %{_sysconfdir}/subversion
%exclude %{_mandir}/man*/*::*
%{_unitdir}/*.service
%dir /run/svnserve
%{_prefix}/lib/tmpfiles.d/svnserve.conf
%files tools -f tools.files
%defattr(-,root,root)
%files libs
%defattr(-,root,root)
%doc LICENSE NOTICE
%{_libdir}/libsvn_*.so.*
%exclude %{_libdir}/libsvn_swig_perl*
%exclude %{_libdir}/libsvn_swig_ruby*
%if %{with_kwallet}
%exclude %{_libdir}/libsvn_auth_kwallet*
%endif
%exclude %{_libdir}/libsvn_auth_gnome*
%files python
%defattr(-,root,root)
%{python_sitearch}/svn
%{python_sitearch}/libsvn
%files gnome
%defattr(-,root,root)
%{_libdir}/libsvn_auth_gnome_keyring-*.so.*
%if %{with_kwallet}
%files kde
%defattr(-,root,root)
%{_libdir}/libsvn_auth_kwallet-*.so.*
%endif
%files devel
%defattr(-,root,root)
%{_includedir}/subversion-1
%{_libdir}/libsvn*.*a
%{_libdir}/libsvn*.so
%exclude %{_libdir}/libsvn_swig_perl*
%if %{with_java}
%exclude %{_libdir}/libsvnjavahl-1.*
%endif
%files -n mod_dav_svn
%defattr(-,root,root)
%config(noreplace) %{_httpd_modconfdir}/*.conf
%{_libdir}/httpd/modules/mod_*.so
%if "%{_httpd_modconfdir}" != "%{_httpd_confdir}"
%doc example.conf
%endif
%files perl
%defattr(-,root,root,-)
%{perl_vendorarch}/auto/SVN
%{perl_vendorarch}/SVN
%{_libdir}/libsvn_swig_perl*
%{_mandir}/man*/*::*
%files ruby
%defattr(-,root,root,-)
%{_libdir}/libsvn_swig_ruby*
%{ruby_vendorarchdir}/svn
%if %{with_java}
%files javahl
%defattr(-,root,root,-)
%{_libdir}/libsvnjavahl-1.*
%{_javadir}/svn-javahl.jar
%endif
%changelog
* Fri Feb 21 2014 Daniel Steiner <elpito@bluewin.ch>
- First package got from original fedora source (1.8.8).