Gentoo Archives: gentoo-commits

From: Lars Wendler <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-vcs/git/, dev-vcs/git/files/
Date: Tue, 29 Sep 2015 15:16:58
Message-Id: 1443539807.e169d1bc34f448f086f3f731d30a84af217cb53f.polynomial-c@gentoo
1 commit: e169d1bc34f448f086f3f731d30a84af217cb53f
2 Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
3 AuthorDate: Tue Sep 29 15:16:22 2015 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Tue Sep 29 15:16:47 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e169d1bc
7
8 dev-vcs/git: git-send-email.perl: Fixed sending of many changes/patches
9
10 As per request from howarang.
11
12 Package-Manager: portage-2.2.22
13 Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
14
15 ...it-2.6.0-send-email_connection_closed_fix.patch | 34 ++
16 dev-vcs/git/git-2.6.0-r1.ebuild | 642 +++++++++++++++++++++
17 2 files changed, 676 insertions(+)
18
19 diff --git a/dev-vcs/git/files/git-2.6.0-send-email_connection_closed_fix.patch b/dev-vcs/git/files/git-2.6.0-send-email_connection_closed_fix.patch
20 new file mode 100644
21 index 0000000..11c082f
22 --- /dev/null
23 +++ b/dev-vcs/git/files/git-2.6.0-send-email_connection_closed_fix.patch
24 @@ -0,0 +1,34 @@
25 +From edc9433aff268f4c54b36072ebad40e76dcd3aed Mon Sep 17 00:00:00 2001
26 +From: Stefan Agner <stefan@×××××.ch>
27 +Date: Tue, 29 Sep 2015 16:49:46 +0200
28 +Subject: [PATCH] git-send-email.perl: Fixed sending of many changes/patches
29 +
30 +See http://permalink.gmane.org/gmane.comp.version-control.git/274569
31 +
32 +Reported-by: Juston Li <juston.h.li@×××××.com>
33 +Tested-by: Markos Chandras <hwoarang@g.o>
34 +Signed-off-by: Lars Wendler <polynomial-c@g.o>
35 +---
36 + git-send-email.perl | 6 +++++-
37 + 1 file changed, 5 insertions(+), 1 deletion(-)
38 +
39 +diff --git a/git-send-email.perl b/git-send-email.perl
40 +index e3ff44b..e907e0ea 100755
41 +--- a/git-send-email.perl
42 ++++ b/git-send-email.perl
43 +@@ -1365,7 +1365,11 @@ Message-Id: $message_id
44 + $smtp->mail( $raw_from ) or die $smtp->message;
45 + $smtp->to( @recipients ) or die $smtp->message;
46 + $smtp->data or die $smtp->message;
47 +- $smtp->datasend("$header\n$message") or die $smtp->message;
48 ++ $smtp->datasend("$header\n") or die $smtp->message;
49 ++ my @lines = split /^/, $message;
50 ++ foreach my $line (@lines) {
51 ++ $smtp->datasend("$line") or die $smtp->message;
52 ++ }
53 + $smtp->dataend() or die $smtp->message;
54 + $smtp->code =~ /250|200/ or die "Failed to send $subject\n".$smtp->message;
55 + }
56 +--
57 +2.6.0
58 +
59
60 diff --git a/dev-vcs/git/git-2.6.0-r1.ebuild b/dev-vcs/git/git-2.6.0-r1.ebuild
61 new file mode 100644
62 index 0000000..fa75f1e
63 --- /dev/null
64 +++ b/dev-vcs/git/git-2.6.0-r1.ebuild
65 @@ -0,0 +1,642 @@
66 +# Copyright 1999-2015 Gentoo Foundation
67 +# Distributed under the terms of the GNU General Public License v2
68 +# $Id$
69 +
70 +EAPI=5
71 +
72 +GENTOO_DEPEND_ON_PERL=no
73 +
74 +# bug #329479: git-remote-testgit is not multiple-version aware
75 +PYTHON_COMPAT=( python2_7 )
76 +[[ ${PV} == *9999 ]] && SCM="git-2"
77 +EGIT_REPO_URI="git://git.kernel.org/pub/scm/git/git.git"
78 +EGIT_MASTER=pu
79 +
80 +inherit toolchain-funcs eutils elisp-common perl-module bash-completion-r1 python-single-r1 systemd ${SCM}
81 +
82 +MY_PV="${PV/_rc/.rc}"
83 +MY_P="${PN}-${MY_PV}"
84 +
85 +DOC_VER=${MY_PV}
86 +
87 +DESCRIPTION="GIT - the stupid content tracker, the revision control system heavily used by the Linux kernel team"
88 +HOMEPAGE="http://www.git-scm.com/"
89 +if [[ ${PV} != *9999 ]]; then
90 + SRC_URI_SUFFIX="xz"
91 + SRC_URI_GOOG="https://git-core.googlecode.com/files"
92 + SRC_URI_KORG="mirror://kernel/software/scm/git"
93 + SRC_URI="${SRC_URI_GOOG}/${MY_P}.tar.${SRC_URI_SUFFIX}
94 + ${SRC_URI_KORG}/${MY_P}.tar.${SRC_URI_SUFFIX}
95 + ${SRC_URI_GOOG}/${PN}-manpages-${DOC_VER}.tar.${SRC_URI_SUFFIX}
96 + ${SRC_URI_KORG}/${PN}-manpages-${DOC_VER}.tar.${SRC_URI_SUFFIX}
97 + doc? (
98 + ${SRC_URI_KORG}/${PN}-htmldocs-${DOC_VER}.tar.${SRC_URI_SUFFIX}
99 + ${SRC_URI_GOOG}/${PN}-htmldocs-${DOC_VER}.tar.${SRC_URI_SUFFIX}
100 + )"
101 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
102 +fi
103 +
104 +LICENSE="GPL-2"
105 +SLOT="0"
106 +IUSE="+blksha1 +curl cgi doc emacs gnome-keyring +gpg gtk highlight +iconv libressl mediawiki +nls +pcre +perl +python ppcsha1 tk +threads +webdav xinetd cvs subversion test"
107 +
108 +# Common to both DEPEND and RDEPEND
109 +CDEPEND="
110 + !libressl? ( dev-libs/openssl:0= )
111 + libressl? ( dev-libs/libressl:= )
112 + sys-libs/zlib
113 + pcre? ( dev-libs/libpcre )
114 + perl? ( dev-lang/perl:=[-build(-)] )
115 + tk? ( dev-lang/tk:0= )
116 + curl? (
117 + net-misc/curl
118 + webdav? ( dev-libs/expat )
119 + )
120 + emacs? ( virtual/emacs )
121 + gnome-keyring? ( gnome-base/libgnome-keyring )"
122 +
123 +RDEPEND="${CDEPEND}
124 + gpg? ( app-crypt/gnupg )
125 + mediawiki? (
126 + dev-perl/HTML-Tree
127 + dev-perl/MediaWiki-API
128 + )
129 + perl? ( dev-perl/Error
130 + dev-perl/Net-SMTP-SSL
131 + dev-perl/Authen-SASL
132 + cgi? ( dev-perl/CGI highlight? ( app-text/highlight ) )
133 + cvs? ( >=dev-vcs/cvsps-2.1:0 dev-perl/DBI dev-perl/DBD-SQLite )
134 + subversion? ( dev-vcs/subversion[-dso,perl] dev-perl/libwww-perl dev-perl/TermReadKey )
135 + )
136 + python? ( gtk?
137 + (
138 + >=dev-python/pygtk-2.8[${PYTHON_USEDEP}]
139 + >=dev-python/pygtksourceview-2.10.1-r1:2[${PYTHON_USEDEP}]
140 + )
141 + ${PYTHON_DEPS} )"
142 +
143 +# This is how info docs are created with Git:
144 +# .txt/asciidoc --(asciidoc)---------> .xml/docbook
145 +# .xml/docbook --(docbook2texi.pl)--> .texi
146 +# .texi --(makeinfo)---------> .info
147 +DEPEND="${CDEPEND}
148 + doc? (
149 + app-text/asciidoc
150 + app-text/docbook2X
151 + sys-apps/texinfo
152 + app-text/xmlto
153 + )
154 + nls? ( sys-devel/gettext )
155 + test? ( app-crypt/gnupg )"
156 +
157 +# Live ebuild builds man pages and HTML docs, additionally
158 +if [[ ${PV} == *9999 ]]; then
159 + DEPEND="${DEPEND}
160 + app-text/asciidoc"
161 +fi
162 +
163 +SITEFILE=50${PN}-gentoo.el
164 +S="${WORKDIR}/${MY_P}"
165 +
166 +REQUIRED_USE="
167 + cgi? ( perl )
168 + cvs? ( perl )
169 + mediawiki? ( perl )
170 + subversion? ( perl )
171 + webdav? ( curl )
172 + gtk? ( python )
173 + python? ( ${PYTHON_REQUIRED_USE} )
174 +"
175 +
176 +pkg_setup() {
177 + if use subversion && has_version "dev-vcs/subversion[dso]"; then
178 + ewarn "Per Gentoo bugs #223747, #238586, when subversion is built"
179 + ewarn "with USE=dso, there may be weird crashes in git-svn. You"
180 + ewarn "have been warned."
181 + fi
182 + if use python ; then
183 + python-single-r1_pkg_setup
184 + fi
185 +}
186 +
187 +# This is needed because for some obscure reasons future calls to make don't
188 +# pick up these exports if we export them in src_unpack()
189 +exportmakeopts() {
190 + local myopts
191 +
192 + if use blksha1 ; then
193 + myopts+=" BLK_SHA1=YesPlease"
194 + elif use ppcsha1 ; then
195 + myopts+=" PPC_SHA1=YesPlease"
196 + fi
197 +
198 + if use curl ; then
199 + use webdav || myopts+=" NO_EXPAT=YesPlease"
200 + else
201 + myopts+=" NO_CURL=YesPlease"
202 + fi
203 +
204 + # broken assumptions, because of broken build system ...
205 + myopts+=" NO_FINK=YesPlease NO_DARWIN_PORTS=YesPlease"
206 + myopts+=" INSTALL=install TAR=tar"
207 + myopts+=" SHELL_PATH=${EPREFIX}/bin/sh"
208 + myopts+=" SANE_TOOL_PATH="
209 + myopts+=" OLD_ICONV="
210 + myopts+=" NO_EXTERNAL_GREP="
211 +
212 + # For svn-fe
213 + extlibs="-lz -lssl ${S}/xdiff/lib.a $(usex threads -lpthread '')"
214 +
215 + # can't define this to null, since the entire makefile depends on it
216 + sed -i -e '/\/usr\/local/s/BASIC_/#BASIC_/' Makefile
217 +
218 + use iconv \
219 + || myopts+=" NO_ICONV=YesPlease"
220 + use nls \
221 + || myopts+=" NO_GETTEXT=YesPlease"
222 + use tk \
223 + || myopts+=" NO_TCLTK=YesPlease"
224 + use pcre \
225 + && myopts+=" USE_LIBPCRE=yes" \
226 + && extlibs+=" -lpcre"
227 + use perl \
228 + && myopts+=" INSTALLDIRS=vendor" \
229 + || myopts+=" NO_PERL=YesPlease"
230 + use python \
231 + || myopts+=" NO_PYTHON=YesPlease"
232 + use subversion \
233 + || myopts+=" NO_SVN_TESTS=YesPlease"
234 + use threads \
235 + && myopts+=" THREADED_DELTA_SEARCH=YesPlease" \
236 + || myopts+=" NO_PTHREADS=YesPlease"
237 + use cvs \
238 + || myopts+=" NO_CVS=YesPlease"
239 +# Disabled until ~m68k-mint can be keyworded again
240 +# if [[ ${CHOST} == *-mint* ]] ; then
241 +# myopts+=" NO_MMAP=YesPlease"
242 +# myopts+=" NO_IPV6=YesPlease"
243 +# myopts+=" NO_STRLCPY=YesPlease"
244 +# myopts+=" NO_MEMMEM=YesPlease"
245 +# myopts+=" NO_MKDTEMP=YesPlease"
246 +# myopts+=" NO_MKSTEMPS=YesPlease"
247 +# fi
248 + if [[ ${CHOST} == ia64-*-hpux* ]]; then
249 + myopts+=" NO_NSEC=YesPlease"
250 + fi
251 + if [[ ${CHOST} == *-*-aix* ]]; then
252 + myopts+=" NO_FNMATCH_CASEFOLD=YesPlease"
253 + fi
254 + if [[ ${CHOST} == *-solaris* ]]; then
255 + myopts+=" NEEDS_LIBICONV=YesPlease"
256 + fi
257 +
258 + has_version '>=app-text/asciidoc-8.0' \
259 + && myopts+=" ASCIIDOC8=YesPlease"
260 + myopts+=" ASCIIDOC_NO_ROFF=YesPlease"
261 +
262 + # Bug 290465:
263 + # builtin-fetch-pack.c:816: error: 'struct stat' has no member named 'st_mtim'
264 + [[ "${CHOST}" == *-uclibc* ]] && \
265 + myopts+=" NO_NSEC=YesPlease"
266 +
267 + export MY_MAKEOPTS="${myopts}"
268 + export EXTLIBS="${extlibs}"
269 +}
270 +
271 +src_unpack() {
272 + if [[ ${PV} != *9999 ]]; then
273 + unpack ${MY_P}.tar.${SRC_URI_SUFFIX}
274 + cd "${S}"
275 + unpack ${PN}-manpages-${DOC_VER}.tar.${SRC_URI_SUFFIX}
276 + use doc && \
277 + cd "${S}"/Documentation && \
278 + unpack ${PN}-htmldocs-${DOC_VER}.tar.${SRC_URI_SUFFIX}
279 + cd "${S}"
280 + else
281 + git-2_src_unpack
282 + cd "${S}"
283 + #cp "${FILESDIR}"/GIT-VERSION-GEN .
284 + fi
285 +
286 +}
287 +
288 +src_prepare() {
289 + # bug #350330 - automagic CVS when we don't want it is bad.
290 + epatch "${FILESDIR}"/git-2.2.2-optional-cvs.patch
291 +
292 + # install mediawiki perl modules also in vendor_dir
293 + # hack, needs better upstream solution
294 + epatch "${FILESDIR}"/git-1.8.5-mw-vendor.patch
295 +
296 + epatch "${FILESDIR}"/git-2.2.0-svn-fe-linking.patch
297 +
298 + # Bug #493306, where FreeBSD 10.x merged libiconv into its libc.
299 + epatch "${FILESDIR}"/git-2.5.1-freebsd-10.x-no-iconv.patch
300 +
301 + epatch "${FILESDIR}"/${PN}-2.6.0-send-email_connection_closed_fix.patch
302 +
303 + epatch_user
304 +
305 + sed -i \
306 + -e 's:^\(CFLAGS[[:space:]]*=\).*$:\1 $(OPTCFLAGS) -Wall:' \
307 + -e 's:^\(LDFLAGS[[:space:]]*=\).*$:\1 $(OPTLDFLAGS):' \
308 + -e 's:^\(CC[[:space:]]* =\).*$:\1$(OPTCC):' \
309 + -e 's:^\(AR[[:space:]]* =\).*$:\1$(OPTAR):' \
310 + -e "s:\(PYTHON_PATH[[:space:]]\+=[[:space:]]\+\)\(.*\)$:\1${EPREFIX}\2:" \
311 + -e "s:\(PERL_PATH[[:space:]]\+=[[:space:]]\+\)\(.*\)$:\1${EPREFIX}\2:" \
312 + Makefile contrib/svn-fe/Makefile || die "sed failed"
313 +
314 + # Never install the private copy of Error.pm (bug #296310)
315 + sed -i \
316 + -e '/private-Error.pm/s,^,#,' \
317 + perl/Makefile.PL
318 +
319 + # Fix docbook2texi command
320 + sed -r -i 's/DOCBOOK2X_TEXI[[:space:]]*=[[:space:]]*docbook2x-texi/DOCBOOK2X_TEXI = docbook2texi.pl/' \
321 + Documentation/Makefile || die "sed failed"
322 +
323 + # Fix git-subtree missing DESTDIR
324 + sed -i \
325 + -e '/$(INSTALL)/s/ $(libexecdir)/ $(DESTDIR)$(libexecdir)/g' \
326 + -e '/$(INSTALL)/s/ $(man1dir)/ $(DESTDIR)$(man1dir)/g' \
327 + contrib/subtree/Makefile
328 +}
329 +
330 +git_emake() {
331 + # bug #326625: PERL_PATH, PERL_MM_OPT
332 + # bug #320647: PYTHON_PATH
333 + PYTHON_PATH=""
334 + use python && PYTHON_PATH="${PYTHON}"
335 + emake ${MY_MAKEOPTS} \
336 + DESTDIR="${D}" \
337 + OPTCFLAGS="${CFLAGS}" \
338 + OPTLDFLAGS="${LDFLAGS}" \
339 + OPTCC="$(tc-getCC)" \
340 + OPTAR="$(tc-getAR)" \
341 + prefix="${EPREFIX}"/usr \
342 + htmldir="${EPREFIX}"/usr/share/doc/${PF}/html \
343 + sysconfdir="${EPREFIX}"/etc \
344 + PYTHON_PATH="${PYTHON_PATH}" \
345 + PERL_MM_OPT="" \
346 + GIT_TEST_OPTS="--no-color" \
347 + V=1 \
348 + "$@"
349 + # This is the fix for bug #326625, but it also causes breakage, see bug
350 + # #352693.
351 + # PERL_PATH="${EPREFIX}/usr/bin/env perl" \
352 +}
353 +
354 +src_configure() {
355 + exportmakeopts
356 +}
357 +
358 +src_compile() {
359 + if use perl ; then
360 + git_emake perl/PM.stamp || die "emake perl/PM.stamp failed"
361 + git_emake perl/perl.mak || die "emake perl/perl.mak failed"
362 + fi
363 + git_emake || die "emake failed"
364 +
365 + if use emacs ; then
366 + elisp-compile contrib/emacs/git{,-blame}.el
367 + fi
368 +
369 + if use perl && use cgi ; then
370 + git_emake \
371 + gitweb \
372 + || die "emake gitweb (cgi) failed"
373 + fi
374 +
375 + if [[ ${CHOST} == *-darwin* ]]; then
376 + cd "${S}"/contrib/credential/osxkeychain || die "cd credential/osxkeychain"
377 + git_emake || die "emake credential-osxkeychain"
378 + fi
379 +
380 + cd "${S}"/Documentation
381 + if [[ ${PV} == *9999 ]] ; then
382 + git_emake man \
383 + || die "emake man failed"
384 + if use doc ; then
385 + git_emake info html \
386 + || die "emake info html failed"
387 + fi
388 + else
389 + if use doc ; then
390 + git_emake info \
391 + || die "emake info html failed"
392 + fi
393 + fi
394 +
395 + if use subversion ; then
396 + cd "${S}"/contrib/svn-fe
397 + # by defining EXTLIBS we override the detection for libintl and
398 + # libiconv, bug #516168
399 + local nlsiconv=
400 + use nls && use !elibc_glibc && nlsiconv+=" -lintl"
401 + use iconv && use !elibc_glibc && nlsiconv+=" -liconv"
402 + git_emake EXTLIBS="${EXTLIBS} ${nlsiconv}" || die "emake svn-fe failed"
403 + if use doc ; then
404 + git_emake svn-fe.{1,html} || die "emake svn-fe.1 svn-fe.html failed"
405 + fi
406 + cd "${S}"
407 + fi
408 +
409 + if use gnome-keyring ; then
410 + cd "${S}"/contrib/credential/gnome-keyring
411 + git_emake || die "emake git-credential-gnome-keyring failed"
412 + fi
413 +
414 + cd "${S}"/contrib/subtree
415 + git_emake
416 + use doc && git_emake doc
417 +
418 + if use mediawiki ; then
419 + cd "${S}"/contrib/mw-to-git
420 + git_emake
421 + fi
422 +}
423 +
424 +src_install() {
425 + git_emake \
426 + install || \
427 + die "make install failed"
428 +
429 + if [[ ${CHOST} == *-darwin* ]]; then
430 + dobin contrib/credential/osxkeychain/git-credential-osxkeychain
431 + fi
432 +
433 + # Depending on the tarball and manual rebuild of the documentation, the
434 + # manpages may exist in either OR both of these directories.
435 + find man?/*.[157] >/dev/null 2>&1 && doman man?/*.[157]
436 + find Documentation/*.[157] >/dev/null 2>&1 && doman Documentation/*.[157]
437 +
438 + dodoc README Documentation/{SubmittingPatches,CodingGuidelines}
439 + use doc && dodir /usr/share/doc/${PF}/html
440 + for d in / /howto/ /technical/ ; do
441 + docinto ${d}
442 + dodoc Documentation${d}*.txt
443 + use doc && dohtml -p ${d} Documentation${d}*.html
444 + done
445 + docinto /
446 + # Upstream does not ship this pre-built :-(
447 + use doc && doinfo Documentation/{git,gitman}.info
448 +
449 + newbashcomp contrib/completion/git-completion.bash ${PN}
450 + bashcomp_alias git gitk
451 + # Not really a bash-completion file (bug #477920)
452 + # but still needed uncompressed (bug #507480)
453 + insinto /usr/share/${PN}
454 + doins contrib/completion/git-prompt.sh
455 +
456 + if use emacs ; then
457 + elisp-install ${PN} contrib/emacs/git.{el,elc}
458 + elisp-install ${PN} contrib/emacs/git-blame.{el,elc}
459 + #elisp-install ${PN}/compat contrib/emacs/vc-git.{el,elc}
460 + # don't add automatically to the load-path, so the sitefile
461 + # can do a conditional loading
462 + touch "${ED}${SITELISP}/${PN}/compat/.nosearch"
463 + elisp-site-file-install "${FILESDIR}"/${SITEFILE}
464 + fi
465 +
466 + if use python && use gtk ; then
467 + python_doscript "${S}"/contrib/gitview/gitview
468 + dodoc "${S}"/contrib/gitview/gitview.txt
469 + fi
470 +
471 + #dobin contrib/fast-import/git-p4 # Moved upstream
472 + #dodoc contrib/fast-import/git-p4.txt # Moved upstream
473 + newbin contrib/fast-import/import-tars.perl import-tars
474 + exeinto /usr/libexec/git-core/
475 + newexe contrib/git-resurrect.sh git-resurrect
476 +
477 + # git-subtree
478 + cd "${S}"/contrib/subtree
479 + git_emake install || die "Failed to emake install git-subtree"
480 + if use doc ; then
481 + git_emake install-man install-doc || die "Failed to emake install-doc install-mangit-subtree"
482 + fi
483 + newdoc README README.git-subtree
484 + dodoc git-subtree.txt
485 + cd "${S}"
486 +
487 + if use mediawiki ; then
488 + cd "${S}"/contrib/mw-to-git
489 + git_emake install
490 + cd "${S}"
491 + fi
492 +
493 + # diff-highlight
494 + dobin contrib/diff-highlight/diff-highlight
495 + newdoc contrib/diff-highlight/README README.diff-highlight
496 +
497 + # git-jump
498 + exeinto /usr/libexec/git-core/
499 + doexe contrib/git-jump/git-jump
500 + newdoc contrib/git-jump/README git-jump.txt
501 +
502 + # git-contacts
503 + exeinto /usr/libexec/git-core/
504 + doexe contrib/contacts/git-contacts
505 + dodoc contrib/contacts/git-contacts.txt
506 +
507 + if use gnome-keyring ; then
508 + cd "${S}"/contrib/credential/gnome-keyring
509 + dobin git-credential-gnome-keyring
510 + fi
511 +
512 + if use subversion ; then
513 + cd "${S}"/contrib/svn-fe
514 + dobin svn-fe
515 + dodoc svn-fe.txt
516 + use doc && doman svn-fe.1 && dohtml svn-fe.html
517 + cd "${S}"
518 + fi
519 +
520 + dodir /usr/share/${PN}/contrib
521 + # The following are excluded:
522 + # completion - installed above
523 + # credential/gnome-keyring TODO
524 + # diff-highlight - done above
525 + # emacs - installed above
526 + # examples - these are stuff that is not used in Git anymore actually
527 + # git-jump - done above
528 + # gitview - installed above
529 + # p4import - excluded because fast-import has a better one
530 + # patches - stuff the Git guys made to go upstream to other places
531 + # persistent-https - TODO
532 + # mw-to-git - TODO
533 + # subtree - build seperately
534 + # svnimport - use git-svn
535 + # thunderbird-patch-inline - fixes thunderbird
536 + for i in \
537 + buildsystems convert-objects fast-import \
538 + hg-to-git hooks remotes2config.sh rerere-train.sh \
539 + stats workdir \
540 + ; do
541 + cp -rf \
542 + "${S}"/contrib/${i} \
543 + "${ED}"/usr/share/${PN}/contrib \
544 + || die "Failed contrib ${i}"
545 + done
546 +
547 + if use perl && use cgi ; then
548 + # We used to install in /usr/share/${PN}/gitweb
549 + # but upstream installs in /usr/share/gitweb
550 + # so we will install a symlink and use their location for compat with other
551 + # distros
552 + dosym /usr/share/gitweb /usr/share/${PN}/gitweb
553 +
554 + # INSTALL discusses configuration issues, not just installation
555 + docinto /
556 + newdoc "${S}"/gitweb/INSTALL INSTALL.gitweb
557 + newdoc "${S}"/gitweb/README README.gitweb
558 +
559 + find "${ED}"/usr/lib64/perl5/ \
560 + -name .packlist \
561 + -exec rm \{\} \;
562 + else
563 + rm -rf "${ED}"/usr/share/gitweb
564 + fi
565 +
566 + if ! use subversion ; then
567 + rm -f "${ED}"/usr/libexec/git-core/git-svn \
568 + "${ED}"/usr/share/man/man1/git-svn.1*
569 + fi
570 +
571 + if use xinetd ; then
572 + insinto /etc/xinetd.d
573 + newins "${FILESDIR}"/git-daemon.xinetd git-daemon
574 + fi
575 +
576 + if use !prefix ; then
577 + newinitd "${FILESDIR}"/git-daemon-r1.initd git-daemon
578 + newconfd "${FILESDIR}"/git-daemon.confd git-daemon
579 + systemd_newunit "${FILESDIR}/git-daemon_at.service" "git-daemon@.service"
580 + systemd_dounit "${FILESDIR}/git-daemon.socket"
581 + fi
582 +
583 + perl_delete_localpod
584 +}
585 +
586 +src_test() {
587 + local disabled="" #t7004-tag.sh" #520270
588 + local tests_cvs="t9200-git-cvsexportcommit.sh \
589 + t9400-git-cvsserver-server.sh \
590 + t9401-git-cvsserver-crlf.sh \
591 + t9402-git-cvsserver-refs.sh \
592 + t9600-cvsimport.sh \
593 + t9601-cvsimport-vendor-branch.sh \
594 + t9602-cvsimport-branches-tags.sh \
595 + t9603-cvsimport-patchsets.sh \
596 + t9604-cvsimport-timestamps.sh"
597 + local tests_perl="t3701-add-interactive.sh \
598 + t5502-quickfetch.sh \
599 + t5512-ls-remote.sh \
600 + t5520-pull.sh \
601 + t7106-reset-unborn-branch.sh \
602 + t7501-commit.sh"
603 + # Bug #225601 - t0004 is not suitable for root perm
604 + # Bug #219839 - t1004 is not suitable for root perm
605 + # t0001-init.sh - check for init notices EPERM* fails
606 + local tests_nonroot="t0001-init.sh \
607 + t0004-unwritable.sh \
608 + t0070-fundamental.sh \
609 + t1004-read-tree-m-u-wf.sh \
610 + t3700-add.sh \
611 + t7300-clean.sh"
612 + # t9100 still fails with symlinks in SVN 1.7
613 + local test_svn="t9100-git-svn-basic.sh"
614 +
615 + # Unzip is used only for the testcase code, not by any normal parts of Git.
616 + if ! has_version app-arch/unzip ; then
617 + einfo "Disabling tar-tree tests"
618 + disabled="${disabled} t5000-tar-tree.sh"
619 + fi
620 +
621 + cvs=0
622 + use cvs && let cvs=$cvs+1
623 + if [[ ${EUID} -eq 0 ]]; then
624 + if [[ $cvs -eq 1 ]]; then
625 + ewarn "Skipping CVS tests because CVS does not work as root!"
626 + ewarn "You should retest with FEATURES=userpriv!"
627 + disabled="${disabled} ${tests_cvs}"
628 + fi
629 + einfo "Skipping other tests that require being non-root"
630 + disabled="${disabled} ${tests_nonroot}"
631 + else
632 + [[ $cvs -gt 0 ]] && \
633 + has_version dev-vcs/cvs && \
634 + let cvs=$cvs+1
635 + [[ $cvs -gt 1 ]] && \
636 + has_version "dev-vcs/cvs[server]" && \
637 + let cvs=$cvs+1
638 + if [[ $cvs -lt 3 ]]; then
639 + einfo "Disabling CVS tests (needs dev-vcs/cvs[USE=server])"
640 + disabled="${disabled} ${tests_cvs}"
641 + fi
642 + fi
643 +
644 + if ! use perl ; then
645 + einfo "Disabling tests that need Perl"
646 + disabled="${disabled} ${tests_perl}"
647 + fi
648 +
649 + einfo "Disabling tests that fail with SVN 1.7"
650 + disabled="${disabled} ${test_svn}"
651 +
652 + # Reset all previously disabled tests
653 + cd "${S}/t"
654 + for i in *.sh.DISABLED ; do
655 + [[ -f "${i}" ]] && mv -f "${i}" "${i%.DISABLED}"
656 + done
657 + einfo "Disabled tests:"
658 + for i in ${disabled} ; do
659 + [[ -f "${i}" ]] && mv -f "${i}" "${i}.DISABLED" && einfo "Disabled $i"
660 + done
661 +
662 + # Avoid the test system removing the results because we want them ourselves
663 + sed -e '/^[[:space:]]*$(MAKE) clean/s,^,#,g' \
664 + -i "${S}"/t/Makefile
665 +
666 + # Clean old results first, must always run
667 + cd "${S}/t"
668 + nonfatal git_emake clean
669 +
670 + # Now run the tests, keep going if we hit an error, and don't terminate on
671 + # failure
672 + cd "${S}"
673 + einfo "Start test run"
674 + #MAKEOPTS=-j1
675 + nonfatal git_emake --keep-going test
676 + rc=$?
677 +
678 + # Display nice results, now print the results
679 + cd "${S}/t"
680 + nonfatal git_emake aggregate-results
681 +
682 + # And bail if there was a problem
683 + [ $rc -eq 0 ] || die "tests failed. Please file a bug."
684 +}
685 +
686 +showpkgdeps() {
687 + local pkg=$1
688 + shift
689 + elog " $(printf "%-17s:" ${pkg}) ${@}"
690 +}
691 +
692 +pkg_postinst() {
693 + use emacs && elisp-site-regen
694 + einfo "Please read /usr/share/bash-completion/git for Git bash command completion"
695 + einfo "Please read /usr/share/git/git-prompt.sh for Git bash prompt"
696 + einfo "Note that the prompt bash code is now in that separate script"
697 + elog "These additional scripts need some dependencies:"
698 + echo
699 + showpkgdeps git-quiltimport "dev-util/quilt"
700 + showpkgdeps git-instaweb \
701 + "|| ( www-servers/lighttpd www-servers/apache www-servers/nginx )"
702 + echo
703 +}
704 +
705 +pkg_postrm() {
706 + use emacs && elisp-site-regen
707 +}