games-strategy/boswars: remove last-rited pkg
[gentoo.git] / games-strategy / freesynd / freesynd-0.7.1-r1.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 CMAKE_IN_SOURCE_BUILD=1
7 inherit cmake-utils desktop gnome2-utils readme.gentoo-r1
8
9 DESCRIPTION="Portable reimplementation of engine for the classic Bullfrog game, Syndicate"
10 HOMEPAGE="http://freesynd.sourceforge.net/"
11 SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
12
13 LICENSE="GPL-3"
14 SLOT="0"
15 KEYWORDS="~amd64 ~x86"
16 IUSE="debug devtools"
17
18 RDEPEND="
19         media-libs/libogg
20         media-libs/libpng:0=
21         media-libs/libsdl[X,sound,video]
22         media-libs/libvorbis
23         media-libs/sdl-mixer[mp3,vorbis]
24         media-libs/sdl-image[png]
25 "
26 DEPEND="${RDEPEND}"
27
28 DOCS=( NEWS README INSTALL AUTHORS )
29
30 PATCHES=( "${FILESDIR}"/${P}-cmake.patch )
31
32 DOC_CONTENTS="
33         You have to set \"data_dir = /my/path/to/synd-data\"
34         in \"~/.${PN}/${PN}.ini\".
35 "
36
37 src_prepare() {
38         cmake-utils_src_prepare
39
40         sed \
41                 -e "s:#freesynd_data_dir = /usr/share/freesynd/data:freesynd_data_dir = /usr/share/${PN}/data:" \
42                 -i ${PN}.ini || die
43 }
44
45 src_configure() {
46         local mycmakeargs=(
47                 -DWITH_DEBUG=$(usex debug)
48                 -DBUILD_DEV_TOOLS=$(usex devtools)
49         )
50
51         cmake-utils_src_configure
52 }
53
54 src_install() {
55         dobin src/${PN}
56         use devtools && newbin src/dump ${PN}-dump
57         insinto /usr/share/${PN}
58         doins -r data
59         newicon -s 128 icon/sword.png ${PN}.png
60         make_desktop_entry ${PN}
61         einstalldocs
62         readme.gentoo_create_doc
63 }
64
65 pkg_postinst() {
66         gnome2_icon_cache_update
67         if use debug ; then
68                 ewarn "Debug build is not meant for regular playing,"
69                 ewarn "game speed is higher."
70         fi
71         readme.gentoo_print_elog
72 }
73
74 pkg_postrm() {
75         gnome2_icon_cache_update
76 }