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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

(Portage version: 2.1.10.65/cvs/Linux i686)

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

  ViewVC Help
Powered by ViewVC 1.1.20