Gentoo Archives: gentoo-commits

From: Lars Wendler <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-vcs/subversion/
Date: Wed, 23 Jan 2019 12:05:50
Message-Id: 1548245133.625515698353fe286516385c7d6c26ae8d3bc0b3.polynomial-c@gentoo
1 commit: 625515698353fe286516385c7d6c26ae8d3bc0b3
2 Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jan 23 11:58:36 2019 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Wed Jan 23 12:05:33 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=62551569
7
8 v-vcs/subversion: Security bump to version 1.10.4
9
10 Bug: https://bugs.gentoo.org/676094
11 Package-Manager: Portage-2.3.58, Repoman-2.3.12
12 Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
13
14 dev-vcs/subversion/Manifest | 1 +
15 dev-vcs/subversion/subversion-1.10.4.ebuild | 527 ++++++++++++++++++++++++++++
16 2 files changed, 528 insertions(+)
17
18 diff --git a/dev-vcs/subversion/Manifest b/dev-vcs/subversion/Manifest
19 index afc8ca812a0..8ae6427cb0f 100644
20 --- a/dev-vcs/subversion/Manifest
21 +++ b/dev-vcs/subversion/Manifest
22 @@ -1,5 +1,6 @@
23 DIST subversion-1.10.0_rc1-patches-1.tar.xz 2984 BLAKE2B 7c9619b95ca6b433a58dc5baf3a1e1b14ef0017f714af81762b975d50a37b743788a4da65cf7f9eb8e633cbc813ad8dd974b530a19ec2d3fc74b75921f8f0c17 SHA512 aa7a25a253ea2da99520399d292d3e1602985392bae6dc5582003fdb9719d654638754b6e370b68b184ee6729ba3833bd511c09b2cb36f8f476b42063f55fbb2
24 DIST subversion-1.10.3.tar.bz2 8374465 BLAKE2B 48610f0edec52dad43a4fd971098ed5d8b43a5396fcc3fdaa42af6ff7ce4722300f0c32a342521072abcccbc32e1364a87fc644913cb4a3a21658793f5991234 SHA512 e753c76be2c7a7d1e47ef70a417f33ad48a5076ddbe02062b478b0baf8ce063f101aab3a86895e33f6277f273917b87d8c07b002e3e4f9fe3a750a2f8142ef6d
25 +DIST subversion-1.10.4.tar.bz2 8392477 BLAKE2B 93364178d2252332b070ebddd5791cb43e0000802d820848a6ca2e13ae3036a9119901dcde1b73ea09bd34af3fd72b923bdd2765e302359e7f1ecf49a6840685 SHA512 c44a4a4a9533cd4f4cb6ddbc3ce98585a96da6c8e75497d087034b52f899797bb0972dfc0e79db99e81149e59e7fa765398c6ad35eba64f11f4ae9c3b3537434
26 DIST subversion-1.11.0.tar.bz2 8490744 BLAKE2B 27b2172e1ebae5641fc2bc73fd77f479278bc0725645e6bf8f974932e5c313552c508cdeeddce101f12fb983398ff81fd2ca2408950513d4ad0bd2cae4fcf729 SHA512 d73cc800080529b1716a027fd3001d9c963a3cb69619d059498c99426cccc21a2985d1eeb5e1bff8d421fff477a9dff6f9be1c092470152452cf5e7175414e92
27 DIST subversion-1.11.1.tar.bz2 8499709 BLAKE2B f14bbe9b28dec32894a8c262d32f36e01c9866352f1c54b5468804e81c1eadb895cbe9e33783a9e7d4a7f54dfa3b25b762015b9ca4886a14628c434254995c77 SHA512 2d082f715bf592ffc6a19311a9320dbae2ff0ee126b0472ce1c3f10e9aee670f43d894889430e6d093620f7b69c611e9a26773bc7a2f8b599ec37540ecd84a8d
28 DIST subversion-1.8.18-patchset.tar.bz2 7407 BLAKE2B dc3b6d80dfdf4c6cc30f1663c8cee3eebc4f42d433c3965d8b309f9cc79c31b566a74cf43b3b04037c2498b6a2bffe2c60953c5cfb25aec61a8e4a7e928efcae SHA512 b5c207ed7b6923f1259290563409b2e946a512cc052e4e5d8a061abf3f0909dbbb15c0525a1fca618f1ec5e4abbbc8b49f3f0f714c9dd100f1d6c7e6d88442b2
29
30 diff --git a/dev-vcs/subversion/subversion-1.10.4.ebuild b/dev-vcs/subversion/subversion-1.10.4.ebuild
31 new file mode 100644
32 index 00000000000..e21f5be59ff
33 --- /dev/null
34 +++ b/dev-vcs/subversion/subversion-1.10.4.ebuild
35 @@ -0,0 +1,527 @@
36 +# Copyright 1999-2019 Gentoo Authors
37 +# Distributed under the terms of the GNU General Public License v2
38 +
39 +EAPI=6
40 +
41 +PYTHON_COMPAT=( python2_7 )
42 +USE_RUBY="ruby25 ruby24 ruby23"
43 +DISTUTILS_OPTIONAL=1
44 +WANT_AUTOMAKE="none"
45 +GENTOO_DEPEND_ON_PERL="no"
46 +
47 +inherit autotools bash-completion-r1 db-use depend.apache distutils-r1 elisp-common flag-o-matic java-pkg-opt-2 libtool multilib perl-module ruby-single xdg-utils
48 +
49 +MY_P="${P/_/-}"
50 +DESCRIPTION="Advanced version control system"
51 +HOMEPAGE="https://subversion.apache.org/"
52 +SRC_URI="mirror://apache/${PN}/${MY_P}.tar.bz2
53 + https://dev.gentoo.org/~polynomial-c/${PN}-1.10.0_rc1-patches-1.tar.xz"
54 +S="${WORKDIR}/${MY_P}"
55 +
56 +LICENSE="Subversion GPL-2"
57 +SLOT="0"
58 +[[ "${PV}" = *_rc* ]] || \
59 +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
60 +IUSE="apache2 berkdb ctypes-python debug doc +dso extras gnome-keyring +http java kwallet nls perl python ruby sasl test vim-syntax"
61 +
62 +COMMON_DEPEND="
63 + app-arch/bzip2
64 + app-arch/lz4
65 + >=dev-db/sqlite-3.7.12
66 + >=dev-libs/apr-1.3:1
67 + >=dev-libs/apr-util-1.3:1
68 + dev-libs/expat
69 + dev-libs/libutf8proc:=
70 + sys-apps/file
71 + sys-libs/zlib
72 + berkdb? ( >=sys-libs/db-4.0.14:= )
73 + ctypes-python? ( ${PYTHON_DEPS} )
74 + gnome-keyring? (
75 + dev-libs/glib:2
76 + gnome-base/libgnome-keyring
77 + sys-apps/dbus
78 + )
79 + http? ( >=net-libs/serf-1.3.4 )
80 + kwallet? (
81 + dev-qt/qtcore:5
82 + dev-qt/qtdbus:5
83 + dev-qt/qtgui:5
84 + kde-frameworks/kcoreaddons:5
85 + kde-frameworks/ki18n:5
86 + kde-frameworks/kwallet:5
87 + sys-apps/dbus
88 + )
89 + perl? ( dev-lang/perl:= )
90 + python? ( ${PYTHON_DEPS} )
91 + ruby? ( ${RUBY_DEPS} )
92 + sasl? ( dev-libs/cyrus-sasl )"
93 +RDEPEND="${COMMON_DEPEND}
94 + apache2? ( www-servers/apache[apache2_modules_dav] )
95 + java? ( >=virtual/jre-1.5 )
96 + nls? ( virtual/libintl )
97 + perl? ( dev-perl/URI )"
98 +# Note: ctypesgen doesn't need PYTHON_USEDEP, it's used once
99 +DEPEND="${COMMON_DEPEND}
100 + !!<sys-apps/sandbox-1.6
101 + ctypes-python? ( dev-python/ctypesgen )
102 + doc? ( app-doc/doxygen )
103 + gnome-keyring? ( virtual/pkgconfig )
104 + http? ( virtual/pkgconfig )
105 + java? ( >=virtual/jdk-1.5 )
106 + kwallet? (
107 + kde-frameworks/kdelibs4support:5
108 + virtual/pkgconfig
109 + )
110 + nls? ( sys-devel/gettext )
111 + perl? ( dev-lang/swig )
112 + python? ( dev-lang/swig )
113 + ruby? ( dev-lang/swig )
114 + test? ( ${PYTHON_DEPS} )"
115 +
116 +REQUIRED_USE="
117 + ctypes-python? ( ${PYTHON_REQUIRED_USE} )
118 + python? ( ${PYTHON_REQUIRED_USE} )
119 + test? (
120 + ${PYTHON_REQUIRED_USE}
121 + !dso
122 + )"
123 +
124 +want_apache
125 +
126 +pkg_setup() {
127 + if use berkdb ; then
128 + local apu_bdb_version="$(${EPREFIX}/usr/bin/apu-1-config --includes \
129 + | grep -Eoe '-I${EPREFIX}/usr/include/db[[:digit:]]\.[[:digit:]]' \
130 + | sed 's:.*b::')"
131 + einfo
132 + if [[ -z "${SVN_BDB_VERSION}" ]] ; then
133 + if [[ -n "${apu_bdb_version}" ]] ; then
134 + SVN_BDB_VERSION="${apu_bdb_version}"
135 + einfo "Matching db version to apr-util"
136 + else
137 + SVN_BDB_VERSION="$(db_ver_to_slot "$(db_findver sys-libs/db 2>/dev/null)")"
138 + einfo "SVN_BDB_VERSION variable isn't set. You can set it to enforce using of specific version of Berkeley DB."
139 + fi
140 + fi
141 + einfo "Using: Berkeley DB ${SVN_BDB_VERSION}"
142 + einfo
143 +
144 + if [[ -n "${apu_bdb_version}" && "${SVN_BDB_VERSION}" != "${apu_bdb_version}" ]]; then
145 + eerror "APR-Util is linked against Berkeley DB ${apu_bdb_version}, but you are trying"
146 + eerror "to build Subversion with support for Berkeley DB ${SVN_BDB_VERSION}."
147 + eerror "Rebuild dev-libs/apr-util or set SVN_BDB_VERSION=\"${apu_bdb_version}\"."
148 + eerror "Aborting to avoid possible run-time crashes."
149 + die "Berkeley DB version mismatch"
150 + fi
151 + fi
152 +
153 + depend.apache_pkg_setup
154 +
155 + java-pkg-opt-2_pkg_setup
156 +
157 + if ! use http ; then
158 + ewarn "WebDAV support is disabled. You need WebDAV to"
159 + ewarn "access repositories through the HTTP protocol."
160 + ewarn "Consider enabling \"http\" USE flag"
161 + echo -ne "\a"
162 + fi
163 +
164 + if use debug ; then
165 + append-cppflags -DSVN_DEBUG -DAP_DEBUG
166 + fi
167 +
168 + # http://mail-archives.apache.org/mod_mbox/subversion-dev/201306.mbox/%3C51C42014.3060700@××××××××.com%3E
169 + [[ ${CHOST} == *-solaris2* ]] && append-cppflags -D__EXTENSIONS__
170 +
171 + # Allow for custom repository locations.
172 + SVN_REPOS_LOC="${SVN_REPOS_LOC:-${EPREFIX}/var/svn}"
173 +
174 + if use ruby ; then
175 + local rbslot
176 + RB_VER=""
177 + for rbslot in $(sed 's@\([[:digit:]]\+\)\([[:digit:]]\)@\1.\2@g' <<< ${USE_RUBY//ruby}) ; do
178 + if has_version dev-lang/ruby:${rbslot} ; then
179 + RB_VER="${rbslot/.}"
180 + break
181 + fi
182 + done
183 + [[ -z "${RB_VER}" ]] && die "No useable ruby version found"
184 + fi
185 +}
186 +
187 +src_prepare() {
188 + eapply "${WORKDIR}/patches"
189 + eapply_user
190 +
191 + fperms +x build/transform_libtool_scripts.sh
192 +
193 + sed -i \
194 + -e "s/\(BUILD_RULES=.*\) bdb-test\(.*\)/\1\2/g" \
195 + -e "s/\(BUILD_RULES=.*\) test\(.*\)/\1\2/g" configure.ac
196 +
197 + # this bites us in particular on Solaris
198 + sed -i -e '1c\#!/usr/bin/env sh' build/transform_libtool_scripts.sh || \
199 + die "/bin/sh is not POSIX shell!"
200 +
201 + eautoconf
202 + elibtoolize
203 +
204 + sed -e 's/\(libsvn_swig_py\)-\(1\.la\)/\1-$(EPYTHON)-\2/g' \
205 + -i build-outputs.mk || die "sed failed"
206 +
207 + if use python ; then
208 + # XXX: make python_copy_sources accept path
209 + S=${S}/subversion/bindings/swig/python python_copy_sources
210 + rm -r "${S}"/subversion/bindings/swig/python || die
211 + fi
212 +
213 + xdg_environment_reset
214 +}
215 +
216 +src_configure() {
217 + local myconf=(
218 + --libdir="${EPREFIX%/}/usr/$(get_libdir)"
219 + $(use_with apache2 apache-libexecdir)
220 + $(use_with apache2 apxs "${APXS}")
221 + $(use_with berkdb berkeley-db "db.h:${EPREFIX%/}/usr/include/db${SVN_BDB_VERSION}::db-${SVN_BDB_VERSION}")
222 + $(use_with ctypes-python ctypesgen "${EPREFIX%/}/usr")
223 + $(use_enable dso runtime-module-search)
224 + $(use_with gnome-keyring)
225 + $(use_enable java javahl)
226 + $(use_with java jdk "${JAVA_HOME}")
227 + $(use_with kwallet)
228 + $(use_enable nls)
229 + $(use_with sasl)
230 + $(use_with http serf)
231 + --with-apr="${EPREFIX%/}/usr/bin/apr-1-config"
232 + --with-apr-util="${EPREFIX%/}/usr/bin/apu-1-config"
233 + --disable-experimental-libtool
234 + --without-jikes
235 + --disable-mod-activation
236 + --disable-static
237 + )
238 +
239 + if use python || use perl || use ruby; then
240 + myconf+=( --with-swig )
241 + else
242 + myconf+=( --without-swig )
243 + fi
244 +
245 + if use java ; then
246 + myconf+=( --without-junit )
247 + fi
248 +
249 + case ${CHOST} in
250 + *-aix*)
251 + # avoid recording immediate path to sharedlibs into executables
252 + append-ldflags -Wl,-bnoipath
253 + ;;
254 + *-cygwin*)
255 + # no LD_PRELOAD support, no undefined symbols
256 + myconf+=( --disable-local-library-preloading LT_LDFLAGS=-no-undefined )
257 + ;;
258 + *-interix*)
259 + # loader crashes on the LD_PRELOADs...
260 + myconf+=( --disable-local-library-preloading )
261 + ;;
262 + *-solaris*)
263 + # need -lintl to link
264 + use nls && append-libs intl
265 + # this breaks installation, on x64 echo replacement is 32-bits
266 + myconf+=( --disable-local-library-preloading )
267 + ;;
268 + *-mint*)
269 + myconf+=( --enable-all-static --disable-local-library-preloading )
270 + ;;
271 + *)
272 + # inject LD_PRELOAD entries for easy in-tree development
273 + myconf+=( --enable-local-library-preloading )
274 + ;;
275 + esac
276 +
277 + #version 1.7.7 again tries to link against the older installed version and fails, when trying to
278 + #compile for x86 on amd64, so workaround this issue again
279 + #check newer versions, if this is still/again needed
280 + myconf+=( --disable-disallowing-of-undefined-references )
281 +
282 + # for build-time scripts
283 + if use ctypes-python || use python || use test; then
284 + python_setup
285 + fi
286 +
287 + if use python && [[ ${CHOST} == *-darwin* ]] ; then
288 + export ac_cv_python_link="$(tc-getCC) "'$(PYTHON_CFLAGS) -bundle -undefined dynamic_lookup $(PYTHON_LIBS)'
289 + export ac_cv_python_libs='$(PYTHON_CFLAGS) -bundle -undefined dynamic_lookup $(PYTHON_LIBS)'
290 + export ac_cv_python_compile="$(tc-getCC)"
291 + fi
292 +
293 + # allow overriding Python include directory
294 + ac_cv_path_RUBY=$(usex ruby "${EPREFIX%/}/usr/bin/ruby${RB_VER}" "none") \
295 + ac_cv_path_RDOC=$(usex ruby "${EPREFIX%/}/usr/bin/rdoc${RB_VER}" "none") \
296 + ac_cv_python_includes='-I$(PYTHON_INCLUDEDIR)' \
297 + econf "${myconf[@]}"
298 +}
299 +
300 +src_compile() {
301 + emake local-all
302 +
303 + if use ctypes-python ; then
304 + # pre-generate .py files
305 + use ctypes-python && emake ctypes-python
306 +
307 + pushd subversion/bindings/ctypes-python >/dev/null || die
308 + distutils-r1_src_compile
309 + popd >/dev/null || die
310 + fi
311 +
312 + if use python ; then
313 + swig_py_compile() {
314 + local p=subversion/bindings/swig/python
315 + rm -f ${p} || die
316 + ln -s "${BUILD_DIR}" ${p} || die
317 +
318 + python_export PYTHON_INCLUDEDIR
319 + emake swig-py \
320 + swig_pydir="$(python_get_sitedir)/libsvn" \
321 + swig_pydir_extra="$(python_get_sitedir)/svn"
322 + }
323 +
324 + # this will give us proper BUILD_DIR for symlinking
325 + BUILD_DIR=python \
326 + python_foreach_impl swig_py_compile
327 + fi
328 +
329 + if use perl ; then
330 + emake swig-pl
331 + fi
332 +
333 + if use ruby ; then
334 + emake swig-rb
335 + fi
336 +
337 + if use java ; then
338 + emake -j1 JAVAC_FLAGS="$(java-pkg_javac-args) -encoding iso8859-1" javahl
339 + fi
340 +
341 + if use extras ; then
342 + emake tools
343 + fi
344 +
345 + if use doc ; then
346 + doxygen doc/doxygen.conf || die "Building of Subversion HTML documentation failed"
347 +
348 + if use java; then
349 + emake doc-javahl
350 + fi
351 + fi
352 +}
353 +
354 +src_test() {
355 + if has_version ~${CATEGORY}/${P} ; then
356 + default
357 +
358 + if use ctypes-python ; then
359 + python_test() {
360 + "${PYTHON}" subversion/bindings/ctypes-python/test/run_all.py \
361 + || die "ctypes-python tests fail with ${EPYTHON}"
362 + }
363 +
364 + distutils-r1_src_test
365 + fi
366 +
367 + if use python ; then
368 + swig_py_test() {
369 + pushd "${BUILD_DIR}" >/dev/null || die
370 + "${PYTHON}" tests/run_all.py || die "swig-py tests fail with ${EPYTHON}"
371 + popd >/dev/null || die
372 + }
373 +
374 + BUILD_DIR=subversion/bindings/swig/python \
375 + python_foreach_impl swig_py_test
376 + fi
377 + else
378 + ewarn "The test suite shows errors when there is an older version of"
379 + ewarn "${CATEGORY}/${PN} installed. Please install =${CATEGORY}/${P}*"
380 + ewarn "before running the test suite."
381 + ewarn "Test suite skipped."
382 + fi
383 +}
384 +
385 +src_install() {
386 + emake -j1 DESTDIR="${D}" local-install
387 +
388 + if use ctypes-python ; then
389 + pushd subversion/bindings/ctypes-python >/dev/null || die
390 + distutils-r1_src_install
391 + popd >/dev/null || die
392 + fi
393 +
394 + if use python ; then
395 + swig_py_install() {
396 + local p=subversion/bindings/swig/python
397 + rm -f ${p} || die
398 + ln -s "${BUILD_DIR}" ${p} || die
399 +
400 + emake \
401 + DESTDIR="${D}" \
402 + swig_pydir="$(python_get_sitedir)/libsvn" \
403 + swig_pydir_extra="$(python_get_sitedir)/svn" \
404 + install-swig-py
405 + }
406 +
407 + BUILD_DIR=python \
408 + python_foreach_impl swig_py_install
409 + fi
410 +
411 + if use perl ; then
412 + emake DESTDIR="${D}" INSTALLDIRS="vendor" install-swig-pl
413 + perl_delete_localpod
414 + find "${ED}" \( -name .packlist -o -name "*.bs" \) -delete || die
415 + fi
416 +
417 + if use ruby ; then
418 + emake DESTDIR="${D}" install-swig-rb
419 + fi
420 +
421 + if use java ; then
422 + emake DESTDIR="${D}" install-javahl
423 + java-pkg_regso "${ED%/}"/usr/$(get_libdir)/libsvnjavahl*$(get_libname)
424 + java-pkg_dojar "${ED%/}"/usr/$(get_libdir)/svn-javahl/svn-javahl.jar
425 + rm -fr "${ED%/}"/usr/$(get_libdir)/svn-javahl/*.jar
426 + fi
427 +
428 + # Install Apache module configuration.
429 + if use apache2 ; then
430 + keepdir "${APACHE_MODULES_CONFDIR}"
431 + insinto "${APACHE_MODULES_CONFDIR}"
432 + doins "${FILESDIR}/47_mod_dav_svn.conf"
433 + fi
434 +
435 + # Install Bash Completion, bug 43179.
436 + newbashcomp tools/client-side/bash_completion svn
437 + bashcomp_alias svn svn{admin,dumpfilter,look,sync,version}
438 + rm -f tools/client-side/bash_completion
439 +
440 + # Install hot backup script, bug 54304.
441 + newbin tools/backup/hot-backup.py svn-hot-backup
442 + rm -fr tools/backup
443 +
444 + # Install svnserve init-script and xinet.d snippet, bug 43245.
445 + newinitd "${FILESDIR}"/svnserve.initd3 svnserve
446 + newconfd "${FILESDIR}"/svnserve.confd svnserve
447 + insinto /etc/xinetd.d
448 + newins "${FILESDIR}"/svnserve.xinetd svnserve
449 +
450 + #adjust default user and group with disabled apache2 USE flag, bug 381385
451 + if ! use apache2 ; then
452 + sed -e "s\USER:-apache\USER:-svn\g" \
453 + -e "s\GROUP:-apache\GROUP:-svnusers\g" \
454 + -i "${ED%/}"/etc/init.d/svnserve || die
455 + sed -e "0,/apache/s//svn/" \
456 + -e "s:apache:svnusers:" \
457 + -i "${ED%/}"/etc/xinetd.d/svnserve || die
458 + fi
459 +
460 + # Install documentation.
461 + dodoc CHANGES COMMITTERS README
462 + dodoc tools/xslt/svnindex.{css,xsl}
463 + rm -fr tools/xslt
464 +
465 + # Install extra files.
466 + if use extras ; then
467 + cat <<- EOF > 80subversion-extras
468 + PATH="${EPREFIX}/usr/$(get_libdir)/subversion/bin"
469 + ROOTPATH="${EPREFIX}/usr/$(get_libdir)/subversion/bin"
470 + EOF
471 + doenvd 80subversion-extras
472 +
473 + emake DESTDIR="${D}" toolsdir="/usr/$(get_libdir)/subversion/bin" install-tools
474 +
475 + find tools \( -name "*.bat" -o -name "*.in" -o -name ".libs" \) -print0 | xargs -0 rm -fr
476 + rm -fr tools/client-side/svnmucc
477 + rm -fr tools/server-side/{svn-populate-node-origins-index,svnauthz-validate}*
478 + rm -fr tools/{buildbot,dev,diff,po}
479 +
480 + insinto /usr/share/${PN}
481 + find tools -name '*.py' -exec sed -i -e '1s:python:&2:' {} + || die
482 + doins -r tools
483 + fi
484 +
485 + if use doc ; then
486 + docinto html
487 + dodoc -r doc/doxygen/html/*
488 +
489 + if use java ; then
490 + java-pkg_dojavadoc doc/javadoc
491 + fi
492 + fi
493 +
494 + prune_libtool_files --all
495 +
496 + cd "${ED%/}"/usr/share/locale
497 + for i in * ; do
498 + if [[ ${i} != *${LINGUAS}* ]] ; then
499 + rm -r ${i} || die
500 + fi
501 + done
502 +}
503 +
504 +pkg_preinst() {
505 + # Compare versions of Berkeley DB, bug 122877.
506 + if use berkdb && [[ -f "${EROOT}/usr/bin/svn" ]] ; then
507 + OLD_BDB_VERSION="$(scanelf -nq "${EROOT}/usr/$(get_libdir)/libsvn_subr-1$(get_libname 0)" | grep -Eo "libdb-[[:digit:]]+\.[[:digit:]]+" | sed -e "s/libdb-\(.*\)/\1/")"
508 + NEW_BDB_VERSION="$(scanelf -nq "${ED%/}/usr/$(get_libdir)/libsvn_subr-1$(get_libname 0)" | grep -Eo "libdb-[[:digit:]]+\.[[:digit:]]+" | sed -e "s/libdb-\(.*\)/\1/")"
509 + if [[ "${OLD_BDB_VERSION}" != "${NEW_BDB_VERSION}" ]] ; then
510 + CHANGED_BDB_VERSION="1"
511 + fi
512 + fi
513 +}
514 +
515 +pkg_postinst() {
516 + if [[ -n "${CHANGED_BDB_VERSION}" ]] ; then
517 + ewarn "You upgraded from an older version of Berkeley DB and may experience"
518 + ewarn "problems with your repository. Run the following commands as root to fix it:"
519 + ewarn " db4_recover -h ${SVN_REPOS_LOC}/repos"
520 + ewarn " chown -Rf apache:apache ${SVN_REPOS_LOC}/repos"
521 + fi
522 +
523 + ewarn "If you run subversion as a daemon, you will need to restart it to avoid module mismatches."
524 +}
525 +
526 +pkg_postrm() {
527 + :
528 +}
529 +
530 +pkg_config() {
531 + # Remember: Don't use ${EROOT}${SVN_REPOS_LOC} since ${SVN_REPOS_LOC}
532 + # already has EPREFIX in it
533 + einfo "Initializing the database in ${SVN_REPOS_LOC}..."
534 + if [[ -e "${SVN_REPOS_LOC}/repos" ]] ; then
535 + echo "A Subversion repository already exists and I will not overwrite it."
536 + echo "Delete \"${SVN_REPOS_LOC}/repos\" first if you're sure you want to have a clean version."
537 + else
538 + mkdir -p "${SVN_REPOS_LOC}/conf"
539 +
540 + einfo "Populating repository directory..."
541 + # Create initial repository.
542 + "${EROOT}/usr/bin/svnadmin" create "${SVN_REPOS_LOC}/repos"
543 +
544 + einfo "Setting repository permissions..."
545 + SVNSERVE_USER="$(. "${EROOT}/etc/conf.d/svnserve"; echo "${SVNSERVE_USER}")"
546 + SVNSERVE_GROUP="$(. "${EROOT}/etc/conf.d/svnserve"; echo "${SVNSERVE_GROUP}")"
547 + if use apache2 ; then
548 + [[ -z "${SVNSERVE_USER}" ]] && SVNSERVE_USER="apache"
549 + [[ -z "${SVNSERVE_GROUP}" ]] && SVNSERVE_GROUP="apache"
550 + else
551 + [[ -z "${SVNSERVE_USER}" ]] && SVNSERVE_USER="svn"
552 + [[ -z "${SVNSERVE_GROUP}" ]] && SVNSERVE_GROUP="svnusers"
553 + fi
554 + chmod -Rf go-rwx "${SVN_REPOS_LOC}/conf"
555 + chmod -Rf o-rwx "${SVN_REPOS_LOC}/repos"
556 + echo "Please create \"${SVNSERVE_GROUP}\" group if it does not exist yet."
557 + echo "Afterwards please create \"${SVNSERVE_USER}\" user with homedir \"${SVN_REPOS_LOC}\""
558 + echo "and as part of the \"${SVNSERVE_GROUP}\" group if it does not exist yet."
559 + echo "Finally, execute \"chown -Rf ${SVNSERVE_USER}:${SVNSERVE_GROUP} ${SVN_REPOS_LOC}/repos\""
560 + echo "to finish the configuration."
561 + fi
562 +}