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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Tue Dec 7 07:29:48 2010 UTC (3 years, 7 months ago) by robbat2
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
Version bump and cleanup.

(Portage version: 2.2.0_alpha6/cvs/Linux x86_64)

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

  ViewVC Help
Powered by ViewVC 1.1.20