Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37909640
en ru br
ALT Linux repos
S:1.14.2-alt1
D:1.4.4-alt2.3.2
5.0: 1.5.4-alt3
4.1: 1.4.4-alt2.1.M41.1
4.0: 1.4.4-alt1
+updates:1.4.4-alt1
3.0: 1.2.3-alt2

Group :: Development/Other
RPM: subversion

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

# hey Emacs, its -*- mode: rpm-spec; coding: cyrillic-cp1251; -*-
# Subversion
# Notes:
# * Do not build subversion on the system where an older version is
#   installed. Subversion links against system-installed libraries in
#   that case which may lead to failed tests or other failures during
#   validation stage. Prefer to build subversion in hasher.
# * Update alt-bdb patch when libdb version changes. Otherwise you may
#   have failyres in tests for FS_TYPE=bdb.


%def_without doc

%def_with server
%def_with dav
%def_with emacs
%def_with javahl
%def_with swig_py
%def_with swig_pl
# Temporarily disbled due to fail on x86_64
%def_without swig_rb
# Note: this spec does not have support for building with swig_java
%def_without swig_java

%def_with svn_push

# Global switch to enable/diable all tests

%def_enable check
# Use these switches to selectively turn on/off some of tests
# These make sence only if tests enabled
%def_with fsfs_check
%def_with bdb_check
%def_with pl_check
%def_without rb_check
%def_with javahl_check

%define svn_ver_pre %nil
%define svn_rel alt3

# uncinditionally link subversion to this versions

# there are libdb4.7 is using after this versions
# later solo is wanting to make more flexible mechanism for subversion and libdb bindings
%define apr_name libapr1
%define apr_ver 1.3.3-alt1
%define apu_name libaprutil1
%define apu_ver 1.3.4-alt3.2

# subversion require libdb > 4

# with --with-berkeley-db libdb version is taken from $apu_config
# without --with-berkeley-db bdb version is assumed  to be more
# than 4.0.4 (see SVN_FS_WANT_DB_* in ./configure).
# old subversion-1.3.1-alt-bdb.patch change it to 4.3.29
# (see it in srpm with version smaller then 1.5.4, or investigate git.alt)

# solo's macros for full libdb version to point it in requires

# set %%libdb_soname_req (for Requires: <libname>-libdb = %%libdb_soname_req)
%define libdb_soname_req 4%(rpm -q --whatprovides libdb4-devel | sed -r 's/^libdb4(\\.[^-]+)-devel-.+$/\\1/')

%define svn_user subversion
%define svn_group subversion
%define svn_repo_dir %_localstatedir/subversion
%define svn_service svnserve

# Directory for subversion-tools

%define _svn_tools_dir %_datadir/%name
%define _svn_tools_bindir %_bindir

%define module_name dav_svn
%define modname dav_svn_module

Name: subversion
Version: 1.5.4
Release: %svn_rel

Summary: A version control system
Group: Development/Other
License: Apache
Url: http://subversion.tigris.org/
Packager: Sviatoslav Sviridov <svd at altlinux.ru>

Source: %name-%version%svn_ver_pre.tar
Source1: %name.el
Source2: %name-config-1.4.0.tar
Source3: svnserve.init
Source4: svnserve.sysconfig
##Source5: %name-apache.conf
Source5: %module_name.conf
Source6: svnwrapper
#Source7: vc-svn.el
Source8: Makefile-tools

Source9: %module_name.load
Source10: %module_name.start

Patch1: %name-1.5.4-alt-dockbook.patch
Patch2: %name-1.5.4-alt-perl-DESTROY.patch
Patch5: %name-1.5.4-alt-quote-filenames.patch
Patch11: %name-1.4.0-alt-linkage-neon.patch
Patch12: %name-1.3.0-deb-swig-1.3.27.patch
Patch13: %name-1.3.1-alt-configure-swig-ruby.patch
Patch14: %name-1.3.1-alt-libsvn_swig-install.patch
Patch15: %name-1.5.4-alt-linkage-libdb.patch

# http://bugs.gentoo.org/show_bug.cgi?id=219959

Patch16: %name-1.5.4-gentoo-java-headers.patch

Requires: lib%name = %version-%release

