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