b66e05e96645c885fd3ed4a9dc10f285f761cb48
[gentoo-interactive-fiction.git] / games-engines / hugor / hugor-0.9.ebuild
1 # Copyright 1999-2011 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 EAPI="4"
6
7 if [ "$PV" != "9999" ]; then
8         SRC_URI="http://foss.aegean.gr/~realnc/hugor/${P}.tar.bz2"
9         KEYWORDS="x86 amd64"
10 else
11         SRC_URI=""
12         KEYWORDS=""
13 fi
14
15 inherit eutils gnome2-utils fdo-mime games qt4-r2 confutils
16
17 if [ "$PV" == "9999" ]; then
18         EGIT_REPO_URI="git://git.assembla.com/hugor.git"
19         inherit git-2
20 fi
21
22 DESCRIPTION="Multimedia interpreter for Hugo text adventures"
23 HOMEPAGE="http://ifwiki.org/index.php/Hugor"
24
25 LICENSE="Hugo"
26 SLOT="0"
27 IUSE="fmod +sdl"
28 REQUIRED_USE="^^ ( fmod sdl )"
29
30 DEPEND="x11-libs/qt-gui:4
31         sdl? ( >=media-libs/sdl-mixer-1.2.12[mad,midi,modplug] )
32         fmod? ( media-libs/fmod )
33         x11-misc/shared-mime-info"
34
35 src_configure() {
36         if use sdl; then
37                 eqmake4 SOUND=sdl
38         else
39                 eqmake4 SOUND=fmod
40         fi
41 }
42
43 src_install() {
44         dogamesbin "hugor"
45         dodoc README
46         doicon "${FILESDIR}/hugor.png"
47         make_desktop_entry hugor Hugor "hugor" Game "GenericName=Hugo Multimedia Interpreter\nMimeType=application/x-hugo-image;"
48         insinto /usr/share/icons
49         doins -r "${FILESDIR}/hicolor"
50         insinto /usr/share/mime/packages
51         doins "${FILESDIR}/hugor.xml"
52         prepgamesdirs
53 }
54
55 pkg_preinst() {
56         games_pkg_preinst
57         gnome2_icon_savelist
58 }
59
60 pkg_postinst() {
61         games_pkg_postinst
62         fdo-mime_desktop_database_update
63         fdo-mime_mime_database_update
64         gnome2_icon_cache_update
65 }
66
67 pkg_postrm() {
68         fdo-mime_desktop_database_update
69         fdo-mime_mime_database_update
70         gnome2_icon_cache_update
71 }