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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.11 - (show annotations) (download)
Thu Aug 23 20:18:14 2012 UTC (22 months, 2 weeks ago) by robbat2
Branch: MAIN
Changes since 1.10: +2 -2 lines
Bug #432388: Make app-text/highlight optional as has heavy dependencies and is disabled by default in gitweb.

(Portage version: 2.2.0_alpha121/cvs/Linux x86_64, RepoMan options: --force)

1 # Copyright 1999-2012 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.4.5.ebuild,v 1.10 2011/04/04 08:58:41 pacho 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 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 fi
28
29 LICENSE="GPL-2"
30 SLOT="0"
31 KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
32 IUSE="curl cgi doc emacs gtk iconv mozsha1 perl ppcsha1 tk threads webdav xinetd cvs subversion"
33
34 # Common to both DEPEND and RDEPEND
35 CDEPEND="
36 dev-libs/openssl
37 sys-libs/zlib
38 app-arch/cpio
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] dev-perl/libwww-perl dev-perl/TermReadKey )
54 )
55 gtk?
56 (
57 >=dev-python/pygtk-2.8
58 dev-python/pygtksourceview:2
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 mozsha1 ; then
98 myopts="${myopts} MOZILLA_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 export MY_MAKEOPTS="${myopts}"
122 }
123
124 src_unpack() {
125 if [ "${PV}" != "9999" ]; then
126 unpack ${MY_P}.tar.bz2
127 cd "${S}"
128 unpack ${PN}-manpages-${DOC_VER}.tar.bz2
129 use doc && \
130 cd "${S}"/Documentation && \
131 unpack ${PN}-htmldocs-${DOC_VER}.tar.bz2
132 cd "${S}"
133 else
134 git_src_unpack
135 cd "${S}"
136 #cp "${FILESDIR}"/GIT-VERSION-GEN .
137 fi
138
139 }
140
141 src_prepare() {
142 # Noperl is being merged to upstream as of 2009/04/05
143 #epatch "${FILESDIR}"/20090305-git-1.6.2-noperl.patch
144
145 # GetOpt-Long v2.38 is strict
146 # Merged in 1.6.3 final 2009/05/07
147 #epatch "${FILESDIR}"/20090505-git-1.6.2.5-getopt-fixes.patch
148
149 # CVE-2010-3906: XSS in gitweb
150 # applied upstream
151 #epatch "${FILESDIR}"/git-1.6.4.5-gitweb-cve-2010-3906.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 if [[ "$PV" == "9999" ]] && use doc; then
196 cd Documentation
197 git_emake man info html \
198 || die "emake man html info failed"
199 fi
200 }
201
202 src_install() {
203 git_emake \
204 install || \
205 die "make install failed"
206
207 # Depending on the tarball and manual rebuild of the documentation, the
208 # manpages may exist in either OR both of these directories.
209 find man?/*.[157] >/dev/null 2>&1 && doman man?/*.[157]
210 find Documentation/*.[157] >/dev/null 2>&1 && doman Documentation/*.[157]
211
212 dodoc README Documentation/{SubmittingPatches,CodingGuidelines}
213 use doc && dodir /usr/share/doc/${PF}/html
214 for d in / /howto/ /technical/ ; do
215 docinto ${d}
216 dodoc Documentation${d}*.txt
217 use doc && dohtml -p ${d} Documentation${d}*.html
218 done
219 docinto /
220
221 dobashcompletion contrib/completion/git-completion.bash ${PN}
222
223 if use emacs ; then
224 elisp-install ${PN} contrib/emacs/git.{el,elc} || die
225 elisp-install ${PN} contrib/emacs/git-blame.{el,elc} || die
226 #elisp-install ${PN}/compat contrib/emacs/vc-git.{el,elc} || die
227 # don't add automatically to the load-path, so the sitefile
228 # can do a conditional loading
229 touch "${D}${SITELISP}/${PN}/compat/.nosearch"
230 elisp-site-file-install "${FILESDIR}"/${SITEFILE} || die
231 fi
232
233 if use gtk ; then
234 dobin "${S}"/contrib/gitview/gitview
235 dodoc "${S}"/contrib/gitview/gitview.txt
236 fi
237
238 dobin contrib/fast-import/git-p4
239 dodoc contrib/fast-import/git-p4.txt
240 newbin contrib/fast-import/import-tars.perl import-tars
241
242 dodir /usr/share/${PN}/contrib
243 # The following are excluded:
244 # svnimport - use git-svn
245 # p4import - excluded because fast-import has a better one
246 # examples - these are stuff that is not used in Git anymore actually
247 # patches - stuff the Git guys made to go upstream to other places
248 for i in continuous fast-import hg-to-git \
249 hooks remotes2config.sh stats \
250 workdir convert-objects blameview ; do
251 cp -rf \
252 "${S}"/contrib/${i} \
253 "${D}"/usr/share/${PN}/contrib \
254 || die "Failed contrib ${i}"
255 done
256
257 if use perl && use cgi ; then
258 dodir /usr/share/${PN}/gitweb
259 insinto /usr/share/${PN}/gitweb
260 doins "${S}"/gitweb/gitweb.cgi
261 doins "${S}"/gitweb/gitweb.css
262 doins "${S}"/gitweb/git-{favicon,logo}.png
263
264 # Make sure it can run
265 fperms 0755 /usr/share/${PN}/gitweb/gitweb.cgi
266
267 # INSTALL discusses configuration issues, not just installation
268 docinto /
269 newdoc "${S}"/gitweb/INSTALL INSTALL.gitweb
270 newdoc "${S}"/gitweb/README README.gitweb
271
272 find "${D}"/usr/lib64/perl5/ \
273 -name .packlist \
274 -exec rm \{\} \;
275 fi
276 if ! use subversion ; then
277 rm -f "${D}"/usr/libexec/git-core/git-svn \
278 "${D}"/usr/share/man/man1/git-svn.1*
279 fi
280
281 if use xinetd ; then
282 insinto /etc/xinetd.d
283 newins "${FILESDIR}"/git-daemon.xinetd git-daemon
284 fi
285
286 newinitd "${FILESDIR}"/git-daemon.initd git-daemon
287 newconfd "${FILESDIR}"/git-daemon.confd git-daemon
288
289 fixlocalpod
290 }
291
292 src_test() {
293 local disabled=""
294 local tests_cvs="t9200-git-cvsexportcommit.sh \
295 t9400-git-cvsserver-server.sh \
296 t9401-git-cvsserver-crlf.sh \
297 t9600-cvsimport.sh \
298 t9601-cvsimport-vendor-branch.sh \
299 t9602-cvsimport-branches-tags.sh \
300 t9603-cvsimport-patchsets.sh"
301 local tests_perl="t5502-quickfetch.sh \
302 t5512-ls-remote.sh \
303 t5520-pull.sh"
304
305 # Unzip is used only for the testcase code, not by any normal parts of Git.
306 if ! has_version app-arch/unzip ; then
307 einfo "Disabling tar-tree tests"
308 disabled="${disabled} t5000-tar-tree.sh"
309 fi
310
311 cvs=0
312 use cvs && let cvs=$cvs+1
313 if [[ ${EUID} -eq 0 ]]; then
314 if [[ $cvs -eq 1 ]]; then
315 ewarn "Skipping CVS tests because CVS does not work as root!"
316 ewarn "You should retest with FEATURES=userpriv!"
317 disabled="${disabled} ${tests_cvs}"
318 fi
319 # Bug #225601 - t0004 is not suitable for root perm
320 # Bug #219839 - t1004 is not suitable for root perm
321 # Bug #288575 - t3700 is not suitable for root perm
322 # Bug #288575 - t7300 is not suitable for root perm
323 disabled="${disabled} t0004-unwritable.sh t1004-read-tree-m-u-wf.sh
324 t3700-add.sh t7300-clean.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