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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.20