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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Wed Oct 10 17:47:37 2012 UTC (23 months, 1 week ago) by robbat2
Branch: MAIN
Version bump per bug 437870.

(Portage version: 2.2.0_alpha120/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-r1.ebuild,v 1.5 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 ~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 !blksha1? ( 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 cd "${S}"/Documentation
282 if [[ ${PV} == *9999 ]] ; then
283 git_emake man \
284 || die "emake man failed"
285 if use doc ; then
286 git_emake info html \
287 || die "emake info html failed"
288 fi
289 else
290 if use doc ; then
291 git_emake info \
292 || die "emake info html failed"
293 fi
294 fi
295 }
296
297 src_install() {
298 git_emake \
299 install || \
300 die "make install failed"
301
302 # Depending on the tarball and manual rebuild of the documentation, the
303 # manpages may exist in either OR both of these directories.
304 find man?/*.[157] >/dev/null 2>&1 && doman man?/*.[157]
305 find Documentation/*.[157] >/dev/null 2>&1 && doman Documentation/*.[157]
306
307 dodoc README Documentation/{SubmittingPatches,CodingGuidelines}
308 use doc && dodir /usr/share/doc/${PF}/html
309 for d in / /howto/ /technical/ ; do
310 docinto ${d}
311 dodoc Documentation${d}*.txt
312 use doc && dohtml -p ${d} Documentation${d}*.html
313 done
314 docinto /
315 # Upstream does not ship this pre-built :-(
316 use doc && doinfo Documentation/{git,gitman}.info
317
318 newbashcomp contrib/completion/git-completion.bash ${PN}
319
320 if use emacs ; then
321 elisp-install ${PN} contrib/emacs/git.{el,elc} || die
322 elisp-install ${PN} contrib/emacs/git-blame.{el,elc} || die
323 #elisp-install ${PN}/compat contrib/emacs/vc-git.{el,elc} || die
324 # don't add automatically to the load-path, so the sitefile
325 # can do a conditional loading
326 touch "${ED}${SITELISP}/${PN}/compat/.nosearch"
327 elisp-site-file-install "${FILESDIR}"/${SITEFILE} || die
328 fi
329
330 if use python && use gtk ; then
331 dobin "${S}"/contrib/gitview/gitview
332 python_convert_shebangs ${PYTHON_ABI} "${ED}"/usr/bin/gitview
333 dodoc "${S}"/contrib/gitview/gitview.txt
334 fi
335
336 #dobin contrib/fast-import/git-p4 # Moved upstream
337 #dodoc contrib/fast-import/git-p4.txt # Moved upstream
338 newbin contrib/fast-import/import-tars.perl import-tars
339 newbin contrib/git-resurrect.sh git-resurrect
340
341 dodir /usr/share/${PN}/contrib
342 # The following are excluded:
343 # completion - installed above
344 # emacs - installed above
345 # examples - these are stuff that is not used in Git anymore actually
346 # gitview - installed above
347 # p4import - excluded because fast-import has a better one
348 # patches - stuff the Git guys made to go upstream to other places
349 # svnimport - use git-svn
350 # thunderbird-patch-inline - fixes thunderbird
351 for i in \
352 blameview buildsystems ciabot continuous convert-objects fast-import \
353 hg-to-git hooks remotes2config.sh remotes2config.sh rerere-train.sh \
354 stats svn-fe vim workdir \
355 ; do
356 cp -rf \
357 "${S}"/contrib/${i} \
358 "${ED}"/usr/share/${PN}/contrib \
359 || die "Failed contrib ${i}"
360 done
361
362 if use perl && use cgi ; then
363 # We used to install in /usr/share/${PN}/gitweb
364 # but upstream installs in /usr/share/gitweb
365 # so we will install a symlink and use their location for compat with other
366 # distros
367 dosym /usr/share/gitweb /usr/share/${PN}/gitweb
368
369 # INSTALL discusses configuration issues, not just installation
370 docinto /
371 newdoc "${S}"/gitweb/INSTALL INSTALL.gitweb
372 newdoc "${S}"/gitweb/README README.gitweb
373
374 find "${ED}"/usr/lib64/perl5/ \
375 -name .packlist \
376 -exec rm \{\} \;
377 else
378 rm -rf "${ED}"/usr/share/gitweb
379 fi
380
381 if ! use subversion ; then
382 rm -f "${ED}"/usr/libexec/git-core/git-svn \
383 "${ED}"/usr/share/man/man1/git-svn.1*
384 fi
385
386 if use xinetd ; then
387 insinto /etc/xinetd.d
388 newins "${FILESDIR}"/git-daemon.xinetd git-daemon
389 fi
390
391 newinitd "${FILESDIR}"/git-daemon.initd git-daemon
392 newconfd "${FILESDIR}"/git-daemon.confd git-daemon
393
394 fixlocalpod
395 }
396
397 src_test() {
398 local disabled=""
399 local tests_cvs="t9200-git-cvsexportcommit.sh \
400 t9400-git-cvsserver-server.sh \
401 t9401-git-cvsserver-crlf.sh \
402 t9600-cvsimport.sh \
403 t9601-cvsimport-vendor-branch.sh \
404 t9602-cvsimport-branches-tags.sh \
405 t9603-cvsimport-patchsets.sh"
406 local tests_perl="t5502-quickfetch.sh \
407 t5512-ls-remote.sh \
408 t5520-pull.sh"
409 # Bug #225601 - t0004 is not suitable for root perm
410 # Bug #219839 - t1004 is not suitable for root perm
411 # t0001-init.sh - check for init notices EPERM* fails
412 local tests_nonroot="t0001-init.sh \
413 t0004-unwritable.sh \
414 t0070-fundamental.sh \
415 t1004-read-tree-m-u-wf.sh \
416 t3700-add.sh \
417 t7300-clean.sh"
418 # t9100 still fails with symlinks in SVN 1.7
419 local test_svn="t9100-git-svn-basic.sh"
420
421 # Unzip is used only for the testcase code, not by any normal parts of Git.
422 if ! has_version app-arch/unzip ; then
423 einfo "Disabling tar-tree tests"
424 disabled="${disabled} t5000-tar-tree.sh"
425 fi
426
427 cvs=0
428 use cvs && let cvs=$cvs+1
429 if [[ ${EUID} -eq 0 ]]; then
430 if [[ $cvs -eq 1 ]]; then
431 ewarn "Skipping CVS tests because CVS does not work as root!"
432 ewarn "You should retest with FEATURES=userpriv!"
433 disabled="${disabled} ${tests_cvs}"
434 fi
435 einfo "Skipping other tests that require being non-root"
436 disabled="${disabled} ${tests_nonroot}"
437 else
438 [[ $cvs -gt 0 ]] && \
439 has_version dev-vcs/cvs && \
440 let cvs=$cvs+1
441 [[ $cvs -gt 1 ]] && \
442 built_with_use dev-vcs/cvs server && \
443 let cvs=$cvs+1
444 if [[ $cvs -lt 3 ]]; then
445 einfo "Disabling CVS tests (needs dev-vcs/cvs[USE=server])"
446 disabled="${disabled} ${tests_cvs}"
447 fi
448 fi
449
450 if ! use perl ; then
451 einfo "Disabling tests that need Perl"
452 disabled="${disabled} ${tests_perl}"
453 fi
454
455 einfo "Disabling tests that fail with SVN 1.7"
456 disabled="${disabled} ${test_svn}"
457
458 # Reset all previously disabled tests
459 cd "${S}/t"
460 for i in *.sh.DISABLED ; do
461 [[ -f "${i}" ]] && mv -f "${i}" "${i%.DISABLED}"
462 done
463 einfo "Disabled tests:"
464 for i in ${disabled} ; do
465 [[ -f "${i}" ]] && mv -f "${i}" "${i}.DISABLED" && einfo "Disabled $i"
466 done
467
468 # Avoid the test system removing the results because we want them ourselves
469 sed -e '/^[[:space:]]*$(MAKE) clean/s,^,#,g' \
470 -i "${S}"/t/Makefile
471
472 # Clean old results first, must always run
473 cd "${S}/t"
474 nonfatal git_emake clean
475
476 # Now run the tests, keep going if we hit an error, and don't terminate on
477 # failure
478 cd "${S}"
479 einfo "Start test run"
480 #MAKEOPTS=-j1
481 nonfatal git_emake --keep-going test
482 rc=$?
483
484 # Display nice results, now print the results
485 cd "${S}/t"
486 nonfatal git_emake aggregate-results
487
488 # And bail if there was a problem
489 [ $rc -eq 0 ] || die "tests failed. Please file a bug."
490 }
491
492 showpkgdeps() {
493 local pkg=$1
494 shift
495 elog " $(printf "%-17s:" ${pkg}) ${@}"
496 }
497
498 pkg_postinst() {
499 use emacs && elisp-site-regen
500 use python && python_mod_optimize git_remote_helpers
501 einfo "Please read /usr/share/bash-completion/git for Git bash completion"
502 elog "These additional scripts need some dependencies:"
503 echo
504 showpkgdeps git-quiltimport "dev-util/quilt"
505 showpkgdeps git-instaweb \
506 "|| ( www-servers/lighttpd www-servers/apache )"
507 echo
508 }
509
510 pkg_postrm() {
511 use emacs && elisp-site-regen
512 use python && python_mod_cleanup git_remote_helpers
513 }

  ViewVC Help
Powered by ViewVC 1.1.20