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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Thu Oct 18 00:44:40 2012 UTC (2 years ago) by robbat2
Branch: MAIN
Bump.

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

  ViewVC Help
Powered by ViewVC 1.1.20