games-strategy/lgeneral: Remove old 1.3.1-r2
[gentoo.git] / games-strategy / outerspace / outerspace-0.5.68-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 PYTHON_COMPAT=( python2_7 )
6
7 inherit desktop gnome2-utils distutils-r1
8
9 MY_PN="${PN/outerspace/Outer Space}"
10 DESCRIPTION="On-line strategy game taking place in the dangerous universe"
11 HOMEPAGE="https://www.ospace.net/ https://sourceforge.net/projects/ospace/"
12 SRC_URI="mirror://sourceforge/ospace/Client/${PV}/Outer%20Space-${PV}.tar.gz -> ${P}.tar.gz
13         mirror://sourceforge/ospace/Client/${PV}/outerspace_${PV}-0ubuntu1_all.deb"
14
15 LICENSE="GPL-2"
16 SLOT="0"
17 KEYWORDS="~amd64 ~x86"
18 IUSE=""
19
20 RDEPEND=">=dev-python/pygame-1.7"
21 DEPEND=""
22
23 S="${WORKDIR}/${MY_PN}-${PV}"
24
25 src_unpack() {
26         default
27         unpack ./data.tar.gz
28 }
29
30 python_install() {
31         distutils-r1_python_install \
32                 --install-scripts="/usr/bin" \
33                 --install-data="/usr/share/${PN}" \
34                 --install-lib="$(python_get_sitedir)"
35
36         # source tarball is missing files
37         # get them from ubuntu.deb
38         python_moduleinto ige.ospace.Rules
39         python_domodule "${WORKDIR}"/usr/share/games/outerspace/libsrvr/ige/ospace/Rules/{Tech,techs}.spf
40 }
41
42 src_prepare() {
43         default
44
45         # fix setup script
46         # rework python start script to avoid shell-wrapper script
47         eapply "${FILESDIR}"/${P}-setup.patch
48
49         sed -i\
50                 -e "s:@GENTOO_DATADIR@:/usr/share/${PN}:" \
51                 osc.py || die "sed failed"
52
53         distutils-r1_src_prepare
54 }
55
56 src_install() {
57         distutils-r1_src_install
58         newicon res/logo-login.png ${PN}.png
59         make_desktop_entry "osc.py" "${MY_PN}"
60 }
61
62 pkg_preinst() {
63         gnome2_icon_savelist
64 }
65
66 pkg_postinst() {
67         gnome2_icon_cache_update
68 }
69
70 pkg_postrm() {
71         gnome2_icon_cache_update
72 }