diff -r fcb5600be81f -r 138803117c57 subversion/subversion.spec --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/subversion/subversion.spec Fri Aug 10 14:34:00 2012 +0200 @@ -0,0 +1,238 @@ +## +## subversion.spec -- OpenPKG RPM Package Specification +## Copyright (c) 2000-2012 OpenPKG Foundation e.V. +## +## 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.7.5 +%define V_opkg 1.7.5 +%define V_book_html 20120518 +%define V_book_pdf 20120518 + +# package information +Name: subversion +Summary: Subversion Source Revision Control System +URL: http://subversion.apache.org/ +Vendor: Apache Software Foundation +Packager: OpenPKG Foundation e.V. +Distribution: OpenPKG Community +Class: BASE +Group: SCM +License: Apache/BSD +Version: %{V_opkg} +Release: 20120714 + +# package options +%option with_fsl yes +%option with_db no +%option with_sasl no + +# list of sources +Source0: http://www.apache.org/dist/subversion/subversion-%{V_dist}.tar.bz2 +Source1: http://download.openpkg.org/components/versioned/subversion/svn-book-%{V_book_html}.html +Source2: http://download.openpkg.org/components/versioned/subversion/svn-book-%{V_book_pdf}.pdf +Source3: subversion.config +Source4: subversion.servers +Source5: rc.subversion +Source6: fsl.subversion +Patch0: subversion.patch + +# build information +BuildPreReq: OpenPKG, openpkg >= 20100101, make, libtool, sed, pkgconfig +PreReq: OpenPKG, openpkg >= 20100101 +BuildPreReq: diffutils, openssl, zlib, libiconv, expat, serf, neon, apr, sqlite +PreReq: diffutils, openssl, zlib, libiconv, expat, serf, neon, apr, sqlite +%if "%{with_fsl}" == "yes" +BuildPreReq: fsl +PreReq: fsl +%endif +%if "%{with_db}" == "yes" +BuildPreReq: db +PreReq: db +%endif +%if "%{with_sasl}" == "yes" +BuildPreReq: sasl +PreReq: sasl +%endif + +%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.apache.org/download/ + regex = subversion-(\d+\.\d+.\d+)\.tar\.bz2 + } + +%prep + %setup -q + %patch -p0 + + # 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 + +%build + # configure package + CC="%{l_cc}" \ + CFLAGS="%{l_cflags -O}" \ + CPPFLAGS="%{l_cppflags libxml2 .} -DSQLITE_THREADSAFE=1" \ +%if "%{with_sasl}" == "yes" && "%{with_db}" == "yes" + LDFLAGS="%{l_ldflags} `pkg-config db sasl --libs-only-L` %{l_fsl_ldflags}" \ + LIBS="`pkg-config db sasl --libs-only-l` -lz %{l_fsl_libs}" \ +%else +%if "%{with_sasl}" == "yes" + LDFLAGS="%{l_ldflags} `pkg-config sasl --libs-only-L` %{l_fsl_ldflags}" \ + LIBS="`pkg-config sasl --libs-only-l` `pkg-config apr-util-1 --libs-only-l` -lz %{l_fsl_libs}" \ +%else + LDFLAGS="%{l_ldflags} %{l_fsl_ldflags}" \ + LIBS="`pkg-config apr-util-1 --libs-only-l` -lz %{l_fsl_libs}" \ +%endif +%endif + CONFIG_SHELL="%{l_bash}" \ + ./configure \ + --prefix=%{l_prefix} \ + --mandir=%{l_prefix}/man \ +%if "%{with_db}" == "yes" + --with-berkeley-db="db.h:%{l_prefix}/include:%{l_prefix}/lib:db" \ +%else + --without-berkeley-db \ +%endif + --with-sqlite=%{l_prefix} \ + --with-ssl=openssl \ + --with-zlib=%{l_prefix} \ + --with-apr=%{l_prefix} \ + --with-apr-util=%{l_prefix} \ + --with-neon=%{l_prefix} \ + --with-serf=%{l_prefix} \ +%if "%{with_sasl}" == "yes" + --with-sasl \ +%else + --without-sasl \ +%endif + --without-gssapi \ + --without-apxs \ + --disable-nls \ + --disable-shared \ + --enable-static + + # build package + %{l_make} %{l_mflags} + +%install + # install package + %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT + + # strip down installation + rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/*.exp + 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-1 + strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true + + # 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 %{l_value -s -a} \ + %{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 + + # 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/ + + # install OSSP fsl configuration + %{l_shtool} mkdir -f -p -m 755 \ + $RPM_BUILD_ROOT%{l_prefix}/etc/fsl + %{l_shtool} install -c -m 644 %{l_value -s -a} \ + %{SOURCE fsl.subversion} \ + $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/ + + # 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/*' \ + '%config %{l_prefix}/etc/fsl/fsl.subversion' \ + '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/subversion' \ + '%doc %{l_prefix}/share/subversion/svn-book.*' + +%files -f files + +%clean + +%post + # create default repository + if [ ! -d $RPM_INSTALL_PREFIX/var/subversion/default ]; then + su - %{l_rusr} -c \ + "$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 +