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

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

  ViewVC Help
Powered by ViewVC 1.1.20