| 1 |
# Copyright 1999-2012 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/games-strategy/freeciv/freeciv-2.3.2.ebuild,v 1.4 2012/05/21 10:10:10 phajdan.jr Exp $
|
| 4 |
|
| 5 |
EAPI=2
|
| 6 |
inherit eutils gnome2-utils games-ggz games
|
| 7 |
|
| 8 |
DESCRIPTION="multiplayer strategy game (Civilization Clone)"
|
| 9 |
HOMEPAGE="http://www.freeciv.org/"
|
| 10 |
SRC_URI="mirror://sourceforge/freeciv/${P}.tar.bz2"
|
| 11 |
|
| 12 |
LICENSE="GPL-2"
|
| 13 |
SLOT="0"
|
| 14 |
KEYWORDS="amd64 ~ppc ~ppc64 x86"
|
| 15 |
IUSE="auth dedicated ggz gtk ipv6 nls readline sdl +sound"
|
| 16 |
|
| 17 |
RDEPEND="readline? ( sys-libs/readline )
|
| 18 |
sys-libs/zlib
|
| 19 |
app-arch/bzip2
|
| 20 |
auth? ( virtual/mysql )
|
| 21 |
!dedicated? (
|
| 22 |
nls? ( virtual/libintl )
|
| 23 |
gtk? ( x11-libs/gtk+:2 )
|
| 24 |
sdl? (
|
| 25 |
media-libs/libsdl[video]
|
| 26 |
media-libs/sdl-image[png]
|
| 27 |
media-libs/freetype
|
| 28 |
)
|
| 29 |
!gtk? ( !sdl? ( x11-libs/gtk+:2 ) )
|
| 30 |
sound? (
|
| 31 |
media-libs/libsdl[audio]
|
| 32 |
media-libs/sdl-mixer
|
| 33 |
)
|
| 34 |
ggz? ( games-board/ggz-gtk-client )
|
| 35 |
media-libs/libpng
|
| 36 |
)"
|
| 37 |
DEPEND="${RDEPEND}
|
| 38 |
virtual/pkgconfig
|
| 39 |
!dedicated? (
|
| 40 |
nls? ( sys-devel/gettext )
|
| 41 |
x11-proto/xextproto
|
| 42 |
)"
|
| 43 |
|
| 44 |
src_prepare() {
|
| 45 |
# install the .desktop in /usr/share/applications
|
| 46 |
# install the icons in /usr/share/pixmaps
|
| 47 |
sed -i \
|
| 48 |
-e 's:^.*\(desktopfiledir = \).*:\1/usr/share/applications:' \
|
| 49 |
-e 's:^\(icon[0-9]*dir = \)$(prefix)\(.*\):\1/usr\2:' \
|
| 50 |
-e 's:^\(icon[0-9]*dir = \)$(datadir)\(.*\):\1/usr/share\2:' \
|
| 51 |
client/Makefile.in \
|
| 52 |
server/Makefile.in \
|
| 53 |
modinst/Makefile.in \
|
| 54 |
data/Makefile.in \
|
| 55 |
data/icons/Makefile.in \
|
| 56 |
|| die "sed failed"
|
| 57 |
|
| 58 |
# remove civclient manpage if dedicated server
|
| 59 |
if use dedicated ; then
|
| 60 |
epatch "${FILESDIR}"/${P}-clean-man.patch
|
| 61 |
fi
|
| 62 |
}
|
| 63 |
|
| 64 |
src_configure() {
|
| 65 |
local myclient myopts
|
| 66 |
|
| 67 |
if use dedicated ; then
|
| 68 |
myclient="no"
|
| 69 |
else
|
| 70 |
use sdl && myclient="${myclient} sdl"
|
| 71 |
use gtk && myclient="${myclient} gtk"
|
| 72 |
[[ -z ${myclient} ]] && myclient="gtk" # default to gtk if none specified
|
| 73 |
myopts=$(use_with ggz ggz-client)
|
| 74 |
fi
|
| 75 |
|
| 76 |
egamesconf \
|
| 77 |
--disable-dependency-tracking \
|
| 78 |
--localedir=/usr/share/locale \
|
| 79 |
--with-ggzconfig=/usr/bin \
|
| 80 |
--enable-noregistry="${GGZ_MODDIR}" \
|
| 81 |
$(use_enable auth) \
|
| 82 |
$(use_enable ipv6) \
|
| 83 |
$(use_enable nls) \
|
| 84 |
$(use_with readline) \
|
| 85 |
$(use_enable sound sdl-mixer) \
|
| 86 |
${myopts} \
|
| 87 |
--enable-client="${myclient}"
|
| 88 |
}
|
| 89 |
|
| 90 |
src_install() {
|
| 91 |
emake DESTDIR="${D}" install || die "emake install failed"
|
| 92 |
|
| 93 |
if ! use dedicated ; then
|
| 94 |
# Create and install the html manual. It can't be done for dedicated
|
| 95 |
# servers, because the 'civmanual' tool is then not built. Also
|
| 96 |
# delete civmanual from the GAMES_BINDIR, because it's then useless.
|
| 97 |
# Note: to have it localized, it should be ran from _postinst, or
|
| 98 |
# something like that, but then it's a PITA to avoid orphan files...
|
| 99 |
./manual/freeciv-manual || die "freeciv-manual failed"
|
| 100 |
dohtml manual*.html || die "dohtml failed"
|
| 101 |
rm -f "${D}/${GAMES_BINDIR}"/civmanual
|
| 102 |
use sdl && make_desktop_entry freeciv-sdl "Freeciv (SDL)" freeciv-client
|
| 103 |
fi
|
| 104 |
|
| 105 |
dodoc ChangeLog NEWS doc/{BUGS,CodingStyle,HACKING,HOWTOPLAY,README*,TODO}
|
| 106 |
rm -rf "${D}$(games_get_libdir)"
|
| 107 |
|
| 108 |
prepgamesdirs
|
| 109 |
}
|
| 110 |
|
| 111 |
pkg_preinst() {
|
| 112 |
games_pkg_preinst
|
| 113 |
gnome2_icon_savelist
|
| 114 |
}
|
| 115 |
|
| 116 |
pkg_postinst() {
|
| 117 |
games_pkg_postinst
|
| 118 |
games-ggz_update_modules
|
| 119 |
gnome2_icon_cache_update
|
| 120 |
}
|
| 121 |
|
| 122 |
pkg_postrm() {
|
| 123 |
games-ggz_update_modules
|
| 124 |
gnome2_icon_cache_update
|
| 125 |
}
|