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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.8 - (show annotations) (download)
Fri Aug 24 17:11:07 2012 UTC (2 years, 3 months ago) by robbat2
Branch: MAIN
CVS Tags: HEAD
Changes since 1.7: +1 -1 lines
FILE REMOVED
Trim versions that were always masked.

(Portage version: 2.2.0_alpha121/cvs/Linux x86_64, RepoMan options: --force)

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.7.ebuild,v 1.7 2012/08/24 03:51:48 zmedico 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 +gpg gtk highlight +iconv +nls +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 gpg? ( app-crypt/gnupg )
61 perl? ( dev-perl/Error
62 dev-perl/Net-SMTP-SSL
63 dev-perl/Authen-SASL
64 cgi? ( virtual/perl-CGI highlight? ( 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 || myopts="${myopts} NO_ICONV=YesPlease"
148 use nls \
149 || myopts="${myopts} NO_GETTEXT=YesPlease"
150 use tk \
151 || myopts="${myopts} NO_TCLTK=YesPlease"
152 use pcre \
153 && myopts="${myopts} USE_LIBPCRE=yes"
154 use perl \
155 && myopts="${myopts} INSTALLDIRS=vendor" \
156 || myopts="${myopts} NO_PERL=YesPlease"
157 use python \
158 || myopts="${myopts} NO_PYTHON=YesPlease"
159 use subversion \
160 || myopts="${myopts} NO_SVN_TESTS=YesPlease"
161 use threads \
162 && myopts="${myopts} THREADED_DELTA_SEARCH=YesPlease"
163 use cvs \
164 || myopts="${myopts} NO_CVS=YesPlease"
165 # Disabled until ~m68k-mint can be keyworded again
166 # if [[ ${CHOST} == *-mint* ]] ; then
167 # myopts="${myopts} NO_MMAP=YesPlease"
168 # myopts="${myopts} NO_IPV6=YesPlease"
169 # myopts="${myopts} NO_STRLCPY=YesPlease"
170 # myopts="${myopts} NO_MEMMEM=YesPlease"
171 # myopts="${myopts} NO_MKDTEMP=YesPlease"
172 # myopts="${myopts} NO_MKSTEMPS=YesPlease"
173 # fi
174 if [[ ${CHOST} == ia64-*-hpux* ]]; then
175 myopts="${myopts} NO_NSEC=YesPlease"
176 fi
177 if [[ ${CHOST} == *-solaris* ]]; then
178 myopts="${myopts} NEEDS_LIBICONV=YesPlease"
179 fi
180 if [[ ${CHOST} == *-*-aix* ]]; then
181 myopts="${myopts} NO_FNMATCH_CASEFOLD=YesPlease"
182 fi
183
184 has_version '>=app-text/asciidoc-8.0' \
185 && myopts="${myopts} ASCIIDOC8=YesPlease"
186 myopts="${myopts} ASCIIDOC_NO_ROFF=YesPlease"
187
188 # Bug 290465:
189 # builtin-fetch-pack.c:816: error: 'struct stat' has no member named 'st_mtim'
190 [[ "${CHOST}" == *-uclibc* ]] && \
191 myopts="${myopts} NO_NSEC=YesPlease"
192
193 export MY_MAKEOPTS="${myopts}"
194 }
195
196 src_unpack() {
197 if [[ ${PV} != *9999 ]]; then
198 unpack ${MY_P}.tar.${SRC_URI_SUFFIX}
199 cd "${S}"
200 unpack ${PN}-manpages-${DOC_VER}.tar.${SRC_URI_SUFFIX}
201 use doc && \
202 cd "${S}"/Documentation && \
203 unpack ${PN}-htmldocs-${DOC_VER}.tar.${SRC_URI_SUFFIX}
204 cd "${S}"
205 else
206 git-2_src_unpack
207 cd "${S}"
208 #cp "${FILESDIR}"/GIT-VERSION-GEN .
209 fi
210
211 }
212
213 src_prepare() {
214 # Noperl is being merged to upstream as of 2009/04/05
215 #epatch "${FILESDIR}"/20090305-git-1.6.2-noperl.patch
216
217 # GetOpt-Long v2.38 is strict
218 # Merged in 1.6.3 final 2009/05/07
219 #epatch "${FILESDIR}"/20090505-git-1.6.2.5-getopt-fixes.patch
220
221 # JS install fixup
222 # Merged in 1.7.5.x
223 #epatch "${FILESDIR}"/git-1.7.2-always-install-js.patch
224
225 # Fix false positives with t3404 due to SHELL=/bin/false for the portage
226 # user.
227 # Merged upstream
228 #epatch "${FILESDIR}"/git-1.7.3.4-avoid-shell-issues.patch
229
230 # bug #350075: t9001: fix missing prereq on some tests
231 # Merged upstream
232 #epatch "${FILESDIR}"/git-1.7.3.4-fix-perl-test-prereq.patch
233
234 # bug #350330 - automagic CVS when we don't want it is bad.
235 epatch "${FILESDIR}"/git-1.7.3.5-optional-cvs.patch
236
237 sed -i \
238 -e 's:^\(CFLAGS =\).*$:\1 $(OPTCFLAGS) -Wall:' \
239 -e 's:^\(LDFLAGS =\).*$:\1 $(OPTLDFLAGS):' \
240 -e 's:^\(CC = \).*$:\1$(OPTCC):' \
241 -e 's:^\(AR = \).*$:\1$(OPTAR):' \
242 -e "s:\(PYTHON_PATH = \)\(.*\)$:\1${EPREFIX}\2:" \
243 -e "s:\(PERL_PATH = \)\(.*\)$:\1${EPREFIX}\2:" \
244 Makefile || die "sed failed"
245
246 # Never install the private copy of Error.pm (bug #296310)
247 sed -i \
248 -e '/private-Error.pm/s,^,#,' \
249 perl/Makefile.PL
250
251 # Fix docbook2texi command
252 sed -i 's/DOCBOOK2X_TEXI=docbook2x-texi/DOCBOOK2X_TEXI=docbook2texi.pl/' \
253 Documentation/Makefile || die "sed failed"
254
255 # Newer versions of SVN hate a whitespace in the file URL.
256 # So we avoid that by replaced the space with an underscore.
257 #Initialized empty Git repository in /dev/shm/portage/dev-vcs/git-9999/work/git-9999/t/t d.t9155/git_project/.git/
258 #svn: E235000: In file 'subversion/libsvn_subr/dirent_uri.c' line 2291: assertion failed (svn_uri_is_canonical(url, pool))
259 #
260 # With this change the following tests still fail: t9100 t9118 t9120
261 # Without it, MOST of t91* fails, due to the space tripping up the
262 # svn_uri_is_canonical.
263 #
264 # git-svn actually needs to be fixed here, but this chagne is useful for
265 # testing it.
266 #
267 # This patch is my work to date on fixing git-svn, but it causes more
268 # breakage than it fixes (it's manually-edited now to do nothing).
269 #epatch "${FILESDIR}"/git-1.7.8-git-svn-1.7-canonical-path.patch
270 cd "${S}"/t
271 sed -i \
272 -e 's/trash directory/trash_directory/g' \
273 test-lib.sh t0000-basic.sh Makefile || die "sed failed"
274 }
275
276 git_emake() {
277 # bug #326625: PERL_PATH, PERL_MM_OPT
278 # bug #320647: PYTHON_PATH
279 PYTHON_PATH=""
280 use python && PYTHON_PATH="$(PYTHON -a)"
281 emake ${MY_MAKEOPTS} \
282 DESTDIR="${D}" \
283 OPTCFLAGS="${CFLAGS}" \
284 OPTLDFLAGS="${LDFLAGS}" \
285 OPTCC="$(tc-getCC)" \
286 OPTAR="$(tc-getAR)" \
287 prefix="${EPREFIX}"/usr \
288 htmldir="${EPREFIX}"/usr/share/doc/${PF}/html \
289 sysconfdir="${EPREFIX}"/etc \
290 PYTHON_PATH="${PYTHON_PATH}" \
291 PERL_PATH="${EPREFIX}/usr/bin/perl" \
292 PERL_MM_OPT="" \
293 GIT_TEST_OPTS="--no-color" \
294 "$@"
295 # This is the fix for bug #326625, but it also causes breakage, see bug
296 # #352693.
297 # PERL_PATH="${EPREFIX}/usr/bin/env perl" \
298 }
299
300 src_configure() {
301 exportmakeopts
302 }
303
304 src_compile() {
305 git_emake || die "emake failed"
306
307 if use emacs ; then
308 elisp-compile contrib/emacs/git{,-blame}.el \
309 || die "emacs modules failed"
310 fi
311
312 if use perl && use cgi ; then
313 git_emake \
314 gitweb/gitweb.cgi \
315 || die "emake gitweb/gitweb.cgi failed"
316 fi
317
318 cd "${S}"/Documentation
319 if [[ ${PV} == *9999 ]] ; then
320 git_emake man \
321 || die "emake man failed"
322 if use doc ; then
323 git_emake info html \
324 || die "emake info html failed"
325 fi
326 else
327 if use doc ; then
328 git_emake info \
329 || die "emake info html failed"
330 fi
331 fi
332 }
333
334 src_install() {
335 git_emake \
336 install || \
337 die "make install failed"
338
339 # Depending on the tarball and manual rebuild of the documentation, the
340 # manpages may exist in either OR both of these directories.
341 find man?/*.[157] >/dev/null 2>&1 && doman man?/*.[157]
342 find Documentation/*.[157] >/dev/null 2>&1 && doman Documentation/*.[157]
343
344 dodoc README Documentation/{SubmittingPatches,CodingGuidelines}
345 use doc && dodir /usr/share/doc/${PF}/html
346 for d in / /howto/ /technical/ ; do
347 docinto ${d}
348 dodoc Documentation${d}*.txt
349 use doc && dohtml -p ${d} Documentation${d}*.html
350 done
351 docinto /
352 # Upstream does not ship this pre-built :-(
353 use doc && doinfo Documentation/{git,gitman}.info
354
355 newbashcomp contrib/completion/git-completion.bash ${PN}
356
357 if use emacs ; then
358 elisp-install ${PN} contrib/emacs/git.{el,elc} || die
359 elisp-install ${PN} contrib/emacs/git-blame.{el,elc} || die
360 #elisp-install ${PN}/compat contrib/emacs/vc-git.{el,elc} || die
361 # don't add automatically to the load-path, so the sitefile
362 # can do a conditional loading
363 touch "${ED}${SITELISP}/${PN}/compat/.nosearch"
364 elisp-site-file-install "${FILESDIR}"/${SITEFILE} || die
365 fi
366
367 if use python && use gtk ; then
368 dobin "${S}"/contrib/gitview/gitview
369 python_convert_shebangs ${PYTHON_ABI} "${ED}"/usr/bin/gitview
370 dodoc "${S}"/contrib/gitview/gitview.txt
371 fi
372
373 dobin contrib/fast-import/git-p4
374 #dodoc contrib/fast-import/git-p4.txt # Moved upstream
375 newbin contrib/fast-import/import-tars.perl import-tars
376 newbin contrib/git-resurrect.sh git-resurrect
377
378 dodir /usr/share/${PN}/contrib
379 # The following are excluded:
380 # completion - installed above
381 # emacs - installed above
382 # examples - these are stuff that is not used in Git anymore actually
383 # gitview - installed above
384 # p4import - excluded because fast-import has a better one
385 # patches - stuff the Git guys made to go upstream to other places
386 # svnimport - use git-svn
387 # thunderbird-patch-inline - fixes thunderbird
388 for i in \
389 blameview buildsystems ciabot continuous convert-objects fast-import \
390 hg-to-git hooks remotes2config.sh remotes2config.sh rerere-train.sh \
391 stats svn-fe vim workdir \
392 ; do
393 cp -rf \
394 "${S}"/contrib/${i} \
395 "${ED}"/usr/share/${PN}/contrib \
396 || die "Failed contrib ${i}"
397 done
398
399 if use perl && use cgi ; then
400 # We used to install in /usr/share/${PN}/gitweb
401 # but upstream installs in /usr/share/gitweb
402 # so we will install a symlink and use their location for compat with other
403 # distros
404 dosym /usr/share/gitweb /usr/share/${PN}/gitweb
405
406 # INSTALL discusses configuration issues, not just installation
407 docinto /
408 newdoc "${S}"/gitweb/INSTALL INSTALL.gitweb
409 newdoc "${S}"/gitweb/README README.gitweb
410
411 find "${ED}"/usr/lib64/perl5/ \
412 -name .packlist \
413 -exec rm \{\} \;
414 else
415 rm -rf "${ED}"/usr/share/gitweb
416 fi
417
418 if ! use subversion ; then
419 rm -f "${ED}"/usr/libexec/git-core/git-svn \
420 "${ED}"/usr/share/man/man1/git-svn.1*
421 fi
422
423 if use xinetd ; then
424 insinto /etc/xinetd.d
425 newins "${FILESDIR}"/git-daemon.xinetd git-daemon
426 fi
427
428 newinitd "${FILESDIR}"/git-daemon.initd git-daemon
429 newconfd "${FILESDIR}"/git-daemon.confd git-daemon
430
431 fixlocalpod
432 }
433
434 src_test() {
435 local disabled=""
436 local tests_cvs="t9200-git-cvsexportcommit.sh \
437 t9400-git-cvsserver-server.sh \
438 t9401-git-cvsserver-crlf.sh \
439 t9600-cvsimport.sh \
440 t9601-cvsimport-vendor-branch.sh \
441 t9602-cvsimport-branches-tags.sh \
442 t9603-cvsimport-patchsets.sh"
443 local tests_perl="t5502-quickfetch.sh \
444 t5512-ls-remote.sh \
445 t5520-pull.sh"
446 # Bug #225601 - t0004 is not suitable for root perm
447 # Bug #219839 - t1004 is not suitable for root perm
448 # t0001-init.sh - check for init notices EPERM* fails
449 local tests_nonroot="t0001-init.sh \
450 t0004-unwritable.sh \
451 t0070-fundamental.sh \
452 t1004-read-tree-m-u-wf.sh \
453 t3700-add.sh \
454 t7300-clean.sh"
455 # t9100 t9118 t9120 all fail with SVN 1.7, despite the workaround for spaces
456 # in the test directory.
457 local test_svn="t9100-git-svn-basic.sh \
458 t9118-git-svn-funky-branch-names.sh \
459 t9120-git-svn-clone-with-percent-escapes.sh"
460
461 # Unzip is used only for the testcase code, not by any normal parts of Git.
462 if ! has_version app-arch/unzip ; then
463 einfo "Disabling tar-tree tests"
464 disabled="${disabled} t5000-tar-tree.sh"
465 fi
466
467 cvs=0
468 use cvs && let cvs=$cvs+1
469 if [[ ${EUID} -eq 0 ]]; then
470 if [[ $cvs -eq 1 ]]; then
471 ewarn "Skipping CVS tests because CVS does not work as root!"
472 ewarn "You should retest with FEATURES=userpriv!"
473 disabled="${disabled} ${tests_cvs}"
474 fi
475 einfo "Skipping other tests that require being non-root"
476 disabled="${disabled} ${tests_nonroot}"
477 else
478 [[ $cvs -gt 0 ]] && \
479 has_version dev-vcs/cvs && \
480 let cvs=$cvs+1
481 [[ $cvs -gt 1 ]] && \
482 built_with_use dev-vcs/cvs server && \
483 let cvs=$cvs+1
484 if [[ $cvs -lt 3 ]]; then
485 einfo "Disabling CVS tests (needs dev-vcs/cvs[USE=server])"
486 disabled="${disabled} ${tests_cvs}"
487 fi
488 fi
489
490 if ! use perl ; then
491 einfo "Disabling tests that need Perl"
492 disabled="${disabled} ${tests_perl}"
493 fi
494
495 einfo "Disabling tests that fail with SVN 1.7"
496 disabled="${disabled} ${test_svn}"
497
498 # Reset all previously disabled tests
499 cd "${S}/t"
500 for i in *.sh.DISABLED ; do
501 [[ -f "${i}" ]] && mv -f "${i}" "${i%.DISABLED}"
502 done
503 einfo "Disabled tests:"
504 for i in ${disabled} ; do
505 [[ -f "${i}" ]] && mv -f "${i}" "${i}.DISABLED" && einfo "Disabled $i"
506 done
507
508 # Avoid the test system removing the results because we want them ourselves
509 sed -e '/^[[:space:]]*$(MAKE) clean/s,^,#,g' \
510 -i "${S}"/t/Makefile
511
512 # Clean old results first, must always run
513 cd "${S}/t"
514 nonfatal git_emake clean
515
516 # Now run the tests, keep going if we hit an error, and don't terminate on
517 # failure
518 cd "${S}"
519 einfo "Start test run"
520 #MAKEOPTS=-j1
521 nonfatal git_emake --keep-going test
522 rc=$?
523
524 # Display nice results, now print the results
525 cd "${S}/t"
526 nonfatal git_emake aggregate-results
527
528 # And bail if there was a problem
529 [ $rc -eq 0 ] || die "tests failed. Please file a bug."
530 }
531
532 showpkgdeps() {
533 local pkg=$1
534 shift
535 elog " $(printf "%-17s:" ${pkg}) ${@}"
536 }
537
538 pkg_postinst() {
539 use emacs && elisp-site-regen
540 use python && python_mod_optimize git_remote_helpers
541 einfo "Please read /usr/share/bash-completion/git for Git bash completion"
542 elog "These additional scripts need some dependencies:"
543 echo
544 showpkgdeps git-quiltimport "dev-util/quilt"
545 showpkgdeps git-instaweb \
546 "|| ( www-servers/lighttpd www-servers/apache )"
547 echo
548 }
549
550 pkg_postrm() {
551 use emacs && elisp-site-regen
552 use python && python_mod_cleanup git_remote_helpers
553 }

  ViewVC Help
Powered by ViewVC 1.1.20