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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Tue Jun 26 16:24:30 2012 UTC (2 years, 6 months ago) by darkside
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
Cleanup some unstable ebuilds

(Portage version: 2.1.10.65/cvs/Linux i686)

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

  ViewVC Help
Powered by ViewVC 1.1.20