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

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

  ViewVC Help
Powered by ViewVC 1.1.20