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

Contents of /dev-vcs/git/git-1.7.4_rc1-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations) (download)
Wed Apr 6 23:07:49 2011 UTC (3 years, 8 months ago) by robbat2
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +1 -1 lines
FILE REMOVED
Clean up old 1.7.4_rc versions. Version bump to other new versions.

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

  ViewVC Help
Powered by ViewVC 1.1.20