# Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI="4" inherit mono DESCRIPTION="information indexing software library for mono" HOMEPAGE="http://incubator.apache.org/lucene.net/" SRC_URI="mirror://apache/incubator/lucene.net/source/${PV}-incubating/Apache-Lucene.Net-${PV}-incubating.src.zip" LICENSE="Apache-2.0 GPL-2" SLOT="0" KEYWORDS="~amd64" IUSE="libs contrib demo test debug doc latex" RDEPEND=">=dev-lang/mono-1.0" DEPEND="${RDEPEND} app-arch/unzip >=dev-util/pkgconfig-0.20 doc? ( app-doc/doxygen )" src_unpack() { mkdir -p "${S}" || die cd "${S}" || die unpack ${A} } src_prepare() { cp "${FILESDIR}/config.doxygen" . || die einfo "Prepare assemblies for signing (creating strong names)" local files=$(find . -iname 'AssemblyInfo.cs') for file in ${files} do einfo "Patching: " ${file} sed -i '/AssemblyDelaySign/d' ${file} || die sed -i '/AssemblyKeyFile/d' ${file} || die sed -i '/AssemblyKeyName/d' ${file} || die cat >>${file} <<-EOF || die [assembly: AssemblyKeyFile(@"${FILESDIR}/gentoo.snk")] [assembly: AssemblyDelaySign(false)] EOF done } src_compile() { local cfg=$(use debug && echo Debug || echo Release) if use libs; then xbuild /property:Configuration=${cfg} \ build/Lucene.Net.Core.sln \ || die "build failed" fi if use contrib; then xbuild /property:Configuration=${cfg} \ build/Contrib.All.sln \ || die "build failed" fi if use demo; then xbuild /property:Configuration=${cfg} \ build/Lucene.Net.Demo.sln \ || die "build failed" fi if use test; then xbuild /property:Configuration=${cfg} \ build/Lucene.Net.Test.sln \ || die "build failed" fi if use doc; then doxygen config.doxygen fi } src_install() { insinto /usr/lib/nlucene/${PV} local folder=$(use debug && echo bin/Debug || echo obj) local configs=$(find . -wholename "**/${folder}/*.config") local exes=$(find . -wholename "**/${folder}/*.exe") local dlls=$(find . -wholename "**/${folder}/*.dll") local mdbs=$(find . -wholename "**/${folder}/*.mdb") for file in ${configs} ${exes} ${dlls} ${mdbs} do einfo "Installing: " ${file} doins ${file} done if use libs; then egacinstall "${D}usr/lib/nlucene/${PV}/Lucene.Net.dll" fi if use doc; then einfo "Installing html documentation" dohtml -r html/* einfo "Installing latex documentation" if use latex; then doins -r latex/* fi fi }