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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.20