xNode Pastebin
New List Find
Post Details
WakingMars 1.2.1 PKGBUILD (Enverex on 2013-01-18-23:29:15)
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
# Contributor: Ben R. <thebenj88 *AT* gmail *DOT* com>

pkgname=wakingmars-hib
pkgver=1.2.1
pkgrel=1
pkgdesc='Explore Mars in this 2D sidescrolling adventure game (Humble Bundle version)'
url='http://www.tigerstylegames.com/wakingmars/'
arch=('i686' 'x86_64')
license=('custom:commercial')
depends=('libgl' 'mesa')
source=("hib://WakingMars-${pkgver}-Linux.tar.gz" 'https://dl.dropbox.com/s/6p1dvlpqiyccenf/oal14.tar.gz?dl=1')
md5sums=('526010897806564fd699907d0ece1e3c' 'a684078b08bac6578e915fd1c812bfdc')

package() {
    msg "Extract files"
    tar zxvf ${srcdir}/WakingMars-${pkgver}-Linux.tar.gz

    msg "Create directories"
    mkdir -p ${pkgdir}/usr/bin
    mkdir -p ${pkgdir}/opt/${pkgname}/
    mkdir -p ${pkgdir}/usr/share/{licenses,doc}/${pkgname}
    mkdir ${pkgdir}/usr/share/applications

    msg "Install license, documentation and desktop file"
    install -Dm644 ${srcdir}/WakingMars-${pkgver}-Linux/Licenses/EULA.txt ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
    install -Dm644 ${srcdir}/WakingMars-${pkgver}-Linux/README.txt ${pkgdir}/usr/share/doc/${pkgname}/README.html

    sed -i 's|Path=/usr/local/games/wakingmars|Path=/usr/bin/wakingmars|g' ${srcdir}/WakingMars-${pkgver}-Linux/wakingmars.desktop
    sed -i 's|Icon=/usr/local/games/wakingmars/wakingmars.png|Path=/opt/wakingmars-hib/wakingmars.png|g' ${srcdir}/WakingMars-${pkgver}-Linux/wakingmars.desktop
    install -Dm644 ${srcdir}/WakingMars-${pkgver}-Linux/wakingmars.desktop ${pkgdir}/usr/share/applications/wakingmars.desktop
    rm -r ${srcdir}/WakingMars-${pkgver}-Linux/{Licenses,install,README.txt,wakingmars.desktop}

    msg "Install game contents"
    mv -v ${srcdir}/WakingMars-${pkgver}-Linux/wakingmars/* ${pkgdir}/opt/${pkgname}/

    msg "Add patch for preventing lock ups."
    rm -f ${pkgdir}/opt/${pkgname}/lib/libopenal.so*
    cp ${srcdir}/libopenal.so* ${pkgdir}/opt/${pkgname}/lib/

    msg "Set owner and permissions"
    chown root:games ${pkgdir}/opt/${pkgname} -R
    find ${pkgdir}/opt/${pkgname} -type f -print0 | xargs -0 chmod 644
    find ${pkgdir}/opt/${pkgname} -type d -print0 | xargs -0 chmod 755
    chmod 755 ${pkgdir}/opt/${pkgname}/wakingmars

    msg "Link binary to /usr/bin"
    ln -s /opt/${pkgname}/wakingmars ${pkgdir}/usr/bin/wakingmars
}