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

Contents of /dev-vcs/git/git-1.6.4.4-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Sat Feb 12 23:26:10 2011 UTC (3 years, 10 months ago) by robbat2
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
Cleanup old files.

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

  ViewVC Help
Powered by ViewVC 1.1.20