# Automatically added by buildreq on Mon Nov 03 2008

BuildRequires: libcom_err-devel zlib-devel libexpat-devel

# unconditionally need by configure

BuildRequires: libapr1-devel >= %apr_ver
BuildRequires: libaprutil1-devel >= %apu_ver

# it is not nesessary for simple build, but dav require this

BuildRequires: libneon-devel

%def_disable static
%{?_enable_static:BuildPreReq: glibc-devel-static}

# Manually removed from list:

# + emacs-related packages
# + swig (coonditional, required for swig bindings)
# + apache2-devel (needed only for subversion-server-dav)
# + java-devel, junit (conditional, required for javahl, swig_java)
# + gcc-c++ (conditional, required for javahl)

%if_with emacs
BuildPreReq: emacs-common
%endif

%if_with swig_py
BuildPreReq: swig python-devel
%endif

%if_with swig_pl
BuildPreReq: perl-devel swig
%endif

%if_with swig_rb
BuildPreReq: ruby swig
%endif

%if_with javahl
BuildPreReq: gcc-c++ libstdc++-devel junit
BuildPreReq: java-devel-default
BuildPreReq: /proc
%endif

%if_with dav
BuildPreReq: apache2-devel
%endif

%add_findprov_lib_path %_libdir/libsvn_swig

%description
The goal of the Subversion project is to build a revision system that is
a compelling replacement for CVS in the open community.  The software is
released under an Apache/BSD-style source license.  See the status page
for current progress.
This package contains command-line subversion utilities: svn and
svnversion. For more utilities please look for packages subversion-tools
and subversion-server-common.

%package -n lib%name
Summary: Shared libraries required for subversion
Group: System/Libraries
Requires: %apr_name >= %apr_ver
Requires: %apu_name >= %apu_ver
Requires: libaprutil1-libdb = %libdb_soname_req

%description -n lib%name
The goal of the Subversion project is to build a revision system that is
a compelling replacement for CVS in the open community.  The software is
released under an Apache/BSD-style source license.  See the status page
for current progress.

%package -n lib%name-devel
Summary: Development files for applications which will use subversion libraries
Group: Development/C
Provides: %name-devel = %version-%release
Requires: lib%name = %version-%release
Requires: %apr_name-devel >= %apr_ver
Requires: %apu_name-devel >= %apu_ver
Requires: libneon-devel

%description -n lib%name-devel
The goal of the Subversion project is to build a revision system that is
a compelling replacement for CVS in the open community.  The software is
released under an Apache/BSD-style source license.  See the status page
for current progress.

%package -n lib%name-devel-static
Summary: Static libraries for developing statically linked applications which will use subversion libraries
Group: Development/C
Requires: lib%name-devel = %version-%release

%description -n lib%name-devel-static
The goal of the Subversion project is to build a revision system that is
a compelling replacement for CVS in the open community.  The software is
released under an Apache/BSD-style source license.  See the status page
for current progress.

%if_with swig_py
%package python
Summary: Pyhton bindings for Subversion
Group: Development/Other
Requires: lib%name = %version-%release

%description python
The goal of the Subversion project is to build a revision system that is
a compelling replacement for CVS in the open community.  The software is
released under an Apache/BSD-style source license.  See the status page
for current progress.
This package contains the files necessary to use the subversion library
functions within python scripts.
%endif

%if_with swig_pl
%package perl
Summary: Perl bindings for Subversion
Group: Development/Other
Requires: lib%name = %version-%release

# The following dependecies where found before 'relaxed' _perl_req_method:

#   perl(File/Temp.pm)
#   perl(IO/Handle.pm)
#   perl(Symbol.pm)
#   perl(overload.pm)
#   perl(warnings.pm) - still found automatically
# Now we need to specify dependencies manually (except thouse still found automatically)
Requires: perl(File/Temp.pm)
Requires: perl(IO/Handle.pm)
Requires: perl(Symbol.pm)
Requires: perl(overload.pm)

%description perl
The goal of the Subversion project is to build a revision system that is
a compelling replacement for CVS in the open community.  The software is
released under an Apache/BSD-style source license.  See the status page
for current progress.
This package contains the files necessary to use the subversion library
functions within perl scripts.
%endif

