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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations) (download)
Fri Jul 30 21:01:32 2010 UTC (4 years, 5 months ago) by robbat2
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +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.ebuild,v 1.4 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 DEPEND="${CDEPEND}"
62
63 # These are needed to build the docs
64 if [ "$PV" == "9999" ]; then
65 DEPEND="${DEPEND}
66 doc? (
67 app-text/asciidoc
68 app-text/xmlto
69 app-text/docbook2X
70 )"
71 fi
72
73 SITEFILE=50${PN}-gentoo.el
74 S="${WORKDIR}/${MY_P}"
75
76 pkg_setup() {
77 if ! use perl ; then
78 use cgi && ewarn "gitweb needs USE=perl, ignoring USE=cgi"
79 use cvs && ewarn "CVS integration needs USE=perl, ignoring USE=cvs"
80 use subversion && ewarn "git-svn needs USE=perl, it won't work"
81 fi
82 if use webdav && ! use curl ; then
83 ewarn "USE=webdav needs USE=curl. Ignoring"
84 fi
85 if use subversion && has_version dev-vcs/subversion && built_with_use --missing false dev-vcs/subversion dso ; then
86 ewarn "Per Gentoo bugs #223747, #238586, when subversion is built"
87 ewarn "with USE=dso, there may be weird crashes in git-svn. You"
88 ewarn "have been warned."
89 fi
90 }
91
92 # This is needed because for some obscure reasons future calls to make don't
93 # pick up these exports if we export them in src_unpack()
94 exportmakeopts() {
95 local myopts
96
97 if use blksha1 ; then
98 myopts="${myopts} BLK_SHA1=YesPlease"
99 elif use ppcsha1 ; then
100 myopts="${myopts} PPC_SHA1=YesPlease"
101 fi
102
103 if use curl ; then
104 use webdav || myopts="${myopts} NO_EXPAT=YesPlease"
105 else
106 myopts="${myopts} NO_CURL=YesPlease"
107 fi
108
109 use iconv \
110 || myopts="${myopts} NO_ICONV=YesPlease"
111 use tk \
112 || myopts="${myopts} NO_TCLTK=YesPlease"
113 use perl \
114 && myopts="${myopts} INSTALLDIRS=vendor" \
115 || myopts="${myopts} NO_PERL=YesPlease"
116 use threads \
117 && myopts="${myopts} THREADED_DELTA_SEARCH=YesPlease"
118 use subversion \
119 || myopts="${myopts} NO_SVN_TESTS=YesPlease"
120
121 has_version '>=app-text/asciidoc-8.0' \
122 && myopts="${myopts} ASCIIDOC8=YesPlease"
123 myopts="${myopts} ASCIIDOC_NO_ROFF=YesPlease"
124
125 export MY_MAKEOPTS="${myopts}"
126 }
127
128 src_unpack() {
129 if [ "${PV}" != "9999" ]; then
130 unpack ${MY_P}.tar.bz2
131 cd "${S}"
132 unpack ${PN}-manpages-${DOC_VER}.tar.bz2
133 use doc && \
134 cd "${S}"/Documentation && \
135 unpack ${PN}-htmldocs-${DOC_VER}.tar.bz2
136 cd "${S}"
137 else
138 git_src_unpack
139 cd "${S}"
140 #cp "${FILESDIR}"/GIT-VERSION-GEN .
141 fi
142
143 }
144
145 src_prepare() {
146 # Noperl is being merged to upstream as of 2009/04/05
147 #epatch "${FILESDIR}"/20090305-git-1.6.2-noperl.patch
148
149 # GetOpt-Long v2.38 is strict
150 # Merged in 1.6.3 final 2009/05/07
151 #epatch "${FILESDIR}"/20090505-git-1.6.2.5-getopt-fixes.patch
152
153 sed -i \
154 -e 's:^\(CFLAGS =\).*$:\1 $(OPTCFLAGS) -Wall:' \
155 -e 's:^\(LDFLAGS =\).*$:\1 $(OPTLDFLAGS):' \
156 -e 's:^\(CC = \).*$:\1$(OPTCC):' \
157 -e 's:^\(AR = \).*$:\1$(OPTAR):' \
158 Makefile || die "sed failed"
159
160 # Fix docbook2texi command
161 sed -i 's/DOCBOOK2X_TEXI=docbook2x-texi/DOCBOOK2X_TEXI=docbook2texi.pl/' \
162 Documentation/Makefile || die "sed failed"
163 }
164
165 git_emake() {
166 emake ${MY_MAKEOPTS} \
167 DESTDIR="${D}" \
168 OPTCFLAGS="${CFLAGS}" \
169 OPTLDFLAGS="${LDFLAGS}" \
170 OPTCC="$(tc-getCC)" \
171 OPTAR="$(tc-getAR)" \
172 prefix=/usr \
173 htmldir=/usr/share/doc/${PF}/html \
174 "$@"
175 }
176
177 src_configure() {
178 exportmakeopts
179 }
180
181 src_compile() {
182 git_emake || die "emake failed"
183
184 if use emacs ; then
185 elisp-compile contrib/emacs/git{,-blame}.el \
186 || die "emacs modules failed"
187 fi
188
189 if use perl && use cgi ; then
190 git_emake \
191 gitweb/gitweb.cgi \
192 || die "emake gitweb/gitweb.cgi failed"
193 fi
194
195 cd "${S}"/Documentation
196 if [[ "$PV" == "9999" ]] ; then
197 git_emake man \
198 || die "emake man failed"
199 if use doc ; then
200 git_emake info html \
201 || die "emake info html failed"
202 fi
203 fi
204 }
205
206 src_install() {
207 git_emake \
208 install || \
209 die "make install failed"
210
211 doman man?/*.[157] Documentation/*.[157]
212
213 dodoc README Documentation/{SubmittingPatches,CodingGuidelines}
214 use doc && dodir /usr/share/doc/${PF}/html
215 for d in / /howto/ /technical/ ; do
216 docinto ${d}
217 dodoc Documentation${d}*.txt
218 use doc && dohtml -p ${d} Documentation${d}*.html
219 done
220 docinto /
221 # Upstream does not ship this pre-built :-(
222 [[ "$PV" == "9999" ]] && use doc && doinfo Documentation/{git,gitman}.info
223
224 dobashcompletion contrib/completion/git-completion.bash ${PN}
225
226 if use emacs ; then
227 elisp-install ${PN} contrib/emacs/git.{el,elc} || die
228 elisp-install ${PN} contrib/emacs/git-blame.{el,elc} || die
229 #elisp-install ${PN}/compat contrib/emacs/vc-git.{el,elc} || die
230 # don't add automatically to the load-path, so the sitefile
231 # can do a conditional loading
232 touch "${D}${SITELISP}/${PN}/compat/.nosearch"
233 elisp-site-file-install "${FILESDIR}"/${SITEFILE} || die
234 fi
235
236 if use gtk ; then
237 dobin "${S}"/contrib/gitview/gitview
238 dodoc "${S}"/contrib/gitview/gitview.txt
239 fi
240
241 dobin contrib/fast-import/git-p4
242 dodoc contrib/fast-import/git-p4.txt
243 newbin contrib/fast-import/import-tars.perl import-tars
244
245 dodir /usr/share/${PN}/contrib
246 # The following are excluded:
247 # svnimport - use git-svn
248 # p4import - excluded because fast-import has a better one
249 # examples - these are stuff that is not used in Git anymore actually
250 # patches - stuff the Git guys made to go upstream to other places
251 for i in continuous fast-import hg-to-git \
252 hooks remotes2config.sh stats \
253 workdir convert-objects blameview ; do
254 cp -rf \
255 "${S}"/contrib/${i} \
256 "${D}"/usr/share/${PN}/contrib \
257 || die "Failed contrib ${i}"
258 done
259
260 if use perl && use cgi ; then
261 dodir /usr/share/${PN}/gitweb
262 insinto /usr/share/${PN}/gitweb
263 doins "${S}"/gitweb/gitweb.cgi
264 doins "${S}"/gitweb/gitweb.css
265 doins "${S}"/gitweb/git-{favicon,logo}.png
266
267 # Make sure it can run
268 fperms 0755 /usr/share/${PN}/gitweb/gitweb.cgi
269
270 # INSTALL discusses configuration issues, not just installation
271 docinto /
272 newdoc "${S}"/gitweb/INSTALL INSTALL.gitweb
273 newdoc "${S}"/gitweb/README README.gitweb
274
275 find "${D}"/usr/lib64/perl5/ \
276 -name .packlist \
277 -exec rm \{\} \;
278 fi
279 if ! use subversion ; then
280 rm -f "${D}"/usr/libexec/git-core/git-svn \
281 "${D}"/usr/share/man/man1/git-svn.1*
282 fi
283
284 if use xinetd ; then
285 insinto /etc/xinetd.d
286 newins "${FILESDIR}"/git-daemon.xinetd git-daemon
287 fi
288
289 newinitd "${FILESDIR}"/git-daemon.initd git-daemon
290 newconfd "${FILESDIR}"/git-daemon.confd git-daemon
291
292 fixlocalpod
293 }
294
295 src_test() {
296 local disabled=""
297 local tests_cvs="t9200-git-cvsexportcommit.sh \
298 t9400-git-cvsserver-server.sh \
299 t9401-git-cvsserver-crlf.sh \
300 t9600-cvsimport.sh \
301 t9601-cvsimport-vendor-branch.sh \
302 t9602-cvsimport-branches-tags.sh \
303 t9603-cvsimport-patchsets.sh"
304 local tests_perl="t5502-quickfetch.sh \
305 t5512-ls-remote.sh \
306 t5520-pull.sh"
307
308 # Unzip is used only for the testcase code, not by any normal parts of Git.
309 if ! has_version app-arch/unzip ; then
310 einfo "Disabling tar-tree tests"
311 disabled="${disabled} t5000-tar-tree.sh"
312 fi
313
314 cvs=0
315 use cvs && let cvs=$cvs+1
316 if [[ ${EUID} -eq 0 ]]; then
317 if [[ $cvs -eq 1 ]]; then
318 ewarn "Skipping CVS tests because CVS does not work as root!"
319 ewarn "You should retest with FEATURES=userpriv!"
320 disabled="${disabled} ${tests_cvs}"
321 fi
322 # Bug #225601 - t0004 is not suitable for root perm
323 # Bug #219839 - t1004 is not suitable for root perm
324 disabled="${disabled} t0004-unwritable.sh t1004-read-tree-m-u-wf.sh"
325 else
326 [[ $cvs -gt 0 ]] && \
327 has_version dev-vcs/cvs && \
328 let cvs=$cvs+1
329 [[ $cvs -gt 1 ]] && \
330 built_with_use dev-vcs/cvs server && \
331 let cvs=$cvs+1
332 if [[ $cvs -lt 3 ]]; then
333 einfo "Disabling CVS tests (needs dev-vcs/cvs[USE=server])"
334 disabled="${disabled} ${tests_cvs}"
335 fi
336 fi
337
338 if ! use perl ; then
339 einfo "Disabling tests that need Perl"
340 disabled="${disabled} ${tests_perl}"
341 fi
342
343 # Reset all previously disabled tests
344 cd "${S}/t"
345 for i in *.sh.DISABLED ; do
346 [[ -f "${i}" ]] && mv -f "${i}" "${i%.DISABLED}"
347 done
348 einfo "Disabled tests:"
349 for i in ${disabled} ; do
350 [[ -f "${i}" ]] && mv -f "${i}" "${i}.DISABLED" && einfo "Disabled $i"
351 done
352 cd "${S}"
353 # Now run the tests
354 einfo "Start test run"
355 git_emake \
356 test || die "tests failed"
357 }
358
359 showpkgdeps() {
360 local pkg=$1
361 shift
362 elog " $(printf "%-17s:" ${pkg}) ${@}"
363 }
364
365 pkg_postinst() {
366 use emacs && elisp-site-regen
367 if use subversion && has_version dev-vcs/subversion && ! built_with_use --missing false dev-vcs/subversion perl ; then
368 ewarn "You must build dev-vcs/subversion with USE=perl"
369 ewarn "to get the full functionality of git-svn!"
370 fi
371 elog "These additional scripts need some dependencies:"
372 echo
373 showpkgdeps git-quiltimport "dev-util/quilt"
374 showpkgdeps git-instaweb \
375 "|| ( www-servers/lighttpd www-servers/apache )"
376 echo
377 }
378
379 pkg_postrm() {
380 use emacs && elisp-site-regen
381 }

  ViewVC Help
Powered by ViewVC 1.1.20