summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 71531113e739f59fe469d8fc41a1ab5131cbc949 (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
61
62
63
64
65
66
67
68
69
# Maintainer: Sam S. <smls75@gmail.com>
# Contributor: Marek Otahal <markotahal gmail>
# Contributor: C5OK5Y 
# Contributor: N30N <archlinux@alunamation.com>

pkgname=osmos
pkgver=1.6.1+h20110216
_hibver=1.6.1
pkgrel=1
pkgdesc="A unique physics-based ambient game (Humble Bundle/Store version)"
arch=("i686" "x86_64")
url="http://www.hemispheregames.com/osmos/"
license=("custom: commercial")
depends=("glu" "freetype2" "libvorbis" "openal")
install='osmos.install'
DLAGENTS+=('hib::/usr/bin/echo "Could not find %u. Manually download it to \"$(pwd)\", or set up a hib:// DLAGENT in /etc/makepkg.conf."; exit 1')

source=("hib://Osmos_$_hibver.tar.gz"
        "osmos.desktop")
md5sums=("ed2cb029c20c25de719c28062e6fc9cf"
         "030de4b7f794aaab819273bba8edf05d")

_installname=osmos
case $CARCH in
    i686)   _arch=bin32; _other=bin64; ;;
    x86_64) _arch=bin64; _other=bin32; ;;
esac

prepare() {
    # Create custom launcher
    echo -e "#!/usr/bin/sh\n" \
            "cd /opt/$_installname\n" \
            "exec ./Osmos.$_arch" '"$@"' \
        > "launcher.sh"
    
    # Remove unneeded files
    rm Osmos/{Osmos,Osmos.$_other}
    
    # Set apart files to install separately
    mv Osmos/{readme.html,eula.txt} "$srcdir"
    
    # Patch sound issue
    sed -ri 's/^(soundDevice ")-/\1/' Osmos/defaults.cfg
}

package() {
    # Game data
    install -g games -d "$pkgdir"/opt/$_installname
    cp -rT Osmos "$pkgdir"/opt/$_installname
    
    # Launcher
    install -Dm755 launcher.sh "$pkgdir"/usr/bin/$_installname
    
    # Desktop entry
    install -Dm644 osmos.desktop \
                   "$pkgdir"/usr/share/applications/osmos.desktop
    
    # Icon
    for i in 16x16 22x22 32x32 48x48 64x64 72x72 96x96 128x128 192x192 256x256; do
        install -Dm644 Osmos/Icons/$i.png \
                       "$pkgdir"/usr/share/icons/hicolor/$i/apps/$_installname.png
    done
    
    # License and documentation
    install -Dm644 eula.txt \
                   "$pkgdir"/usr/share/licenses/$_installname/LICENSE
    install -Dm644 readme.html \
                   "$pkgdir"/usr/share/doc/$_installname/readme.html
}