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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Mon Aug 9 20:02:32 2010 UTC (3 years, 11 months ago) by grobian
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
Change SHELL_PATH from bash to sh to resolve problems with git's shell scripts for some people, bug #331031

(Portage version: 2.2.01.15553-prefix/cvs/Darwin powerpc)

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

  ViewVC Help
Powered by ViewVC 1.1.20