%if_with swig_rb
%package ruby
Summary: Ruby bindings for Subversion
Group: Development/Other
Requires: lib%name = %version-%release

%description ruby
The goal of the Subversion project is to build a revision system that is
a compelling replacement for CVS in the open community.  The software is
released under an Apache/BSD-style source license.  See the status page
for current progress.
This package contains the files necessary to use the subversion library
functions within ruby scripts.
%endif

%if_with swig_java
%package java
Summary: Java bindings for Subversion
Group: Development/Other
Requires: lib%name = %version-%release
%endif

%if_with javahl
%package javahl
Summary: JavaHL bindings for Subversion
Group: Development/Other
Requires: lib%name = %version-%release

%description javahl
The goal of the Subversion project is to build a revision system that is
a compelling replacement for CVS in the open community.  The software is
released under an Apache/BSD-style source license.  See the status page
for current progress.
This package contains the files necessary to use the subversion library
functions within java.
%endif

%package -n emacs-%name
Summary: Subversion support for Emacs
Group: Editors
Requires: %name

%description -n emacs-%name
vc-svn is a VC backend for Subversion.ataff
psvn is an interface for subversion. psvn provides a similar interface
for subversion as pcl-cvs for cvs.

All Emacs Lisp code is byte-compiled, install emacs-%name-el for sources.

%package -n emacs-%name-el
Summary: The Emacs Lisp sources for bytecode included in emacs-%name
Group: Editors

%description -n emacs-%name-el
emacs-%name-el contains the Emacs Lisp sources for the bytecode
included in emacs-%name package

%package doc
Summary: Subversion documentation
Group: Books/Other
Requires(post): %install_info
Requires(preun): %uninstall_info

%description doc
This package contains subversion documentation:
+ the "Version Control with Subversion" book,
+ documents for Subversion programmers,
+ documents for Subversion users.

%package server-common
Summary: Common files required to maintain subversion server
Group: System/Servers
Requires: lib%name = %version-%release

%description server-common
The goal of the Subversion project is to build a revision system that is
a compelling replacement for CVS in the open community.  The software is
released under an Apache/BSD-style source license.  See the status page
for current progress.
This package contains common files required for maintaing subversion
repositories.

%package server-standalone
Summary: Subversion standalone server
Group: System/Servers
Requires: %name-server-common = %version-%release
Requires: /bin/su

%description server-standalone
The goal of the Subversion project is to build a revision system that is
a compelling replacement for CVS in the open community.  The software is
released under an Apache/BSD-style source license.  See the status page
for current progress.
This package contains scripts for running standalone subversion server.

%package server-dav
Summary: Subversion server module for Apache
Group: System/Servers
Requires: %name-server-common = %version-%release

%description server-dav
The goal of the Subversion project is to build a revision system that is
a compelling replacement for CVS in the open community.  The software is
released under an Apache/BSD-style source license.  See the status page
for current progress.
This package contains the apache2 server shared module for running
subversion server.

%package tools
Summary: Tools for subversion
Group: Development/Other
Requires: %name = %version-%release
Requires: %name-server-common = %version-%release
Requires: %name-python = %version-%release
BuildPreReq: perl-URI

%description tools
Tools for Subversion.  This package includes:
+ hook scripts
+ bash completion,
+ other useful scripts (hot-backup.py, server-vsn.py, showchange.pl),
+ some scripts and code examples.

%package -n bash-completion-svn
Summary: Bash completion for subversion
Group: Development/Other

%description -n bash-completion-svn
Bash completion for subversion

%description -n emacs-%name
vc-svn is a VC backend for Subversion.ataff
psvn is an interface for subversion. psvn provides a similar interface
for subversion as pcl-cvs for cvs.

All Emacs Lisp code is byte-compiled, install emacs-%name-el for sources.

%prep
%setup -q -n %name-%version%svn_ver_pre

%patch1 -p1
%patch2 -p1
%patch5 -p1
#%patch9
%patch11 -p2
# Note: this patch is required for sisyphus only, but hopefuly it will
# not break build for M24
# TODO: check this patch
#%patch12 -p1
# TODO: check this patch
#%patch13 -p1
#%%patch14 -p1
#patch15 -p1
%patch16 -p1

rm -rf apr apr-util neon

