summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 483d18f1f1b8ccd86d92c8834bb6e8eb7e36bb06 (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
pkgname=sonicthehedgehog
_pkgname=SonicTheHedgehog
pkgver=1.0.0
pkgrel=1
pkgdesc="Sonic the Hedgehog game powered by the rsdkv4 engine."
arch=('x86_64' 'aarch64' 'i686')
url="https://gitlab.com/linuxbombay/sonicthehedgehog"
license=('GPL')
depends=('rsdkv4-bin' 'libogg' 'libvorbis' 'wget' 'sdl2' 'unzip' 'yad')
makedepends=('unzip')
source=("https://gitlab.com/linuxbombay/sonicthehedgehog/-/archive/$pkgver-$pkgrel/sonicthehedgehog-$pkgver-$pkgrel.tar")
sha256sums=('84976089f69e93393d111c49dc6691b50e3a10aced722f661cee0358ae060d7e')

package() {
    install -dm755 "$pkgdir/usr/bin"
    install -dm775 "$pkgdir/usr/share/games/$_pkgname"
    install -dm755 "$pkgdir/usr/share/pixmaps"

    # Packaging files
    
    # Check if Data.rsdk exists so it doesn't redownload the file when it doesn't need to.
    FILE="/usr/share/games/$_pkgname/Data.rsdk"
     if test -f "$FILE"
    then
        echo "$FILE exists skipping download."
        cp -r "/usr/share/games/$_pkgname/Data.rsdk" "$pkgdir/usr/share/games/$_pkgname"
    else
        echo "$FILE does not exist, Starting download.."
        cd $srcdir/$pkgname-$pkgver-$pkgrel
        wget "https://archive.org/download/data_20231229_202312/Data.rsdk"
    fi    
    cd $srcdir/$pkgname-$pkgver-$pkgrel
    cp "$srcdir/$pkgname-$pkgver-$pkgrel/sonic.sh" "$pkgdir/usr/bin/sonic"
    cp -r ./ "$pkgdir/usr/share/games/$_pkgname"
    cp sonic.png "$pkgdir/usr/share/pixmaps"

    # Desktop Entry
    install -Dm644 "$srcdir/$pkgname-$pkgver-$pkgrel/$_pkgname.desktop" \
    "$pkgdir/usr/share/applications/$_pkgname.desktop"
    sed -i s%/usr/share%/opt% "$pkgdir/usr/share/applications/$_pkgname.desktop"
}