| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366 |
- ##
- ## subversion.spec -- OpenPKG RPM Package Specification
- ## Copyright (c) 2000-2006 OpenPKG Foundation e.V. <http://openpkg.net/>
- ## Copyright (c) 2000-2006 Ralf S. Engelschall <http://engelschall.com/>
- ##
- ## Permission to use, copy, modify, and distribute this software for
- ## any purpose with or without fee is hereby granted, provided that
- ## the above copyright notice and this permission notice appear in all
- ## copies.
- ##
- ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
- ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- ## SUCH DAMAGE.
- ##
- # package version
- %define V_dist 1.4.0
- %define V_opkg 1.4.0
- %define V_cvs2svn 1.4.0
- %define V_svn2cvs 20060127
- %define V_book_html 20060912
- %define V_book_pdf 20060912
- # package information
- Name: subversion
- Summary: Source Revision Control System
- URL: http://subversion.tigris.org/
- Vendor: Tigris
- Packager: OpenPKG
- Distribution: OpenPKG
- Class: BASE
- Group: SCM
- License: Apache/BSD
- Version: %{V_opkg}
- Release: 20061004
- # package options
- %option with_cvs2svn no
- %option with_svn2cvs no
- %option with_perl no
- %option with_python no
- %option with_ruby no
- # list of sources
- Source0: http://subversion.tigris.org/downloads/subversion-%{V_dist}.tar.gz
- Source1: http://subversion.tigris.org/downloads/subversion-deps-%{V_dist}.tar.gz
- Source2: ftp://ftp.openpkg.org/sources/CPY/subversion/cvs2svn-%{V_cvs2svn}.tar.gz
- Source3: ftp://ftp.openpkg.org/sources/CPY/subversion/svn2cvs.pl-%{V_svn2cvs}
- Source4: ftp://ftp.openpkg.org/sources/CPY/subversion/svn-book-%{V_book_html}.html
- Source5: ftp://ftp.openpkg.org/sources/CPY/subversion/svn-book-%{V_book_pdf}.pdf
- Source6: subversion.config
- Source7: subversion.servers
- Source8: rc.subversion
- Patch0: subversion.patch
- # build information
- Prefix: %{l_prefix}
- BuildRoot: %{l_buildroot}
- BuildPreReq: OpenPKG, openpkg >= 20060823, make, libtool, sed, pkgconfig
- PreReq: OpenPKG, openpkg >= 20060823
- BuildPreReq: diffutils, libxml, db >= 4.4.20.4-20060918, openssl, zlib, libiconv
- PreReq: diffutils, libxml, db >= 4.4.20.4-20060918, openssl, zlib, libiconv
- %if "%{with_cvs2svn}" == "yes"
- PreReq: rcs, python, python::with_dbm = yes
- %endif
- %if "%{with_svn2cvs}" == "yes"
- BuildPreReq: perl
- PreReq: perl, perl-xml, cvs, rcs
- %endif
- %if "%{with_perl}" == "yes" || "%{with_python}" == "yes"
- BuildPreReq: swig
- %endif
- %if "%{with_perl}" == "yes"
- BuildPreReq: perl, perl-openpkg
- PreReq: perl
- %endif
- %if "%{with_python}" == "yes"
- BuildPreReq: python, swig
- PreReq: python
- %endif
- %if "%{with_ruby}" == "yes"
- BuildPreReq: ruby
- PreReq: ruby
- %endif
- AutoReq: no
- AutoReqProv: no
- %description
- Subversion is a modern Version Control System (VCS) providing most
- current CVS features, versioned directories/renames/meta-data,
- atomic commits, cheap branching and tagging, native client/server
- architecture, and the choice of database or plain-file repository
- implementations.
- %track
- prog subversion = {
- version = %{V_dist}
- url = http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=260
- regex = subversion-(\d+\.\d+\.\d+)\.tar\.gz
- }
- prog subversion:cvs2svn = {
- version = %{V_cvs2svn}
- url = ftp://ftp.openpkg.org/sources/CPY/subversion/
- regex = cvs2svn-(__VER__)\.tar\.gz
- }
- prog subversion:svn2cvs = {
- version = %{V_svn2cvs}
- url = ftp://ftp.openpkg.org/sources/CPY/subversion/
- regex = svn2cvs.pl-(__VER__)
- }
- %prep
- %setup -q
- %setup -q -T -D -b 1
- %setup -q -T -D -a 2
- cp %{SOURCE svn2cvs.pl-%{V_svn2cvs}} svn2cvs.pl
- %patch -p0
- # substitute path from applied patch
- %{l_shtool} subst %{l_value -s -a} \
- subversion/bindings/swig/perl/native/Makefile.PL.in
- # patch: correctly pass --disable-shared to sub-directories
- %{l_shtool} subst \
- -e 's;\($ac_abs_srcdir/configure $ac_configure_args\);\1 --disable-shared;' \
- configure
- # patch: adjust path to configuration directory
- %{l_shtool} subst \
- -e 's;/etc/subversion;%{l_prefix}/etc/subversion;g' \
- subversion/libsvn_subr/config_impl.h \
- subversion/libsvn_subr/config_file.c
- # patch: fix installation of APR
- %{l_shtool} subst \
- -e '/^<Layout apr>/,/<\/Layout>/{ s!\(^[ ]*prefix:\).*$!\1 %{l_prefix}!; s!\(^[ ]*sysconfdir:\).*$!\1 %{l_prefix}/etc/subversion!; }' \
- apr/config.layout \
- apr-util/config.layout
- %build
- # configure package
- CC="%{l_cc}" \
- CFLAGS="%{l_cflags -O}" \
- CPPFLAGS="%{l_cppflags libxml2 .}" \
- LDFLAGS="%{l_ldflags} `pkg-config db --libs-only-L`" \
- LIBS="`pkg-config db --libs-only-l`" \
- CONFIG_SHELL="%{l_bash}" \
- ./configure \
- --prefix=%{l_prefix} \
- --with-berkeley-db=%{l_prefix} \
- --with-dbm=db44 \
- --with-ssl=openssl \
- --with-zlib \
- --without-gssapi \
- --with-libxml2 \
- --enable-static \
- %if "%{with_perl}" == "yes" || "%{with_python}" == "yes"
- --with-swig=%{l_prefix}/bin/swig \
- %endif
- %if "%{with_perl}" == "yes"
- --with-perl=%{l_prefix}/bin/perl \
- %endif
- %if "%{with_python}" == "yes"
- --with-python=%{l_prefix}/bin/python \
- %endif
- %if "%{with_ruby}" == "yes"
- --with-ruby=%{l_prefix}/bin/ruby \
- %endif
- --disable-nls \
- --disable-shared \
- --without-apxs
- # build package
- %{l_make} %{l_mflags}
- # build Perl bindings
- %if "%{with_perl}" == "yes"
- ( cd apr; ln -s .libs/libapr-0.a . ) || exit $?
- ( cd apr-util; ln -s .libs/libaprutil-0.a . ) || exit $?
- %{l_make} %{l_mflags} swig-pl
- %endif
- # build Python bindings
- %if "%{with_python}" == "yes"
- %{l_make} %{l_mflags} swig-py
- %endif
- # build Ruby bindings
- %if "%{with_ruby}" == "yes"
- %{l_make} %{l_mflags} swig-rb
- %endif
- %install
- # install package
- rm -rf $RPM_BUILD_ROOT
- %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
- # install Perl bindings
- %if "%{with_perl}" == "yes"
- %{l_make} %{l_mflags} install-swig-pl DESTDIR=$RPM_BUILD_ROOT
- %{l_prefix}/bin/perl-openpkg -F- fixate >/dev/null
- rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/libsvn_swig_perl*
- %endif
- # install Python bindings
- %if "%{with_python}" == "yes"
- %{l_make} %{l_mflags} install-swig-py DESTDIR=$RPM_BUILD_ROOT
- rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/libsvn_swig_py*
- rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/svn-python/libsvn/_*.a
- rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/svn-python/libsvn/_*.la
- mv $RPM_BUILD_ROOT%{l_prefix}/lib/svn-python \
- $RPM_BUILD_ROOT%{l_prefix}/lib/python
- %endif
- # install Ruby bindings
- %if "%{with_ruby}" == "yes"
- %{l_make} %{l_mflags} install-swig-rb DESTDIR=$RPM_BUILD_ROOT
- rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/libsvn_swig_ruby*
- %endif
- # adjust APR installation for SVN local namespace
- ( cd $RPM_BUILD_ROOT%{l_prefix}/include/apr-0
- for i in *; do
- mv $i ../subversion-1/svn_$i
- done
- ) || exit $?
- %{l_shtool} subst \
- -e 's;^\(#include <\)\(apr.*\)$;\1svn_\2;' \
- $RPM_BUILD_ROOT/%{l_prefix}/include/subversion-1/svn*.h
- ( cd $RPM_BUILD_ROOT%{l_prefix}/lib
- for i in libapr*; do
- mv $i `echo "$i" | sed -e 's;^libapr\(.*\)$;libsvn_apr\1;'`
- done
- ) || exit $?
- # strip down installation
- rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/apr-config
- rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/apr.exp
- rm -rf $RPM_BUILD_ROOT%{l_prefix}/libexec/subversion/neon
- rmdir $RPM_BUILD_ROOT%{l_prefix}/libexec/subversion >/dev/null 2>&1 || true
- rm -rf $RPM_BUILD_ROOT%{l_prefix}/include/apr-0
- rm -f $RPM_BUILD_ROOT%{l_prefix}/include/subversion-1/svn-revision.txt
- rm -f $RPM_BUILD_ROOT%{l_prefix}/include/subversion-1/mod_dav_svn.h
- rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/doc
- rm -rf $RPM_BUILD_ROOT%{l_prefix}/build
- rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/neon*
- strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
- # install svn_load_dirs(1) tool
- %{l_shtool} install -c -m 755 \
- -e 's;#!/usr/bin/perl;#!%{l_prefix}/bin/perl;' \
- contrib/client-side/svn_load_dirs.pl \
- $RPM_BUILD_ROOT%{l_prefix}/bin/svn_load_dirs
- # install Subversion default global configuration files
- %{l_shtool} mkdir -f -p -m 755 \
- $RPM_BUILD_ROOT%{l_prefix}/etc/subversion
- %{l_shtool} install -c -m 644 \
- %{SOURCE subversion.config} \
- $RPM_BUILD_ROOT%{l_prefix}/etc/subversion/config
- %{l_shtool} install -c -m 644 \
- %{SOURCE subversion.servers} \
- $RPM_BUILD_ROOT%{l_prefix}/etc/subversion/servers
- # install Subversion Bash command completion
- %{l_shtool} install -c -m 644 \
- tools/client-side/bash_completion \
- $RPM_BUILD_ROOT%{l_prefix}/etc/subversion/bashrc
- # install Subversion book
- %{l_shtool} mkdir -f -p -m 755 \
- $RPM_BUILD_ROOT%{l_prefix}/share/subversion
- %{l_shtool} install -c -m 644 \
- %{SOURCE svn-book-%{V_book_pdf}.pdf} \
- $RPM_BUILD_ROOT%{l_prefix}/share/subversion/svn-book.pdf
- %{l_shtool} install -c -m 644 \
- %{SOURCE svn-book-%{V_book_html}.html} \
- $RPM_BUILD_ROOT%{l_prefix}/share/subversion/svn-book.html
- %if "%{with_cvs2svn}" == "yes"
- # install cvs2svn(1) tool
- ( cd cvs2svn-%{V_cvs2svn}
- %{l_shtool} mkdir -f -p -m 755 \
- $RPM_BUILD_ROOT%{l_prefix}/libexec/subversion/cvs2svn/cvs2svn_rcsparse \
- $RPM_BUILD_ROOT%{l_prefix}/libexec/subversion/cvs2svn/cvs2svn_lib
- ( echo "#!/bin/sh"
- echo "PYTHONPATH=\"%{l_prefix}/libexec/subversion/cvs2svn\""
- echo "export PYTHONPATH"
- echo "%{l_prefix}/bin/python %{l_prefix}/libexec/subversion/cvs2svn/cvs2svn \${1+\"\$@\"}"
- ) >cvs2svn.sh
- %{l_shtool} install -c -m 755 \
- cvs2svn.sh $RPM_BUILD_ROOT%{l_prefix}/bin/cvs2svn
- %{l_shtool} install -c -m 644 \
- cvs2svn.1 $RPM_BUILD_ROOT%{l_prefix}/man/man1/
- %{l_shtool} install -c -m 644 \
- cvs2svn $RPM_BUILD_ROOT%{l_prefix}/libexec/subversion/cvs2svn/
- %{l_shtool} install -c -m 644 \
- cvs2svn_rcsparse/*.py \
- $RPM_BUILD_ROOT%{l_prefix}/libexec/subversion/cvs2svn/cvs2svn_rcsparse/
- %{l_shtool} install -c -m 644 \
- cvs2svn_lib/*.py \
- $RPM_BUILD_ROOT%{l_prefix}/libexec/subversion/cvs2svn/cvs2svn_lib/
- ) || exit $?
- %endif
- %if "%{with_svn2cvs}" == "yes"
- # install svn2cvs(1) tool
- %{l_shtool} install -c -m 755 \
- -e 's;#!/usr/bin/perl;#!%{l_prefix}/bin/perl;' \
- svn2cvs.pl $RPM_BUILD_ROOT%{l_prefix}/bin/svn2cvs
- %{l_prefix}/bin/pod2man svn2cvs.pl >svn2cvs.1
- %{l_shtool} install -c -m 644 \
- svn2cvs.1 $RPM_BUILD_ROOT%{l_prefix}/man/man1/svn2cvs.1
- %endif
- # install run-command script
- %{l_shtool} mkdir -f -p -m 755 \
- $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
- %{l_shtool} install -c -m 755 %{l_value -s -a} \
- %{SOURCE rc.subversion} \
- $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
- # create directory for default repository and svnserve pidfile
- %{l_shtool} mkdir -f -p -m 755 \
- $RPM_BUILD_ROOT%{l_prefix}/var/subversion
- # determine installation files
- %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
- %{l_files_std} \
- '%config %{l_prefix}/etc/subversion/*' \
- '%doc %{l_prefix}/share/subversion/svn-book.*'
- %files -f files
- %clean
- rm -rf $RPM_BUILD_ROOT
- %post
- # create default repository
- if [ ! -d $RPM_INSTALL_PREFIX/var/subversion/default ]; then
- $RPM_INSTALL_PREFIX/bin/svnadmin create \
- $RPM_INSTALL_PREFIX/var/subversion/default
- fi
- # after upgrade, restart service
- [ $1 -eq 2 ] || exit 0
- eval `%{l_rc} subversion status 2>/dev/null`
- [ ".$subversion_active" = .yes ] && %{l_rc} subversion restart
- exit 0
- %preun
- # before erase, stop service
- [ $1 -eq 0 ] || exit 0
- %{l_rc} subversion stop 2>/dev/null
- exit 0
|