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

Contents of /dev-vcs/git/git-1.7.3.4-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.15 - (show annotations) (download)
Sat Jan 8 06:27:01 2011 UTC (3 years, 6 months ago) by robbat2
Branch: MAIN
Changes since 1.14: +6 -1 lines
Backport bug #350330 automagic perl to stable ebuild.

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

  ViewVC Help
Powered by ViewVC 1.1.20