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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Fri Aug 24 03:51:48 2012 UTC (2 years, 2 months ago) by zmedico
Branch: MAIN
Changes since 1.3: +2 -2 lines
Fix IUSE.missing for new highlight flag.

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

  ViewVC Help
Powered by ViewVC 1.1.20