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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (show annotations) (download)
Sat Feb 12 23:26:10 2011 UTC (3 years, 6 months ago) by robbat2
Branch: MAIN
CVS Tags: HEAD
Changes since 1.6: +1 -1 lines
FILE REMOVED
Cleanup old files.

(Portage version: 2.2.0_alpha21/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.2.ebuild,v 1.6 2010/12/28 17:35:53 mr_bones_ 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} == ia64-*-hpux* ]]; then
153 myopts="${myopts} NO_NSEC=YesPlease"
154 fi
155
156 has_version '>=app-text/asciidoc-8.0' \
157 && myopts="${myopts} ASCIIDOC8=YesPlease"
158 myopts="${myopts} ASCIIDOC_NO_ROFF=YesPlease"
159
160 # Bug 290465:
161 # builtin-fetch-pack.c:816: error: 'struct stat' has no member named 'st_mtim'
162 [[ "${CHOST}" == *-uclibc* ]] && \
163 myopts="${myopts} NO_NSEC=YesPlease"
164
165 export MY_MAKEOPTS="${myopts}"
166 }
167
168 src_unpack() {
169 if [ "${PV}" != "9999" ]; then
170 unpack ${MY_P}.tar.bz2
171 cd "${S}"
172 unpack ${PN}-manpages-${DOC_VER}.tar.bz2
173 use doc && \
174 cd "${S}"/Documentation && \
175 unpack ${PN}-htmldocs-${DOC_VER}.tar.bz2
176 cd "${S}"
177 else
178 git_src_unpack
179 cd "${S}"
180 #cp "${FILESDIR}"/GIT-VERSION-GEN .
181 fi
182
183 }
184
185 src_prepare() {
186 # Noperl is being merged to upstream as of 2009/04/05
187 #epatch "${FILESDIR}"/20090305-git-1.6.2-noperl.patch
188
189 # GetOpt-Long v2.38 is strict
190 # Merged in 1.6.3 final 2009/05/07
191 #epatch "${FILESDIR}"/20090505-git-1.6.2.5-getopt-fixes.patch
192
193 # JS install fixup
194 epatch "${FILESDIR}"/git-1.7.2-always-install-js.patch
195
196 # USE=-iconv causes segfaults, fixed post 1.7.1
197 # Gentoo bug #321895
198 #epatch "${FILESDIR}"/git-1.7.1-noiconv-segfault-fix.patch
199
200 # Fix false positives with t3404 due to SHELL=/bin/false for the portage
201 # user.
202 epatch "${FILESDIR}"/git-1.7.3.4-avoid-shell-issues.patch
203
204 sed -i \
205 -e 's:^\(CFLAGS =\).*$:\1 $(OPTCFLAGS) -Wall:' \
206 -e 's:^\(LDFLAGS =\).*$:\1 $(OPTLDFLAGS):' \
207 -e 's:^\(CC = \).*$:\1$(OPTCC):' \
208 -e 's:^\(AR = \).*$:\1$(OPTAR):' \
209 -e "s:\(PYTHON_PATH = \)\(.*\)$:\1${EPREFIX}\2:" \
210 -e "s:\(PERL_PATH = \)\(.*\)$:\1${EPREFIX}\2:" \
211 Makefile || die "sed failed"
212
213 # Never install the private copy of Error.pm (bug #296310)
214 sed -i \
215 -e '/private-Error.pm/s,^,#,' \
216 perl/Makefile.PL
217
218 # Fix docbook2texi command
219 sed -i 's/DOCBOOK2X_TEXI=docbook2x-texi/DOCBOOK2X_TEXI=docbook2texi.pl/' \
220 Documentation/Makefile || die "sed failed"
221
222 # bug #318289
223 epatch "${FILESDIR}"/git-1.7.3.2-interix.patch
224 }
225
226 git_emake() {
227 emake ${MY_MAKEOPTS} \
228 DESTDIR="${D}" \
229 OPTCFLAGS="${CFLAGS}" \
230 OPTLDFLAGS="${LDFLAGS}" \
231 OPTCC="$(tc-getCC)" \
232 OPTAR="$(tc-getAR)" \
233 prefix="${EPREFIX}"/usr \
234 htmldir="${EPREFIX}"/usr/share/doc/${PF}/html \
235 sysconfdir="${EPREFIX}"/etc \
236 "$@"
237 }
238
239 src_configure() {
240 exportmakeopts
241 }
242
243 src_compile() {
244 git_emake || die "emake failed"
245
246 if use emacs ; then
247 elisp-compile contrib/emacs/git{,-blame}.el \
248 || die "emacs modules failed"
249 fi
250
251 if use perl && use cgi ; then
252 git_emake \
253 gitweb/gitweb.cgi \
254 || die "emake gitweb/gitweb.cgi failed"
255 fi
256
257 cd "${S}"/Documentation
258 if [[ "$PV" == "9999" ]] ; then
259 git_emake man \
260 || die "emake man failed"
261 if use doc ; then
262 git_emake info html \
263 || die "emake info html failed"
264 fi
265 else
266 if use doc ; then
267 git_emake info \
268 || die "emake info html failed"
269 fi
270 fi
271 }
272
273 src_install() {
274 git_emake \
275 install || \
276 die "make install failed"
277
278 # Depending on the tarball and manual rebuild of the documentation, the
279 # manpages may exist in either OR both of these directories.
280 find man?/*.[157] >/dev/null 2>&1 && doman man?/*.[157]
281 find Documentation/*.[157] >/dev/null 2>&1 && doman Documentation/*.[157]
282
283 dodoc README Documentation/{SubmittingPatches,CodingGuidelines}
284 use doc && dodir /usr/share/doc/${PF}/html
285 for d in / /howto/ /technical/ ; do
286 docinto ${d}
287 dodoc Documentation${d}*.txt
288 use doc && dohtml -p ${d} Documentation${d}*.html
289 done
290 docinto /
291 # Upstream does not ship this pre-built :-(
292 use doc && doinfo Documentation/{git,gitman}.info
293
294 dobashcompletion contrib/completion/git-completion.bash ${PN}
295
296 if use emacs ; then
297 elisp-install ${PN} contrib/emacs/git.{el,elc} || die
298 elisp-install ${PN} contrib/emacs/git-blame.{el,elc} || die
299 #elisp-install ${PN}/compat contrib/emacs/vc-git.{el,elc} || die
300 # don't add automatically to the load-path, so the sitefile
301 # can do a conditional loading
302 touch "${ED}${SITELISP}/${PN}/compat/.nosearch"
303 elisp-site-file-install "${FILESDIR}"/${SITEFILE} || die
304 fi
305
306 if use gtk ; then
307 dobin "${S}"/contrib/gitview/gitview
308 dodoc "${S}"/contrib/gitview/gitview.txt
309 fi
310
311 dobin contrib/fast-import/git-p4
312 dodoc contrib/fast-import/git-p4.txt
313 newbin contrib/fast-import/import-tars.perl import-tars
314
315 dodir /usr/share/${PN}/contrib
316 # The following are excluded:
317 # svnimport - use git-svn
318 # p4import - excluded because fast-import has a better one
319 # examples - these are stuff that is not used in Git anymore actually
320 # patches - stuff the Git guys made to go upstream to other places
321 for i in continuous fast-import hg-to-git \
322 hooks remotes2config.sh stats \
323 workdir convert-objects blameview ; do
324 cp -rf \
325 "${S}"/contrib/${i} \
326 "${ED}"/usr/share/${PN}/contrib \
327 || die "Failed contrib ${i}"
328 done
329
330 if use perl && use cgi ; then
331 exeinto /usr/share/${PN}/gitweb
332 doexe "${S}"/gitweb/gitweb.cgi
333 insinto /usr/share/${PN}/gitweb/static
334 doins "${S}"/gitweb/static/gitweb.css
335 js=gitweb.js
336 [ -f "${S}"/gitweb/static/gitweb.min.js ] && js=gitweb.min.js
337 doins "${S}"/gitweb/static/${js}
338 doins "${S}"/gitweb/static/git-{favicon,logo}.png
339
340 # INSTALL discusses configuration issues, not just installation
341 docinto /
342 newdoc "${S}"/gitweb/INSTALL INSTALL.gitweb
343 newdoc "${S}"/gitweb/README README.gitweb
344
345 find "${ED}"/usr/lib64/perl5/ \
346 -name .packlist \
347 -exec rm \{\} \;
348 fi
349 if ! use subversion ; then
350 rm -f "${ED}"/usr/libexec/git-core/git-svn \
351 "${ED}"/usr/share/man/man1/git-svn.1*
352 fi
353
354 if use xinetd ; then
355 insinto /etc/xinetd.d
356 newins "${FILESDIR}"/git-daemon.xinetd git-daemon
357 fi
358
359 newinitd "${FILESDIR}"/git-daemon.initd git-daemon
360 newconfd "${FILESDIR}"/git-daemon.confd git-daemon
361
362 fixlocalpod
363 }
364
365 src_test() {
366 local disabled=""
367 local tests_cvs="t9200-git-cvsexportcommit.sh \
368 t9400-git-cvsserver-server.sh \
369 t9401-git-cvsserver-crlf.sh \
370 t9600-cvsimport.sh \
371 t9601-cvsimport-vendor-branch.sh \
372 t9602-cvsimport-branches-tags.sh \
373 t9603-cvsimport-patchsets.sh"
374 local tests_perl="t5502-quickfetch.sh \
375 t5512-ls-remote.sh \
376 t5520-pull.sh"
377 # Bug #225601 - t0004 is not suitable for root perm
378 # Bug #219839 - t1004 is not suitable for root perm
379 # t0001-init.sh - check for init notices EPERM* fails
380 local tests_nonroot="t0001-init.sh \
381 t0004-unwritable.sh \
382 t1004-read-tree-m-u-wf.sh \
383 t3700-add.sh \
384 t7300-clean.sh"
385
386 # Unzip is used only for the testcase code, not by any normal parts of Git.
387 if ! has_version app-arch/unzip ; then
388 einfo "Disabling tar-tree tests"
389 disabled="${disabled} t5000-tar-tree.sh"
390 fi
391
392 cvs=0
393 use cvs && let cvs=$cvs+1
394 if [[ ${EUID} -eq 0 ]]; then
395 if [[ $cvs -eq 1 ]]; then
396 ewarn "Skipping CVS tests because CVS does not work as root!"
397 ewarn "You should retest with FEATURES=userpriv!"
398 disabled="${disabled} ${tests_cvs}"
399 fi
400 einfo "Skipping other tests that require being non-root"
401 disabled="${disabled} ${tests_nonroot}"
402 else
403 [[ $cvs -gt 0 ]] && \
404 has_version dev-vcs/cvs && \
405 let cvs=$cvs+1
406 [[ $cvs -gt 1 ]] && \
407 built_with_use dev-vcs/cvs server && \
408 let cvs=$cvs+1
409 if [[ $cvs -lt 3 ]]; then
410 einfo "Disabling CVS tests (needs dev-vcs/cvs[USE=server])"
411 disabled="${disabled} ${tests_cvs}"
412 fi
413 fi
414
415 if ! use perl ; then
416 einfo "Disabling tests that need Perl"
417 disabled="${disabled} ${tests_perl}"
418 fi
419
420 # Reset all previously disabled tests
421 cd "${S}/t"
422 for i in *.sh.DISABLED ; do
423 [[ -f "${i}" ]] && mv -f "${i}" "${i%.DISABLED}"
424 done
425 einfo "Disabled tests:"
426 for i in ${disabled} ; do
427 [[ -f "${i}" ]] && mv -f "${i}" "${i}.DISABLED" && einfo "Disabled $i"
428 done
429 cd "${S}"
430 # Now run the tests
431 einfo "Start test run"
432 git_emake \
433 test || die "tests failed"
434 }
435
436 showpkgdeps() {
437 local pkg=$1
438 shift
439 elog " $(printf "%-17s:" ${pkg}) ${@}"
440 }
441
442 pkg_postinst() {
443 use emacs && elisp-site-regen
444 if use subversion && has_version dev-vcs/subversion && ! built_with_use --missing false dev-vcs/subversion perl ; then
445 ewarn "You must build dev-vcs/subversion with USE=perl"
446 ewarn "to get the full functionality of git-svn!"
447 fi
448 elog "These additional scripts need some dependencies:"
449 echo
450 showpkgdeps git-quiltimport "dev-util/quilt"
451 showpkgdeps git-instaweb \
452 "|| ( www-servers/lighttpd www-servers/apache )"
453 echo
454 }
455
456 pkg_postrm() {
457 use emacs && elisp-site-regen
458 }

  ViewVC Help
Powered by ViewVC 1.1.20