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

Contents of /dev-vcs/git/git-1.7.8_rc4.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Sat Dec 3 01:57:16 2011 UTC (2 years, 4 months ago) by robbat2
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Version bump.

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

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

  ViewVC Help
Powered by ViewVC 1.1.20