# Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI=5 inherit base games versionator MY_REV=$(get_version_component_range $(get_version_component_count)) MY_P=${PN}-src-r${MY_REV#p} DESCRIPTION="SDL-based implementation of Heroes of Might and Magic 2 engine" HOMEPAGE="http://sourceforge.net/projects/fheroes2/" SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tgz" LICENSE="GPL-2" SLOT="0" KEYWORDS="~x86 ~amd64" IUSE="debug mixer network png unicode" DEPEND="media-libs/libsdl mixer? ( media-libs/sdl-mixer[vorbis] ) network? ( media-libs/sdl-net ) png? ( media-libs/sdl-image[png] ) unicode? ( media-libs/sdl-ttf ) virtual/libintl" RDEPEND="${DEPEND}" # games-strategy/fheroes2-data" IUSE_LINGUAS=" cs es fr hu nl pl pt_BR ru sv tr" IUSE="${IUSE} ${IUSE_LINGUAS// / linguas_}" S=${WORKDIR}/fheroes-src PATCHES=( "${FILESDIR}/${P}-fix-make.patch" "${FILESDIR}/${P}-copy-configs.patch" ) usew() { use $1 || echo -n WITHOUT_$(echo ${2:-1} | tr a-z A-Z)=1 } # src_prepare() { # base_src_prepare # sed -e "s/# unicode = off/unicode = on/" \ # -i fheroes2.cfg # } src_compile() { local dir local buildtype=RELEASE use debug && buildtype=DEBUG emake $(usew mixer) $(usew network) $(usew png image) $(usew unicode) \ DATADIR="${GAMES_DATADIR}/${PN}" LOCALEDIR="/usr/share/locale" \ ${buildtype}=1 || die "emake failed." for l in ${LINGUAS}; do emake -C files/lang/${l}/LC_MESSAGES done } src_install() { dogamesbin fheroes2 || die "dogamesbin failed." pushd files/lang for l in ${LINGUAS}; do cp ${l}/LC_MESSAGES/fheroes2.mo ${l}.mo done popd domo files/lang/*.mo || die "domo failed." insinto ${GAMES_DATADIR}/${PN} || die "insdir failed" doins fheroes2.{cfg,key} || die "doins failed" insinto ${GAMES_DATADIR}/${PN}/files || die "insdir failed" doins -r files/{fonts,images,music,sounds,stats} || die "doins failed" dodoc AUTHORS changelog.txt README || die "dodoc failed." } pkg_postinst() { ewarn "Put game resources to ${GAMES_DATADIR}/${PN}/ or" ewarn "to ~/.${PN}/" echo games_pkg_postinst }