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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (show annotations) (download)
Fri Jul 30 21:01:32 2010 UTC (4 years, 2 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.4.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 # Fix docbook2texi command
173 sed -i 's/DOCBOOK2X_TEXI=docbook2x-texi/DOCBOOK2X_TEXI=docbook2texi.pl/' \
174 Documentation/Makefile || die "sed failed"
175 }
176
177 git_emake() {
178 emake ${MY_MAKEOPTS} \
179 DESTDIR="${D}" \
180 OPTCFLAGS="${CFLAGS}" \
181 OPTLDFLAGS="${LDFLAGS}" \
182 OPTCC="$(tc-getCC)" \
183 OPTAR="$(tc-getAR)" \
184 prefix=/usr \
185 htmldir=/usr/share/doc/${PF}/html \
186 "$@"
187 }
188
189 src_configure() {
190 exportmakeopts
191 }
192
193 src_compile() {
194 git_emake || die "emake failed"
195
196 if use emacs ; then
197 elisp-compile contrib/emacs/git{,-blame}.el \
198 || die "emacs modules failed"
199 fi
200
201 if use perl && use cgi ; then
202 git_emake \
203 gitweb/gitweb.cgi \
204 || die "emake gitweb/gitweb.cgi failed"
205 fi
206
207 cd "${S}"/Documentation
208 if [[ "$PV" == "9999" ]] ; then
209 git_emake man \
210 || die "emake man failed"
211 if use doc ; then
212 git_emake info html \
213 || die "emake info html failed"
214 fi
215 else
216 if use doc ; then
217 git_emake info \
218 || die "emake info html failed"
219 fi
220 fi
221 }
222
223 src_install() {
224 git_emake \
225 install || \
226 die "make install failed"
227
228 doman man?/*.[157] Documentation/*.[157]
229
230 dodoc README Documentation/{SubmittingPatches,CodingGuidelines}
231 use doc && dodir /usr/share/doc/${PF}/html
232 for d in / /howto/ /technical/ ; do
233 docinto ${d}
234 dodoc Documentation${d}*.txt
235 use doc && dohtml -p ${d} Documentation${d}*.html
236 done
237 docinto /
238 # Upstream does not ship this pre-built :-(
239 use doc && doinfo Documentation/{git,gitman}.info
240
241 dobashcompletion contrib/completion/git-completion.bash ${PN}
242
243 if use emacs ; then
244 elisp-install ${PN} contrib/emacs/git.{el,elc} || die
245 elisp-install ${PN} contrib/emacs/git-blame.{el,elc} || die
246 #elisp-install ${PN}/compat contrib/emacs/vc-git.{el,elc} || die
247 # don't add automatically to the load-path, so the sitefile
248 # can do a conditional loading
249 touch "${D}${SITELISP}/${PN}/compat/.nosearch"
250 elisp-site-file-install "${FILESDIR}"/${SITEFILE} || die
251 fi
252
253 if use gtk ; then
254 dobin "${S}"/contrib/gitview/gitview
255 dodoc "${S}"/contrib/gitview/gitview.txt
256 fi
257
258 dobin contrib/fast-import/git-p4
259 dodoc contrib/fast-import/git-p4.txt
260 newbin contrib/fast-import/import-tars.perl import-tars
261
262 dodir /usr/share/${PN}/contrib
263 # The following are excluded:
264 # svnimport - use git-svn
265 # p4import - excluded because fast-import has a better one
266 # examples - these are stuff that is not used in Git anymore actually
267 # patches - stuff the Git guys made to go upstream to other places
268 for i in continuous fast-import hg-to-git \
269 hooks remotes2config.sh stats \
270 workdir convert-objects blameview ; do
271 cp -rf \
272 "${S}"/contrib/${i} \
273 "${D}"/usr/share/${PN}/contrib \
274 || die "Failed contrib ${i}"
275 done
276
277 if use perl && use cgi ; then
278 dodir /usr/share/${PN}/gitweb
279 insinto /usr/share/${PN}/gitweb
280 doins "${S}"/gitweb/gitweb.cgi
281 doins "${S}"/gitweb/gitweb.css
282 doins "${S}"/gitweb/git-{favicon,logo}.png
283
284 # Make sure it can run
285 fperms 0755 /usr/share/${PN}/gitweb/gitweb.cgi
286
287 # INSTALL discusses configuration issues, not just installation
288 docinto /
289 newdoc "${S}"/gitweb/INSTALL INSTALL.gitweb
290 newdoc "${S}"/gitweb/README README.gitweb
291
292 find "${D}"/usr/lib64/perl5/ \
293 -name .packlist \
294 -exec rm \{\} \;
295 fi
296 if ! use subversion ; then
297 rm -f "${D}"/usr/libexec/git-core/git-svn \
298 "${D}"/usr/share/man/man1/git-svn.1*
299 fi
300
301 if use xinetd ; then
302 insinto /etc/xinetd.d
303 newins "${FILESDIR}"/git-daemon.xinetd git-daemon
304 fi
305
306 newinitd "${FILESDIR}"/git-daemon.initd git-daemon
307 newconfd "${FILESDIR}"/git-daemon.confd git-daemon
308
309 fixlocalpod
310 }
311
312 src_test() {
313 local disabled=""
314 local tests_cvs="t9200-git-cvsexportcommit.sh \
315 t9400-git-cvsserver-server.sh \
316 t9401-git-cvsserver-crlf.sh \
317 t9600-cvsimport.sh \
318 t9601-cvsimport-vendor-branch.sh \
319 t9602-cvsimport-branches-tags.sh \
320 t9603-cvsimport-patchsets.sh"
321 local tests_perl="t5502-quickfetch.sh \
322 t5512-ls-remote.sh \
323 t5520-pull.sh"
324 # Bug #225601 - t0004 is not suitable for root perm
325 # Bug #219839 - t1004 is not suitable for root perm
326 # t0001-init.sh - check for init notices EPERM* fails
327 local tests_nonroot="t0001-init.sh \
328 t0004-unwritable.sh \
329 t1004-read-tree-m-u-wf.sh \
330 t3700-add.sh \
331 t7300-clean.sh"
332
333 # Unzip is used only for the testcase code, not by any normal parts of Git.
334 if ! has_version app-arch/unzip ; then
335 einfo "Disabling tar-tree tests"
336 disabled="${disabled} t5000-tar-tree.sh"
337 fi
338
339 cvs=0
340 use cvs && let cvs=$cvs+1
341 if [[ ${EUID} -eq 0 ]]; then
342 if [[ $cvs -eq 1 ]]; then
343 ewarn "Skipping CVS tests because CVS does not work as root!"
344 ewarn "You should retest with FEATURES=userpriv!"
345 disabled="${disabled} ${tests_cvs}"
346 fi
347 einfo "Skipping other tests that require being non-root"
348 disabled="${disabled} ${tests_nonroot}"
349 else
350 [[ $cvs -gt 0 ]] && \
351 has_version dev-vcs/cvs && \
352 let cvs=$cvs+1
353 [[ $cvs -gt 1 ]] && \
354 built_with_use dev-vcs/cvs server && \
355 let cvs=$cvs+1
356 if [[ $cvs -lt 3 ]]; then
357 einfo "Disabling CVS tests (needs dev-vcs/cvs[USE=server])"
358 disabled="${disabled} ${tests_cvs}"
359 fi
360 fi
361
362 if ! use perl ; then
363 einfo "Disabling tests that need Perl"
364 disabled="${disabled} ${tests_perl}"
365 fi
366
367 # Reset all previously disabled tests
368 cd "${S}/t"
369 for i in *.sh.DISABLED ; do
370 [[ -f "${i}" ]] && mv -f "${i}" "${i%.DISABLED}"
371 done
372 einfo "Disabled tests:"
373 for i in ${disabled} ; do
374 [[ -f "${i}" ]] && mv -f "${i}" "${i}.DISABLED" && einfo "Disabled $i"
375 done
376 cd "${S}"
377 # Now run the tests
378 einfo "Start test run"
379 git_emake \
380 test || die "tests failed"
381 }
382
383 showpkgdeps() {
384 local pkg=$1
385 shift
386 elog " $(printf "%-17s:" ${pkg}) ${@}"
387 }
388
389 pkg_postinst() {
390 use emacs && elisp-site-regen
391 if use subversion && has_version dev-vcs/subversion && ! built_with_use --missing false dev-vcs/subversion perl ; then
392 ewarn "You must build dev-vcs/subversion with USE=perl"
393 ewarn "to get the full functionality of git-svn!"
394 fi
395 elog "These additional scripts need some dependencies:"
396 echo
397 showpkgdeps git-quiltimport "dev-util/quilt"
398 showpkgdeps git-instaweb \
399 "|| ( www-servers/lighttpd www-servers/apache )"
400 echo
401 }
402
403 pkg_postrm() {
404 use emacs && elisp-site-regen
405 }

  ViewVC Help
Powered by ViewVC 1.1.20