summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 75f069d44a36e16b3400dad3b7602e89c315b1a4 (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
pkgname=rtcw
_pkgname=RTCW
pkgver=1.0.0
pkgrel=1
pkgdesc="Return to Castle Wolfenstein game powered by the iortcw."
arch=('i686' 'x86_64' 'aarch64')
license=('GPL')
depends=('iortcw-bin' 'wget' 'unzip' 'yad' 'aria2')
makedepends=('unzip')
source=("https://gitlab.com/linuxbombay/rtcw/-/archive/$pkgver/rtcw-$pkgver.tar.bz2")
sha256sums=('61173ec992649f8908d1fb5d4a61f4104e3fe9db82327f60f3c642fa19e4ba45')
pkgspname=rtcwsp
pkgmpname=rtcwmp
pkgdedname=rtcwded

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

   # Packaging files
    for dir in $pkgname-$pkgver ; do mv "${dir}" "$pkgname" ;done
   # Check if pak0.pk3 exists so it doesn't redownload the file when it doesn't need to.
    FILE="/usr/share/games/$_pkgname/main/pak0.pk3"
     if test -f "$FILE"
    then
        echo "$FILE exists skipping download."
        cp -r /usr/share/games/iortcw/main "$pkgdir/usr/share/games/$_pkgname"
        cp -r /usr/share/games/$_pkgname/main "$pkgdir/usr/share/games/$_pkgname"
    else
        echo "$FILE does not exist, Starting download.."
        cd $srcdir
        aria2c -x5 "https://archive.org/download/rtcw-pk3/rtcw-pk3.zip"
        cp -r /usr/share/games/iortcw/main "$pkgdir/usr/share/games/$_pkgname"
        unzip rtcw-pk3.zip -d "$pkgdir/usr/share/games/$_pkgname/main"       
    fi    
    cd $srcdir/$pkgname
    cp -r ./ "$pkgdir/usr/share/games/$_pkgname"
   #Copying Binaries from iortcw to game folder
    cp -r /usr/share/games/iortcw/iowolfsp.* "$pkgdir/usr/share/games/$_pkgname"
    cp -r /usr/share/games/iortcw/iowolfmp.* "$pkgdir/usr/share/games/$_pkgname"
    cp -r /usr/share/games/iortcw/iowolfded.* "$pkgdir/usr/share/games/$_pkgname"
   #Installing launch scripts 
    install -m775 "$srcdir/$pkgname/rtcwsp" "$pkgdir/usr/bin"
    install -m775 "$srcdir/$pkgname/rtcwmp" "$pkgdir/usr/bin"
    install -m775 "$srcdir/$pkgname/rtcwded" "$pkgdir/usr/bin"
   #Symlink lib files
    find /usr/share/games/iortcw/ -name 'renderer_*' -exec cp -r {} "$pkgdir/usr/share/games/$_pkgname" \;
   #icons
    cp -r "$srcdir/$pkgname/rtcwsp.png" "$pkgdir/usr/share/pixmaps"
    cp -r "$srcdir/$pkgname/rtcwmp.png" "$pkgdir/usr/share/pixmaps"
    cp -r "$srcdir/$pkgname/rtcwded.png" "$pkgdir/usr/share/pixmaps"
   # Desktop Entries
    install -Dm644 "$srcdir/$pkgname/rtcwsp.desktop" "$pkgdir/usr/share/applications/"
    install -Dm644 "$srcdir/$pkgname/rtcwmp.desktop" "$pkgdir/usr/share/applications/"
    install -Dm644 "$srcdir/$pkgname/rtcwded.desktop" "$pkgdir/usr/share/applications/"
}