/[gentoo-x86]/dev-vcs/subversion/subversion-1.6.17-r1.ebuild
Gentoo

Contents of /dev-vcs/subversion/subversion-1.6.17-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Fri Aug 19 10:40:53 2011 UTC (2 years, 11 months ago) by chainsaw
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
More gracefully handle dependency between KDE & NLS USE-flags, as requested by Jeroen Roovers in bug #330941. Perfection would require EAPI=4, which I can not use yet. Tell user to restart daemon after upgrade, as requested by Joel Koglin in bug #337042. Use recursive dodoc instead of ecompressdir as requested by Ulrich Müller in bug #356503. Move the environment config back to inline for now, as Kent Fredric reports that variable substitution broke and caused env-update failures. Closes bug #379819. Killed old -r1 ebuild due to this problem.

(Portage version: 2.1.10.11/cvs/Linux x86_64)

1 # Copyright 1999-2011 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/dev-vcs/subversion/subversion-1.6.17-r1.ebuild,v 1.1 2011/08/18 09:51:23 chainsaw Exp $
4
5 EAPI="3"
6 SUPPORT_PYTHON_ABIS="1"
7 RESTRICT_PYTHON_ABIS="3.* *-jython"
8 WANT_AUTOMAKE="none"
9 MY_P="${P/_/-}"
10
11 inherit autotools base bash-completion db-use depend.apache elisp-common flag-o-matic java-pkg-opt-2 libtool multilib perl-module python
12
13 DESCRIPTION="Advanced version control system"
14 HOMEPAGE="http://subversion.apache.org/"
15 SRC_URI="http://subversion.tigris.org/downloads/${MY_P}.tar.bz2"
16 S="${WORKDIR}/${MY_P}"
17
18 LICENSE="Subversion"
19 SLOT="0"
20 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
21 IUSE="apache2 berkdb ctypes-python debug doc +dso emacs extras gnome-keyring java kde nls perl python ruby sasl vim-syntax +webdav-neon webdav-serf"
22
23 CDEPEND=">=dev-db/sqlite-3.4
24 >=dev-libs/apr-1.3:1
25 >=dev-libs/apr-util-1.3:1
26 dev-libs/expat
27 sys-libs/zlib
28 berkdb? ( =sys-libs/db-4* )
29 ctypes-python? ( =dev-lang/python-2* )
30 emacs? ( virtual/emacs )
31 gnome-keyring? ( dev-libs/glib:2 sys-apps/dbus gnome-base/gnome-keyring )
32 kde? ( sys-apps/dbus x11-libs/qt-core x11-libs/qt-dbus x11-libs/qt-gui >=kde-base/kdelibs-4 )
33 perl? ( dev-lang/perl )
34 python? ( =dev-lang/python-2* )
35 ruby? ( >=dev-lang/ruby-1.8.2 )
36 sasl? ( dev-libs/cyrus-sasl )
37 webdav-neon? ( >=net-libs/neon-0.28 )
38 webdav-serf? ( >=net-libs/serf-0.3.0 )"
39 RDEPEND="${CDEPEND}
40 apache2? ( www-servers/apache[apache2_modules_dav] )
41 java? ( >=virtual/jre-1.5 )
42 kde? ( kde-base/kwalletd )
43 nls? ( virtual/libintl )
44 perl? ( dev-perl/URI )"
45 DEPEND="${CDEPEND}
46 !!<sys-apps/sandbox-1.6
47 ctypes-python? ( dev-python/ctypesgen )
48 doc? ( app-doc/doxygen )
49 gnome-keyring? ( dev-util/pkgconfig )
50 java? ( >=virtual/jdk-1.5 )
51 kde? ( dev-util/pkgconfig )
52 nls? ( sys-devel/gettext )
53 webdav-neon? ( dev-util/pkgconfig )"
54
55 PATCHES=(
56 "${FILESDIR}/${PN}-1.6.0-disable_linking_against_unneeded_libraries.patch"
57 "${FILESDIR}/${PN}-1.6.2-local_library_preloading.patch"
58 "${FILESDIR}/${PN}-1.6.3-kwallet_window.patch"
59 )
60
61 want_apache
62
63 pkg_setup() {
64 if use kde && ! use nls; then
65 eerror "Support for KWallet (KDE) requires Native Language Support (NLS)."
66 die "Enable \"nls\" USE flag"
67 fi
68
69 if use berkdb; then
70 einfo
71 if [[ -z "${SVN_BDB_VERSION}" ]]; then
72 SVN_BDB_VERSION="$(db_ver_to_slot "$(db_findver sys-libs/db 2>/dev/null)")"
73 einfo "SVN_BDB_VERSION variable isn't set. You can set it to enforce using of specific version of Berkeley DB."
74 fi
75 einfo "Using: Berkeley DB ${SVN_BDB_VERSION}"
76 einfo
77
78 local apu_bdb_version="$(scanelf -nq "${EROOT}usr/$(get_libdir)/libaprutil-1.so.0" | grep -Eo "libdb-[[:digit:]]+\.[[:digit:]]+" | sed -e "s/libdb-\(.*\)/\1/")"
79 if [[ -n "${apu_bdb_version}" && "${SVN_BDB_VERSION}" != "${apu_bdb_version}" ]]; then
80 eerror "APR-Util is linked against Berkeley DB ${apu_bdb_version}, but you are trying"
81 eerror "to build Subversion with support for Berkeley DB ${SVN_BDB_VERSION}."
82 eerror "Rebuild dev-libs/apr-util or set SVN_BDB_VERSION=\"${apu_bdb_version}\"."
83 eerror "Aborting to avoid possible run-time crashes."
84 die "Berkeley DB version mismatch"
85 fi
86 fi
87
88 depend.apache_pkg_setup
89
90 java-pkg-opt-2_pkg_setup
91
92 if use ctypes-python || use python; then
93 python_pkg_setup
94 fi
95
96 if ! use webdav-neon && ! use webdav-serf; then
97 ewarn "WebDAV support is disabled. You need WebDAV to"
98 ewarn "access repositories through the HTTP protocol."
99 ewarn "Consider enabling one of the following USE-flags:"
100 ewarn " webdav-neon webdav-serf"
101 echo -ne "\a"
102 fi
103
104 if use debug; then
105 append-cppflags -DSVN_DEBUG -DAP_DEBUG
106 fi
107
108 # Allow for custom repository locations.
109 SVN_REPOS_LOC="${SVN_REPOS_LOC:-${EPREFIX}/var/svn}"
110 }
111
112 src_prepare() {
113 base_src_prepare
114 fperms +x build/transform_libtool_scripts.sh
115
116 sed -i \
117 -e "s/\(BUILD_RULES=.*\) bdb-test\(.*\)/\1\2/g" \
118 -e "s/\(BUILD_RULES=.*\) test\(.*\)/\1\2/g" configure.ac
119
120 sed -e "/SWIG_PY_INCLUDES=/s/\$ac_cv_python_includes/\\\\\$(PYTHON_INCLUDES)/" -i build/ac-macros/swig.m4 || die "sed failed"
121
122 eautoconf
123 elibtoolize
124
125 sed -e "s/libsvn_swig_py-1\.la/libsvn_swig_py-\$(PYTHON_VERSION)-1.la/" -i build-outputs.mk || die "sed failed"
126 }
127
128 src_configure() {
129 local myconf
130
131 if use python || use perl || use ruby; then
132 myconf+=" --with-swig"
133 else
134 myconf+=" --without-swig"
135 fi
136
137 if use java; then
138 myconf+=" --without-junit"
139 fi
140
141 econf --libdir="${EPREFIX}/usr/$(get_libdir)" \
142 $(use_with apache2 apxs "${APXS}") \
143 $(use_with berkdb berkeley-db "db.h:${EPREFIX}/usr/include/db${SVN_BDB_VERSION}::db-${SVN_BDB_VERSION}") \
144 $(use_with ctypes-python ctypesgen "${EPREFIX}/usr") \
145 $(use_enable dso runtime-module-search) \
146 $(use_with gnome-keyring) \
147 $(use_enable java javahl) \
148 $(use_with java jdk "${JAVA_HOME}") \
149 $(use_with kde kwallet) \
150 $(use_enable nls) \
151 $(use_with sasl) \
152 $(use_with webdav-neon neon) \
153 $(use_with webdav-serf serf "${EPREFIX}/usr") \
154 ${myconf} \
155 --with-apr="${EPREFIX}/usr/bin/apr-1-config" \
156 --with-apr-util="${EPREFIX}/usr/bin/apu-1-config" \
157 --disable-experimental-libtool \
158 --without-jikes \
159 --enable-local-library-preloading \
160 --disable-mod-activation \
161 --disable-neon-version-check \
162 --with-sqlite="${EPREFIX}/usr"
163 }
164
165 src_compile() {
166 emake local-all || die "Building of core of Subversion failed"
167
168 if use ctypes-python; then
169 python_copy_sources subversion/bindings/ctypes-python
170 rm -fr subversion/bindings/ctypes-python
171 ctypes_python_bindings_building() {
172 rm -f subversion/bindings/ctypes-python
173 ln -s ctypes-python-${PYTHON_ABI} subversion/bindings/ctypes-python
174 emake ctypes-python
175 }
176 python_execute_function \
177 --action-message 'Building of Subversion Ctypes Python bindings with $(python_get_implementation) $(python_get_version)' \
178 --failure-message 'Building of Subversion Ctypes Python bindings failed with $(python_get_implementation) $(python_get_version)' \
179 ctypes_python_bindings_building
180 fi
181
182 if use python; then
183 python_copy_sources subversion/bindings/swig/python
184 rm -fr subversion/bindings/swig/python
185 swig_python_bindings_building() {
186 rm -f subversion/bindings/swig/python
187 ln -s python-${PYTHON_ABI} subversion/bindings/swig/python
188 emake \
189 PYTHON_INCLUDES="-I${EPREFIX}$(python_get_includedir)" \
190 PYTHON_VERSION="$(python_get_version)" \
191 swig_pydir="${EPREFIX}$(python_get_sitedir)/libsvn" \
192 swig_pydir_extra="${EPREFIX}$(python_get_sitedir)/svn" \
193 swig-py
194 }
195 python_execute_function \
196 --action-message 'Building of Subversion SWIG Python bindings with $(python_get_implementation) $(python_get_version)' \
197 --failure-message 'Building of Subversion SWIG Python bindings failed with $(python_get_implementation) $(python_get_version)' \
198 swig_python_bindings_building
199 fi
200
201 if use perl; then
202 emake -j1 swig-pl || die "Building of Subversion SWIG Perl bindings failed"
203 fi
204
205 if use ruby; then
206 emake swig-rb || die "Building of Subversion SWIG Ruby bindings failed"
207 fi
208
209 if use java; then
210 emake -j1 JAVAC_FLAGS="$(java-pkg_javac-args) -encoding iso8859-1" javahl || die "Building of Subversion JavaHL library failed"
211 fi
212
213 if use emacs; then
214 elisp-compile contrib/client-side/emacs/{dsvn,psvn,vc-svn}.el doc/svn-doc.el doc/tools/svnbook.el || die "Compilation of Emacs modules failed"
215 fi
216
217 if use extras; then
218 emake contrib || die "Building of contrib failed"
219 emake tools || die "Building of tools failed"
220 fi
221
222 if use doc; then
223 doxygen doc/doxygen.conf || die "Building of Subversion HTML documentation failed"
224
225 if use java; then
226 emake doc-javahl || die "Building of Subversion JavaHL library HTML documentation failed"
227 fi
228 fi
229 }
230
231 src_install() {
232 emake -j1 DESTDIR="${D}" local-install || die "Installation of core of Subversion failed"
233
234 if use ctypes-python; then
235 ctypes_python_bindings_installation() {
236 rm -f subversion/bindings/ctypes-python
237 ln -s ctypes-python-${PYTHON_ABI} subversion/bindings/ctypes-python
238 emake DESTDIR="${D}" install-ctypes-python
239 }
240 python_execute_function \
241 --action-message 'Installation of Subversion Ctypes Python bindings with $(python_get_implementation) $(python_get_version)' \
242 --failure-message 'Installation of Subversion Ctypes Python bindings failed with $(python_get_implementation) $(python_get_version)' \
243 ctypes_python_bindings_installation
244 fi
245
246 if use python; then
247 swig_python_bindings_installation() {
248 rm -f subversion/bindings/swig/python
249 ln -s python-${PYTHON_ABI} subversion/bindings/swig/python
250 emake -j1 \
251 DESTDIR="${D}" \
252 PYTHON_VERSION="$(python_get_version)" \
253 swig_pydir="${EPREFIX}$(python_get_sitedir)/libsvn" \
254 swig_pydir_extra="${EPREFIX}$(python_get_sitedir)/svn" \
255 install-swig-py
256 }
257 python_execute_function \
258 --action-message 'Installation of Subversion SWIG Python bindings with $(python_get_implementation) $(python_get_version)' \
259 --failure-message 'Installation of Subversion SWIG Python bindings failed with $(python_get_implementation) $(python_get_version)' \
260 swig_python_bindings_installation
261
262 delete_static_libraries() {
263 find "${ED}$(python_get_sitedir)" -name "*.a" -print0 | xargs -0 rm -f
264 }
265 python_execute_function -q delete_static_libraries
266 fi
267
268 if use ctypes-python || use python; then
269 python_clean_installation_image -q
270 fi
271
272 if use perl; then
273 emake -j1 DESTDIR="${D}" INSTALLDIRS="vendor" install-swig-pl || die "Installation of Subversion SWIG Perl bindings failed"
274 fixlocalpod
275 find "${ED}" "(" -name .packlist -o -name "*.bs" ")" -print0 | xargs -0 rm -fr
276 fi
277
278 if use ruby; then
279 emake -j1 DESTDIR="${D}" install-swig-rb || die "Installation of Subversion SWIG Ruby bindings failed"
280 find "${ED}usr/$(get_libdir)/ruby" "(" -name "*.a" -o -name "*.la" ")" -print0 | xargs -0 rm -f
281 fi
282
283 if use java; then
284 emake -j1 DESTDIR="${D}" install-javahl || die "Installation of Subversion JavaHL library failed"
285 java-pkg_regso "${ED}"usr/$(get_libdir)/libsvnjavahl*.so
286 java-pkg_dojar "${ED}"usr/$(get_libdir)/svn-javahl/svn-javahl.jar
287 rm -fr "${ED}"usr/$(get_libdir)/svn-javahl/*.jar
288 fi
289
290 # Install Apache module configuration.
291 if use apache2; then
292 keepdir "${APACHE_MODULES_CONFDIR}"
293 insinto "${APACHE_MODULES_CONFDIR}"
294 doins "${FILESDIR}/47_mod_dav_svn.conf"
295 fi
296
297 # Install Bash Completion, bug 43179.
298 dobashcompletion tools/client-side/bash_completion subversion
299 rm -f tools/client-side/bash_completion
300
301 # Install hot backup script, bug 54304.
302 newbin tools/backup/hot-backup.py svn-hot-backup
303 rm -fr tools/backup
304
305 # Install svn_load_dirs.pl.
306 if use perl; then
307 dobin contrib/client-side/svn_load_dirs/svn_load_dirs.pl
308 fi
309 rm -f contrib/client-side/svn_load_dirs/svn_load_dirs.pl
310
311 # Install svnserve init-script and xinet.d snippet, bug 43245.
312 newinitd "${FILESDIR}"/svnserve.initd2 svnserve
313 newconfd "${FILESDIR}"/svnserve.confd svnserve
314 insinto /etc/xinetd.d
315 newins "${FILESDIR}"/svnserve.xinetd svnserve
316
317 # Install documentation.
318 dodoc CHANGES COMMITTERS README
319 dodoc tools/xslt/svnindex.{css,xsl}
320 rm -fr tools/xslt
321
322 # Install Vim syntax files.
323 if use vim-syntax; then
324 insinto /usr/share/vim/vimfiles/syntax
325 doins contrib/client-side/vim/svn.vim
326 fi
327 rm -f contrib/client-side/vim/svn.vim
328
329 # Install Emacs Lisps.
330 if use emacs; then
331 elisp-install ${PN} contrib/client-side/emacs/{dsvn,psvn}.{el,elc} doc/svn-doc.{el,elc} doc/tools/svnbook.{el,elc} || die "Installation of Emacs modules failed"
332 elisp-install ${PN}/compat contrib/client-side/emacs/vc-svn.{el,elc} || die "Installation of Emacs modules failed"
333 touch "${ED}${SITELISP}/${PN}/compat/.nosearch"
334 elisp-site-file-install "${FILESDIR}/70svn-gentoo.el" || die "Installation of Emacs site-init file failed"
335 fi
336 rm -fr contrib/client-side/emacs
337
338 # Install extra files.
339 if use extras; then
340 doenvd "${FILESDIR}/80subversion-extras"
341
342 emake DESTDIR="${D}" contribdir="/usr/$(get_libdir)/subversion/bin" install-contrib || die "Installation of contrib failed"
343 emake DESTDIR="${D}" toolsdir="/usr/$(get_libdir)/subversion/bin" install-tools || die "Installation of tools failed"
344
345 find contrib tools "(" -name "*.bat" -o -name "*.in" -o -name ".libs" ")" -print0 | xargs -0 rm -fr
346 rm -fr contrib/client-side/svn-push
347 rm -fr contrib/server-side/svnstsw
348 rm -fr tools/client-side/svnmucc
349 rm -fr tools/server-side/{svn-populate-node-origins-index,svnauthz-validate}*
350 rm -fr tools/{buildbot,dev,diff,po}
351
352 insinto /usr/share/${PN}
353 doins -r contrib tools
354 fi
355
356 if use doc; then
357 dohtml -r doc/doxygen/html/* || die "Installation of Subversion HTML documentation failed"
358
359 insinto /usr/share/doc/${PF}
360 doins -r notes
361 ecompressdir /usr/share/doc/${PF}/notes
362
363 if use java; then
364 java-pkg_dojavadoc doc/javadoc
365 fi
366 fi
367 }
368
369 pkg_preinst() {
370 # Compare versions of Berkeley DB, bug 122877.
371 if use berkdb && [[ -f "${EROOT}usr/bin/svn" ]]; then
372 OLD_BDB_VERSION="$(scanelf -nq "${EROOT}usr/$(get_libdir)/libsvn_subr-1.so.0" | grep -Eo "libdb-[[:digit:]]+\.[[:digit:]]+" | sed -e "s/libdb-\(.*\)/\1/")"
373 NEW_BDB_VERSION="$(scanelf -nq "${ED}usr/$(get_libdir)/libsvn_subr-1.so.0" | grep -Eo "libdb-[[:digit:]]+\.[[:digit:]]+" | sed -e "s/libdb-\(.*\)/\1/")"
374 if [[ "${OLD_BDB_VERSION}" != "${NEW_BDB_VERSION}" ]]; then
375 CHANGED_BDB_VERSION="1"
376 fi
377 fi
378 }
379
380 pkg_postinst() {
381 use emacs && elisp-site-regen
382 use perl && perl-module_pkg_postinst
383
384 if use ctypes-python; then
385 python_mod_optimize csvn
386 fi
387
388 if use python; then
389 python_mod_optimize libsvn svn
390 fi
391
392 if use apache2; then
393 elog " - http-based server:"
394 elog " 1. Edit /etc/conf.d/apache2 to include both \"-D DAV\" and \"-D SVN\""
395 elog " 2. Create an htpasswd file:"
396 elog " htpasswd2 -m -c ${SVN_REPOS_LOC}/conf/svnusers USERNAME"
397 elog " 3. Fix the repository permissions (see \"Fixing the repository permissions\")"
398 elog " 4. Restart Apache: /etc/init.d/apache2 restart"
399 elog
400 fi
401
402 if [[ -n "${CHANGED_BDB_VERSION}" ]]; then
403 ewarn "You upgraded from an older version of Berkeley DB and may experience"
404 ewarn "problems with your repository. Run the following commands as root to fix it:"
405 ewarn " db4_recover -h ${SVN_REPOS_LOC}/repos"
406 ewarn " chown -Rf apache:apache ${SVN_REPOS_LOC}/repos"
407 fi
408 }
409
410 pkg_postrm() {
411 use emacs && elisp-site-regen
412 use perl && perl-module_pkg_postrm
413
414 if use ctypes-python; then
415 python_mod_cleanup csvn
416 fi
417
418 if use python; then
419 python_mod_cleanup libsvn svn
420 fi
421 }
422
423 pkg_config() {
424 einfo "Initializing the database in ${EROOT}${SVN_REPOS_LOC}..."
425 if [[ -e "${EROOT}${SVN_REPOS_LOC}/repos" ]]; then
426 echo "A Subversion repository already exists and I will not overwrite it."
427 echo "Delete \"${EROOT}${SVN_REPOS_LOC}/repos\" first if you're sure you want to have a clean version."
428 else
429 mkdir -p "${EROOT}${SVN_REPOS_LOC}/conf"
430
431 einfo "Populating repository directory..."
432 # Create initial repository.
433 "${EROOT}usr/bin/svnadmin" create "${EROOT}${SVN_REPOS_LOC}/repos"
434
435 einfo "Setting repository permissions..."
436 SVNSERVE_USER="$(. "${EROOT}etc/conf.d/svnserve"; echo "${SVNSERVE_USER}")"
437 SVNSERVE_GROUP="$(. "${EROOT}etc/conf.d/svnserve"; echo "${SVNSERVE_GROUP}")"
438 if use apache2; then
439 [[ -z "${SVNSERVE_USER}" ]] && SVNSERVE_USER="apache"
440 [[ -z "${SVNSERVE_GROUP}" ]] && SVNSERVE_GROUP="apache"
441 else
442 [[ -z "${SVNSERVE_USER}" ]] && SVNSERVE_USER="svn"
443 [[ -z "${SVNSERVE_GROUP}" ]] && SVNSERVE_GROUP="svnusers"
444 enewgroup "${SVNSERVE_GROUP}"
445 enewuser "${SVNSERVE_USER}" -1 -1 "${SVN_REPOS_LOC}" "${SVNSERVE_GROUP}"
446 fi
447 chown -Rf "${SVNSERVE_USER}:${SVNSERVE_GROUP}" "${EROOT}${SVN_REPOS_LOC}/repos"
448 chmod -Rf go-rwx "${EROOT}${SVN_REPOS_LOC}/conf"
449 chmod -Rf o-rwx "${EROOT}${SVN_REPOS_LOC}/repos"
450 fi
451 }

  ViewVC Help
Powered by ViewVC 1.1.20