summaryrefslogtreecommitdiff
path: root/portsToCome/openttd/Pkgfile
blob: 0fbc8db8ea78bd7550f61d7504d69ec324543819 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Description: A FOSS clone of Transport Tycoon Deluxe.
# URL: http://www.openttd.org
# Maintainer: Erich Eckner, erich at eckner dot net
# Packager: Lennart Sauerbeck, devel at lennart dot sauerbeck dot org
# Depends on: libsdl libpng fontconfig lzo

name=openttd
version=1.5.2
gfxversion=0.5.2
sfxversion=0.2.3
msxversion=0.3.1
release=1
source=(http://binaries.openttd.org/releases/$version/$name-$version-source.tar.xz
        http://binaries.openttd.org/extra/opengfx/$gfxversion/opengfx-$gfxversion-all.zip
        http://binaries.openttd.org/extra/opensfx/$sfxversion/opensfx-$sfxversion-all.zip
        http://binaries.openttd.org/extra/openmsx/$msxversion/openmsx-$msxversion-all.zip)

build() {
    tar -xf opengfx-$gfxversion.tar

    cd $name-$version

    ./configure --prefix-dir=/usr \
                --binary-dir=bin \
                --data-dir=share/openttd \
                --icon-dir=share/openttd \
                --man-dir=man \
                --personal-dir=.openttd \
                --install-dir=$PKG \

    make
    make DESTDIR=$PKG install

    # Install OpenGFX
    install -d $PKG/usr/share/openttd/data/opengfx-$gfxversion
    install -m 644 $SRC/opengfx-$gfxversion/* $PKG/usr/share/openttd/data/opengfx-$gfxversion
    chown -R root:root $PKG/usr/share/openttd/data/opengfx-$gfxversion

    # Install OpenSFX
    install -d $PKG/usr/share/openttd/data/opensfx-$sfxversion
    install -m 644 $SRC/opensfx-$sfxversion/* $PKG/usr/share/openttd/data/opensfx-$sfxversion
    chown -R root:root $PKG/usr/share/openttd/data/opensfx-$sfxversion

    # Install OpenMSX
    install -d $PKG/usr/share/openttd/gm
    install -m 644 $SRC/openmsx-$msxversion/* $PKG/usr/share/openttd/gm
    chown -R root:root $PKG/usr/share/openttd/gm/*

    # Remove unnecessary languages
    cp $PKG/usr/share/openttd/lang/{english,german}.lng $SRC
    rm $PKG/usr/share/openttd/lang/*
    install -m 644 $SRC/{english,german}.lng $PKG/usr/share/openttd/lang

    # Remove junk
    rm -rf $PKG/usr/share/doc
    rm -rf $PKG/usr/share/openttd/scripts
    rm $PKG/usr/share/openttd/data/opengfx-$gfxversion/{changelog,readme}.txt
    rm $PKG/usr/share/openttd/data/opensfx-$sfxversion/{changelog,readme}.txt
    rm $PKG/usr/share/openttd/gm/{changelog,readme}.txt
}