subversion/subversion.spec

Tue, 28 Aug 2012 18:29:00 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 28 Aug 2012 18:29:00 +0200
changeset 532
e5f1af644b30
parent 513
138803117c57
child 655
57a8260ef460
permissions
-rw-r--r--

Massively update modules from Drupal 6.x to 7.x, and add diverse OpenID modules.
Unfortunately many modules available to Drupal 6.x installations have not been
since maintained or ported to 7.x causing this package to diminish in both size
and utility.

michael@513 1 ##
michael@513 2 ## subversion.spec -- OpenPKG RPM Package Specification
michael@513 3 ## Copyright (c) 2000-2012 OpenPKG Foundation e.V. <http://openpkg.net/>
michael@513 4 ##
michael@513 5 ## Permission to use, copy, modify, and distribute this software for
michael@513 6 ## any purpose with or without fee is hereby granted, provided that
michael@513 7 ## the above copyright notice and this permission notice appear in all
michael@513 8 ## copies.
michael@513 9 ##
michael@513 10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
michael@513 11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
michael@513 12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
michael@513 13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
michael@513 14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
michael@513 15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
michael@513 16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
michael@513 17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
michael@513 18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
michael@513 19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
michael@513 20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
michael@513 21 ## SUCH DAMAGE.
michael@513 22 ##
michael@513 23
michael@513 24 # package version
michael@513 25 %define V_dist 1.7.5
michael@513 26 %define V_opkg 1.7.5
michael@513 27 %define V_book_html 20120518
michael@513 28 %define V_book_pdf 20120518
michael@513 29
michael@513 30 # package information
michael@513 31 Name: subversion
michael@513 32 Summary: Subversion Source Revision Control System
michael@513 33 URL: http://subversion.apache.org/
michael@513 34 Vendor: Apache Software Foundation
michael@513 35 Packager: OpenPKG Foundation e.V.
michael@513 36 Distribution: OpenPKG Community
michael@513 37 Class: BASE
michael@513 38 Group: SCM
michael@513 39 License: Apache/BSD
michael@513 40 Version: %{V_opkg}
michael@514 41 Release: 20120800
michael@513 42
michael@513 43 # package options
michael@513 44 %option with_fsl yes
michael@513 45 %option with_db no
michael@513 46 %option with_sasl no
michael@513 47
michael@513 48 # list of sources
michael@513 49 Source0: http://www.apache.org/dist/subversion/subversion-%{V_dist}.tar.bz2
michael@513 50 Source1: http://download.openpkg.org/components/versioned/subversion/svn-book-%{V_book_html}.html
michael@513 51 Source2: http://download.openpkg.org/components/versioned/subversion/svn-book-%{V_book_pdf}.pdf
michael@513 52 Source3: subversion.config
michael@513 53 Source4: subversion.servers
michael@513 54 Source5: rc.subversion
michael@513 55 Source6: fsl.subversion
michael@513 56 Patch0: subversion.patch
michael@513 57
michael@513 58 # build information
michael@513 59 BuildPreReq: OpenPKG, openpkg >= 20100101, make, libtool, sed, pkgconfig
michael@513 60 PreReq: OpenPKG, openpkg >= 20100101
michael@513 61 BuildPreReq: diffutils, openssl, zlib, libiconv, expat, serf, neon, apr, sqlite
michael@513 62 PreReq: diffutils, openssl, zlib, libiconv, expat, serf, neon, apr, sqlite
michael@513 63 %if "%{with_fsl}" == "yes"
michael@513 64 BuildPreReq: fsl
michael@513 65 PreReq: fsl
michael@513 66 %endif
michael@513 67 %if "%{with_db}" == "yes"
michael@513 68 BuildPreReq: db
michael@513 69 PreReq: db
michael@513 70 %endif
michael@513 71 %if "%{with_sasl}" == "yes"
michael@513 72 BuildPreReq: sasl
michael@513 73 PreReq: sasl
michael@513 74 %endif
michael@513 75
michael@513 76 %description
michael@513 77 Subversion is a modern Version Control System (VCS) providing most
michael@513 78 current CVS features, versioned directories/renames/meta-data,
michael@513 79 atomic commits, cheap branching and tagging, native client/server
michael@513 80 architecture, and the choice of database or plain-file repository
michael@513 81 implementations.
michael@513 82
michael@513 83 %track
michael@513 84 prog subversion = {
michael@513 85 version = %{V_dist}
michael@513 86 url = http://subversion.apache.org/download/
michael@513 87 regex = subversion-(\d+\.\d+.\d+)\.tar\.bz2
michael@513 88 }
michael@513 89
michael@513 90 %prep
michael@513 91 %setup -q
michael@513 92 %patch -p0
michael@513 93
michael@513 94 # patch: correctly pass --disable-shared to sub-directories
michael@513 95 %{l_shtool} subst \
michael@514 96 -e 's;\(\$ac_abs_srcdir/configure \$ac_configure_args\);\1 --disable-shared;' \
michael@513 97 configure
michael@513 98
michael@514 99 # patch: accommodate defective sqlite3_close(3) test from configure
michael@514 100 %{l_shtool} subst \
michael@514 101 -e 's;\(SVN_SQLITE_INCLUDES *= *\).*;\1`pkg-config --cflags-only-I sqlite3`;' \
michael@514 102 -e 's;\(SVN_SQLITE_LIBS *= *\).*;\1`pkg-config --libs-only-l sqlite3`;' \
michael@514 103 Makefile.in
michael@514 104
michael@513 105 # patch: adjust path to configuration directory
michael@513 106 %{l_shtool} subst \
michael@513 107 -e 's;/etc/subversion;%{l_prefix}/etc/subversion;g' \
michael@513 108 subversion/libsvn_subr/config_impl.h \
michael@513 109 subversion/libsvn_subr/config_file.c
michael@513 110
michael@513 111 %build
michael@513 112 # configure package
michael@513 113 CC="%{l_cc}" \
michael@513 114 CFLAGS="%{l_cflags -O}" \
michael@513 115 CPPFLAGS="%{l_cppflags libxml2 .} -DSQLITE_THREADSAFE=1" \
michael@513 116 %if "%{with_sasl}" == "yes" && "%{with_db}" == "yes"
michael@513 117 LDFLAGS="%{l_ldflags} `pkg-config db sasl --libs-only-L` %{l_fsl_ldflags}" \
michael@513 118 LIBS="`pkg-config db sasl --libs-only-l` -lz %{l_fsl_libs}" \
michael@513 119 %else
michael@513 120 %if "%{with_sasl}" == "yes"
michael@513 121 LDFLAGS="%{l_ldflags} `pkg-config sasl --libs-only-L` %{l_fsl_ldflags}" \
michael@513 122 LIBS="`pkg-config sasl --libs-only-l` `pkg-config apr-util-1 --libs-only-l` -lz %{l_fsl_libs}" \
michael@513 123 %else
michael@513 124 LDFLAGS="%{l_ldflags} %{l_fsl_ldflags}" \
michael@513 125 LIBS="`pkg-config apr-util-1 --libs-only-l` -lz %{l_fsl_libs}" \
michael@513 126 %endif
michael@513 127 %endif
michael@513 128 CONFIG_SHELL="%{l_bash}" \
michael@513 129 ./configure \
michael@513 130 --prefix=%{l_prefix} \
michael@513 131 --mandir=%{l_prefix}/man \
michael@513 132 %if "%{with_db}" == "yes"
michael@513 133 --with-berkeley-db="db.h:%{l_prefix}/include:%{l_prefix}/lib:db" \
michael@513 134 %else
michael@513 135 --without-berkeley-db \
michael@513 136 %endif
michael@513 137 --with-sqlite=%{l_prefix} \
michael@513 138 --with-ssl=openssl \
michael@513 139 --with-zlib=%{l_prefix} \
michael@513 140 --with-apr=%{l_prefix} \
michael@513 141 --with-apr-util=%{l_prefix} \
michael@513 142 --with-neon=%{l_prefix} \
michael@513 143 --with-serf=%{l_prefix} \
michael@513 144 %if "%{with_sasl}" == "yes"
michael@513 145 --with-sasl \
michael@513 146 %else
michael@513 147 --without-sasl \
michael@513 148 %endif
michael@513 149 --without-gssapi \
michael@513 150 --without-apxs \
michael@513 151 --disable-nls \
michael@513 152 --disable-shared \
michael@513 153 --enable-static
michael@513 154
michael@513 155 # build package
michael@514 156 %{l_make} %{l_mflags -O}
michael@513 157
michael@513 158 %install
michael@513 159 # install package
michael@513 160 %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
michael@513 161
michael@513 162 # strip down installation
michael@513 163 rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/*.exp
michael@513 164 rm -f $RPM_BUILD_ROOT%{l_prefix}/include/subversion-1/svn-revision.txt
michael@513 165 rm -f $RPM_BUILD_ROOT%{l_prefix}/include/subversion-1/mod_dav_svn.h
michael@513 166 rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/doc
michael@513 167 rm -rf $RPM_BUILD_ROOT%{l_prefix}/build-1
michael@513 168 strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
michael@513 169
michael@513 170 # install Subversion default global configuration files
michael@513 171 %{l_shtool} mkdir -f -p -m 755 \
michael@513 172 $RPM_BUILD_ROOT%{l_prefix}/etc/subversion
michael@513 173 %{l_shtool} install -c -m 644 %{l_value -s -a} \
michael@513 174 %{SOURCE subversion.config} \
michael@513 175 $RPM_BUILD_ROOT%{l_prefix}/etc/subversion/config
michael@513 176 %{l_shtool} install -c -m 644 \
michael@513 177 %{SOURCE subversion.servers} \
michael@513 178 $RPM_BUILD_ROOT%{l_prefix}/etc/subversion/servers
michael@513 179
michael@513 180 # install Subversion Bash command completion
michael@513 181 %{l_shtool} install -c -m 644 \
michael@513 182 tools/client-side/bash_completion \
michael@513 183 $RPM_BUILD_ROOT%{l_prefix}/etc/subversion/bashrc
michael@513 184
michael@513 185 # install Subversion book
michael@513 186 %{l_shtool} mkdir -f -p -m 755 \
michael@513 187 $RPM_BUILD_ROOT%{l_prefix}/share/subversion
michael@513 188 %{l_shtool} install -c -m 644 \
michael@513 189 %{SOURCE svn-book-%{V_book_pdf}.pdf} \
michael@513 190 $RPM_BUILD_ROOT%{l_prefix}/share/subversion/svn-book.pdf
michael@513 191 %{l_shtool} install -c -m 644 \
michael@513 192 %{SOURCE svn-book-%{V_book_html}.html} \
michael@513 193 $RPM_BUILD_ROOT%{l_prefix}/share/subversion/svn-book.html
michael@513 194
michael@513 195 # install run-command script
michael@513 196 %{l_shtool} mkdir -f -p -m 755 \
michael@513 197 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
michael@513 198 %{l_shtool} install -c -m 755 %{l_value -s -a} \
michael@513 199 %{SOURCE rc.subversion} \
michael@513 200 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
michael@513 201
michael@513 202 # install OSSP fsl configuration
michael@513 203 %{l_shtool} mkdir -f -p -m 755 \
michael@513 204 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
michael@513 205 %{l_shtool} install -c -m 644 %{l_value -s -a} \
michael@513 206 %{SOURCE fsl.subversion} \
michael@513 207 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
michael@513 208
michael@513 209 # create directory for default repository and svnserve pidfile
michael@513 210 %{l_shtool} mkdir -f -p -m 755 \
michael@513 211 $RPM_BUILD_ROOT%{l_prefix}/var/subversion
michael@513 212
michael@513 213 # determine installation files
michael@513 214 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
michael@513 215 %{l_files_std} \
michael@513 216 '%config %{l_prefix}/etc/subversion/*' \
michael@513 217 '%config %{l_prefix}/etc/fsl/fsl.subversion' \
michael@513 218 '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/subversion' \
michael@513 219 '%doc %{l_prefix}/share/subversion/svn-book.*'
michael@513 220
michael@513 221 %files -f files
michael@513 222
michael@513 223 %clean
michael@513 224
michael@513 225 %post
michael@513 226 # create default repository
michael@513 227 if [ ! -d $RPM_INSTALL_PREFIX/var/subversion/default ]; then
michael@513 228 su - %{l_rusr} -c \
michael@513 229 "$RPM_INSTALL_PREFIX/bin/svnadmin create \
michael@513 230 $RPM_INSTALL_PREFIX/var/subversion/default"
michael@513 231 fi
michael@513 232
michael@513 233 # after upgrade, restart service
michael@513 234 [ $1 -eq 2 ] || exit 0
michael@513 235 eval `%{l_rc} subversion status 2>/dev/null`
michael@513 236 [ ".$subversion_active" = .yes ] && %{l_rc} subversion restart
michael@513 237 exit 0
michael@513 238
michael@513 239 %preun
michael@513 240 # before erase, stop service
michael@513 241 [ $1 -eq 0 ] || exit 0
michael@513 242 %{l_rc} subversion stop 2>/dev/null
michael@513 243 exit 0
michael@513 244

mercurial