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: Tue, 12 Mar 2019 08:59:15
Message-Id: 1552381144.e7bb5a2b1558eedcbdad446c68fcb91df7e44697.polynomial-c@gentoo
1 commit: e7bb5a2b1558eedcbdad446c68fcb91df7e44697
2 Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
3 AuthorDate: Tue Mar 12 08:57:19 2019 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Tue Mar 12 08:59:04 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e7bb5a2b
7
8 dev-vcs/subversion: Bump to version 1.12.0_rc1
9
10 Package-Manager: Portage-2.3.62, 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.12.0_rc1.ebuild | 528 ++++++++++++++++++++++++
15 2 files changed, 529 insertions(+)
16
17 diff --git a/dev-vcs/subversion/Manifest b/dev-vcs/subversion/Manifest
18 index 8ae6427cb0f..74cd6d00145 100644
19 --- a/dev-vcs/subversion/Manifest
20 +++ b/dev-vcs/subversion/Manifest
21 @@ -3,5 +3,6 @@ DIST subversion-1.10.3.tar.bz2 8374465 BLAKE2B 48610f0edec52dad43a4fd971098ed5d8
22 DIST subversion-1.10.4.tar.bz2 8392477 BLAKE2B 93364178d2252332b070ebddd5791cb43e0000802d820848a6ca2e13ae3036a9119901dcde1b73ea09bd34af3fd72b923bdd2765e302359e7f1ecf49a6840685 SHA512 c44a4a4a9533cd4f4cb6ddbc3ce98585a96da6c8e75497d087034b52f899797bb0972dfc0e79db99e81149e59e7fa765398c6ad35eba64f11f4ae9c3b3537434
23 DIST subversion-1.11.0.tar.bz2 8490744 BLAKE2B 27b2172e1ebae5641fc2bc73fd77f479278bc0725645e6bf8f974932e5c313552c508cdeeddce101f12fb983398ff81fd2ca2408950513d4ad0bd2cae4fcf729 SHA512 d73cc800080529b1716a027fd3001d9c963a3cb69619d059498c99426cccc21a2985d1eeb5e1bff8d421fff477a9dff6f9be1c092470152452cf5e7175414e92
24 DIST subversion-1.11.1.tar.bz2 8499709 BLAKE2B f14bbe9b28dec32894a8c262d32f36e01c9866352f1c54b5468804e81c1eadb895cbe9e33783a9e7d4a7f54dfa3b25b762015b9ca4886a14628c434254995c77 SHA512 2d082f715bf592ffc6a19311a9320dbae2ff0ee126b0472ce1c3f10e9aee670f43d894889430e6d093620f7b69c611e9a26773bc7a2f8b599ec37540ecd84a8d
25 +DIST subversion-1.12.0-rc1.tar.bz2 8503704 BLAKE2B e9f2779155aa45ee0f60359d292c085c1a4bbb2237964d6c045278d7dff71e665662c3af8bfcd81139eb7c501f8f0923377c80348202d1dfb1c9087fafe5a1ed SHA512 b82205d6530ba36d29194382897dbf0b79bd81326eebdaf71f21d061d3759c4f77fecfc2f9f5e761bef9e2534eb4567d62b96618813be644059d5c20219ff546
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.12.0_rc1.ebuild b/dev-vcs/subversion/subversion-1.12.0_rc1.ebuild
30 new file mode 100644
31 index 00000000000..088d6446ba4
32 --- /dev/null
33 +++ b/dev-vcs/subversion/subversion-1.12.0_rc1.ebuild
34 @@ -0,0 +1,528 @@
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="ruby26 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 + --enable-svnxx
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 +}