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