subversion/subversion.spec

changeset 513
138803117c57
child 514
b0b94589986b
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/subversion/subversion.spec	Fri Aug 10 14:34:00 2012 +0200
     1.3 @@ -0,0 +1,238 @@
     1.4 +##
     1.5 +##  subversion.spec -- OpenPKG RPM Package Specification
     1.6 +##  Copyright (c) 2000-2012 OpenPKG Foundation e.V. <http://openpkg.net/>
     1.7 +##
     1.8 +##  Permission to use, copy, modify, and distribute this software for
     1.9 +##  any purpose with or without fee is hereby granted, provided that
    1.10 +##  the above copyright notice and this permission notice appear in all
    1.11 +##  copies.
    1.12 +##
    1.13 +##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    1.14 +##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    1.15 +##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    1.16 +##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
    1.17 +##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    1.18 +##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    1.19 +##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    1.20 +##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    1.21 +##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    1.22 +##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    1.23 +##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    1.24 +##  SUCH DAMAGE.
    1.25 +##
    1.26 +
    1.27 +#   package version
    1.28 +%define       V_dist      1.7.5
    1.29 +%define       V_opkg      1.7.5
    1.30 +%define       V_book_html 20120518
    1.31 +%define       V_book_pdf  20120518
    1.32 +
    1.33 +#   package information
    1.34 +Name:         subversion
    1.35 +Summary:      Subversion Source Revision Control System
    1.36 +URL:          http://subversion.apache.org/
    1.37 +Vendor:       Apache Software Foundation
    1.38 +Packager:     OpenPKG Foundation e.V.
    1.39 +Distribution: OpenPKG Community
    1.40 +Class:        BASE
    1.41 +Group:        SCM
    1.42 +License:      Apache/BSD
    1.43 +Version:      %{V_opkg}
    1.44 +Release:      20120714
    1.45 +
    1.46 +#   package options
    1.47 +%option       with_fsl      yes
    1.48 +%option       with_db       no
    1.49 +%option       with_sasl     no
    1.50 +
    1.51 +#   list of sources
    1.52 +Source0:      http://www.apache.org/dist/subversion/subversion-%{V_dist}.tar.bz2
    1.53 +Source1:      http://download.openpkg.org/components/versioned/subversion/svn-book-%{V_book_html}.html
    1.54 +Source2:      http://download.openpkg.org/components/versioned/subversion/svn-book-%{V_book_pdf}.pdf
    1.55 +Source3:      subversion.config
    1.56 +Source4:      subversion.servers
    1.57 +Source5:      rc.subversion
    1.58 +Source6:      fsl.subversion
    1.59 +Patch0:       subversion.patch
    1.60 +
    1.61 +#   build information
    1.62 +BuildPreReq:  OpenPKG, openpkg >= 20100101, make, libtool, sed, pkgconfig
    1.63 +PreReq:       OpenPKG, openpkg >= 20100101
    1.64 +BuildPreReq:  diffutils, openssl, zlib, libiconv, expat, serf, neon, apr, sqlite
    1.65 +PreReq:       diffutils, openssl, zlib, libiconv, expat, serf, neon, apr, sqlite
    1.66 +%if "%{with_fsl}" == "yes"
    1.67 +BuildPreReq:  fsl
    1.68 +PreReq:       fsl
    1.69 +%endif
    1.70 +%if "%{with_db}" == "yes"
    1.71 +BuildPreReq:  db
    1.72 +PreReq:       db
    1.73 +%endif
    1.74 +%if "%{with_sasl}" == "yes"
    1.75 +BuildPreReq:  sasl
    1.76 +PreReq:       sasl
    1.77 +%endif
    1.78 +
    1.79 +%description
    1.80 +    Subversion is a modern Version Control System (VCS) providing most
    1.81 +    current CVS features, versioned directories/renames/meta-data,
    1.82 +    atomic commits, cheap branching and tagging, native client/server
    1.83 +    architecture, and the choice of database or plain-file repository
    1.84 +    implementations.
    1.85 +
    1.86 +%track
    1.87 +    prog subversion = {
    1.88 +        version   = %{V_dist}
    1.89 +        url       = http://subversion.apache.org/download/
    1.90 +        regex     = subversion-(\d+\.\d+.\d+)\.tar\.bz2
    1.91 +    }
    1.92 +
    1.93 +%prep
    1.94 +    %setup -q
    1.95 +    %patch -p0
    1.96 +
    1.97 +    #   patch: correctly pass --disable-shared to sub-directories
    1.98 +    %{l_shtool} subst \
    1.99 +        -e 's;\($ac_abs_srcdir/configure $ac_configure_args\);\1 --disable-shared;' \
   1.100 +        configure
   1.101 +
   1.102 +    #   patch: adjust path to configuration directory
   1.103 +    %{l_shtool} subst \
   1.104 +        -e 's;/etc/subversion;%{l_prefix}/etc/subversion;g' \
   1.105 +        subversion/libsvn_subr/config_impl.h \
   1.106 +        subversion/libsvn_subr/config_file.c
   1.107 +
   1.108 +%build
   1.109 +    #   configure package
   1.110 +    CC="%{l_cc}" \
   1.111 +    CFLAGS="%{l_cflags -O}" \
   1.112 +    CPPFLAGS="%{l_cppflags libxml2 .} -DSQLITE_THREADSAFE=1" \
   1.113 +%if "%{with_sasl}" == "yes" && "%{with_db}" == "yes"
   1.114 +    LDFLAGS="%{l_ldflags} `pkg-config db sasl --libs-only-L` %{l_fsl_ldflags}" \
   1.115 +    LIBS="`pkg-config db sasl --libs-only-l` -lz %{l_fsl_libs}" \
   1.116 +%else
   1.117 +%if "%{with_sasl}" == "yes"
   1.118 +    LDFLAGS="%{l_ldflags} `pkg-config sasl --libs-only-L` %{l_fsl_ldflags}" \
   1.119 +    LIBS="`pkg-config sasl --libs-only-l` `pkg-config apr-util-1 --libs-only-l` -lz %{l_fsl_libs}" \
   1.120 +%else
   1.121 +    LDFLAGS="%{l_ldflags} %{l_fsl_ldflags}" \
   1.122 +    LIBS="`pkg-config apr-util-1 --libs-only-l` -lz %{l_fsl_libs}" \
   1.123 +%endif
   1.124 +%endif
   1.125 +    CONFIG_SHELL="%{l_bash}" \
   1.126 +    ./configure \
   1.127 +        --prefix=%{l_prefix} \
   1.128 +        --mandir=%{l_prefix}/man \
   1.129 +%if "%{with_db}" == "yes"
   1.130 +        --with-berkeley-db="db.h:%{l_prefix}/include:%{l_prefix}/lib:db" \
   1.131 +%else
   1.132 +        --without-berkeley-db \
   1.133 +%endif
   1.134 +        --with-sqlite=%{l_prefix} \
   1.135 +        --with-ssl=openssl \
   1.136 +        --with-zlib=%{l_prefix} \
   1.137 +        --with-apr=%{l_prefix} \
   1.138 +        --with-apr-util=%{l_prefix} \
   1.139 +        --with-neon=%{l_prefix} \
   1.140 +        --with-serf=%{l_prefix} \
   1.141 +%if "%{with_sasl}" == "yes"
   1.142 +        --with-sasl \
   1.143 +%else
   1.144 +        --without-sasl \
   1.145 +%endif
   1.146 +        --without-gssapi \
   1.147 +        --without-apxs \
   1.148 +        --disable-nls \
   1.149 +        --disable-shared \
   1.150 +        --enable-static
   1.151 +
   1.152 +    #   build package
   1.153 +    %{l_make} %{l_mflags}
   1.154 +
   1.155 +%install
   1.156 +    #   install package
   1.157 +    %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
   1.158 +
   1.159 +    #   strip down installation
   1.160 +    rm -f  $RPM_BUILD_ROOT%{l_prefix}/lib/*.exp
   1.161 +    rm -f  $RPM_BUILD_ROOT%{l_prefix}/include/subversion-1/svn-revision.txt
   1.162 +    rm -f  $RPM_BUILD_ROOT%{l_prefix}/include/subversion-1/mod_dav_svn.h
   1.163 +    rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/doc
   1.164 +    rm -rf $RPM_BUILD_ROOT%{l_prefix}/build-1
   1.165 +    strip  $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
   1.166 +
   1.167 +    #   install Subversion default global configuration files
   1.168 +    %{l_shtool} mkdir -f -p -m 755 \
   1.169 +        $RPM_BUILD_ROOT%{l_prefix}/etc/subversion
   1.170 +    %{l_shtool} install -c -m 644 %{l_value -s -a} \
   1.171 +        %{SOURCE subversion.config} \
   1.172 +        $RPM_BUILD_ROOT%{l_prefix}/etc/subversion/config
   1.173 +    %{l_shtool} install -c -m 644 \
   1.174 +        %{SOURCE subversion.servers} \
   1.175 +        $RPM_BUILD_ROOT%{l_prefix}/etc/subversion/servers
   1.176 +
   1.177 +    #   install Subversion Bash command completion
   1.178 +    %{l_shtool} install -c -m 644 \
   1.179 +        tools/client-side/bash_completion \
   1.180 +        $RPM_BUILD_ROOT%{l_prefix}/etc/subversion/bashrc
   1.181 +
   1.182 +    #   install Subversion book
   1.183 +    %{l_shtool} mkdir -f -p -m 755 \
   1.184 +        $RPM_BUILD_ROOT%{l_prefix}/share/subversion
   1.185 +    %{l_shtool} install -c -m 644 \
   1.186 +        %{SOURCE svn-book-%{V_book_pdf}.pdf} \
   1.187 +        $RPM_BUILD_ROOT%{l_prefix}/share/subversion/svn-book.pdf
   1.188 +    %{l_shtool} install -c -m 644 \
   1.189 +        %{SOURCE svn-book-%{V_book_html}.html} \
   1.190 +        $RPM_BUILD_ROOT%{l_prefix}/share/subversion/svn-book.html
   1.191 +
   1.192 +    #   install run-command script
   1.193 +    %{l_shtool} mkdir -f -p -m 755 \
   1.194 +        $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
   1.195 +    %{l_shtool} install -c -m 755 %{l_value -s -a} \
   1.196 +        %{SOURCE rc.subversion} \
   1.197 +        $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
   1.198 +
   1.199 +    #   install OSSP fsl configuration
   1.200 +    %{l_shtool} mkdir -f -p -m 755 \
   1.201 +        $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
   1.202 +    %{l_shtool} install -c -m 644 %{l_value -s -a} \
   1.203 +        %{SOURCE fsl.subversion} \
   1.204 +        $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
   1.205 +
   1.206 +    #   create directory for default repository and svnserve pidfile
   1.207 +    %{l_shtool} mkdir -f -p -m 755 \
   1.208 +        $RPM_BUILD_ROOT%{l_prefix}/var/subversion
   1.209 +
   1.210 +    #   determine installation files
   1.211 +    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
   1.212 +        %{l_files_std} \
   1.213 +        '%config %{l_prefix}/etc/subversion/*' \
   1.214 +        '%config %{l_prefix}/etc/fsl/fsl.subversion' \
   1.215 +        '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/subversion' \
   1.216 +        '%doc %{l_prefix}/share/subversion/svn-book.*'
   1.217 +
   1.218 +%files -f files
   1.219 +
   1.220 +%clean
   1.221 +
   1.222 +%post
   1.223 +    #   create default repository
   1.224 +    if [ ! -d $RPM_INSTALL_PREFIX/var/subversion/default ]; then
   1.225 +        su - %{l_rusr} -c \
   1.226 +            "$RPM_INSTALL_PREFIX/bin/svnadmin create \
   1.227 +                $RPM_INSTALL_PREFIX/var/subversion/default"
   1.228 +    fi
   1.229 +
   1.230 +    #   after upgrade, restart service
   1.231 +    [ $1 -eq 2 ] || exit 0
   1.232 +    eval `%{l_rc} subversion status 2>/dev/null`
   1.233 +    [ ".$subversion_active" = .yes ] && %{l_rc} subversion restart
   1.234 +    exit 0
   1.235 +
   1.236 +%preun
   1.237 +    #   before erase, stop service
   1.238 +    [ $1 -eq 0 ] || exit 0
   1.239 +    %{l_rc} subversion stop 2>/dev/null
   1.240 +    exit 0
   1.241 +

mercurial