summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 95240c84bc2bf6eb2aab24d9e47327ac880e0c8a (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: Slash <demodevil5[at]yahoo[dot]com>
# Contributor: Andrew Simmons <andrew.simmons@gmail.com>

pkgname=quake4-demo
pkgver=1.0
pkgrel=5
pkgdesc="Quake 4 demo"
url="https://web.archive.org/web/20061205073314/http://www.idsoftware.com/games/quake/quake4/"
arch=('i686' 'x86_64')
license=('custom:"Quake 4 Demo"')
depends_x86_64=('lib32-glibc' 'lib32-sdl' 'lib32-libx11' 'lib32-libxext' 'lib32-zlib')
depends_i686=('gcc-libs' 'libgl' 'sdl' 'zlib')
optdepends_x86_64=('lib32-nvidia-utils: Accelerated 3D with the NVIDIA binary blob video driver'
            'lib32-catalyst-utils: Accelerated 3D with the AMD/ATI binary blob video driver')
install="quake4-demo.install"
source=("${pkgname}.sh" "${pkgname}-dedicated.sh" \
    'https://aur.slashbunny.com/quake4/quake4-linux-1.0-demo.x86.run')
sha256sums=('6f0620a70380214bc57977b27e0d3584f48443e396faa136fabcb8f712b3b581'
            '57c10f7c4771c28ca2e24e5dd6671d01d93e6a5af8df99c42648b54748f7bfdd'
            '69e69e8cb22dd1496bcc98dc63f244d35c516c2e770aba64c72275827814bc73')
PKGEXT=.pkg.tar

package() {
    cd ${srcdir}

    # Create Destination Directories
    install -d ${pkgdir}/opt/ \
        ${pkgdir}/usr/bin \
        ${pkgdir}/usr/share/licenses/${pkgname}

    # Make Installer Executable
    chmod +x quake4-linux-${pkgver}-demo.x86.run

    # Run Installer
    ./quake4-linux-${pkgver}-demo.x86.run --noexec --target quake4

    # Move Executables and Libraries
    install -m 755 -t ${srcdir}/quake4/ \
        ${srcdir}/quake4/bin/Linux/x86/{lib*,q4ded*,quake4*}

    # Make Everything World-Readable
    chmod -R a+r ${srcdir}/quake4/

    # Remove Unneeded Files
    rm -rf ${srcdir}/quake4/{germany/,setup.data/,setup.sh,us/,bin/}

    # Move Quake4 to Destination Directory
    mv ${srcdir}/quake4 ${pkgdir}/opt/${pkgname}

    # Install Client Launcher
    install -m755 -D ${pkgname}.sh \
        ${pkgdir}/opt/${pkgname}/${pkgname}

    # Install Server Launcher
    install -m755 -D ${pkgname}-dedicated.sh \
        ${pkgdir}/opt/${pkgname}/${pkgname}-dedicated

    # Symlink Client Launcher
    ln -sf /opt/${pkgname}/${pkgname} \
        ${pkgdir}/usr/bin/${pkgname}

    # Symlink Server Launcher
    ln -sf /opt/${pkgname}/${pkgname}-dedicated \
        ${pkgdir}/usr/bin/${pkgname}-dedicated

    # Install Licence File
    install -D -m644 ${pkgdir}/opt/${pkgname}/License.txt \
        ${pkgdir}/usr/share/licenses/${pkgname}/License.txt
}