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

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

  ViewVC Help
Powered by ViewVC 1.1.20