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

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

  ViewVC Help
Powered by ViewVC 1.1.20