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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.20