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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.20