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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Fri Jan 20 08:38:27 2012 UTC (2 years, 11 months ago) by robbat2
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Clean up some unstable ebuilds.

(Portage version: 2.2.0_alpha84/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.7.1.ebuild,v 1.1 2011/10/24 08:34:13 robbat2 Exp $
4
5 EAPI=3
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 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] )
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 pkg_setup() {
94 if ! use perl ; then
95 use cgi && ewarn "gitweb needs USE=perl, ignoring USE=cgi"
96 use cvs && ewarn "CVS integration needs USE=perl, ignoring USE=cvs"
97 use subversion && ewarn "git-svn needs USE=perl, it won't work"
98 fi
99 if use webdav && ! use curl ; then
100 ewarn "USE=webdav needs USE=curl. Ignoring"
101 fi
102 if use subversion && has_version dev-vcs/subversion && built_with_use --missing false dev-vcs/subversion dso ; then
103 ewarn "Per Gentoo bugs #223747, #238586, when subversion is built"
104 ewarn "with USE=dso, there may be weird crashes in git-svn. You"
105 ewarn "have been warned."
106 fi
107 if use python ; then
108 python_set_active_version 2
109 python_pkg_setup
110 fi
111 }
112
113 # This is needed because for some obscure reasons future calls to make don't
114 # pick up these exports if we export them in src_unpack()
115 exportmakeopts() {
116 local myopts
117
118 if use blksha1 ; then
119 myopts="${myopts} BLK_SHA1=YesPlease"
120 elif use ppcsha1 ; then
121 myopts="${myopts} PPC_SHA1=YesPlease"
122 fi
123
124 if use curl ; then
125 use webdav || myopts="${myopts} NO_EXPAT=YesPlease"
126 else
127 myopts="${myopts} NO_CURL=YesPlease"
128 fi
129
130 # broken assumptions, because of broken build system ...
131 myopts="${myopts} NO_FINK=YesPlease NO_DARWIN_PORTS=YesPlease"
132 myopts="${myopts} INSTALL=install TAR=tar"
133 myopts="${myopts} SHELL_PATH=${EPREFIX}/bin/sh"
134 myopts="${myopts} SANE_TOOL_PATH="
135 myopts="${myopts} OLD_ICONV="
136 myopts="${myopts} NO_EXTERNAL_GREP="
137
138 # can't define this to null, since the entire makefile depends on it
139 sed -i -e '/\/usr\/local/s/BASIC_/#BASIC_/' Makefile
140
141 use iconv \
142 || einfo "Forcing iconv for ${PVR} due to bugs #321895, #322205."
143 # || myopts="${myopts} NO_ICONV=YesPlease"
144 # because, above, we need to do this unconditionally (no "&& use iconv")
145 use !elibc_glibc && myopts="${myopts} NEEDS_LIBICONV=YesPlease"
146
147 use tk \
148 || myopts="${myopts} NO_TCLTK=YesPlease"
149 use perl \
150 && myopts="${myopts} INSTALLDIRS=vendor" \
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 # USE=-iconv causes segfaults, fixed post 1.7.1
218 # Gentoo bug #321895
219 #epatch "${FILESDIR}"/git-1.7.1-noiconv-segfault-fix.patch
220
221 # Fix false positives with t3404 due to SHELL=/bin/false for the portage
222 # user.
223 # Merged upstream
224 #epatch "${FILESDIR}"/git-1.7.3.4-avoid-shell-issues.patch
225
226 # bug #350075: t9001: fix missing prereq on some tests
227 # Merged upstream
228 #epatch "${FILESDIR}"/git-1.7.3.4-fix-perl-test-prereq.patch
229
230 # bug #350330 - automagic CVS when we don't want it is bad.
231 epatch "${FILESDIR}"/git-1.7.3.5-optional-cvs.patch
232
233 sed -i \
234 -e 's:^\(CFLAGS =\).*$:\1 $(OPTCFLAGS) -Wall:' \
235 -e 's:^\(LDFLAGS =\).*$:\1 $(OPTLDFLAGS):' \
236 -e 's:^\(CC = \).*$:\1$(OPTCC):' \
237 -e 's:^\(AR = \).*$:\1$(OPTAR):' \
238 -e "s:\(PYTHON_PATH = \)\(.*\)$:\1${EPREFIX}\2:" \
239 -e "s:\(PERL_PATH = \)\(.*\)$:\1${EPREFIX}\2:" \
240 Makefile || die "sed failed"
241
242 # Never install the private copy of Error.pm (bug #296310)
243 sed -i \
244 -e '/private-Error.pm/s,^,#,' \
245 perl/Makefile.PL
246
247 # Fix docbook2texi command
248 sed -i 's/DOCBOOK2X_TEXI=docbook2x-texi/DOCBOOK2X_TEXI=docbook2texi.pl/' \
249 Documentation/Makefile || die "sed failed"
250
251 # bug #318289
252 # Merged upstream
253 #epatch "${FILESDIR}"/git-1.7.3.2-interix.patch
254
255 # merged upstream
256 #epatch "${FILESDIR}"/git-1.7.5-interix.patch
257
258 # merged upstream
259 #epatch "${FILESDIR}"/git-1.7.6-interix.patch
260 }
261
262 git_emake() {
263 # bug #326625: PERL_PATH, PERL_MM_OPT
264 # bug #320647: PYTHON_PATH
265 PYTHON_PATH=""
266 use python && PYTHON_PATH="$(PYTHON -a)"
267 emake ${MY_MAKEOPTS} \
268 DESTDIR="${D}" \
269 OPTCFLAGS="${CFLAGS}" \
270 OPTLDFLAGS="${LDFLAGS}" \
271 OPTCC="$(tc-getCC)" \
272 OPTAR="$(tc-getAR)" \
273 prefix="${EPREFIX}"/usr \
274 htmldir="${EPREFIX}"/usr/share/doc/${PF}/html \
275 sysconfdir="${EPREFIX}"/etc \
276 PYTHON_PATH="${PYTHON_PATH}" \
277 PERL_MM_OPT="" \
278 GIT_TEST_OPTS="--no-color" \
279 "$@"
280 # This is the fix for bug #326625, but it also causes breakage, see bug
281 # #352693.
282 # PERL_PATH="${EPREFIX}/usr/bin/env perl" \
283 }
284
285 src_configure() {
286 exportmakeopts
287 }
288
289 src_compile() {
290 git_emake || die "emake failed"
291
292 if use emacs ; then
293 elisp-compile contrib/emacs/git{,-blame}.el \
294 || die "emacs modules failed"
295 fi
296
297 if use perl && use cgi ; then
298 git_emake \
299 gitweb/gitweb.cgi \
300 || die "emake gitweb/gitweb.cgi failed"
301 fi
302
303 cd "${S}"/Documentation
304 if [[ ${PV} == *9999 ]] ; then
305 git_emake man \
306 || die "emake man failed"
307 if use doc ; then
308 git_emake info html \
309 || die "emake info html failed"
310 fi
311 else
312 if use doc ; then
313 git_emake info \
314 || die "emake info html failed"
315 fi
316 fi
317 }
318
319 src_install() {
320 git_emake \
321 install || \
322 die "make install failed"
323
324 # Depending on the tarball and manual rebuild of the documentation, the
325 # manpages may exist in either OR both of these directories.
326 find man?/*.[157] >/dev/null 2>&1 && doman man?/*.[157]
327 find Documentation/*.[157] >/dev/null 2>&1 && doman Documentation/*.[157]
328
329 dodoc README Documentation/{SubmittingPatches,CodingGuidelines}
330 use doc && dodir /usr/share/doc/${PF}/html
331 for d in / /howto/ /technical/ ; do
332 docinto ${d}
333 dodoc Documentation${d}*.txt
334 use doc && dohtml -p ${d} Documentation${d}*.html
335 done
336 docinto /
337 # Upstream does not ship this pre-built :-(
338 use doc && doinfo Documentation/{git,gitman}.info
339
340 dobashcompletion contrib/completion/git-completion.bash ${PN}
341
342 if use emacs ; then
343 elisp-install ${PN} contrib/emacs/git.{el,elc} || die
344 elisp-install ${PN} contrib/emacs/git-blame.{el,elc} || die
345 #elisp-install ${PN}/compat contrib/emacs/vc-git.{el,elc} || die
346 # don't add automatically to the load-path, so the sitefile
347 # can do a conditional loading
348 touch "${ED}${SITELISP}/${PN}/compat/.nosearch"
349 elisp-site-file-install "${FILESDIR}"/${SITEFILE} || die
350 fi
351
352 if use python && use gtk ; then
353 dobin "${S}"/contrib/gitview/gitview
354 python_convert_shebangs ${PYTHON_ABI} "${ED}"/usr/bin/gitview
355 dodoc "${S}"/contrib/gitview/gitview.txt
356 fi
357
358 dobin contrib/fast-import/git-p4
359 dodoc contrib/fast-import/git-p4.txt
360 newbin contrib/fast-import/import-tars.perl import-tars
361 newbin contrib/git-resurrect.sh git-resurrect
362
363 dodir /usr/share/${PN}/contrib
364 # The following are excluded:
365 # completion - installed above
366 # emacs - installed above
367 # examples - these are stuff that is not used in Git anymore actually
368 # gitview - installed above
369 # p4import - excluded because fast-import has a better one
370 # patches - stuff the Git guys made to go upstream to other places
371 # svnimport - use git-svn
372 # thunderbird-patch-inline - fixes thunderbird
373 for i in \
374 blameview buildsystems ciabot continuous convert-objects fast-import \
375 hg-to-git hooks remotes2config.sh remotes2config.sh rerere-train.sh \
376 stats svn-fe vim workdir \
377 ; do
378 cp -rf \
379 "${S}"/contrib/${i} \
380 "${ED}"/usr/share/${PN}/contrib \
381 || die "Failed contrib ${i}"
382 done
383
384 if use perl && use cgi ; then
385 # We used to install in /usr/share/${PN}/gitweb
386 # but upstream installs in /usr/share/gitweb
387 # so we will install a symlink and use their location for compat with other
388 # distros
389 dosym /usr/share/gitweb /usr/share/${PN}/gitweb
390
391 # INSTALL discusses configuration issues, not just installation
392 docinto /
393 newdoc "${S}"/gitweb/INSTALL INSTALL.gitweb
394 newdoc "${S}"/gitweb/README README.gitweb
395
396 find "${ED}"/usr/lib64/perl5/ \
397 -name .packlist \
398 -exec rm \{\} \;
399 else
400 rm -rf "${ED}"/usr/share/gitweb
401 fi
402
403 if ! use subversion ; then
404 rm -f "${ED}"/usr/libexec/git-core/git-svn \
405 "${ED}"/usr/share/man/man1/git-svn.1*
406 fi
407
408 if use xinetd ; then
409 insinto /etc/xinetd.d
410 newins "${FILESDIR}"/git-daemon.xinetd git-daemon
411 fi
412
413 newinitd "${FILESDIR}"/git-daemon.initd git-daemon
414 newconfd "${FILESDIR}"/git-daemon.confd git-daemon
415
416 fixlocalpod
417 }
418
419 src_test() {
420 local disabled=""
421 local tests_cvs="t9200-git-cvsexportcommit.sh \
422 t9400-git-cvsserver-server.sh \
423 t9401-git-cvsserver-crlf.sh \
424 t9600-cvsimport.sh \
425 t9601-cvsimport-vendor-branch.sh \
426 t9602-cvsimport-branches-tags.sh \
427 t9603-cvsimport-patchsets.sh"
428 local tests_perl="t5502-quickfetch.sh \
429 t5512-ls-remote.sh \
430 t5520-pull.sh"
431 # Bug #225601 - t0004 is not suitable for root perm
432 # Bug #219839 - t1004 is not suitable for root perm
433 # t0001-init.sh - check for init notices EPERM* fails
434 local tests_nonroot="t0001-init.sh \
435 t0004-unwritable.sh \
436 t0070-fundamental.sh \
437 t1004-read-tree-m-u-wf.sh \
438 t3700-add.sh \
439 t7300-clean.sh"
440
441 # Unzip is used only for the testcase code, not by any normal parts of Git.
442 if ! has_version app-arch/unzip ; then
443 einfo "Disabling tar-tree tests"
444 disabled="${disabled} t5000-tar-tree.sh"
445 fi
446
447 cvs=0
448 use cvs && let cvs=$cvs+1
449 if [[ ${EUID} -eq 0 ]]; then
450 if [[ $cvs -eq 1 ]]; then
451 ewarn "Skipping CVS tests because CVS does not work as root!"
452 ewarn "You should retest with FEATURES=userpriv!"
453 disabled="${disabled} ${tests_cvs}"
454 fi
455 einfo "Skipping other tests that require being non-root"
456 disabled="${disabled} ${tests_nonroot}"
457 else
458 [[ $cvs -gt 0 ]] && \
459 has_version dev-vcs/cvs && \
460 let cvs=$cvs+1
461 [[ $cvs -gt 1 ]] && \
462 built_with_use dev-vcs/cvs server && \
463 let cvs=$cvs+1
464 if [[ $cvs -lt 3 ]]; then
465 einfo "Disabling CVS tests (needs dev-vcs/cvs[USE=server])"
466 disabled="${disabled} ${tests_cvs}"
467 fi
468 fi
469
470 if ! use perl ; then
471 einfo "Disabling tests that need Perl"
472 disabled="${disabled} ${tests_perl}"
473 fi
474
475 # Reset all previously disabled tests
476 cd "${S}/t"
477 for i in *.sh.DISABLED ; do
478 [[ -f "${i}" ]] && mv -f "${i}" "${i%.DISABLED}"
479 done
480 einfo "Disabled tests:"
481 for i in ${disabled} ; do
482 [[ -f "${i}" ]] && mv -f "${i}" "${i}.DISABLED" && einfo "Disabled $i"
483 done
484
485 # Avoid the test system removing the results because we want them ourselves
486 sed -e '/^[[:space:]]*$(MAKE) clean/s,^,#,g' \
487 -i "${S}"/t/Makefile
488
489 # Clean old results first
490 cd "${S}/t"
491 git_emake clean
492
493 # Now run the tests
494 cd "${S}"
495 einfo "Start test run"
496 git_emake test
497 rc=$?
498
499 # Display nice results
500 cd "${S}/t"
501 git_emake aggregate-results
502
503 # And exit
504 [ $rc -eq 0 ] || die "tests failed. Please file a bug."
505 }
506
507 showpkgdeps() {
508 local pkg=$1
509 shift
510 elog " $(printf "%-17s:" ${pkg}) ${@}"
511 }
512
513 pkg_postinst() {
514 use emacs && elisp-site-regen
515 use python && python_mod_optimize git_remote_helpers
516 use bash-completion && \
517 einfo "Please read /usr/share/bash-completion/git for Git bash completion"
518 elog "These additional scripts need some dependencies:"
519 echo
520 showpkgdeps git-quiltimport "dev-util/quilt"
521 showpkgdeps git-instaweb \
522 "|| ( www-servers/lighttpd www-servers/apache )"
523 echo
524 }
525
526 pkg_postrm() {
527 use emacs && elisp-site-regen
528 use python && python_mod_cleanup git_remote_helpers
529 }

  ViewVC Help
Powered by ViewVC 1.1.20