# NOTE: vc-svn.el is developed as part of emacs now but is not included

# into official emacs yet.
# However, subversion includes its own  vc-svn.el which works well
# with older emacs versions

%__cp %SOURCE8 .

%build
CONFIGURE_OPTS="%{subst_enable static} --enable-shared"
CONFIGURE_OPTS="$CONFIGURE_OPTS --with-berkeley-db"
CONFIGURE_OPTS="$CONFIGURE_OPTS --with-neon=%prefix --disable-neon-version-check"
CONFIGURE_OPTS="$CONFIGURE_OPTS --with-apr=%prefix --with-apr-util=%prefix"

%if_with dav
CONFIGURE_OPTS="$CONFIGURE_OPTS --with-apxs=%apache2_apxs"
%endif

%if_with javahl
CONFIGURE_OPTS="$CONFIGURE_OPTS --enable-javahl --with-jdk=/usr/lib/jvm/java --with-jikes=no"
CONFIGURE_OPTS="$CONFIGURE_OPTS --with-junit=/usr/share/java/junit.jar"
%else
CONFIGURE_OPTS="$CONFIGURE_OPTS --disable-javahl"
%endif

%if_with swig_rb
CONFIGURE_OPTS="$CONFIGURE_OPTS --with-ruby-sitelibdir=%ruby_sitelibdir --with-ruby-sitearchdir=%ruby_sitearchdir"
%endif

%add_optflags %optflags_shared

%configure $CONFIGURE_OPTS
%make_build

%if_with svn_push
%make_build contrib/client-side/svn-push/svn-push
%endif

%if_with swig_py
%make_build libdir=%_libdir/libsvn_swig swig_pydir=%python_sitelibdir/libsvn swig_pydir_extra=%python_sitelibdir/svn swig-py
%endif

%if_with swig_pl
%make_build libdir=%_libdir/libsvn_swig swig-pl-lib

SVN_VER_MAJOR=`awk '/^#define SVN_VER_MAJOR/ {print $3}' subversion/include/svn_version.h`
SVN_VER_MINOR=`awk '/^#define SVN_VER_MINOR/ {print $3}' subversion/include/svn_version.h`
SVN_VER_PATCH=`awk '/^#define SVN_VER_PATCH/ {print $3}' subversion/include/svn_version.h`

pushd subversion/bindings/swig/perl/native
# This does not work (libraries are being build with RPATH entries, #9307)
#%%perl_vendor_build all

%__perl Makefile.PL INSTALLDIRS=vendor PREFIX=%_prefix
%__subst 's|^\(LD_RUN_PATH =\).*|\1 %_libdir/libsvn_swig|' Makefile Makefile.[a-z]*
%make_build libdir=%_libdir/libsvn_swig all

subst "s/\$SVN::Core::VERSION = .*/\$SVN::Core::VERSION = '$SVN_VER_MAJOR.$SVN_VER_MINOR.$SVN_VER_PATCH';/" Core.pm

popd
%endif

%if_with swig_rb
%make_build libdir=%_libdir/libsvn_swig swig-rb
%endif

%if_with javahl
%make_build javahl
%endif

%if_with doc
# Build subversion documentation
%make XSL_DIR=/usr/share/xml/docbook/xsl-stylesheets \
   doc-all-html doc-all-info

doxygen doc/doxygen.conf
%endif

%if_with emacs
# Building emacs-subversion files
emacs -batch --eval '(byte-compile-file "contrib/client-side/emacs/vc-svn.el")'
emacs -batch --eval '(byte-compile-file "contrib/client-side/emacs/psvn.el")'
%endif

# Fix paths in scripts

