michael@513: ## michael@513: ## subversion.spec -- OpenPKG RPM Package Specification michael@513: ## Copyright (c) 2000-2012 OpenPKG Foundation e.V. michael@513: ## michael@513: ## Permission to use, copy, modify, and distribute this software for michael@513: ## any purpose with or without fee is hereby granted, provided that michael@513: ## the above copyright notice and this permission notice appear in all michael@513: ## copies. michael@513: ## michael@513: ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED michael@513: ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF michael@513: ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. michael@513: ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR michael@513: ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, michael@513: ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT michael@513: ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF michael@513: ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND michael@513: ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, michael@513: ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT michael@513: ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF michael@513: ## SUCH DAMAGE. michael@513: ## michael@513: michael@513: # package version michael@513: %define V_dist 1.7.5 michael@513: %define V_opkg 1.7.5 michael@513: %define V_book_html 20120518 michael@513: %define V_book_pdf 20120518 michael@513: michael@513: # package information michael@513: Name: subversion michael@513: Summary: Subversion Source Revision Control System michael@513: URL: http://subversion.apache.org/ michael@513: Vendor: Apache Software Foundation michael@513: Packager: OpenPKG Foundation e.V. michael@513: Distribution: OpenPKG Community michael@513: Class: BASE michael@513: Group: SCM michael@513: License: Apache/BSD michael@513: Version: %{V_opkg} michael@514: Release: 20120800 michael@513: michael@513: # package options michael@513: %option with_fsl yes michael@513: %option with_db no michael@513: %option with_sasl no michael@513: michael@513: # list of sources michael@513: Source0: http://www.apache.org/dist/subversion/subversion-%{V_dist}.tar.bz2 michael@513: Source1: http://download.openpkg.org/components/versioned/subversion/svn-book-%{V_book_html}.html michael@513: Source2: http://download.openpkg.org/components/versioned/subversion/svn-book-%{V_book_pdf}.pdf michael@513: Source3: subversion.config michael@513: Source4: subversion.servers michael@513: Source5: rc.subversion michael@513: Source6: fsl.subversion michael@513: Patch0: subversion.patch michael@513: michael@513: # build information michael@513: BuildPreReq: OpenPKG, openpkg >= 20100101, make, libtool, sed, pkgconfig michael@513: PreReq: OpenPKG, openpkg >= 20100101 michael@513: BuildPreReq: diffutils, openssl, zlib, libiconv, expat, serf, neon, apr, sqlite michael@513: PreReq: diffutils, openssl, zlib, libiconv, expat, serf, neon, apr, sqlite michael@513: %if "%{with_fsl}" == "yes" michael@513: BuildPreReq: fsl michael@513: PreReq: fsl michael@513: %endif michael@513: %if "%{with_db}" == "yes" michael@513: BuildPreReq: db michael@513: PreReq: db michael@513: %endif michael@513: %if "%{with_sasl}" == "yes" michael@513: BuildPreReq: sasl michael@513: PreReq: sasl michael@513: %endif michael@513: michael@513: %description michael@513: Subversion is a modern Version Control System (VCS) providing most michael@513: current CVS features, versioned directories/renames/meta-data, michael@513: atomic commits, cheap branching and tagging, native client/server michael@513: architecture, and the choice of database or plain-file repository michael@513: implementations. michael@513: michael@513: %track michael@513: prog subversion = { michael@513: version = %{V_dist} michael@513: url = http://subversion.apache.org/download/ michael@513: regex = subversion-(\d+\.\d+.\d+)\.tar\.bz2 michael@513: } michael@513: michael@513: %prep michael@513: %setup -q michael@513: %patch -p0 michael@513: michael@513: # patch: correctly pass --disable-shared to sub-directories michael@513: %{l_shtool} subst \ michael@514: -e 's;\(\$ac_abs_srcdir/configure \$ac_configure_args\);\1 --disable-shared;' \ michael@513: configure michael@513: michael@514: # patch: accommodate defective sqlite3_close(3) test from configure michael@514: %{l_shtool} subst \ michael@514: -e 's;\(SVN_SQLITE_INCLUDES *= *\).*;\1`pkg-config --cflags-only-I sqlite3`;' \ michael@514: -e 's;\(SVN_SQLITE_LIBS *= *\).*;\1`pkg-config --libs-only-l sqlite3`;' \ michael@514: Makefile.in michael@514: michael@513: # patch: adjust path to configuration directory michael@513: %{l_shtool} subst \ michael@513: -e 's;/etc/subversion;%{l_prefix}/etc/subversion;g' \ michael@513: subversion/libsvn_subr/config_impl.h \ michael@513: subversion/libsvn_subr/config_file.c michael@513: michael@513: %build michael@513: # configure package michael@513: CC="%{l_cc}" \ michael@513: CFLAGS="%{l_cflags -O}" \ michael@513: CPPFLAGS="%{l_cppflags libxml2 .} -DSQLITE_THREADSAFE=1" \ michael@513: %if "%{with_sasl}" == "yes" && "%{with_db}" == "yes" michael@513: LDFLAGS="%{l_ldflags} `pkg-config db sasl --libs-only-L` %{l_fsl_ldflags}" \ michael@513: LIBS="`pkg-config db sasl --libs-only-l` -lz %{l_fsl_libs}" \ michael@513: %else michael@513: %if "%{with_sasl}" == "yes" michael@513: LDFLAGS="%{l_ldflags} `pkg-config sasl --libs-only-L` %{l_fsl_ldflags}" \ michael@513: LIBS="`pkg-config sasl --libs-only-l` `pkg-config apr-util-1 --libs-only-l` -lz %{l_fsl_libs}" \ michael@513: %else michael@513: LDFLAGS="%{l_ldflags} %{l_fsl_ldflags}" \ michael@513: LIBS="`pkg-config apr-util-1 --libs-only-l` -lz %{l_fsl_libs}" \ michael@513: %endif michael@513: %endif michael@513: CONFIG_SHELL="%{l_bash}" \ michael@513: ./configure \ michael@513: --prefix=%{l_prefix} \ michael@513: --mandir=%{l_prefix}/man \ michael@513: %if "%{with_db}" == "yes" michael@513: --with-berkeley-db="db.h:%{l_prefix}/include:%{l_prefix}/lib:db" \ michael@513: %else michael@513: --without-berkeley-db \ michael@513: %endif michael@513: --with-sqlite=%{l_prefix} \ michael@513: --with-ssl=openssl \ michael@513: --with-zlib=%{l_prefix} \ michael@513: --with-apr=%{l_prefix} \ michael@513: --with-apr-util=%{l_prefix} \ michael@513: --with-neon=%{l_prefix} \ michael@513: --with-serf=%{l_prefix} \ michael@513: %if "%{with_sasl}" == "yes" michael@513: --with-sasl \ michael@513: %else michael@513: --without-sasl \ michael@513: %endif michael@513: --without-gssapi \ michael@513: --without-apxs \ michael@513: --disable-nls \ michael@513: --disable-shared \ michael@513: --enable-static michael@513: michael@513: # build package michael@514: %{l_make} %{l_mflags -O} michael@513: michael@513: %install michael@513: # install package michael@513: %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT michael@513: michael@513: # strip down installation michael@513: rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/*.exp michael@513: rm -f $RPM_BUILD_ROOT%{l_prefix}/include/subversion-1/svn-revision.txt michael@513: rm -f $RPM_BUILD_ROOT%{l_prefix}/include/subversion-1/mod_dav_svn.h michael@513: rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/doc michael@513: rm -rf $RPM_BUILD_ROOT%{l_prefix}/build-1 michael@513: strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true michael@513: michael@513: # install Subversion default global configuration files michael@513: %{l_shtool} mkdir -f -p -m 755 \ michael@513: $RPM_BUILD_ROOT%{l_prefix}/etc/subversion michael@513: %{l_shtool} install -c -m 644 %{l_value -s -a} \ michael@513: %{SOURCE subversion.config} \ michael@513: $RPM_BUILD_ROOT%{l_prefix}/etc/subversion/config michael@513: %{l_shtool} install -c -m 644 \ michael@513: %{SOURCE subversion.servers} \ michael@513: $RPM_BUILD_ROOT%{l_prefix}/etc/subversion/servers michael@513: michael@513: # install Subversion Bash command completion michael@513: %{l_shtool} install -c -m 644 \ michael@513: tools/client-side/bash_completion \ michael@513: $RPM_BUILD_ROOT%{l_prefix}/etc/subversion/bashrc michael@513: michael@513: # install Subversion book michael@513: %{l_shtool} mkdir -f -p -m 755 \ michael@513: $RPM_BUILD_ROOT%{l_prefix}/share/subversion michael@513: %{l_shtool} install -c -m 644 \ michael@513: %{SOURCE svn-book-%{V_book_pdf}.pdf} \ michael@513: $RPM_BUILD_ROOT%{l_prefix}/share/subversion/svn-book.pdf michael@513: %{l_shtool} install -c -m 644 \ michael@513: %{SOURCE svn-book-%{V_book_html}.html} \ michael@513: $RPM_BUILD_ROOT%{l_prefix}/share/subversion/svn-book.html michael@513: michael@513: # install run-command script michael@513: %{l_shtool} mkdir -f -p -m 755 \ michael@513: $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d michael@513: %{l_shtool} install -c -m 755 %{l_value -s -a} \ michael@513: %{SOURCE rc.subversion} \ michael@513: $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ michael@513: michael@513: # install OSSP fsl configuration michael@513: %{l_shtool} mkdir -f -p -m 755 \ michael@513: $RPM_BUILD_ROOT%{l_prefix}/etc/fsl michael@513: %{l_shtool} install -c -m 644 %{l_value -s -a} \ michael@513: %{SOURCE fsl.subversion} \ michael@513: $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/ michael@513: michael@513: # create directory for default repository and svnserve pidfile michael@513: %{l_shtool} mkdir -f -p -m 755 \ michael@513: $RPM_BUILD_ROOT%{l_prefix}/var/subversion michael@513: michael@513: # determine installation files michael@513: %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ michael@513: %{l_files_std} \ michael@513: '%config %{l_prefix}/etc/subversion/*' \ michael@513: '%config %{l_prefix}/etc/fsl/fsl.subversion' \ michael@513: '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/subversion' \ michael@513: '%doc %{l_prefix}/share/subversion/svn-book.*' michael@513: michael@513: %files -f files michael@513: michael@513: %clean michael@513: michael@513: %post michael@513: # create default repository michael@513: if [ ! -d $RPM_INSTALL_PREFIX/var/subversion/default ]; then michael@513: su - %{l_rusr} -c \ michael@513: "$RPM_INSTALL_PREFIX/bin/svnadmin create \ michael@513: $RPM_INSTALL_PREFIX/var/subversion/default" michael@513: fi michael@513: michael@513: # after upgrade, restart service michael@513: [ $1 -eq 2 ] || exit 0 michael@513: eval `%{l_rc} subversion status 2>/dev/null` michael@513: [ ".$subversion_active" = .yes ] && %{l_rc} subversion restart michael@513: exit 0 michael@513: michael@513: %preun michael@513: # before erase, stop service michael@513: [ $1 -eq 0 ] || exit 0 michael@513: %{l_rc} subversion stop 2>/dev/null michael@513: exit 0 michael@513: