Files
sablink-distro/www-apps/gitweb/gitweb-1.7.4.1.ebuild
T
2011-03-25 23:23:27 +01:00

155 lines
3.2 KiB
Bash

# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI=3
GENTOO_DEPEND_ON_PERL=no
inherit toolchain-funcs eutils
[ "$PV" == "9999" ] && inherit git
MY_PV="${PV/_rc/.rc}"
MY_PV="${MY_PV/gitweb/git}"
MY_P="${PN}-${MY_PV}"
MY_P="${MY_P/gitweb/git}"
DESCRIPTION="A web interface to git"
HOMEPAGE="http://www.git-scm.com/"
if [ "$PV" != "9999" ]; then
SRC_URI="mirror://kernel/software/scm/git/${MY_P}.tar.bz2"
KEYWORDS="~amd64 ~x86"
else
SRC_URI=""
EGIT_BRANCH="master"
EGIT_REPO_URI="git://git.kernel.org/pub/scm/git/git.git"
# EGIT_REPO_URI="http://www.kernel.org/pub/scm/git/git.git"
KEYWORDS=""
fi
LICENSE="GPL-2"
SLOT="0"
IUSE=""
# Common to both DEPEND and RDEPEND
CDEPEND="
sys-libs/zlib
dev-lang/perl[-build]
dev-lang/tk"
RDEPEND="${CDEPEND}
dev-vcs/git[-cgi]
dev-perl/Error
dev-perl/Net-SMTP-SSL
dev-perl/Authen-SASL"
# this is shipped with dev-lang/perl
#virtual/perl-CGI
DEPEND="${CDEPEND}
app-arch/cpio
"
SITEFILE=50${PN}-gentoo.el
S="${WORKDIR}/${MY_P}"
src_unpack() {
if [ "${PV}" != "9999" ]; then
unpack ${MY_P}.tar.bz2
cd "${S}"
else
git_src_unpack
cd "${S}"
#cp "${FILESDIR}"/GIT-VERSION-GEN .
fi
}
src_prepare() {
# JS install fixup
epatch "${FILESDIR}"/git-1.7.2-always-install-js.patch
# bug #350330 - automagic CVS when we don't want it is bad.
epatch "${FILESDIR}"/git-1.7.3.5-optional-cvs.patch
sed -i \
-e 's:^\(CFLAGS =\).*$:\1 $(OPTCFLAGS) -Wall:' \
-e 's:^\(LDFLAGS =\).*$:\1 $(OPTLDFLAGS):' \
-e 's:^\(CC = \).*$:\1$(OPTCC):' \
-e 's:^\(AR = \).*$:\1$(OPTAR):' \
-e "s:\(PYTHON_PATH = \)\(.*\)$:\1${EPREFIX}\2:" \
-e "s:\(PERL_PATH = \)\(.*\)$:\1${EPREFIX}\2:" \
Makefile || die "sed failed"
# Never install the private copy of Error.pm (bug #296310)
sed -i \
-e '/private-Error.pm/s,^,#,' \
perl/Makefile.PL
}
git_emake() {
# PYTHON_PATH="$(PYTHON -a)"
emake ${MY_MAKEOPTS} \
DESTDIR="${D}" \
OPTCFLAGS="${CFLAGS}" \
OPTLDFLAGS="${LDFLAGS}" \
OPTCC="$(tc-getCC)" \
OPTAR="$(tc-getAR)" \
prefix="${EPREFIX}"/usr \
htmldir="${EPREFIX}"/usr/share/doc/${PF}/html \
sysconfdir="${EPREFIX}"/etc \
PERL_PATH="${EPREFIX}/usr/bin/env perl" \
PERL_MM_OPT="" \
GIT_TEST_OPTS="--no-color" \
"$@"
}
src_configure() {
einfo "Nothing to configure."
}
src_compile() {
git_emake gitweb || die "emake gitweb failed"
}
src_install() {
#if use perl && use cgi ; then
# dosym /usr/share/gitweb /usr/share/${PN}/gitweb
# INSTALL discusses configuration issues, not just installation
docinto /
newdoc "${S}"/gitweb/INSTALL INSTALL.gitweb
newdoc "${S}"/gitweb/README README.gitweb
find "${ED}"/usr/lib64/perl5/ \
-name .packlist \
-exec rm \{\} \;
#else
# rm -rf "${ED}"/usr/share/gitweb
#fi
exeinto /usr/share/gitweb/
doexe "${S}"/gitweb/gitweb.cgi
insinto /usr/share/gitweb/static
doins "${S}"/gitweb/static/*.png
doins "${S}"/gitweb/static/*.css
doins "${S}"/gitweb/static/*.js
# fixlocalpod from perl-module: not needed
}
showpkgdeps() {
local pkg=$1
shift
elog " $(printf "%-17s:" ${pkg}) ${@}"
}
pkg_postinst() {
elog "These additional scripts need some dependencies:"
echo
showpkgdeps git-quiltimport "dev-util/quilt"
showpkgdeps git-instaweb \
"|| ( www-servers/lighttpd www-servers/apache )"
echo
}