%__subst 's:^\(SVN=\).*:\1%_bindir/svn:' contrib/client-side/asvn
%__subst 's:#!/usr/bin/env python2:#!/usr/bin/env python:' tools/hook-scripts/mailer/mailer.py
%__subst 's:/usr/bin/env python2$:/usr/bin/env python:' tools/hook-scripts/*.py

# Running tests

%if_enabled check

# There is a workaround to run tests in a chrooted environment

# We need to set LD_LIBRARY_PATH to make all tests executed successfuly
PWD=`pwd`
LDLP=`find subversion -type d -name .libs|while read dir; do echo "$PWD/$dir"; done|xargs echo|tr ' ' ':'`

# Perform generic tests against bdb and fsfs

%if_with fsfs_check
LD_LIBRARY_PATH="$LDLP" %make FS_TYPE=fsfs check
%make check-clean
%endif # with fsfs_check

%if_with bdb_check
# HACK: remove repos-test from TEST_PROGRAMS list
buildmk=build-outputs.mk
#mv -f "$buildmk" "$buildmk.bak"
#sed -e 's:^\(TEST_PROGRAMS = .*\)\(subversion/tests/libsvn_repos/repos-test\$(EXEEXT)\)\(.*\):\1\3:' "$buildmk.bak" >"$buildmk"
LD_LIBRARY_PATH="$LDLP" %make FS_TYPE=bdb check
# restore build-outputs.mk
#mv -f "$buildmk.bak" "$buildmk"
%endif # with bdb_check

%if_with swig_pl
%if_with pl_check
# Perform perl bindings tests
# Tests fail, I do not know why

# Temporarily disable 6ra test (it fails)

#mv -f subversion/bindings/swig/perl/native/t/6ra.t subversion/bindings/swig/perl/native/t/6ra.t.bak
LD_LIBRARY_PATH="$LDLP" %make check-swig-pl
%endif # with pl_check
%endif # with swig_pl

%if_with swig_rb
%if_with rb_check
# Perform ruby bindings tests
LD_LIBRARY_PATH="$LDLP" %make check-swig-rb
%endif # with rb_check
%endif #with swig_rb

# Perform JavaHL tests

%if_with javahl
%if_with javahl_check
%make JAVA_CLASSPATH=%_javadir/junit.jar javahl-tests
LD_LIBRARY_PATH="$LDLP" %make JAVA_CLASSPATH=%_javadir/junit.jar check-javahl
%endif # with javahl_check
%endif # with javahl

%endif # enabled check

%install
# Setting to relaxed untill #9307 resolved
# The following dependecies where found before 'relaxed':
#   perl(File/Temp.pm)
#   perl(IO/Handle.pm)
#   perl(Symbol.pm)
#   perl(overload.pm)
#   perl(warnings.pm)
%set_perl_req_method relaxed

%make_install DESTDIR=%buildroot INSTALL_LOCALE='install -p -m644 -D' install
%__mkdir -p %buildroot%_sysconfdir/%name
%__tar xf %SOURCE2 -C %buildroot%_sysconfdir/%name

use_svnwrapper()
{
local destbindir=%buildroot%_bindir
local target=$1
local suffix=".bin"
local wrappername="svnwrapper"
%__mv "$destbindir/$target" "$destbindir/$target$suffix"
%__ln_s "$wrappername" "$destbindir/$target"
}

# Installing svnwrapper

%__cp %SOURCE6 %buildroot%_bindir
# Making svnserve to use svnwrapper
# Do not forget to update %%files section if using wrappers for other binaries
use_svnwrapper svnserve
#use_svnwrapper svn
#use_svnwrapper svnadmin

%if_with svn_push
%__install -m 755 contrib/client-side/svn-push/.libs/svn-push %buildroot%_bindir
%endif

# Create directory for libsvn_swig libraries

mkdir -p %buildroot%_libdir/libsvn_swig

%if_with swig_py
%make_install DESTDIR=%buildroot swig_py_libdir=%_libdir/libsvn_swig \
   swig_pydir=%python_sitelibdir/libsvn swig_pydir_extra=%python_sitelibdir/svn install-swig-py
rm -f %buildroot%_libdir/libsvn_swig/libsvn_swig_py*.la
#%__install -d %buildroot%python_sitelibdir
#%__rm -f %buildroot%_libdir/svn-python/libsvn/*.a %buildroot%_libdir/svn-python/libsvn/*.la
#%__mv %buildroot%_libdir/svn-python/libsvn %buildroot%python_sitelibdir
#%__rm -rf %buildroot%_libdir/svn-python
%__cp -r %_builddir/%buildsubdir/subversion/bindings/swig/python/svn %buildroot%python_sitelibdir
%endif

%if_with swig_pl
%make_install DESTDIR=%buildroot PREFIX=%_prefix swig_pl_libdir=%_libdir/libsvn_swig install-swig-pl
#%make_install DESTDIR=%buildroot swig_pl_libdir=%_libdir/libsvn_swig install-swig-pl-lib
#pushd subversion/bindings/swig/perl/native
#%make_install DESTDIR=%buildroot PREFIX=%_prefix install
##%%perl_vendor_install
#popd
rm -f %buildroot%perl_vendor_man3dir/SVN::*3*
rm -f %buildroot%_libdir/libsvn_swig/libsvn_swig_pl*.la
%endif

%if_with swig_rb
%make_install DESTDIR=%buildroot swig_rb_libdir=%_libdir/libsvn_swig install-swig-rb
rm -f %buildroot%ruby_sitearchdir/svn/ext/*.la
rm -f %buildroot%_libdir/libsvn_swig/libsvn_swig_ruby*.la
%endif

%if_with swig_java
%make_install DESTDIR=%buildroot install-swig-java
%endif

# Installing javahl bindings

%if_with javahl
%make_install DESTDIR=%buildroot \
javahl_javadir=%_javadir javahl_javahdir=%_includedir/svn-javahl \
install-javahl
%endif

%if_with emacs
# Installing emacs-subversion files
%__mkdir -p %buildroot%_emacslispdir/%name
%__install -m 644 contrib/client-side/emacs/vc-svn.el* %buildroot%_emacslispdir/%name
%__install -m 644 contrib/client-side/emacs/psvn.el* %buildroot%_emacslispdir/%name
%__mkdir -p %buildroot%_sysconfdir/emacs/site-start.d
%__install -m 644 %SOURCE1 %buildroot%_sysconfdir/emacs/site-start.d
%endif

%define docdir %_docdir/%name-%version
%__rm -rf %buildroot%docdir
%__mkdir_p %buildroot%docdir
%__install -p -m644 BUGS CHANGES COMMITTERS COPYING HACKING INSTALL README \
%buildroot%docdir/
%if_with doc
# Installing subversion-doc files
%make_install DESTDIR=%buildroot install-docs
#%make_install XSL_DIR=/usr/share/xml/docbook/xsl-stylesheets \
#    INSTALL_DIR=%buildroot%docdir/doc/book \
#    -C doc/book install-misc-html
%make_install INSTALL_DIR=%buildroot%docdir/ -C ./doc install-misc-html

%__mkdir -p %buildroot%docdir/book/
#%__bzip2 -qc9 doc/book/book/book.ps >%buildroot%docdir/doc/book/book.ps.bz2
# TODO: svn-book.{pdf,html} temporary disabled (Hope, until release)
#%__install -p -m644 doc/book/svn-book.pdf %buildroot%docdir/book/
#%__install -p -m644 doc/book/svn-book.html %buildroot%docdir/book/
%__cp -r doc/user %buildroot%docdir/
%__cp doc/README %buildroot%docdir/DOCS.README
%__mkdir -p %buildroot%docdir/programmer/design
%__install -m644 doc/programmer/*.txt %buildroot%docdir/programmer/
%__install -m644 doc/programmer/design/*.html %buildroot%docdir/programmer/design/
#%__cp -r doc/translations %buildroot%docdir/

%__install -m644 doc/programmer/design/*.info* %buildroot%_infodir/

# Install API docs

#%__mkdir %buildroot%docdir/api
%__cp -r doc/doxygen/html/ %buildroot%docdir/api
%endif

%if_with server
# Installing subversion-server files
%__mkdir_p %buildroot%svn_repo_dir
%__mkdir_p %buildroot%_sysconfdir/rc.d/init.d %buildroot%_sysconfdir/sysconfig
%__install -m 755 %SOURCE3 %buildroot%_sysconfdir/rc.d/init.d/%svn_service
%__install -m 644 %SOURCE4 %buildroot%_sysconfdir/sysconfig/%svn_service

%if_with dav
install -d -m 755 -- %buildroot%apache2_mods_available
install -d -m 755 -- %buildroot%apache2_mods_start
install -p -m 644 -- %SOURCE9 %buildroot%apache2_mods_available/%module_name.load
install -p -m 644 -- %SOURCE5 %buildroot%apache2_mods_available/%module_name.conf
subst 's, at a_libexecdir at ,%apache2_libexecdir,g' %buildroot%apache2_mods_available/%module_name.load
install -p -m 644 -- %SOURCE10 %buildroot%apache2_mods_start/100-%module_name.conf

%endif
%endif

# Installing subversion-tools files

%if_with oldtoolsinstall
%__mkdir -p %buildroot%_svn_tools_dir/hook-scripts
%__mkdir -p %buildroot%_defaultdocdir/%name-tools-%version/hook-scripts
%__install -m 755 tools/backup/hot-backup.py %buildroot%_svn_tools_bindir/
%__cp -r tools/client-side/* %buildroot%_svn_tools_bindir/
%__mv -f %buildroot%_svn_tools_dir/bash_completion_test %buildroot%_defaultdocdir/%name-tools-%version/
%__cp tools/hook-scripts/*.pl tools/hook-scripts/*.py tools/hook-scripts/mailer/*.py \
%buildroot%_svn_tools_dir/hook-scripts/
# commit-access-control.pl has unresolved dependencies
%__mv -f -- %buildroot%_svn_tools_dir/hook-scripts/commit-access-control.pl %buildroot%_defaultdocdir/%name-tools-%version/hook-scripts/
%__cp tools/hook-scripts/README tools/hook-scripts/*.example tools/hook-scripts/mailer/*.example \
%buildroot%_defaultdocdir/%name-tools-%version/hook-scripts/
%__cp -r tools/examples %buildroot%_defaultdocdir/%name-tools-%version/
#%__cp -r tools/dev %buildroot%_svn_tools_dir/
%__cp tools/xslt/svnindex.* %buildroot%_svn_tools_dir/
%__cp -r contrib/client-side/{asvn,*.pl,wcgrep} %buildroot%_svn_tools_dir/
%__cp -r contrib/client-side/{*.vim,*.README,*.example} \
%buildroot%_defaultdocdir/%name-tools-%version/
%else
%make_install -f Makefile-tools DESTDIR=%buildroot bindir=%_bindir \
docdir=%_defaultdocdir/%name-tools-%version \
toolsdir=%_svn_tools_dir
# commit-access-control.pl has unresolved dependencies
%__mv -f -- %buildroot%_svn_tools_dir/hook-scripts/commit-access-control.pl %buildroot%_defaultdocdir/%name-tools-%version/hook-scripts/
%endif

# Installing bash-completion file

%__mkdir -p %buildroot/etc/bash_completion.d
%__install -m 644 tools/client-side/bash_completion %buildroot/etc/bash_completion.d/svn

%find_lang %name

%post doc
%install_info svn-design.info

%preun doc
%uninstall_info svn-design.info

%pre server-common
/usr/sbin/groupadd -r -f %svn_group
/usr/sbin/useradd -r -g %svn_group -d %svn_repo_dir -s /dev/null -c 'Subversion' %svn_user >/dev/null 2>&1 ||:
if [ $1 -gt 1 ]; then
/usr/sbin/usermod -d %svn_repo_dir %svn_user
fi

%post server-standalone
%post_service %svn_service

%preun server-standalone
%preun_service %svn_service

%if_with dav
%post server-dav
# Reconfigure Apache2:
%apache2_sbindir/a2chkconfig ||:

if [ -e %apache2_mods_enabled/%module_name.load ]; then
   CONF_OK=0
   %apache2_sbindir/apachectl2 configtest && CONF_OK=1 ||:
   if [ "$CONF_OK" = "1" ]; then
       service %apache2_dname condrestart ||:
   else
       echo "Some errors detected in Apache2 configuration!"
       echo "To use %modname check configuration and start %apache2_dname service."
   echo
   fi
else
   echo "Apache2 %modname module had been installed, but does't enabled."
   echo "Check %apache2_mods_start directory for files with '%module_name=no' lines."
   echo
fi

%preun server-dav
if [ "$1" = "0" ] ; then # last uninstall
   [ -e %apache2_mods_enabled/%module_name.load ] && %apache2_sbindir/a2dismod %module_name 2>&1 >/dev/null ||:
fi


%postun server-dav
# Reconfigure Apache2:
%apache2_sbindir/a2chkconfig ||:
if [ "$1" = "0" ] ; then # last uninstall
   CONF_OK=0
   %apache2_sbindir/apachectl2 configtest && CONF_OK=1 ||:
   if [ "$CONF_OK" = "1" ]; then
service %apache2_dname condrestart ||:
   else
       echo "Some errors detected in Apache2 configuration!"
echo "To complete %module_name uninstalling check configuration and restart %apache2_dname service."
echo
   fi
fi
%endif

%files -f %name.lang
%dir %_sysconfdir/%name
%config(noreplace) %_sysconfdir/%name/config
%config(noreplace) %_sysconfdir/%name/servers
%_sysconfdir/%name/README.txt
%_bindir/svn
%_bindir/svnversion
%_bindir/svnsync
%_mandir/man1/svn.1.*
%_mandir/man1/svnversion.1.*
%_mandir/man1/svnsync.1.*
%dir %docdir
%docdir/[A-Z]*

%files -n lib%name
%_libdir/libsvn_*-*.so.*
%dir %_libdir/libsvn_swig
#%exclude %_libdir/libsvn_swig_py*.so.*
#%exclude %_libdir/libsvn_swig_perl*.so.*
#%exclude %_libdir/libsvn_swig_ruby*.so.*

%files -n lib%name-devel
%_libdir/libsvn_*-*.so
%_includedir/%name-1
%exclude %_libdir/libsvn_swig*

%if_enabled static
%files -n lib%name-devel-static
%_libdir/libsvn_*.a
%endif

%if_with swig_py
%files python
%_libdir/libsvn_swig/libsvn_swig_py*.so.*
%python_sitelibdir/svn
%python_sitelibdir/libsvn
%endif

%if_with swig_pl
%files perl
%_libdir/libsvn_swig/libsvn_swig_perl*.so.*
%perl_vendor_archlib/SVN
%perl_vendor_autolib/SVN
#%perl_vendor_man3dir/SVN*
%endif

%if_with swig_rb
%files ruby
%_libdir/libsvn_swig/libsvn_swig_ruby*.so.*
%dir %ruby_sitelibdir/svn/
%ruby_sitelibdir/svn/*.rb
%dir %ruby_sitearchdir/svn/
%dir %ruby_sitearchdir/svn/ext/
%ruby_sitearchdir/svn/ext/*.so
%endif

%if_with swig-java
%files java
%endif

%if_with javahl
%files javahl
%_libdir/libsvnjavahl*.so*
%_javadir/svn-javahl.jar
%endif

%if_with emacs
%files -n emacs-%name
%_sysconfdir/emacs/site-start.d/*.el
%dir %_emacslispdir/%name
%_emacslispdir/%name/*.elc

%files -n emacs-%name-el
%_emacslispdir/%name/*.el
%endif

%if_with doc
%files doc
%_infodir/svn-design*
%docdir/DOCS.README
%docdir/book
%docdir/misc-docs
%docdir/programmer
%docdir/user
%docdir/api
%endif

%if_with server
%files server-common
%_bindir/svnserve*
%_bindir/svnadmin
%_bindir/svnlook
%_bindir/svndumpfilter
%_bindir/svnwrapper
%_mandir/man1/svnadmin.1.*
%_mandir/man1/svnlook.1.*
%_mandir/man1/svndumpfilter.1.*
%_mandir/man5/svnserve.conf.5.*
%_mandir/man8/svnserve.8.*
%defattr(640,%svn_user,%svn_group,2710)
%dir %svn_repo_dir

%files server-standalone
%_sysconfdir/rc.d/init.d/%svn_service
%config(noreplace) %_sysconfdir/sysconfig/%svn_service

%if_with dav
%files server-dav
%apache2_libexecdir/*.so
%config(noreplace) %apache2_mods_available/%module_name.conf
%config            %apache2_mods_available/%module_name.load
%config            %apache2_mods_start/100-%module_name.conf
%endif
%endif

%files tools -f %name-tools.list
%_svn_tools_dir
%_defaultdocdir/%name-tools-%version
%if_with svn_push
%_bindir/svn-push
%endif

%files -n bash-completion-svn
/etc/bash_completion.d/*

%changelog

Full changelog you can see here

 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin