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, 29 Nov 2016 16:03:04
Message-Id: 1480435372.f41f37fe49472c2e0baa3811f04ed3fd5ffcaaff.polynomial-c@gentoo
1 commit: f41f37fe49472c2e0baa3811f04ed3fd5ffcaaff
2 Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
3 AuthorDate: Tue Nov 29 13:37:48 2016 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Tue Nov 29 16:02:52 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f41f37fe
7
8 dev-vcs/subversion: Sec bump to versions 1.8.17 and 1.9.5 (bug #600468).
9
10 CVE-2016-8734
11
12 Package-Manager: portage-2.3.2
13
14 dev-vcs/subversion/Manifest | 2 +
15 dev-vcs/subversion/subversion-1.8.17.ebuild | 509 ++++++++++++++++++++++++++++
16 dev-vcs/subversion/subversion-1.9.5.ebuild | 502 +++++++++++++++++++++++++++
17 3 files changed, 1013 insertions(+)
18
19 diff --git a/dev-vcs/subversion/Manifest b/dev-vcs/subversion/Manifest
20 index 3fc87fc..f8cf0ab 100644
21 --- a/dev-vcs/subversion/Manifest
22 +++ b/dev-vcs/subversion/Manifest
23 @@ -1,2 +1,4 @@
24 DIST subversion-1.8.16.tar.bz2 6919310 SHA256 f18f6e8309270982135aae54d96958f9ca6b93f8a4e746dd634b1b5b84edb346 SHA512 de8ce1aacd60516fd412f3f8b73e0e43c1a5e91d21d099937d3b02a1620aa947a330ec435d8662d5ad5372e23b1ebec1d8aea7d3ca4dd02eb3421924f6da88b1 WHIRLPOOL 01093eaf39173f4a789120ab8ed1b68dcb9b1bea5e9d396d23831b9a0733be412842a711ffe9b72e9d1bf26e835f47b1395b24f2a1301cc556e2520da6151f3e
25 +DIST subversion-1.8.17.tar.bz2 6924354 SHA256 de119538d29a5f2c028984cb54a55a4af3e9c32fa9316331bcbe5719e474a090 SHA512 49de24703bc40ccfd5a5df15215fd037f81c20f3047be5d3321bb2ce53dc7664505460791408a8989ede4a1357a0bdb49fb90a3db6ea2e2893c14a13a15b3ae7 WHIRLPOOL 6b420eb23fbf01ba418d759c275d1f0778c3904c76b78e88d4e82ed948fb44f578f6b171f927e4a4d96cf59eb49b528c9204909951d2cb41ad62804979098f1e
26 DIST subversion-1.9.4.tar.bz2 7911473 SHA256 1267f9e2ab983f260623bee841e6c9cc458bf4bf776238ed5f100983f79e9299 SHA512 fa512d8315dd6a435dcc5a3c2ca3cd7cf932364dd3a82063be868aa3ebcc04caf87cd3ff732d3e3d8aec86f3f58848e2b55987451d4697479bb151d1269db07f WHIRLPOOL 0323e5258be08dfdacb0e450b413bdfd053c0026a290dd45cfe5a03437c727d9ad088baba5a42fdd98ff47af5bdc09a0bbeba70a1e4e4e19a8ebcba7e7b7ddd3
27 +DIST subversion-1.9.5.tar.bz2 7904861 SHA256 8a4fc68aff1d18dcb4dd9e460648d24d9e98657fbed496c582929c6b3ce555e5 SHA512 ff7241ffae2506e97f40011242b5d5c6fa665f5463743f9acc52136b59ad84b6db00b60e70c44a9060579db49b818db06da1d1352aaee78e5bfe6ce56f32a2cf WHIRLPOOL 37a124dc2f99bb465b47083de168530f8178305e3208972d56c2c29a93bbf73ded816f742808cf9e7a5d3f13690e48cdd9f800abd85452ad1da4c13d603454f3
28
29 diff --git a/dev-vcs/subversion/subversion-1.8.17.ebuild b/dev-vcs/subversion/subversion-1.8.17.ebuild
30 new file mode 100644
31 index 00000000..c59642a
32 --- /dev/null
33 +++ b/dev-vcs/subversion/subversion-1.8.17.ebuild
34 @@ -0,0 +1,509 @@
35 +# Copyright 1999-2016 Gentoo Foundation
36 +# Distributed under the terms of the GNU General Public License v2
37 +# $Id$
38 +
39 +EAPI=5
40 +PYTHON_COMPAT=( python2_7 )
41 +USE_RUBY="ruby22 ruby21 ruby20"
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 eutils flag-o-matic java-pkg-opt-2 libtool multilib perl-module ruby-single
47 +
48 +MY_P="${P/_/-}"
49 +DESCRIPTION="Advanced version control system"
50 +HOMEPAGE="http://subversion.apache.org/"
51 +SRC_URI="mirror://apache/${PN}/${MY_P}.tar.bz2"
52 +S="${WORKDIR}/${MY_P}"
53 +
54 +LICENSE="Subversion GPL-2"
55 +SLOT="0"
56 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
57 +IUSE="apache2 berkdb ctypes-python debug doc +dso extras gnome-keyring +http java kde nls perl python ruby sasl test vim-syntax"
58 +
59 +COMMON_DEPEND=">=dev-db/sqlite-3.7.12
60 + >=dev-libs/apr-1.3:1
61 + >=dev-libs/apr-util-1.3:1
62 + dev-libs/expat
63 + sys-apps/file
64 + sys-libs/zlib
65 + app-arch/bzip2
66 + berkdb? ( >=sys-libs/db-4.0.14:= )
67 + ctypes-python? ( ${PYTHON_DEPS} )
68 + gnome-keyring? ( dev-libs/glib:2 sys-apps/dbus gnome-base/libgnome-keyring )
69 + kde? ( sys-apps/dbus dev-qt/qtcore:4 dev-qt/qtdbus:4 dev-qt/qtgui:4 >=kde-base/kdelibs-4:4 )
70 + perl? ( dev-lang/perl:= )
71 + python? ( ${PYTHON_DEPS} )
72 + ruby? ( ${RUBY_DEPS} )
73 + sasl? ( dev-libs/cyrus-sasl )
74 + http? ( >=net-libs/serf-1.2.1 )"
75 +RDEPEND="${COMMON_DEPEND}
76 + apache2? ( www-servers/apache[apache2_modules_dav] )
77 + java? ( >=virtual/jre-1.5 )
78 + kde? ( kde-apps/kwalletd:4 )
79 + nls? ( virtual/libintl )
80 + perl? ( dev-perl/URI )"
81 +# Note: ctypesgen doesn't need PYTHON_USEDEP, it's used once
82 +DEPEND="${COMMON_DEPEND}
83 + !!<sys-apps/sandbox-1.6
84 + ctypes-python? ( dev-python/ctypesgen )
85 + doc? ( app-doc/doxygen )
86 + gnome-keyring? ( virtual/pkgconfig )
87 + http? ( virtual/pkgconfig )
88 + java? ( >=virtual/jdk-1.5 )
89 + kde? ( virtual/pkgconfig )
90 + nls? ( sys-devel/gettext )
91 + test? ( ${PYTHON_DEPS} )"
92 +
93 +REQUIRED_USE="
94 + ctypes-python? ( ${PYTHON_REQUIRED_USE} )
95 + python? ( ${PYTHON_REQUIRED_USE} )
96 + test? (
97 + ${PYTHON_REQUIRED_USE}
98 + !dso
99 + )"
100 +
101 +PATCHES=(
102 + "${FILESDIR}"/${PN}-1.5.4-interix.patch
103 + "${FILESDIR}"/${PN}-1.5.6-aix-dso.patch
104 + "${FILESDIR}"/${PN}-1.8.0-hpux-dso.patch
105 + "${FILESDIR}"/${PN}-fix-parallel-build-support-for-perl-bindings.patch
106 + "${FILESDIR}"/${PN}-1.8.1-revert_bdb6check.patch
107 + "${FILESDIR}"/${PN}-1.8.16-javadoc-nolint.patch
108 +)
109 +
110 +want_apache
111 +
112 +pkg_setup() {
113 + if use berkdb ; then
114 + local apu_bdb_version="$(${EPREFIX}/usr/bin/apu-1-config --includes \
115 + | grep -Eoe '-I${EPREFIX}/usr/include/db[[:digit:]]\.[[:digit:]]' \
116 + | sed 's:.*b::')"
117 + einfo
118 + if [[ -z "${SVN_BDB_VERSION}" ]] ; then
119 + if [[ -n "${apu_bdb_version}" ]] ; then
120 + SVN_BDB_VERSION="${apu_bdb_version}"
121 + einfo "Matching db version to apr-util"
122 + else
123 + SVN_BDB_VERSION="$(db_ver_to_slot "$(db_findver sys-libs/db 2>/dev/null)")"
124 + einfo "SVN_BDB_VERSION variable isn't set. You can set it to enforce using of specific version of Berkeley DB."
125 + fi
126 + fi
127 + einfo "Using: Berkeley DB ${SVN_BDB_VERSION}"
128 + einfo
129 +
130 + if [[ -n "${apu_bdb_version}" && "${SVN_BDB_VERSION}" != "${apu_bdb_version}" ]]; then
131 + eerror "APR-Util is linked against Berkeley DB ${apu_bdb_version}, but you are trying"
132 + eerror "to build Subversion with support for Berkeley DB ${SVN_BDB_VERSION}."
133 + eerror "Rebuild dev-libs/apr-util or set SVN_BDB_VERSION=\"${apu_bdb_version}\"."
134 + eerror "Aborting to avoid possible run-time crashes."
135 + die "Berkeley DB version mismatch"
136 + fi
137 + fi
138 +
139 + depend.apache_pkg_setup
140 +
141 + java-pkg-opt-2_pkg_setup
142 +
143 + if ! use http ; then
144 + ewarn "WebDAV support is disabled. You need WebDAV to"
145 + ewarn "access repositories through the HTTP protocol."
146 + ewarn "Consider enabling \"http\" USE flag"
147 + echo -ne "\a"
148 + fi
149 +
150 + if use debug ; then
151 + append-cppflags -DSVN_DEBUG -DAP_DEBUG
152 + fi
153 +
154 + # http://mail-archives.apache.org/mod_mbox/subversion-dev/201306.mbox/%3C51C42014.3060700@××××××××.com%3E
155 + [[ ${CHOST} == *-solaris2* ]] && append-cppflags -D__EXTENSIONS__
156 +
157 + # Allow for custom repository locations.
158 + SVN_REPOS_LOC="${SVN_REPOS_LOC:-${EPREFIX}/var/svn}"
159 +
160 + if use ruby ; then
161 + local rbslot
162 + RB_VER=""
163 + for rbslot in $(sed 's@\([[:digit:]]\+\)\([[:digit:]]\)@\1.\2@g' <<< ${USE_RUBY//ruby}) ; do
164 + if has_version dev-lang/ruby:${rbslot} ; then
165 + RB_VER="${rbslot/.}"
166 + break
167 + fi
168 + done
169 + [[ -z "${RB_VER}" ]] && die "No useable ruby version found"
170 + fi
171 +}
172 +
173 +src_prepare() {
174 + epatch "${PATCHES[@]}"
175 +
176 + fperms +x build/transform_libtool_scripts.sh
177 +
178 + sed -i \
179 + -e "s/\(BUILD_RULES=.*\) bdb-test\(.*\)/\1\2/g" \
180 + -e "s/\(BUILD_RULES=.*\) test\(.*\)/\1\2/g" configure.ac
181 +
182 + # this bites us in particular on Solaris
183 + sed -i -e '1c\#!/usr/bin/env sh' build/transform_libtool_scripts.sh || \
184 + die "/bin/sh is not POSIX shell!"
185 +
186 + eautoconf
187 + elibtoolize
188 +
189 + sed -e 's/\(libsvn_swig_py\)-\(1\.la\)/\1-$(EPYTHON)-\2/g' \
190 + -i build-outputs.mk || die "sed failed"
191 +
192 + if use python ; then
193 + if [[ ${CHOST} == *-darwin* ]] ; then
194 + # http://mail-archives.apache.org/mod_mbox/subversion-dev/201306.mbox/%3C20130614113003.GA19257@××××××.local2%3E
195 + # in short, we don't have gnome-keyring stuff here, patch
196 + # borrowed from MacPorts
197 + epatch "${FILESDIR}"/${PN}-1.8.5-swig-python-no-gnome-keyring.patch
198 + fi
199 +
200 + # XXX: make python_copy_sources accept path
201 + S=${S}/subversion/bindings/swig/python python_copy_sources
202 + rm -r "${S}"/subversion/bindings/swig/python || die
203 + fi
204 +}
205 +
206 +src_configure() {
207 + local myconf=()
208 +
209 + if use python || use perl || use ruby; then
210 + myconf+=( --with-swig )
211 + else
212 + myconf+=( --without-swig )
213 + fi
214 +
215 + if use java ; then
216 + myconf+=( --without-junit )
217 + fi
218 +
219 + case ${CHOST} in
220 + *-aix*)
221 + # avoid recording immediate path to sharedlibs into executables
222 + append-ldflags -Wl,-bnoipath
223 + ;;
224 + *-interix*)
225 + # loader crashes on the LD_PRELOADs...
226 + myconf+=( --disable-local-library-preloading )
227 + ;;
228 + *-solaris*)
229 + # need -lintl to link
230 + use nls && append-libs intl
231 + # this breaks installation, on x64 echo replacement is 32-bits
232 + myconf+=( --disable-local-library-preloading )
233 + ;;
234 + *-mint*)
235 + myconf+=( --enable-all-static --disable-local-library-preloading )
236 + ;;
237 + *)
238 + # inject LD_PRELOAD entries for easy in-tree development
239 + myconf+=( --enable-local-library-preloading )
240 + ;;
241 + esac
242 +
243 + #version 1.7.7 again tries to link against the older installed version and fails, when trying to
244 + #compile for x86 on amd64, so workaround this issue again
245 + #check newer versions, if this is still/again needed
246 + myconf+=( --disable-disallowing-of-undefined-references )
247 +
248 + # for build-time scripts
249 + if use ctypes-python || use python || use test; then
250 + python_setup
251 + fi
252 +
253 + if use python && [[ ${CHOST} == *-darwin* ]] ; then
254 + export ac_cv_python_link="$(tc-getCC) "'$(PYTHON_CFLAGS) -bundle -undefined dynamic_lookup $(PYTHON_LIBS)'
255 + export ac_cv_python_libs='$(PYTHON_CFLAGS) -bundle -undefined dynamic_lookup $(PYTHON_LIBS)'
256 + export ac_cv_python_compile="$(tc-getCC)"
257 + fi
258 +
259 + # allow overriding Python include directory
260 + ac_cv_path_RUBY=$(usex ruby "${EPREFIX}/usr/bin/ruby${RB_VER}" "none") \
261 + ac_cv_path_RDOC=$(usex ruby "${EPREFIX}/usr/bin/rdoc${RB_VER}" "none") \
262 + ac_cv_python_includes='-I$(PYTHON_INCLUDEDIR)' \
263 + econf --libdir="${EPREFIX}/usr/$(get_libdir)" \
264 + $(use_with apache2 apache-libexecdir) \
265 + $(use_with apache2 apxs "${APXS}") \
266 + $(use_with berkdb berkeley-db "db.h:${EPREFIX}/usr/include/db${SVN_BDB_VERSION}::db-${SVN_BDB_VERSION}") \
267 + $(use_with ctypes-python ctypesgen "${EPREFIX}/usr") \
268 + $(use_enable dso runtime-module-search) \
269 + $(use_with gnome-keyring) \
270 + $(use_enable java javahl) \
271 + $(use_with java jdk "${JAVA_HOME}") \
272 + $(use_with kde kwallet) \
273 + $(use_enable nls) \
274 + $(use_with sasl) \
275 + $(use_with http serf) \
276 + ${myconf[@]} \
277 + --with-apr="${EPREFIX}/usr/bin/apr-1-config" \
278 + --with-apr-util="${EPREFIX}/usr/bin/apu-1-config" \
279 + --disable-experimental-libtool \
280 + --without-jikes \
281 + --disable-mod-activation \
282 + --disable-static
283 +}
284 +
285 +src_compile() {
286 + emake local-all
287 +
288 + if use ctypes-python ; then
289 + # pre-generate .py files
290 + use ctypes-python && emake ctypes-python
291 +
292 + pushd subversion/bindings/ctypes-python >/dev/null || die
293 + distutils-r1_src_compile
294 + popd >/dev/null || die
295 + fi
296 +
297 + if use python ; then
298 + swig_py_compile() {
299 + local p=subversion/bindings/swig/python
300 + rm -f ${p} || die
301 + ln -s "${BUILD_DIR}" ${p} || die
302 +
303 + python_export PYTHON_INCLUDEDIR
304 + emake swig-py \
305 + swig_pydir="$(python_get_sitedir)/libsvn" \
306 + swig_pydir_extra="$(python_get_sitedir)/svn"
307 + }
308 +
309 + # this will give us proper BUILD_DIR for symlinking
310 + BUILD_DIR=python \
311 + python_foreach_impl swig_py_compile
312 + fi
313 +
314 + if use perl ; then
315 + emake swig-pl
316 + fi
317 +
318 + if use ruby ; then
319 + emake swig-rb
320 + fi
321 +
322 + if use java ; then
323 + emake -j1 JAVAC_FLAGS="$(java-pkg_javac-args) -encoding iso8859-1" javahl
324 + fi
325 +
326 + if use extras ; then
327 + emake tools
328 + fi
329 +
330 + if use doc ; then
331 + doxygen doc/doxygen.conf || die "Building of Subversion HTML documentation failed"
332 +
333 + if use java; then
334 + emake doc-javahl
335 + fi
336 + fi
337 +}
338 +
339 +src_test() {
340 + if has_version ~${CATEGORY}/${P} ; then
341 + default
342 +
343 + if use ctypes-python ; then
344 + python_test() {
345 + "${PYTHON}" subversion/bindings/ctypes-python/test/run_all.py \
346 + || die "ctypes-python tests fail with ${EPYTHON}"
347 + }
348 +
349 + distutils-r1_src_test
350 + fi
351 +
352 + if use python ; then
353 + swig_py_test() {
354 + pushd "${BUILD_DIR}" >/dev/null || die
355 + "${PYTHON}" tests/run_all.py || die "swig-py tests fail with ${EPYTHON}"
356 + popd >/dev/null || die
357 + }
358 +
359 + BUILD_DIR=subversion/bindings/swig/python \
360 + python_foreach_impl swig_py_test
361 + fi
362 + else
363 + ewarn "The test suite shows errors when there is an older version of"
364 + ewarn "${CATEGORY}/${PN} installed. Please install =${CATEGORY}/${P}*"
365 + ewarn "before running the test suite."
366 + ewarn "Test suite skipped."
367 + fi
368 +}
369 +
370 +src_install() {
371 + emake -j1 DESTDIR="${D}" local-install
372 +
373 + if use ctypes-python ; then
374 + pushd subversion/bindings/ctypes-python >/dev/null || die
375 + distutils-r1_src_install
376 + popd >/dev/null || die
377 + fi
378 +
379 + if use python ; then
380 + swig_py_install() {
381 + local p=subversion/bindings/swig/python
382 + rm -f ${p} || die
383 + ln -s "${BUILD_DIR}" ${p} || die
384 +
385 + emake \
386 + DESTDIR="${D}" \
387 + swig_pydir="$(python_get_sitedir)/libsvn" \
388 + swig_pydir_extra="$(python_get_sitedir)/svn" \
389 + install-swig-py
390 + }
391 +
392 + BUILD_DIR=python \
393 + python_foreach_impl swig_py_install
394 + fi
395 +
396 + if use perl ; then
397 + emake DESTDIR="${D}" INSTALLDIRS="vendor" install-swig-pl
398 + perl_delete_localpod
399 + find "${ED}" "(" -name .packlist -o -name "*.bs" ")" -delete
400 + fi
401 +
402 + if use ruby ; then
403 + emake DESTDIR="${D}" install-swig-rb
404 + fi
405 +
406 + if use java ; then
407 + emake DESTDIR="${D}" install-javahl
408 + java-pkg_regso "${ED}"usr/$(get_libdir)/libsvnjavahl*$(get_libname)
409 + java-pkg_dojar "${ED}"usr/$(get_libdir)/svn-javahl/svn-javahl.jar
410 + rm -fr "${ED}"usr/$(get_libdir)/svn-javahl/*.jar
411 + fi
412 +
413 + # Install Apache module configuration.
414 + if use apache2 ; then
415 + keepdir "${APACHE_MODULES_CONFDIR}"
416 + insinto "${APACHE_MODULES_CONFDIR}"
417 + doins "${FILESDIR}/47_mod_dav_svn.conf"
418 + fi
419 +
420 + # Install Bash Completion, bug 43179.
421 + newbashcomp tools/client-side/bash_completion svn
422 + bashcomp_alias svn svn{admin,dumpfilter,look,sync,version}
423 + rm -f tools/client-side/bash_completion
424 +
425 + # Install hot backup script, bug 54304.
426 + newbin tools/backup/hot-backup.py svn-hot-backup
427 + rm -fr tools/backup
428 +
429 + # Install svnserve init-script and xinet.d snippet, bug 43245.
430 + newinitd "${FILESDIR}"/svnserve.initd3 svnserve
431 + newconfd "${FILESDIR}"/svnserve.confd svnserve
432 + insinto /etc/xinetd.d
433 + newins "${FILESDIR}"/svnserve.xinetd svnserve
434 +
435 + #adjust default user and group with disabled apache2 USE flag, bug 381385
436 + use apache2 || sed -e "s\USER:-apache\USER:-svn\g" \
437 + -e "s\GROUP:-apache\GROUP:-svnusers\g" \
438 + -i "${ED}"etc/init.d/svnserve || die
439 + use apache2 || sed -e "0,/apache/s//svn/" \
440 + -e "s:apache:svnusers:" \
441 + -i "${ED}"etc/xinetd.d/svnserve || die
442 +
443 + # Install documentation.
444 + dodoc CHANGES COMMITTERS README
445 + dodoc tools/xslt/svnindex.{css,xsl}
446 + rm -fr tools/xslt
447 +
448 + # Install extra files.
449 + if use extras ; then
450 + cat << EOF > 80subversion-extras
451 +PATH="${EPREFIX}/usr/$(get_libdir)/subversion/bin"
452 +ROOTPATH="${EPREFIX}/usr/$(get_libdir)/subversion/bin"
453 +EOF
454 + doenvd 80subversion-extras
455 +
456 + emake DESTDIR="${D}" toolsdir="/usr/$(get_libdir)/subversion/bin" install-tools
457 +
458 + find tools "(" -name "*.bat" -o -name "*.in" -o -name ".libs" ")" -print0 | xargs -0 rm -fr
459 + rm -fr tools/client-side/svnmucc
460 + rm -fr tools/server-side/{svn-populate-node-origins-index,svnauthz-validate}*
461 + rm -fr tools/{buildbot,dev,diff,po}
462 +
463 + insinto /usr/share/${PN}
464 + find tools -name '*.py' -exec sed -i -e '1s:python:&2:' {} + || die
465 + doins -r tools
466 + fi
467 +
468 + if use doc ; then
469 + docinto html
470 + dodoc -r doc/doxygen/html/*
471 +
472 + if use java ; then
473 + java-pkg_dojavadoc doc/javadoc
474 + fi
475 + fi
476 +
477 + prune_libtool_files --all
478 +
479 + cd "${ED}"usr/share/locale
480 + for i in * ; do
481 + [[ ${i} == *$LINGUAS* ]] || { rm -r ${i} || die ; }
482 + done
483 +}
484 +
485 +pkg_preinst() {
486 + # Compare versions of Berkeley DB, bug 122877.
487 + if use berkdb && [[ -f "${EROOT}usr/bin/svn" ]] ; then
488 + 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/")"
489 + 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/")"
490 + if [[ "${OLD_BDB_VERSION}" != "${NEW_BDB_VERSION}" ]] ; then
491 + CHANGED_BDB_VERSION="1"
492 + fi
493 + fi
494 +}
495 +
496 +pkg_postinst() {
497 + if [[ -n "${CHANGED_BDB_VERSION}" ]] ; then
498 + ewarn "You upgraded from an older version of Berkeley DB and may experience"
499 + ewarn "problems with your repository. Run the following commands as root to fix it:"
500 + ewarn " db4_recover -h ${SVN_REPOS_LOC}/repos"
501 + ewarn " chown -Rf apache:apache ${SVN_REPOS_LOC}/repos"
502 + fi
503 +
504 + ewarn "If you run subversion as a daemon, you will need to restart it to avoid module mismatches."
505 +}
506 +
507 +pkg_postrm() {
508 + :
509 +}
510 +
511 +pkg_config() {
512 + # Remember: Don't use ${EROOT}${SVN_REPOS_LOC} since ${SVN_REPOS_LOC}
513 + # already has EPREFIX in it
514 + einfo "Initializing the database in ${SVN_REPOS_LOC}..."
515 + if [[ -e "${SVN_REPOS_LOC}/repos" ]] ; then
516 + echo "A Subversion repository already exists and I will not overwrite it."
517 + echo "Delete \"${SVN_REPOS_LOC}/repos\" first if you're sure you want to have a clean version."
518 + else
519 + mkdir -p "${SVN_REPOS_LOC}/conf"
520 +
521 + einfo "Populating repository directory..."
522 + # Create initial repository.
523 + "${EROOT}usr/bin/svnadmin" create "${SVN_REPOS_LOC}/repos"
524 +
525 + einfo "Setting repository permissions..."
526 + SVNSERVE_USER="$(. "${EROOT}etc/conf.d/svnserve"; echo "${SVNSERVE_USER}")"
527 + SVNSERVE_GROUP="$(. "${EROOT}etc/conf.d/svnserve"; echo "${SVNSERVE_GROUP}")"
528 + if use apache2 ; then
529 + [[ -z "${SVNSERVE_USER}" ]] && SVNSERVE_USER="apache"
530 + [[ -z "${SVNSERVE_GROUP}" ]] && SVNSERVE_GROUP="apache"
531 + else
532 + [[ -z "${SVNSERVE_USER}" ]] && SVNSERVE_USER="svn"
533 + [[ -z "${SVNSERVE_GROUP}" ]] && SVNSERVE_GROUP="svnusers"
534 + fi
535 + chmod -Rf go-rwx "${SVN_REPOS_LOC}/conf"
536 + chmod -Rf o-rwx "${SVN_REPOS_LOC}/repos"
537 + echo "Please create \"${SVNSERVE_GROUP}\" group if it does not exist yet."
538 + echo "Afterwards please create \"${SVNSERVE_USER}\" user with homedir \"${SVN_REPOS_LOC}\""
539 + echo "and as part of the \"${SVNSERVE_GROUP}\" group if it does not exist yet."
540 + echo "Finally, execute \"chown -Rf ${SVNSERVE_USER}:${SVNSERVE_GROUP} ${SVN_REPOS_LOC}/repos\""
541 + echo "to finish the configuration."
542 + fi
543 +}
544
545 diff --git a/dev-vcs/subversion/subversion-1.9.5.ebuild b/dev-vcs/subversion/subversion-1.9.5.ebuild
546 new file mode 100644
547 index 00000000..0c77f3f
548 --- /dev/null
549 +++ b/dev-vcs/subversion/subversion-1.9.5.ebuild
550 @@ -0,0 +1,502 @@
551 +# Copyright 1999-2016 Gentoo Foundation
552 +# Distributed under the terms of the GNU General Public License v2
553 +# $Id$
554 +
555 +EAPI=5
556 +PYTHON_COMPAT=( python2_7 )
557 +USE_RUBY="ruby23 ruby22 ruby21 ruby20"
558 +DISTUTILS_OPTIONAL=1
559 +WANT_AUTOMAKE="none"
560 +GENTOO_DEPEND_ON_PERL="no"
561 +
562 +inherit autotools bash-completion-r1 db-use depend.apache distutils-r1 elisp-common eutils flag-o-matic java-pkg-opt-2 libtool multilib perl-module ruby-single
563 +
564 +MY_P="${P/_/-}"
565 +DESCRIPTION="Advanced version control system"
566 +HOMEPAGE="http://subversion.apache.org/"
567 +SRC_URI="mirror://apache/${PN}/${MY_P}.tar.bz2"
568 +S="${WORKDIR}/${MY_P}"
569 +
570 +LICENSE="Subversion GPL-2"
571 +SLOT="0"
572 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
573 +IUSE="apache2 berkdb ctypes-python debug doc +dso extras gnome-keyring +http java kde nls perl python ruby sasl test vim-syntax"
574 +
575 +COMMON_DEPEND=">=dev-db/sqlite-3.7.12
576 + >=dev-libs/apr-1.3:1
577 + >=dev-libs/apr-util-1.3:1
578 + dev-libs/expat
579 + sys-apps/file
580 + sys-libs/zlib
581 + app-arch/bzip2
582 + berkdb? ( >=sys-libs/db-4.0.14:= )
583 + ctypes-python? ( ${PYTHON_DEPS} )
584 + gnome-keyring? ( dev-libs/glib:2 sys-apps/dbus gnome-base/libgnome-keyring )
585 + kde? ( sys-apps/dbus dev-qt/qtcore:4 dev-qt/qtdbus:4 dev-qt/qtgui:4 >=kde-base/kdelibs-4:4 )
586 + perl? ( dev-lang/perl:= )
587 + python? ( ${PYTHON_DEPS} )
588 + ruby? ( ${RUBY_DEPS} )
589 + sasl? ( dev-libs/cyrus-sasl )
590 + http? ( >=net-libs/serf-1.3.4 )"
591 +RDEPEND="${COMMON_DEPEND}
592 + apache2? ( www-servers/apache[apache2_modules_dav] )
593 + java? ( >=virtual/jre-1.5 )
594 + kde? ( kde-apps/kwalletd:4 )
595 + nls? ( virtual/libintl )
596 + perl? ( dev-perl/URI )"
597 +# Note: ctypesgen doesn't need PYTHON_USEDEP, it's used once
598 +DEPEND="${COMMON_DEPEND}
599 + !!<sys-apps/sandbox-1.6
600 + ctypes-python? ( dev-python/ctypesgen )
601 + doc? ( app-doc/doxygen )
602 + gnome-keyring? ( virtual/pkgconfig )
603 + http? ( virtual/pkgconfig )
604 + java? ( >=virtual/jdk-1.5 )
605 + kde? ( virtual/pkgconfig )
606 + nls? ( sys-devel/gettext )
607 + test? ( ${PYTHON_DEPS} )"
608 +
609 +REQUIRED_USE="
610 + ctypes-python? ( ${PYTHON_REQUIRED_USE} )
611 + python? ( ${PYTHON_REQUIRED_USE} )
612 + test? (
613 + ${PYTHON_REQUIRED_USE}
614 + !dso
615 + )"
616 +
617 +PATCHES=(
618 + "${FILESDIR}"/${PN}-1.5.4-interix.patch
619 + "${FILESDIR}"/${PN}-1.5.6-aix-dso.patch
620 + "${FILESDIR}"/${PN}-1.8.0-hpux-dso.patch
621 + "${FILESDIR}"/${PN}-fix-parallel-build-support-for-perl-bindings.patch
622 + "${FILESDIR}"/${PN}-1.8.1-revert_bdb6check.patch
623 + "${FILESDIR}"/${PN}-1.8.16-javadoc-nolint.patch
624 +)
625 +
626 +want_apache
627 +
628 +pkg_setup() {
629 + if use berkdb ; then
630 + local apu_bdb_version="$(${EPREFIX}/usr/bin/apu-1-config --includes \
631 + | grep -Eoe '-I${EPREFIX}/usr/include/db[[:digit:]]\.[[:digit:]]' \
632 + | sed 's:.*b::')"
633 + einfo
634 + if [[ -z "${SVN_BDB_VERSION}" ]] ; then
635 + if [[ -n "${apu_bdb_version}" ]] ; then
636 + SVN_BDB_VERSION="${apu_bdb_version}"
637 + einfo "Matching db version to apr-util"
638 + else
639 + SVN_BDB_VERSION="$(db_ver_to_slot "$(db_findver sys-libs/db 2>/dev/null)")"
640 + einfo "SVN_BDB_VERSION variable isn't set. You can set it to enforce using of specific version of Berkeley DB."
641 + fi
642 + fi
643 + einfo "Using: Berkeley DB ${SVN_BDB_VERSION}"
644 + einfo
645 +
646 + if [[ -n "${apu_bdb_version}" && "${SVN_BDB_VERSION}" != "${apu_bdb_version}" ]]; then
647 + eerror "APR-Util is linked against Berkeley DB ${apu_bdb_version}, but you are trying"
648 + eerror "to build Subversion with support for Berkeley DB ${SVN_BDB_VERSION}."
649 + eerror "Rebuild dev-libs/apr-util or set SVN_BDB_VERSION=\"${apu_bdb_version}\"."
650 + eerror "Aborting to avoid possible run-time crashes."
651 + die "Berkeley DB version mismatch"
652 + fi
653 + fi
654 +
655 + depend.apache_pkg_setup
656 +
657 + java-pkg-opt-2_pkg_setup
658 +
659 + if ! use http ; then
660 + ewarn "WebDAV support is disabled. You need WebDAV to"
661 + ewarn "access repositories through the HTTP protocol."
662 + ewarn "Consider enabling \"http\" USE flag"
663 + echo -ne "\a"
664 + fi
665 +
666 + if use debug ; then
667 + append-cppflags -DSVN_DEBUG -DAP_DEBUG
668 + fi
669 +
670 + # http://mail-archives.apache.org/mod_mbox/subversion-dev/201306.mbox/%3C51C42014.3060700@××××××××.com%3E
671 + [[ ${CHOST} == *-solaris2* ]] && append-cppflags -D__EXTENSIONS__
672 +
673 + # Allow for custom repository locations.
674 + SVN_REPOS_LOC="${SVN_REPOS_LOC:-${EPREFIX}/var/svn}"
675 +
676 + if use ruby ; then
677 + local rbslot
678 + RB_VER=""
679 + for rbslot in $(sed 's@\([[:digit:]]\+\)\([[:digit:]]\)@\1.\2@g' <<< ${USE_RUBY//ruby}) ; do
680 + if has_version dev-lang/ruby:${rbslot} ; then
681 + RB_VER="${rbslot/.}"
682 + break
683 + fi
684 + done
685 + [[ -z "${RB_VER}" ]] && die "No useable ruby version found"
686 + fi
687 +}
688 +
689 +src_prepare() {
690 + epatch "${PATCHES[@]}"
691 +
692 + fperms +x build/transform_libtool_scripts.sh
693 +
694 + sed -i \
695 + -e "s/\(BUILD_RULES=.*\) bdb-test\(.*\)/\1\2/g" \
696 + -e "s/\(BUILD_RULES=.*\) test\(.*\)/\1\2/g" configure.ac
697 +
698 + # this bites us in particular on Solaris
699 + sed -i -e '1c\#!/usr/bin/env sh' build/transform_libtool_scripts.sh || \
700 + die "/bin/sh is not POSIX shell!"
701 +
702 + eautoconf
703 + elibtoolize
704 +
705 + sed -e 's/\(libsvn_swig_py\)-\(1\.la\)/\1-$(EPYTHON)-\2/g' \
706 + -i build-outputs.mk || die "sed failed"
707 +
708 + if use python ; then
709 + # XXX: make python_copy_sources accept path
710 + S=${S}/subversion/bindings/swig/python python_copy_sources
711 + rm -r "${S}"/subversion/bindings/swig/python || die
712 + fi
713 +}
714 +
715 +src_configure() {
716 + local myconf=()
717 +
718 + if use python || use perl || use ruby; then
719 + myconf+=( --with-swig )
720 + else
721 + myconf+=( --without-swig )
722 + fi
723 +
724 + if use java ; then
725 + myconf+=( --without-junit )
726 + fi
727 +
728 + case ${CHOST} in
729 + *-aix*)
730 + # avoid recording immediate path to sharedlibs into executables
731 + append-ldflags -Wl,-bnoipath
732 + ;;
733 + *-interix*)
734 + # loader crashes on the LD_PRELOADs...
735 + myconf+=( --disable-local-library-preloading )
736 + ;;
737 + *-solaris*)
738 + # need -lintl to link
739 + use nls && append-libs intl
740 + # this breaks installation, on x64 echo replacement is 32-bits
741 + myconf+=( --disable-local-library-preloading )
742 + ;;
743 + *-mint*)
744 + myconf+=( --enable-all-static --disable-local-library-preloading )
745 + ;;
746 + *)
747 + # inject LD_PRELOAD entries for easy in-tree development
748 + myconf+=( --enable-local-library-preloading )
749 + ;;
750 + esac
751 +
752 + #version 1.7.7 again tries to link against the older installed version and fails, when trying to
753 + #compile for x86 on amd64, so workaround this issue again
754 + #check newer versions, if this is still/again needed
755 + myconf+=( --disable-disallowing-of-undefined-references )
756 +
757 + # for build-time scripts
758 + if use ctypes-python || use python || use test; then
759 + python_setup
760 + fi
761 +
762 + if use python && [[ ${CHOST} == *-darwin* ]] ; then
763 + export ac_cv_python_link="$(tc-getCC) "'$(PYTHON_CFLAGS) -bundle -undefined dynamic_lookup $(PYTHON_LIBS)'
764 + export ac_cv_python_libs='$(PYTHON_CFLAGS) -bundle -undefined dynamic_lookup $(PYTHON_LIBS)'
765 + export ac_cv_python_compile="$(tc-getCC)"
766 + fi
767 +
768 + # allow overriding Python include directory
769 + ac_cv_path_RUBY=$(usex ruby "${EPREFIX}/usr/bin/ruby${RB_VER}" "none") \
770 + ac_cv_path_RDOC=$(usex ruby "${EPREFIX}/usr/bin/rdoc${RB_VER}" "none") \
771 + ac_cv_python_includes='-I$(PYTHON_INCLUDEDIR)' \
772 + econf --libdir="${EPREFIX}/usr/$(get_libdir)" \
773 + $(use_with apache2 apache-libexecdir) \
774 + $(use_with apache2 apxs "${APXS}") \
775 + $(use_with berkdb berkeley-db "db.h:${EPREFIX}/usr/include/db${SVN_BDB_VERSION}::db-${SVN_BDB_VERSION}") \
776 + $(use_with ctypes-python ctypesgen "${EPREFIX}/usr") \
777 + $(use_enable dso runtime-module-search) \
778 + $(use_with gnome-keyring) \
779 + $(use_enable java javahl) \
780 + $(use_with java jdk "${JAVA_HOME}") \
781 + $(use_with kde kwallet) \
782 + $(use_enable nls) \
783 + $(use_with sasl) \
784 + $(use_with http serf) \
785 + ${myconf[@]} \
786 + --with-apr="${EPREFIX}/usr/bin/apr-1-config" \
787 + --with-apr-util="${EPREFIX}/usr/bin/apu-1-config" \
788 + --disable-experimental-libtool \
789 + --without-jikes \
790 + --disable-mod-activation \
791 + --disable-static
792 +}
793 +
794 +src_compile() {
795 + emake local-all
796 +
797 + if use ctypes-python ; then
798 + # pre-generate .py files
799 + use ctypes-python && emake ctypes-python
800 +
801 + pushd subversion/bindings/ctypes-python >/dev/null || die
802 + distutils-r1_src_compile
803 + popd >/dev/null || die
804 + fi
805 +
806 + if use python ; then
807 + swig_py_compile() {
808 + local p=subversion/bindings/swig/python
809 + rm -f ${p} || die
810 + ln -s "${BUILD_DIR}" ${p} || die
811 +
812 + python_export PYTHON_INCLUDEDIR
813 + emake swig-py \
814 + swig_pydir="$(python_get_sitedir)/libsvn" \
815 + swig_pydir_extra="$(python_get_sitedir)/svn"
816 + }
817 +
818 + # this will give us proper BUILD_DIR for symlinking
819 + BUILD_DIR=python \
820 + python_foreach_impl swig_py_compile
821 + fi
822 +
823 + if use perl ; then
824 + emake swig-pl
825 + fi
826 +
827 + if use ruby ; then
828 + emake swig-rb
829 + fi
830 +
831 + if use java ; then
832 + emake -j1 JAVAC_FLAGS="$(java-pkg_javac-args) -encoding iso8859-1" javahl
833 + fi
834 +
835 + if use extras ; then
836 + emake tools
837 + fi
838 +
839 + if use doc ; then
840 + doxygen doc/doxygen.conf || die "Building of Subversion HTML documentation failed"
841 +
842 + if use java; then
843 + emake doc-javahl
844 + fi
845 + fi
846 +}
847 +
848 +src_test() {
849 + if has_version ~${CATEGORY}/${P} ; then
850 + default
851 +
852 + if use ctypes-python ; then
853 + python_test() {
854 + "${PYTHON}" subversion/bindings/ctypes-python/test/run_all.py \
855 + || die "ctypes-python tests fail with ${EPYTHON}"
856 + }
857 +
858 + distutils-r1_src_test
859 + fi
860 +
861 + if use python ; then
862 + swig_py_test() {
863 + pushd "${BUILD_DIR}" >/dev/null || die
864 + "${PYTHON}" tests/run_all.py || die "swig-py tests fail with ${EPYTHON}"
865 + popd >/dev/null || die
866 + }
867 +
868 + BUILD_DIR=subversion/bindings/swig/python \
869 + python_foreach_impl swig_py_test
870 + fi
871 + else
872 + ewarn "The test suite shows errors when there is an older version of"
873 + ewarn "${CATEGORY}/${PN} installed. Please install =${CATEGORY}/${P}*"
874 + ewarn "before running the test suite."
875 + ewarn "Test suite skipped."
876 + fi
877 +}
878 +
879 +src_install() {
880 + emake -j1 DESTDIR="${D}" local-install
881 +
882 + if use ctypes-python ; then
883 + pushd subversion/bindings/ctypes-python >/dev/null || die
884 + distutils-r1_src_install
885 + popd >/dev/null || die
886 + fi
887 +
888 + if use python ; then
889 + swig_py_install() {
890 + local p=subversion/bindings/swig/python
891 + rm -f ${p} || die
892 + ln -s "${BUILD_DIR}" ${p} || die
893 +
894 + emake \
895 + DESTDIR="${D}" \
896 + swig_pydir="$(python_get_sitedir)/libsvn" \
897 + swig_pydir_extra="$(python_get_sitedir)/svn" \
898 + install-swig-py
899 + }
900 +
901 + BUILD_DIR=python \
902 + python_foreach_impl swig_py_install
903 + fi
904 +
905 + if use perl ; then
906 + emake DESTDIR="${D}" INSTALLDIRS="vendor" install-swig-pl
907 + perl_delete_localpod
908 + find "${ED}" "(" -name .packlist -o -name "*.bs" ")" -delete
909 + fi
910 +
911 + if use ruby ; then
912 + emake DESTDIR="${D}" install-swig-rb
913 + fi
914 +
915 + if use java ; then
916 + emake DESTDIR="${D}" install-javahl
917 + java-pkg_regso "${ED}"usr/$(get_libdir)/libsvnjavahl*$(get_libname)
918 + java-pkg_dojar "${ED}"usr/$(get_libdir)/svn-javahl/svn-javahl.jar
919 + rm -fr "${ED}"usr/$(get_libdir)/svn-javahl/*.jar
920 + fi
921 +
922 + # Install Apache module configuration.
923 + if use apache2 ; then
924 + keepdir "${APACHE_MODULES_CONFDIR}"
925 + insinto "${APACHE_MODULES_CONFDIR}"
926 + doins "${FILESDIR}/47_mod_dav_svn.conf"
927 + fi
928 +
929 + # Install Bash Completion, bug 43179.
930 + newbashcomp tools/client-side/bash_completion svn
931 + bashcomp_alias svn svn{admin,dumpfilter,look,sync,version}
932 + rm -f tools/client-side/bash_completion
933 +
934 + # Install hot backup script, bug 54304.
935 + newbin tools/backup/hot-backup.py svn-hot-backup
936 + rm -fr tools/backup
937 +
938 + # Install svnserve init-script and xinet.d snippet, bug 43245.
939 + newinitd "${FILESDIR}"/svnserve.initd3 svnserve
940 + newconfd "${FILESDIR}"/svnserve.confd svnserve
941 + insinto /etc/xinetd.d
942 + newins "${FILESDIR}"/svnserve.xinetd svnserve
943 +
944 + #adjust default user and group with disabled apache2 USE flag, bug 381385
945 + use apache2 || sed -e "s\USER:-apache\USER:-svn\g" \
946 + -e "s\GROUP:-apache\GROUP:-svnusers\g" \
947 + -i "${ED}"etc/init.d/svnserve || die
948 + use apache2 || sed -e "0,/apache/s//svn/" \
949 + -e "s:apache:svnusers:" \
950 + -i "${ED}"etc/xinetd.d/svnserve || die
951 +
952 + # Install documentation.
953 + dodoc CHANGES COMMITTERS README
954 + dodoc tools/xslt/svnindex.{css,xsl}
955 + rm -fr tools/xslt
956 +
957 + # Install extra files.
958 + if use extras ; then
959 + cat << EOF > 80subversion-extras
960 +PATH="${EPREFIX}/usr/$(get_libdir)/subversion/bin"
961 +ROOTPATH="${EPREFIX}/usr/$(get_libdir)/subversion/bin"
962 +EOF
963 + doenvd 80subversion-extras
964 +
965 + emake DESTDIR="${D}" toolsdir="/usr/$(get_libdir)/subversion/bin" install-tools
966 +
967 + find tools "(" -name "*.bat" -o -name "*.in" -o -name ".libs" ")" -print0 | xargs -0 rm -fr
968 + rm -fr tools/client-side/svnmucc
969 + rm -fr tools/server-side/{svn-populate-node-origins-index,svnauthz-validate}*
970 + rm -fr tools/{buildbot,dev,diff,po}
971 +
972 + insinto /usr/share/${PN}
973 + find tools -name '*.py' -exec sed -i -e '1s:python:&2:' {} + || die
974 + doins -r tools
975 + fi
976 +
977 + if use doc ; then
978 + docinto html
979 + dodoc -r doc/doxygen/html/*
980 +
981 + if use java ; then
982 + java-pkg_dojavadoc doc/javadoc
983 + fi
984 + fi
985 +
986 + prune_libtool_files --all
987 +
988 + cd "${ED}"usr/share/locale
989 + for i in * ; do
990 + [[ ${i} == *$LINGUAS* ]] || { rm -r ${i} || die ; }
991 + done
992 +}
993 +
994 +pkg_preinst() {
995 + # Compare versions of Berkeley DB, bug 122877.
996 + if use berkdb && [[ -f "${EROOT}usr/bin/svn" ]] ; then
997 + 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/")"
998 + 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/")"
999 + if [[ "${OLD_BDB_VERSION}" != "${NEW_BDB_VERSION}" ]] ; then
1000 + CHANGED_BDB_VERSION="1"
1001 + fi
1002 + fi
1003 +}
1004 +
1005 +pkg_postinst() {
1006 + if [[ -n "${CHANGED_BDB_VERSION}" ]] ; then
1007 + ewarn "You upgraded from an older version of Berkeley DB and may experience"
1008 + ewarn "problems with your repository. Run the following commands as root to fix it:"
1009 + ewarn " db4_recover -h ${SVN_REPOS_LOC}/repos"
1010 + ewarn " chown -Rf apache:apache ${SVN_REPOS_LOC}/repos"
1011 + fi
1012 +
1013 + ewarn "If you run subversion as a daemon, you will need to restart it to avoid module mismatches."
1014 +}
1015 +
1016 +pkg_postrm() {
1017 + :
1018 +}
1019 +
1020 +pkg_config() {
1021 + # Remember: Don't use ${EROOT}${SVN_REPOS_LOC} since ${SVN_REPOS_LOC}
1022 + # already has EPREFIX in it
1023 + einfo "Initializing the database in ${SVN_REPOS_LOC}..."
1024 + if [[ -e "${SVN_REPOS_LOC}/repos" ]] ; then
1025 + echo "A Subversion repository already exists and I will not overwrite it."
1026 + echo "Delete \"${SVN_REPOS_LOC}/repos\" first if you're sure you want to have a clean version."
1027 + else
1028 + mkdir -p "${SVN_REPOS_LOC}/conf"
1029 +
1030 + einfo "Populating repository directory..."
1031 + # Create initial repository.
1032 + "${EROOT}usr/bin/svnadmin" create "${SVN_REPOS_LOC}/repos"
1033 +
1034 + einfo "Setting repository permissions..."
1035 + SVNSERVE_USER="$(. "${EROOT}etc/conf.d/svnserve"; echo "${SVNSERVE_USER}")"
1036 + SVNSERVE_GROUP="$(. "${EROOT}etc/conf.d/svnserve"; echo "${SVNSERVE_GROUP}")"
1037 + if use apache2 ; then
1038 + [[ -z "${SVNSERVE_USER}" ]] && SVNSERVE_USER="apache"
1039 + [[ -z "${SVNSERVE_GROUP}" ]] && SVNSERVE_GROUP="apache"
1040 + else
1041 + [[ -z "${SVNSERVE_USER}" ]] && SVNSERVE_USER="svn"
1042 + [[ -z "${SVNSERVE_GROUP}" ]] && SVNSERVE_GROUP="svnusers"
1043 + fi
1044 + chmod -Rf go-rwx "${SVN_REPOS_LOC}/conf"
1045 + chmod -Rf o-rwx "${SVN_REPOS_LOC}/repos"
1046 + echo "Please create \"${SVNSERVE_GROUP}\" group if it does not exist yet."
1047 + echo "Afterwards please create \"${SVNSERVE_USER}\" user with homedir \"${SVN_REPOS_LOC}\""
1048 + echo "and as part of the \"${SVNSERVE_GROUP}\" group if it does not exist yet."
1049 + echo "Finally, execute \"chown -Rf ${SVNSERVE_USER}:${SVNSERVE_GROUP} ${SVN_REPOS_LOC}/repos\""
1050 + echo "to finish the configuration."
1051 + fi
1052 +}