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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.14 - (show annotations) (download)
Thu Aug 23 20:18:14 2012 UTC (2 years ago) by robbat2
Branch: MAIN
Changes since 1.13: +2 -2 lines
Bug #432388: Make app-text/highlight optional as has heavy dependencies and is disabled by default in gitweb.

(Portage version: 2.2.0_alpha121/cvs/Linux x86_64, RepoMan options: --force)

1 # Copyright 1999-2012 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.2.5.ebuild,v 1.13 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 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
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 HTML docs, additionally
74 if [ "$PV" == "9999" ]; then
75 DEPEND="${DEPEND}
76 doc? (
77 app-text/xmlto
78 )"
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 threads \
140 && myopts="${myopts} THREADED_DELTA_SEARCH=YesPlease"
141 use subversion \
142 || myopts="${myopts} NO_SVN_TESTS=YesPlease"
143 # Disabled until ~m68k-mint can be keyworded again
144 # if [[ ${CHOST} == *-mint* ]] ; then
145 # myopts="${myopts} NO_MMAP=YesPlease"
146 # myopts="${myopts} NO_IPV6=YesPlease"
147 # myopts="${myopts} NO_STRLCPY=YesPlease"
148 # myopts="${myopts} NO_MEMMEM=YesPlease"
149 # myopts="${myopts} NO_MKDTEMP=YesPlease"
150 # myopts="${myopts} NO_MKSTEMPS=YesPlease"
151 # fi
152 if [[ ${CHOST} == *-interix* ]] ; then
153 myopts="${myopts} NO_IPV6=YesPlease"
154 myopts="${myopts} NO_MEMMEM=YesPlease"
155 myopts="${myopts} NO_MKDTEMP=YesPlease"
156 myopts="${myopts} NO_STRTOUMAX=YesPlease"
157 myopts="${myopts} NO_STRTOULL=YesPlease"
158 myopts="${myopts} NO_INET_NTOP=YesPlease"
159 myopts="${myopts} NO_INET_PTON=YesPlease"
160 myopts="${myopts} NO_NSEC=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 # CVE-2010-3906: XSS in gitweb
212 # applied upstream
213 #epatch "${FILESDIR}"/git-1.6.4.5-gitweb-cve-2010-3906.patch
214
215 sed -i \
216 -e 's:^\(CFLAGS =\).*$:\1 $(OPTCFLAGS) -Wall:' \
217 -e 's:^\(LDFLAGS =\).*$:\1 $(OPTLDFLAGS):' \
218 -e 's:^\(CC = \).*$:\1$(OPTCC):' \
219 -e 's:^\(AR = \).*$:\1$(OPTAR):' \
220 -e "s:\(PYTHON_PATH = \)\(.*\)$:\1${EPREFIX}\2:" \
221 -e "s:\(PERL_PATH = \)\(.*\)$:\1${EPREFIX}\2:" \
222 Makefile || die "sed failed"
223
224 # Never install the private copy of Error.pm (bug #296310)
225 sed -i \
226 -e '/private-Error.pm/s,^,#,' \
227 perl/Makefile.PL
228
229 # Fix docbook2texi command
230 sed -i 's/DOCBOOK2X_TEXI=docbook2x-texi/DOCBOOK2X_TEXI=docbook2texi.pl/' \
231 Documentation/Makefile || die "sed failed"
232
233 # bug #318289
234 epatch "${FILESDIR}"/git-1.7.1-interix.patch
235 epatch "${FILESDIR}"/git-1.6.6.1-interix6.patch
236 }
237
238 git_emake() {
239 emake ${MY_MAKEOPTS} \
240 DESTDIR="${D}" \
241 OPTCFLAGS="${CFLAGS}" \
242 OPTLDFLAGS="${LDFLAGS}" \
243 OPTCC="$(tc-getCC)" \
244 OPTAR="$(tc-getAR)" \
245 prefix="${EPREFIX}"/usr \
246 htmldir="${EPREFIX}"/usr/share/doc/${PF}/html \
247 sysconfdir="${EPREFIX}"/etc \
248 "$@"
249 }
250
251 src_configure() {
252 exportmakeopts
253 }
254
255 src_compile() {
256 git_emake || die "emake failed"
257
258 if use emacs ; then
259 elisp-compile contrib/emacs/git{,-blame}.el \
260 || die "emacs modules failed"
261 fi
262
263 if use perl && use cgi ; then
264 git_emake \
265 gitweb/gitweb.cgi \
266 || die "emake gitweb/gitweb.cgi failed"
267 fi
268
269 cd "${S}"/Documentation
270 if [[ "$PV" == "9999" ]] ; then
271 git_emake man \
272 || die "emake man failed"
273 if use doc ; then
274 git_emake info html \
275 || die "emake info html failed"
276 fi
277 else
278 if use doc ; then
279 git_emake info \
280 || die "emake info html failed"
281 fi
282 fi
283 }
284
285 src_install() {
286 git_emake \
287 install || \
288 die "make install failed"
289
290 # Depending on the tarball and manual rebuild of the documentation, the
291 # manpages may exist in either OR both of these directories.
292 find man?/*.[157] >/dev/null 2>&1 && doman man?/*.[157]
293 find Documentation/*.[157] >/dev/null 2>&1 && doman Documentation/*.[157]
294
295 dodoc README Documentation/{SubmittingPatches,CodingGuidelines}
296 use doc && dodir /usr/share/doc/${PF}/html
297 for d in / /howto/ /technical/ ; do
298 docinto ${d}
299 dodoc Documentation${d}*.txt
300 use doc && dohtml -p ${d} Documentation${d}*.html
301 done
302 docinto /
303 # Upstream does not ship this pre-built :-(
304 use doc && doinfo Documentation/{git,gitman}.info
305
306 dobashcompletion contrib/completion/git-completion.bash ${PN}
307
308 if use emacs ; then
309 elisp-install ${PN} contrib/emacs/git.{el,elc} || die
310 elisp-install ${PN} contrib/emacs/git-blame.{el,elc} || die
311 #elisp-install ${PN}/compat contrib/emacs/vc-git.{el,elc} || die
312 # don't add automatically to the load-path, so the sitefile
313 # can do a conditional loading
314 touch "${ED}${SITELISP}/${PN}/compat/.nosearch"
315 elisp-site-file-install "${FILESDIR}"/${SITEFILE} || die
316 fi
317
318 if use gtk ; then
319 dobin "${S}"/contrib/gitview/gitview
320 dodoc "${S}"/contrib/gitview/gitview.txt
321 fi
322
323 dobin contrib/fast-import/git-p4
324 dodoc contrib/fast-import/git-p4.txt
325 newbin contrib/fast-import/import-tars.perl import-tars
326
327 dodir /usr/share/${PN}/contrib
328 # The following are excluded:
329 # svnimport - use git-svn
330 # p4import - excluded because fast-import has a better one
331 # examples - these are stuff that is not used in Git anymore actually
332 # patches - stuff the Git guys made to go upstream to other places
333 for i in continuous fast-import hg-to-git \
334 hooks remotes2config.sh stats \
335 workdir convert-objects blameview ; do
336 cp -rf \
337 "${S}"/contrib/${i} \
338 "${ED}"/usr/share/${PN}/contrib \
339 || die "Failed contrib ${i}"
340 done
341
342 if use perl && use cgi ; then
343 exeinto /usr/share/${PN}/gitweb
344 doexe "${S}"/gitweb/gitweb.cgi
345 insinto /usr/share/${PN}/gitweb/static
346 doins "${S}"/gitweb/static/gitweb.css
347 js=gitweb.js
348 [ -f "${S}"/gitweb/static/gitweb.min.js ] && js=gitweb.min.js
349 doins "${S}"/gitweb/static/${js}
350 doins "${S}"/gitweb/static/git-{favicon,logo}.png
351
352 # INSTALL discusses configuration issues, not just installation
353 docinto /
354 newdoc "${S}"/gitweb/INSTALL INSTALL.gitweb
355 newdoc "${S}"/gitweb/README README.gitweb
356
357 find "${ED}"/usr/lib64/perl5/ \
358 -name .packlist \
359 -exec rm \{\} \;
360 fi
361 if ! use subversion ; then
362 rm -f "${ED}"/usr/libexec/git-core/git-svn \
363 "${ED}"/usr/share/man/man1/git-svn.1*
364 fi
365
366 if use xinetd ; then
367 insinto /etc/xinetd.d
368 newins "${FILESDIR}"/git-daemon.xinetd git-daemon
369 fi
370
371 newinitd "${FILESDIR}"/git-daemon.initd git-daemon
372 newconfd "${FILESDIR}"/git-daemon.confd git-daemon
373
374 fixlocalpod
375 }
376
377 src_test() {
378 local disabled=""
379 local tests_cvs="t9200-git-cvsexportcommit.sh \
380 t9400-git-cvsserver-server.sh \
381 t9401-git-cvsserver-crlf.sh \
382 t9600-cvsimport.sh \
383 t9601-cvsimport-vendor-branch.sh \
384 t9602-cvsimport-branches-tags.sh \
385 t9603-cvsimport-patchsets.sh"
386 local tests_perl="t5502-quickfetch.sh \
387 t5512-ls-remote.sh \
388 t5520-pull.sh"
389 # Bug #225601 - t0004 is not suitable for root perm
390 # Bug #219839 - t1004 is not suitable for root perm
391 # t0001-init.sh - check for init notices EPERM* fails
392 local tests_nonroot="t0001-init.sh \
393 t0004-unwritable.sh \
394 t1004-read-tree-m-u-wf.sh \
395 t3700-add.sh \
396 t7300-clean.sh"
397
398 # Unzip is used only for the testcase code, not by any normal parts of Git.
399 if ! has_version app-arch/unzip ; then
400 einfo "Disabling tar-tree tests"
401 disabled="${disabled} t5000-tar-tree.sh"
402 fi
403
404 cvs=0
405 use cvs && let cvs=$cvs+1
406 if [[ ${EUID} -eq 0 ]]; then
407 if [[ $cvs -eq 1 ]]; then
408 ewarn "Skipping CVS tests because CVS does not work as root!"
409 ewarn "You should retest with FEATURES=userpriv!"
410 disabled="${disabled} ${tests_cvs}"
411 fi
412 einfo "Skipping other tests that require being non-root"
413 disabled="${disabled} ${tests_nonroot}"
414 else
415 [[ $cvs -gt 0 ]] && \
416 has_version dev-vcs/cvs && \
417 let cvs=$cvs+1
418 [[ $cvs -gt 1 ]] && \
419 built_with_use dev-vcs/cvs server && \
420 let cvs=$cvs+1
421 if [[ $cvs -lt 3 ]]; then
422 einfo "Disabling CVS tests (needs dev-vcs/cvs[USE=server])"
423 disabled="${disabled} ${tests_cvs}"
424 fi
425 fi
426
427 if ! use perl ; then
428 einfo "Disabling tests that need Perl"
429 disabled="${disabled} ${tests_perl}"
430 fi
431
432 # Reset all previously disabled tests
433 cd "${S}/t"
434 for i in *.sh.DISABLED ; do
435 [[ -f "${i}" ]] && mv -f "${i}" "${i%.DISABLED}"
436 done
437 einfo "Disabled tests:"
438 for i in ${disabled} ; do
439 [[ -f "${i}" ]] && mv -f "${i}" "${i}.DISABLED" && einfo "Disabled $i"
440 done
441 cd "${S}"
442 # Now run the tests
443 einfo "Start test run"
444 git_emake test
445 rc=$?
446 # Display nice results
447 cd "${S}/t"
448 git_emake aggregate-results
449 [ $rc -eq 0 ] || die "tests failed. Please file a bug."
450 }
451
452 showpkgdeps() {
453 local pkg=$1
454 shift
455 elog " $(printf "%-17s:" ${pkg}) ${@}"
456 }
457
458 pkg_postinst() {
459 use emacs && elisp-site-regen
460 elog "These additional scripts need some dependencies:"
461 echo
462 showpkgdeps git-quiltimport "dev-util/quilt"
463 showpkgdeps git-instaweb \
464 "|| ( www-servers/lighttpd www-servers/apache )"
465 echo
466 }
467
468 pkg_postrm() {
469 use emacs && elisp-site-regen
470 }

  ViewVC Help
Powered by ViewVC 1.1.20