/[gentoo-x86]/dev-util/subversion/subversion-1.4.6-r2.ebuild
Gentoo

Contents of /dev-util/subversion/subversion-1.4.6-r2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations) (download)
Thu Apr 9 19:24:23 2009 UTC (10 years ago) by arfrever
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +1 -1 lines
FILE REMOVED
Version bump. Remove older versions.
(Portage version: 13306-svn/cvs/Linux x86_64)

1 # Copyright 1999-2008 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/dev-util/subversion/subversion-1.4.6-r2.ebuild,v 1.4 2008/06/01 10:16:08 hollow Exp $
4
5 inherit autotools bash-completion depend.apache flag-o-matic elisp-common eutils java-pkg-opt-2 libtool multilib perl-module python
6
7 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd"
8
9 DESCRIPTION="A compelling replacement for CVS."
10 HOMEPAGE="http://subversion.tigris.org/"
11 SRC_URI="http://subversion.tigris.org/downloads/${P/_rc/-rc}.tar.bz2"
12
13 LICENSE="Subversion"
14 SLOT="0"
15 IUSE="apache2 berkdb debug doc emacs extras java nls nowebdav perl python ruby svnserve vim-syntax"
16 RESTRICT="test"
17
18 COMMONDEPEND=">=dev-libs/apr-util-1.2.8
19 berkdb? ( =sys-libs/db-4* )
20 emacs? ( virtual/emacs )
21 nls? ( sys-devel/gettext )
22 !nowebdav? ( >=net-misc/neon-0.26.4 )
23 ruby? ( >=dev-lang/ruby-1.8.2 )
24 perl? ( >=dev-lang/perl-5.8.8 )
25 python? ( >=dev-lang/python-2.0 )"
26
27 RDEPEND="${COMMONDEPEND}
28 java? ( >=virtual/jre-1.4 )
29 perl? ( dev-perl/URI )"
30
31 DEPEND="${COMMONDEPEND}
32 >=sys-devel/autoconf-2.59
33 doc? ( app-doc/doxygen )
34 java? ( >=virtual/jdk-1.4 )
35 ruby? ( dev-lang/swig )
36 perl? ( dev-lang/swig )
37 python? ( dev-lang/swig )"
38
39 want_apache
40
41 S="${WORKDIR}"/${P/_rc/-rc}
42
43 # Allow for custom repository locations.
44 # This can't be in pkg_setup because the variable needs to be available to
45 # pkg_config.
46 : ${SVN_REPOS_LOC:=/var/svn}
47
48 pkg_setup() {
49 if use berkdb ; then
50 if ! built_with_use 'dev-libs/apr-util' berkdb ; then
51 eerror "dev-libs/apr-util is missing USE=berkdb"
52 die "dev-libs/apr-util is missing USE=berkdb"
53 fi
54
55 if has_version '<dev-util/subversion-0.34.0' && [[ -z ${SVN_DUMPED} ]] ; then
56 echo
57 ewarn "Presently you have $(best_version dev-util/subversion) installed."
58 ewarn "Subversion has changed the repository filesystem schema from 0.34.0."
59 ewarn "So you MUST dump your repositories before upgrading."
60 ewarn
61 ewarn 'After doing so call emerge with SVN_DUMPED=1 emerge !*'
62 ewarn
63 ewarn "More details on dumping:"
64 ewarn "http://svn.collab.net/repos/svn/trunk/notes/repos_upgrade_HOWTO"
65 echo
66 die "Ensure that you dump your repository first"
67 fi
68 fi
69
70 java-pkg-opt-2_pkg_setup
71 }
72
73 src_unpack() {
74 unpack ${A}
75 cd "${S}"
76
77 # assure we don't use the included libs by accident
78 rm -Rf neon apr apr-util
79
80 epatch "${FILESDIR}"/subversion-1.4-db4.patch
81 epatch "${FILESDIR}"/subversion-1.1.1-perl-vendor.patch
82 epatch "${FILESDIR}"/subversion-hotbackup-config.patch
83 epatch "${FILESDIR}"/subversion-apr_cppflags.patch
84 epatch "${FILESDIR}"/subversion-1.4.3-debug-config.patch
85 epatch "${FILESDIR}"/subversion-1.4.6-neon-0.28.patch
86
87 sed -e 's/\(NEON_ALLOWED_LIST=.* 0.26.4\)"/\1 0.27.2 0.28.0 0.28.1 0.28.2"/' \
88 -i configure.in
89
90 sed -e "s:apr-config:apr-1-config:g" \
91 -e "s:apu-config:apu-1-config:g" \
92 -i build/ac-macros/{find_,}ap*
93
94 eautoreconf
95
96 sed -i -e 's,\(subversion/svnversion/svnversion.*\)\(>.*svn-revision.txt\),echo "exported" \2,' Makefile.in
97
98 elibtoolize
99
100 use emacs && cp "${FILESDIR}"/vc-svn.el "${S}"/contrib/client-side/vc-svn.el
101 }
102
103 src_compile() {
104 local myconf=
105
106 myconf="${myconf} $(use_enable java javahl)"
107 use java && myconf="${myconf} --without-jikes --with-jdk=${JAVA_HOME}"
108
109 if use python || use perl || use ruby ; then
110 myconf="${myconf} --with-swig"
111 else
112 myconf="${myconf} --without-swig"
113 fi
114
115 if use nowebdav ; then
116 myconf="${myconf} --without-neon"
117 else
118 myconf="${myconf} --with-neon=/usr"
119 fi
120
121 append-flags $(/usr/bin/apr-1-config --cppflags)
122
123 econf ${myconf} \
124 --with-apr=/usr/bin/apr-1-config \
125 --with-apr-util=/usr/bin/apu-1-config \
126 $(use_with apache2 apxs ${APXS}) \
127 $(use_with berkdb berkeley-db) \
128 $(use_enable debug maintainer-mode) \
129 $(use_enable nls) \
130 --disable-experimental-libtool \
131 --disable-mod-activation \
132 || die "econf failed"
133
134 # Respect the user LDFLAGS
135 export SWIG_LDFLAGS="${LDFLAGS}"
136
137 # Build subversion, but do it in a way that is safe for parallel builds.
138 # Also apparently the included apr has a libtool that doesn't like -L flags.
139 # So not specifying it at all when not building apache modules and only
140 # specify it for internal parts otherwise.
141 ( emake external-all && emake LT_LDFLAGS="-L${D}/usr/$(get_libdir)" local-all ) || die "Compilation of ${PN} failed"
142
143 if use python ; then
144 # Building fails without the apache apr-util as includes are wrong.
145 emake swig-py || die "Compilation of ${PN} Python bindings failed"
146 fi
147
148 if use perl ; then
149 # Work around a buggy Makefile.PL, bug 64634
150 mkdir -p subversion/bindings/swig/perl/native/blib/arch/auto/SVN/{_Client,_Delta,_Fs,_Ra,_Repos,_Wc}
151 emake -j1 swig-pl || die "Compilation of ${PN} Perl bindings failed"
152 fi
153
154 if use ruby ; then
155 emake swig-rb || die "Compilation of ${PN} Ruby bindings failed"
156 fi
157
158 if use java ; then
159 # ensure that the destination dir exists, else some compilation fails
160 mkdir -p "${S}"/subversion/bindings/java/javahl/classes
161 # Compile javahl
162 make JAVAC_FLAGS="$(java-pkg_javac-args) -encoding iso8859-1" javahl || die "make javahl failed"
163 fi
164
165 if use emacs ; then
166 einfo "Compiling emacs support"
167 elisp-compile "${S}"/contrib/client-side/psvn/psvn.el || die "emacs modules failed"
168 elisp-compile "${S}"/contrib/client-side/vc-svn.el || die "emacs modules failed"
169 elisp-compile "${S}"/doc/svn-doc.el || die "emacs modules failed"
170 elisp-compile "${S}"/doc/tools/svnbook.el || die "emacs modules failed"
171 fi
172
173 if use doc ; then
174 doxygen doc/doxygen.conf || die "doxygen failed"
175 fi
176 }
177
178 src_install () {
179 python_version
180 PYTHON_DIR=/usr/$(get_libdir)/python${PYVER}
181
182 make DESTDIR="${D}" install || die "Installation of ${PN} failed"
183
184 if use python ; then
185 make DESTDIR="${D}" DISTUTIL_PARAM="--prefix=${D}" LD_LIBRARY_PATH="-L${D}/usr/$(get_libdir)" install-swig-py \
186 || die "Installation of ${PN} Python bindings failed"
187
188 # move python bindings
189 dodir "${PYTHON_DIR}/site-packages"
190 mv "${D}"/usr/$(get_libdir)/svn-python/svn "${D}${PYTHON_DIR}/site-packages"
191 mv "${D}"/usr/$(get_libdir)/svn-python/libsvn "${D}${PYTHON_DIR}/site-packages"
192 rm -Rf "${D}"/usr/$(get_libdir)/svn-python
193 fi
194
195 if use perl ; then
196 make DESTDIR="${D}" install-swig-pl || die "Installation of ${PN} Perl bindings failed"
197 fixlocalpod
198 fi
199
200 if use ruby ; then
201 make DESTDIR="${D}" install-swig-rb || die "Installation of ${PN} Ruby bindings failed"
202 fi
203
204 if use java ; then
205 make DESTDIR="${D}" install-javahl || die "make install-javahl failed"
206 java-pkg_regso "${D}"/usr/$(get_libdir)/libsvnjavahl*.so
207 java-pkg_dojar "${D}"/usr/$(get_libdir)/svn-javahl/svn-javahl.jar
208 rm -Rf "${D}"/usr/$(get_libdir)/svn-javahl/*.jar
209 fi
210
211 # Install apache2 module config
212 if use apache2 ; then
213 MOD="${APACHE_MODULESDIR/${APACHE_BASEDIR}\//}"
214 dodir "${APACHE_MODULES_CONFDIR}"
215 cat <<EOF >"${D}/${APACHE_MODULES_CONFDIR}"/47_mod_dav_svn.conf
216 <IfDefine SVN>
217 <IfModule !mod_dav_svn.c>
218 LoadModule dav_svn_module ${MOD}/mod_dav_svn.so
219 </IfModule>
220 <IfDefine SVN_AUTHZ>
221 <IfModule !mod_authz_svn.c>
222 LoadModule authz_svn_module ${MOD}/mod_authz_svn.so
223 </IfModule>
224 </IfDefine>
225
226 # example configuration:
227 #<Location /svn/repos>
228 # DAV svn
229 # SVNPath ${SVN_REPOS_LOC}/repos
230 # AuthType Basic
231 # AuthName "Subversion repository"
232 # AuthUserFile ${SVN_REPOS_LOC}/conf/svnusers
233 # Require valid-user
234 #</Location>
235 </IfDefine>
236 EOF
237 fi
238
239 # Bug 43179 - Install bash-completion if user wishes
240 dobashcompletion tools/client-side/bash_completion subversion
241 rm -f tools/client-side/bash_completion
242
243 # Install hot backup script, bug 54304
244 newbin tools/backup/hot-backup.py svn-hot-backup
245 rm -fr tools/backup
246
247 # The svn_load_dirs script is installed by Debian and looks like a good
248 # candidate for us to install as well
249 if use perl ; then
250 newbin contrib/client-side/svn_load_dirs.pl svn-load-dirs
251 fi
252 rm -f contrib/client-side/svn_load_dirs.pl
253
254 # Install svnserve init-script and xinet.d snippet, bug 43245
255 if use svnserve; then
256 newinitd "${FILESDIR}"/svnserve.initd svnserve
257 if use apache2 ; then
258 newconfd "${FILESDIR}"/svnserve.confd svnserve
259 else
260 newconfd "${FILESDIR}"/svnserve.confd2 svnserve
261 fi
262 insinto /etc/xinetd.d
263 newins "${FILESDIR}"/svnserve.xinetd svnserve
264 fi
265
266 # Install documentation
267 dodoc BUGS CHANGES COMMITTERS HACKING INSTALL README TRANSLATING
268 dodoc tools/xslt/svnindex.{css,xsl}
269 rm -fr tools/xslt
270
271 if use doc ; then
272 dohtml doc/doxygen/html/*
273 cp -R notes "${D}usr/share/doc/${PF}"
274 ecompressdir "/usr/share/doc/${PF}/notes"
275 fi
276
277 # Install Vim syntax files.
278 if use vim-syntax ; then
279 insinto /usr/share/vim/vimfiles/syntax
280 doins contrib/client-side/svn.vim
281 fi
282 rm -f contrib/client-side/svn.vim
283
284 # Install emacs lisps
285 if use emacs ; then
286 elisp-install ${PN} contrib/client-side/psvn/psvn.el*
287 elisp-install ${PN}/compat contrib/client-side/vc-svn.el*
288 elisp-install ${PN} doc/svn-doc.el*
289 elisp-install ${PN} doc/tools/svnbook.el*
290 touch "${D}${SITELISP}/${PN}/compat/.nosearch"
291
292 elisp-site-file-install "${FILESDIR}"/70svn-gentoo.el
293 fi
294 rm -fr contrib/client-side/psvn/
295 rm -f contrib/client-side/vc-svn.el*
296
297 # Install extra files
298 if use extras ; then
299 find contrib tools '(' -name "*.bat" -o -name "*.in" ')' -print0 | xargs -0 rm -f
300 rm -fr tools/{dev,po}
301 dodir "/usr/share/${PN}"
302 cp -R contrib tools "${D}usr/share/${PN}"
303 fi
304 }
305
306 pkg_preinst() {
307 # Compare versions of Berkeley DB.
308 if use berkdb && [[ -f "${ROOT}usr/bin/svn" ]] ; then
309 OLD_BDB_VERSION="$(scanelf -qn "${ROOT}usr/lib/libsvn_subr-1.so.0" | grep -Eo "libdb-[[:digit:]]+\.[[:digit:]]+" | sed -e "s/libdb-\(.*\)/\1/")"
310 NEW_BDB_VERSION="$(scanelf -qn "${D}usr/lib/libsvn_subr-1.so.0" | grep -Eo "libdb-[[:digit:]]+\.[[:digit:]]+" | sed -e "s/libdb-\(.*\)/\1/")"
311 if [[ "${OLD_BDB_VERSION}" != "${NEW_BDB_VERSION}" ]] ; then
312 CHANGED_BDB_VERSION=1
313 fi
314 fi
315 }
316
317 pkg_postinst() {
318 use emacs && elisp-site-regen
319 use perl && perl-module_pkg_postinst
320
321 elog "Subversion Server Notes"
322 elog "-----------------------"
323 elog
324 elog "If you intend to run a server, a repository needs to be created using"
325 elog "svnadmin (see man svnadmin) or the following command to create it in"
326 elog "${SVN_REPOS_LOC}:"
327 elog
328 elog " emerge --config =${CATEGORY}/${PF}"
329 elog
330 elog "Subversion has multiple server types, take your pick:"
331 elog
332 if use svnserve; then
333 elog " - svnserve daemon: "
334 elog " 1. edit /etc/conf.d/svnserve"
335 elog " 2. start daemon: /etc/init.d/svnserve start"
336 elog " 3. make persistent: rc-update add svnserve default"
337 elog
338 elog " - svnserve via xinetd:"
339 elog " 1. edit /etc/xinetd.d/svnserve (remove disable line)"
340 elog " 2. restart xinetd.d: /etc/init.d/xinetd restart"
341 elog
342 fi
343 elog " - svn over ssh:"
344 elog " 1. Fix the repository permissions:"
345 elog " groupadd svnusers"
346 elog " chown -R root:svnusers ${SVN_REPOS_LOC}/repos/"
347 elog " chmod -R g-w ${SVN_REPOS_LOC}/repos"
348 elog " chmod -R g+rw ${SVN_REPOS_LOC}/repos/db"
349 elog " chmod -R g+rw ${SVN_REPOS_LOC}/repos/locks"
350 elog " 2. create an svnserve wrapper in /usr/local/bin to set the umask you"
351 elog " want, for example:"
352 elog " #!/bin/bash"
353 elog " . /etc/conf.d/svnserve"
354 elog " umask 002"
355 elog " exec /usr/bin/svnserve \${SVNSERVE_OPTS} \"\$@\""
356 elog
357 if use apache2; then
358 elog " - http-based server:"
359 elog " 1. edit /etc/conf.d/apache2 to include both \"-D DAV\" and \"-D SVN\""
360 elog " 2. create an htpasswd file:"
361 elog " htpasswd2 -m -c ${SVN_REPOS_LOC}/conf/svnusers USERNAME"
362 elog
363 fi
364
365 elog "If you intend to use svn-hot-backup, you can specify the number of"
366 elog "backups to keep per repository by specifying an environment variable."
367 elog "If you want to keep e.g. 2 backups, do the following:"
368 elog "echo '# hot-backup: Keep that many repository backups around' > /etc/env.d/80subversion"
369 elog "echo 'SVN_HOTBACKUP_NUM_BACKUPS=2' >> /etc/env.d/80subversion"
370 elog
371
372 if [[ -n "${CHANGED_BDB_VERSION}" ]]; then
373 ewarn "You upgraded from an older version of Berkely DB and may experience"
374 ewarn "problems with your repository. Run the following commands as root to fix it:"
375 ewarn " db4_recover -h ${SVN_REPOS_LOC}/repos"
376 ewarn " chown -Rf apache:apache ${SVN_REPOS_LOC}/repos"
377 fi
378 }
379
380 pkg_postrm() {
381 use emacs && elisp-site-regen
382 use perl && perl-module_pkg_postrm
383 }
384
385 pkg_config() {
386 if [[ ! -x "${ROOT}usr/bin/svnadmin" ]] ; then
387 die "You seem to only have built the Subversion client"
388 fi
389
390 einfo ">>> Initializing the database in ${ROOT}${SVN_REPOS_LOC} ..."
391 if [[ -e "${ROOT}${SVN_REPOS_LOC}/repos" ]] ; then
392 echo "A subversion repository already exists and I will not overwrite it."
393 echo "Delete ${ROOT}${SVN_REPOS_LOC}/repos first if you're sure you want to have a clean version."
394 else
395 mkdir -p "${ROOT}${SVN_REPOS_LOC}/conf"
396
397 einfo ">>> Populating repository directory ..."
398 # create initial repository
399 "${ROOT}usr/bin/svnadmin" create "${ROOT}${SVN_REPOS_LOC}/repos"
400
401 einfo ">>> Setting repository permissions ..."
402 if use svnserve; then
403 SVNSERVE_USER="$(. ${ROOT}etc/conf.d/svnserve ; echo ${SVNSERVE_USER})"
404 SVNSERVE_GROUP="$(. ${ROOT}etc/conf.d/svnserve ; echo ${SVNSERVE_GROUP})"
405 fi
406 if use apache2 ; then
407 [[ -z "${SVNSERVE_USER}" ]] && SVNSERVE_USER="apache"
408 [[ -z "${SVNSERVE_GROUP}" ]] && SVNSERVE_GROUP="apache"
409 else
410 [[ -z "${SVNSERVE_USER}" ]] && SVNSERVE_USER="svn"
411 [[ -z "${SVNSERVE_GROUP}" ]] && SVNSERVE_GROUP="svnusers"
412 enewgroup "${SVNSERVE_GROUP}"
413 enewuser "${SVNSERVE_USER}" -1 -1 ${SVN_REPOS_LOC} "${SVNSERVE_GROUP}"
414 fi
415 chown -Rf "${SVNSERVE_USER}:${SVNSERVE_GROUP}" "${ROOT}${SVN_REPOS_LOC}/repos"
416 chmod -Rf 755 "${ROOT}${SVN_REPOS_LOC}/repos"
417 fi
418 }

  ViewVC Help
Powered by ViewVC 1.1.20