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