diff -ur clearsilver.orig/clearsilver-0.10.5-r1.ebuild clearsilver/clearsilver-0.10.5-r1.ebuild --- clearsilver.orig/clearsilver-0.10.5-r1.ebuild 2011-11-18 23:52:38.422952839 +0800 +++ clearsilver/clearsilver-0.10.5-r1.ebuild 2011-11-19 00:56:35.724951686 +0800 @@ -7,7 +7,10 @@ # # dju@gentoo.org, 4th July 2005 -inherit eutils perl-app multilib autotools +EAPI=4 +DEPEND_PYTHON="python? 2" + +inherit eutils perl-app multilib autotools python DESCRIPTION="Clearsilver is a fast, powerful, and language-neutral HTML template system." HOMEPAGE="http://www.clearsilver.net/" @@ -21,30 +24,34 @@ DEPEND="python? ( dev-lang/python ) perl? ( dev-lang/perl ) zlib? ( sys-libs/zlib )" - + RDEPEND=${DEPEND} -DOCS="README INSTALL" +DOCS=( README INSTALL ) if use python ; then DOCS="${DOCS} README.python" fi -src_unpack() { - unpack ${A} - cd "${S}" - - epatch "${FILESDIR}"/${P}-perl_installdir.patch +pkg_setup() { + if use python; then + python_set_active_version 2 + python_pkg_setup + fi +} +src_prepare() { use zlib && epatch "${FILESDIR}"/${P}-libz.patch - - epatch "${FILESDIR}"/${P}-libdir.patch - sed -i -e "s:GENTOO_LIBDIR:$(get_libdir):" configure.in - eautoreconf || die "eautoreconf failed" + epatch "${FILESDIR}"/${P}-perl_installdir.patch \ + "${FILESDIR}"/${P}-libdir.patch + sed -i -e "s:GENTOO_LIBDIR:$(get_libdir):" configure.in || die # Fix for Gentoo/Freebsd [[ "${ARCH}" == FreeBSD ]] && touch ${S}/features.h ${S}/cgi/features.h + + eautoreconf } -src_compile() { + +src_configure() { econf \ $(use_enable perl) \ $(use_with perl perl /usr/bin/perl) \ @@ -54,18 +61,22 @@ "--disable-apache" \ "--disable-ruby" \ "--disable-java" \ - "--disable-csharp" \ - || die "./configure failed" + "--disable-csharp" +} - emake || die "emake failed" +src_compile() { + emake } src_install () { make DESTDIR="${ED}" install - dodoc ${DOCS} || die "dodoc failed" + dodoc ${DOCS[@]} if use perl ; then - fixlocalpod || die "fixlocalpod failed" + fixlocalpod fi fi + if use python; then + python_convert_shebangs -r 2 "${ED}" + fi }