/[gentoo-x86]/dev-vcs/git/git-1.7.9.2.ebuild
Gentoo

Contents of /dev-vcs/git/git-1.7.9.2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Mon Apr 23 17:21:07 2012 UTC (6 years, 3 months ago) by vapier
Branch: MAIN
Changes since 1.1: +2 -2 lines
Kill spurious backslash.

(Portage version: 2.2.0_alpha100/cvs/Linux x86_64)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/dev-vcs/git/git-1.7.9.2.ebuild,v 1.1 2012/02/23 02:54:29 robbat2 Exp $
4
5 EAPI=4
6
7 GENTOO_DEPEND_ON_PERL=no
8
9 # bug #329479: git-remote-testgit is not multiple-version aware
10 PYTHON_DEPEND="python? 2"
11 [[ ${PV} == *9999 ]] && SCM="git-2"
12 EGIT_REPO_URI="git://git.kernel.org/pub/scm/git/git.git"
13
14 inherit toolchain-funcs eutils elisp-common perl-module bash-completion-r1 python ${SCM}
15
16 MY_PV="${PV/_rc/.rc}"
17 MY_P="${PN}-${MY_PV}"
18
19 DOC_VER=${MY_PV}
20
21 DESCRIPTION="GIT - the stupid content tracker, the revision control system heavily used by the Linux kernel team"
22 HOMEPAGE="http://www.git-scm.com/"
23 if [[ ${PV} != *9999 ]]; then
24 SRC_URI_SUFFIX="gz"
25 SRC_URI_GOOG="http://git-core.googlecode.com/files"
26 SRC_URI_KORG="mirror://kernel/software/scm/git"
27 SRC_URI="${SRC_URI_GOOG}/${MY_P}.tar.${SRC_URI_SUFFIX}
28 ${SRC_URI_KORG}/${MY_P}.tar.${SRC_URI_SUFFIX}
29 ${SRC_URI_GOOG}/${PN}-manpages-${DOC_VER}.tar.${SRC_URI_SUFFIX}
30 ${SRC_URI_KORG}/${PN}-manpages-${DOC_VER}.tar.${SRC_URI_SUFFIX}
31 doc? (
32 ${SRC_URI_KORG}/${PN}-htmldocs-${DOC_VER}.tar.${SRC_URI_SUFFIX}
33 ${SRC_URI_GOOG}/${PN}-htmldocs-${DOC_VER}.tar.${SRC_URI_SUFFIX}
34 )"
35 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~ia64-hpux ~x86-interix ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
36 KEYWORDS="" # Pending git-svn fixes
37 else
38 SRC_URI=""
39 KEYWORDS=""
40 fi
41
42 LICENSE="GPL-2"
43 SLOT="0"
44 IUSE="+blksha1 +curl cgi doc emacs gtk iconv +pcre +perl +python ppcsha1 tk +threads +webdav xinetd cvs subversion test"
45
46 # Common to both DEPEND and RDEPEND
47 CDEPEND="
48 !blksha1? ( dev-libs/openssl )
49 sys-libs/zlib
50 pcre? ( dev-libs/libpcre )
51 perl? ( dev-lang/perl[-build] )
52 tk? ( dev-lang/tk )
53 curl? (
54 net-misc/curl
55 webdav? ( dev-libs/expat )
56 )
57 emacs? ( virtual/emacs )"
58
59 RDEPEND="${CDEPEND}
60 app-crypt/gnupg
61 perl? ( dev-perl/Error
62 dev-perl/Net-SMTP-SSL
63 dev-perl/Authen-SASL
64 cgi? ( virtual/perl-CGI app-text/highlight )
65 cvs? ( >=dev-vcs/cvsps-2.1 dev-perl/DBI dev-perl/DBD-SQLite )
66 subversion? ( dev-vcs/subversion[-dso,perl] dev-perl/libwww-perl dev-perl/TermReadKey )
67 )
68 python? ( gtk?
69 (
70 >=dev-python/pygtk-2.8
71 dev-python/pygtksourceview:2
72 ) )"
73
74 # This is how info docs are created with Git:
75 # .txt/asciidoc --(asciidoc)---------> .xml/docbook
76 # .xml/docbook --(docbook2texi.pl)--> .texi
77 # .texi --(makeinfo)---------> .info
78 DEPEND="${CDEPEND}
79 app-arch/cpio
80 doc? (
81 app-text/asciidoc
82 app-text/docbook2X
83 sys-apps/texinfo
84 )
85 test? (
86 app-crypt/gnupg
87 )"
88
89 # Live ebuild builds man pages and HTML docs, additionally
90 if [[ ${PV} == *9999 ]]; then
91 DEPEND="${DEPEND}
92 app-text/asciidoc
93 app-text/xmlto"
94 fi
95
96 SITEFILE=50${PN}-gentoo.el
97 S="${WORKDIR}/${MY_P}"
98
99 REQUIRED_USE="
100 cgi? ( perl )
101 cvs? ( perl )
102 subversion? ( perl )
103 webdav? ( curl )
104 "
105
106 pkg_setup() {
107 if use subversion && has_version dev-vcs/subversion && built_with_use --missing false dev-vcs/subversion dso ; then
108 ewarn "Per Gentoo bugs #223747, #238586, when subversion is built"
109 ewarn "with USE=dso, there may be weird crashes in git-svn. You"
110 ewarn "have been warned."
111 fi
112 if use python ; then
113 python_set_active_version 2
114 python_pkg_setup
115 fi
116 }
117
118 # This is needed because for some obscure reasons future calls to make don't
119 # pick up these exports if we export them in src_unpack()
120 exportmakeopts() {
121 local myopts
122
123 if use blksha1 ; then
124 myopts="${myopts} BLK_SHA1=YesPlease"
125 elif use ppcsha1 ; then
126 myopts="${myopts} PPC_SHA1=YesPlease"
127 fi
128
129 if use curl ; then
130 use webdav || myopts="${myopts} NO_EXPAT=YesPlease"
131 else
132 myopts="${myopts} NO_CURL=YesPlease"
133 fi
134
135 # broken assumptions, because of broken build system ...
136 myopts="${myopts} NO_FINK=YesPlease NO_DARWIN_PORTS=YesPlease"
137 myopts="${myopts} INSTALL=install TAR=tar"
138 myopts="${myopts} SHELL_PATH=${EPREFIX}/bin/sh"
139 myopts="${myopts} SANE_TOOL_PATH="
140 myopts="${myopts} OLD_ICONV="
141 myopts="${myopts} NO_EXTERNAL_GREP="
142
143 # can't define this to null, since the entire makefile depends on it
144 sed -i -e '/\/usr\/local/s/BASIC_/#BASIC_/' Makefile
145
146 use iconv \
147 || einfo "Forcing iconv for ${PVR} due to bugs #321895, #322205."
148 # || myopts="${myopts} NO_ICONV=YesPlease"
149 # because, above, we need to do this unconditionally (no "&& use iconv")
150 use !elibc_glibc && myopts="${myopts} NEEDS_LIBICONV=YesPlease"
151
152 use tk \
153 || myopts="${myopts} NO_TCLTK=YesPlease"
154 use pcre \
155 && myopts="${myopts} USE_LIBPCRE=yes"
156 use perl \
157 && myopts="${myopts} INSTALLDIRS=vendor" \
158 || myopts="${myopts} NO_PERL=YesPlease"
159 use python \
160 || myopts="${myopts} NO_PYTHON=YesPlease"
161 use subversion \
162 || myopts="${myopts} NO_SVN_TESTS=YesPlease"
163 use threads \
164 && myopts="${myopts} THREADED_DELTA_SEARCH=YesPlease"
165 use cvs \
166 || myopts="${myopts} NO_CVS=YesPlease"
167 # Disabled until ~m68k-mint can be keyworded again
168 # if [[ ${CHOST} == *-mint* ]] ; then
169 # myopts="${myopts} NO_MMAP=YesPlease"
170 # myopts="${myopts} NO_IPV6=YesPlease"
171 # myopts="${myopts} NO_STRLCPY=YesPlease"
172 # myopts="${myopts} NO_MEMMEM=YesPlease"
173 # myopts="${myopts} NO_MKDTEMP=YesPlease"
174 # myopts="${myopts} NO_MKSTEMPS=YesPlease"
175 # fi
176 if [[ ${CHOST} == ia64-*-hpux* ]]; then
177 myopts="${myopts} NO_NSEC=YesPlease"
178 fi
179 if [[ ${CHOST} == *-*-aix* ]]; then
180 myopts="${myopts} NO_FNMATCH_CASEFOLD=YesPlease"
181 fi
182
183 has_version '>=app-text/asciidoc-8.0' \
184 && myopts="${myopts} ASCIIDOC8=YesPlease"
185 myopts="${myopts} ASCIIDOC_NO_ROFF=YesPlease"
186
187 # Bug 290465:
188 # builtin-fetch-pack.c:816: error: 'struct stat' has no member named 'st_mtim'
189 [[ "${CHOST}" == *-uclibc* ]] && \
190 myopts="${myopts} NO_NSEC=YesPlease"
191
192 export MY_MAKEOPTS="${myopts}"
193 }
194
195 src_unpack() {
196 if [[ ${PV} != *9999 ]]; then
197 unpack ${MY_P}.tar.${SRC_URI_SUFFIX}
198 cd "${S}"
199 unpack ${PN}-manpages-${DOC_VER}.tar.${SRC_URI_SUFFIX}
200 use doc && \
201 cd "${S}"/Documentation && \
202 unpack ${PN}-htmldocs-${DOC_VER}.tar.${SRC_URI_SUFFIX}
203 cd "${S}"
204 else
205 git-2_src_unpack
206 cd "${S}"
207 #cp "${FILESDIR}"/GIT-VERSION-GEN .
208 fi
209
210 }
211
212 src_prepare() {
213 # Noperl is being merged to upstream as of 2009/04/05
214 #epatch "${FILESDIR}"/20090305-git-1.6.2-noperl.patch
215
216 # GetOpt-Long v2.38 is strict
217 # Merged in 1.6.3 final 2009/05/07
218 #epatch "${FILESDIR}"/20090505-git-1.6.2.5-getopt-fixes.patch
219
220 # JS install fixup
221 # Merged in 1.7.5.x
222 #epatch "${FILESDIR}"/git-1.7.2-always-install-js.patch
223
224 # USE=-iconv causes segfaults, fixed post 1.7.1
225 # Gentoo bug #321895
226 #epatch "${FILESDIR}"/git-1.7.1-noiconv-segfault-fix.patch
227
228 # Fix false positives with t3404 due to SHELL=/bin/false for the portage
229 # user.
230 # Merged upstream
231 #epatch "${FILESDIR}"/git-1.7.3.4-avoid-shell-issues.patch
232
233 # bug #350075: t9001: fix missing prereq on some tests
234 # Merged upstream
235 #epatch "${FILESDIR}"/git-1.7.3.4-fix-perl-test-prereq.patch
236
237 # bug #350330 - automagic CVS when we don't want it is bad.
238 epatch "${FILESDIR}"/git-1.7.3.5-optional-cvs.patch
239
240 sed -i \
241 -e 's:^\(CFLAGS =\).*$:\1 $(OPTCFLAGS) -Wall:' \
242 -e 's:^\(LDFLAGS =\).*$:\1 $(OPTLDFLAGS):' \
243 -e 's:^\(CC = \).*$:\1$(OPTCC):' \
244 -e 's:^\(AR = \).*$:\1$(OPTAR):' \
245 -e "s:\(PYTHON_PATH = \)\(.*\)$:\1${EPREFIX}\2:" \
246 -e "s:\(PERL_PATH = \)\(.*\)$:\1${EPREFIX}\2:" \
247 Makefile || die "sed failed"
248
249 # Never install the private copy of Error.pm (bug #296310)
250 sed -i \
251 -e '/private-Error.pm/s,^,#,' \
252 perl/Makefile.PL
253
254 # Fix docbook2texi command
255 sed -i 's/DOCBOOK2X_TEXI=docbook2x-texi/DOCBOOK2X_TEXI=docbook2texi.pl/' \
256 Documentation/Makefile || die "sed failed"
257
258 # bug #318289
259 # Merged upstream
260 #epatch "${FILESDIR}"/git-1.7.3.2-interix.patch
261
262 # merged upstream
263 #epatch "${FILESDIR}"/git-1.7.5-interix.patch
264
265 # merged upstream
266 #epatch "${FILESDIR}"/git-1.7.6-interix.patch
267
268 # Newer versions of SVN hate a whitespace in the file URL.
269 # So we avoid that by replaced the space with an underscore.
270 #Initialized empty Git repository in /dev/shm/portage/dev-vcs/git-9999/work/git-9999/t/t d.t9155/git_project/.git/
271 #svn: E235000: In file 'subversion/libsvn_subr/dirent_uri.c' line 2291: assertion failed (svn_uri_is_canonical(url, pool))
272 #
273 # With this change the following tests still fail: t9100 t9118 t9120
274 # Without it, MOST of t91* fails, due to the space tripping up the
275 # svn_uri_is_canonical.
276 #
277 # git-svn actually needs to be fixed here, but this chagne is useful for
278 # testing it.
279 #
280 # This patch is my work to date on fixing git-svn, but it causes more
281 # breakage than it fixes (it's manually-edited now to do nothing).
282 #epatch "${FILESDIR}"/git-1.7.8-git-svn-1.7-canonical-path.patch
283 cd "${S}"/t
284 sed -i \
285 -e 's/trash directory/trash_directory/g' \
286 test-lib.sh t0000-basic.sh Makefile || die "sed failed"
287 }
288
289 git_emake() {
290 # bug #326625: PERL_PATH, PERL_MM_OPT
291 # bug #320647: PYTHON_PATH
292 PYTHON_PATH=""
293 use python && PYTHON_PATH="$(PYTHON -a)"
294 emake ${MY_MAKEOPTS} \
295 DESTDIR="${D}" \
296 OPTCFLAGS="${CFLAGS}" \
297 OPTLDFLAGS="${LDFLAGS}" \
298 OPTCC="$(tc-getCC)" \
299 OPTAR="$(tc-getAR)" \
300 prefix="${EPREFIX}"/usr \
301 htmldir="${EPREFIX}"/usr/share/doc/${PF}/html \
302 sysconfdir="${EPREFIX}"/etc \
303 PYTHON_PATH="${PYTHON_PATH}" \
304 PERL_MM_OPT="" \
305 GIT_TEST_OPTS="--no-color" \
306 "$@"
307 # This is the fix for bug #326625, but it also causes breakage, see bug
308 # #352693.
309 # PERL_PATH="${EPREFIX}/usr/bin/env perl" \
310 }
311
312 src_configure() {
313 exportmakeopts
314 }
315
316 src_compile() {
317 git_emake || die "emake failed"
318
319 if use emacs ; then
320 elisp-compile contrib/emacs/git{,-blame}.el \
321 || die "emacs modules failed"
322 fi
323
324 if use perl && use cgi ; then
325 git_emake \
326 gitweb/gitweb.cgi \
327 || die "emake gitweb/gitweb.cgi failed"
328 fi
329
330 cd "${S}"/Documentation
331 if [[ ${PV} == *9999 ]] ; then
332 git_emake man \
333 || die "emake man failed"
334 if use doc ; then
335 git_emake info html \
336 || die "emake info html failed"
337 fi
338 else
339 if use doc ; then
340 git_emake info \
341 || die "emake info html failed"
342 fi
343 fi
344 }
345
346 src_install() {
347 git_emake \
348 install || \
349 die "make install failed"
350
351 # Depending on the tarball and manual rebuild of the documentation, the
352 # manpages may exist in either OR both of these directories.
353 find man?/*.[157] >/dev/null 2>&1 && doman man?/*.[157]
354 find Documentation/*.[157] >/dev/null 2>&1 && doman Documentation/*.[157]
355
356 dodoc README Documentation/{SubmittingPatches,CodingGuidelines}
357 use doc && dodir /usr/share/doc/${PF}/html
358 for d in / /howto/ /technical/ ; do
359 docinto ${d}
360 dodoc Documentation${d}*.txt
361 use doc && dohtml -p ${d} Documentation${d}*.html
362 done
363 docinto /
364 # Upstream does not ship this pre-built :-(
365 use doc && doinfo Documentation/{git,gitman}.info
366
367 newbashcomp contrib/completion/git-completion.bash ${PN}
368
369 if use emacs ; then
370 elisp-install ${PN} contrib/emacs/git.{el,elc} || die
371 elisp-install ${PN} contrib/emacs/git-blame.{el,elc} || die
372 #elisp-install ${PN}/compat contrib/emacs/vc-git.{el,elc} || die
373 # don't add automatically to the load-path, so the sitefile
374 # can do a conditional loading
375 touch "${ED}${SITELISP}/${PN}/compat/.nosearch"
376 elisp-site-file-install "${FILESDIR}"/${SITEFILE} || die
377 fi
378
379 if use python && use gtk ; then
380 dobin "${S}"/contrib/gitview/gitview
381 python_convert_shebangs ${PYTHON_ABI} "${ED}"/usr/bin/gitview
382 dodoc "${S}"/contrib/gitview/gitview.txt
383 fi
384
385 dobin contrib/fast-import/git-p4
386 #dodoc contrib/fast-import/git-p4.txt # Moved upstream
387 newbin contrib/fast-import/import-tars.perl import-tars
388 newbin contrib/git-resurrect.sh git-resurrect
389
390 dodir /usr/share/${PN}/contrib
391 # The following are excluded:
392 # completion - installed above
393 # emacs - installed above
394 # examples - these are stuff that is not used in Git anymore actually
395 # gitview - installed above
396 # p4import - excluded because fast-import has a better one
397 # patches - stuff the Git guys made to go upstream to other places
398 # svnimport - use git-svn
399 # thunderbird-patch-inline - fixes thunderbird
400 for i in \
401 blameview buildsystems ciabot continuous convert-objects fast-import \
402 hg-to-git hooks remotes2config.sh remotes2config.sh rerere-train.sh \
403 stats svn-fe vim workdir \
404 ; do
405 cp -rf \
406 "${S}"/contrib/${i} \
407 "${ED}"/usr/share/${PN}/contrib \
408 || die "Failed contrib ${i}"
409 done
410
411 if use perl && use cgi ; then
412 # We used to install in /usr/share/${PN}/gitweb
413 # but upstream installs in /usr/share/gitweb
414 # so we will install a symlink and use their location for compat with other
415 # distros
416 dosym /usr/share/gitweb /usr/share/${PN}/gitweb
417
418 # INSTALL discusses configuration issues, not just installation
419 docinto /
420 newdoc "${S}"/gitweb/INSTALL INSTALL.gitweb
421 newdoc "${S}"/gitweb/README README.gitweb
422
423 find "${ED}"/usr/lib64/perl5/ \
424 -name .packlist \
425 -exec rm \{\} \;
426 else
427 rm -rf "${ED}"/usr/share/gitweb
428 fi
429
430 if ! use subversion ; then
431 rm -f "${ED}"/usr/libexec/git-core/git-svn \
432 "${ED}"/usr/share/man/man1/git-svn.1*
433 fi
434
435 if use xinetd ; then
436 insinto /etc/xinetd.d
437 newins "${FILESDIR}"/git-daemon.xinetd git-daemon
438 fi
439
440 newinitd "${FILESDIR}"/git-daemon.initd git-daemon
441 newconfd "${FILESDIR}"/git-daemon.confd git-daemon
442
443 fixlocalpod
444 }
445
446 src_test() {
447 local disabled=""
448 local tests_cvs="t9200-git-cvsexportcommit.sh \
449 t9400-git-cvsserver-server.sh \
450 t9401-git-cvsserver-crlf.sh \
451 t9600-cvsimport.sh \
452 t9601-cvsimport-vendor-branch.sh \
453 t9602-cvsimport-branches-tags.sh \
454 t9603-cvsimport-patchsets.sh"
455 local tests_perl="t5502-quickfetch.sh \
456 t5512-ls-remote.sh \
457 t5520-pull.sh"
458 # Bug #225601 - t0004 is not suitable for root perm
459 # Bug #219839 - t1004 is not suitable for root perm
460 # t0001-init.sh - check for init notices EPERM* fails
461 local tests_nonroot="t0001-init.sh \
462 t0004-unwritable.sh \
463 t0070-fundamental.sh \
464 t1004-read-tree-m-u-wf.sh \
465 t3700-add.sh \
466 t7300-clean.sh"
467 # t9100 t9118 t9120 all fail with SVN 1.7, despite the workaround for spaces
468 # in the test directory.
469 local test_svn="t9100-git-svn-basic.sh \
470 t9118-git-svn-funky-branch-names.sh \
471 t9120-git-svn-clone-with-percent-escapes.sh"
472
473 # Unzip is used only for the testcase code, not by any normal parts of Git.
474 if ! has_version app-arch/unzip ; then
475 einfo "Disabling tar-tree tests"
476 disabled="${disabled} t5000-tar-tree.sh"
477 fi
478
479 cvs=0
480 use cvs && let cvs=$cvs+1
481 if [[ ${EUID} -eq 0 ]]; then
482 if [[ $cvs -eq 1 ]]; then
483 ewarn "Skipping CVS tests because CVS does not work as root!"
484 ewarn "You should retest with FEATURES=userpriv!"
485 disabled="${disabled} ${tests_cvs}"
486 fi
487 einfo "Skipping other tests that require being non-root"
488 disabled="${disabled} ${tests_nonroot}"
489 else
490 [[ $cvs -gt 0 ]] && \
491 has_version dev-vcs/cvs && \
492 let cvs=$cvs+1
493 [[ $cvs -gt 1 ]] && \
494 built_with_use dev-vcs/cvs server && \
495 let cvs=$cvs+1
496 if [[ $cvs -lt 3 ]]; then
497 einfo "Disabling CVS tests (needs dev-vcs/cvs[USE=server])"
498 disabled="${disabled} ${tests_cvs}"
499 fi
500 fi
501
502 if ! use perl ; then
503 einfo "Disabling tests that need Perl"
504 disabled="${disabled} ${tests_perl}"
505 fi
506
507 einfo "Disabling tests that fail with SVN 1.7"
508 disabled="${disabled} ${test_svn}"
509
510 # Reset all previously disabled tests
511 cd "${S}/t"
512 for i in *.sh.DISABLED ; do
513 [[ -f "${i}" ]] && mv -f "${i}" "${i%.DISABLED}"
514 done
515 einfo "Disabled tests:"
516 for i in ${disabled} ; do
517 [[ -f "${i}" ]] && mv -f "${i}" "${i}.DISABLED" && einfo "Disabled $i"
518 done
519
520 # Avoid the test system removing the results because we want them ourselves
521 sed -e '/^[[:space:]]*$(MAKE) clean/s,^,#,g' \
522 -i "${S}"/t/Makefile
523
524 # Clean old results first, must always run
525 cd "${S}/t"
526 nonfatal git_emake clean
527
528 # Now run the tests, keep going if we hit an error, and don't terminate on
529 # failure
530 cd "${S}"
531 einfo "Start test run"
532 #MAKEOPTS=-j1
533 nonfatal git_emake --keep-going test
534 rc=$?
535
536 # Display nice results, now print the results
537 cd "${S}/t"
538 nonfatal git_emake aggregate-results
539
540 # And bail if there was a problem
541 [ $rc -eq 0 ] || die "tests failed. Please file a bug."
542 }
543
544 showpkgdeps() {
545 local pkg=$1
546 shift
547 elog " $(printf "%-17s:" ${pkg}) ${@}"
548 }
549
550 pkg_postinst() {
551 use emacs && elisp-site-regen
552 use python && python_mod_optimize git_remote_helpers
553 einfo "Please read /usr/share/bash-completion/git for Git bash completion"
554 elog "These additional scripts need some dependencies:"
555 echo
556 showpkgdeps git-quiltimport "dev-util/quilt"
557 showpkgdeps git-instaweb \
558 "|| ( www-servers/lighttpd www-servers/apache )"
559 echo
560 }
561
562 pkg_postrm() {
563 use emacs && elisp-site-regen
564 use python && python_mod_cleanup git_remote_helpers
565 }

  ViewVC Help
Powered by ViewVC 1.1.20