summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ad5c18cfd84f38ba309506f617f0e4385b46acf8 (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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# Contributor: Slash <demodevil5[at]yahoo[dot]com>

pkgname=ioquake3-git
pkgver=20131217.gbc2efc4
pkgrel=1
pkgdesc="The de-facto OSS Quake 3 distribution. You need the retail/demo .pk3 files to play."
url="http://ioquake3.org/"
license=('GPL')
arch=('i686' 'x86_64')
depends=('sdl' 'openal')
makedepends=('nasm' 'git')
conflicts=('quake3' 'quake3-icculus-svn' 'quake3-svn' 'ioquake3-svn')
provides=('quake3' 'ioquake3')
replaces=('quake3-icculus-svn' 'ioquake3-svn')
install=quake3.install
source=('quake3.desktop' 'quake3.launcher' 'quake3ded.launcher' \
'http://ftp.gwdg.de/pub/misc/ftp.idsoftware.com/idstuff/quake3/linux/linuxq3apoint-1.32b-3.x86.run'
'quake3::git://github.com/ioquake/ioq3.git')
sha256sums=('12dbd31e9de1493642d120bfd1548dfc4935e47fec806003cfc04b9d84b85673'
            '7f0806379b10a6cff248b647aeb67d89a8e954e51e7a633cfadeca9865d125e7'
            '7f0806379b10a6cff248b647aeb67d89a8e954e51e7a633cfadeca9865d125e7'
            'c36132c5556b35e01950f1e9c646235033a5130f87ad776ba2bc7becf4f4f186'
            'SKIP')

pkgver() {
    cd "${srcdir}/quake3"

    git log -1 --format="%cd.g%h" --date=short | sed 's/-//g'
}

prepare() {
    cd "${srcdir}/quake3"

    # Patch Makefile to correct install path
    /bin/sed -i "s:/usr/local/games/quake3:${pkgdir}/opt/quake3:" Makefile
}

build() {
    cd "${srcdir}/quake3"

    # Compile ioQuake3
    make
}

package() {
    cd "${srcdir}/quake3"

    # Install Files
    make copyfiles

    # Extract Patch Files
    cd "${srcdir}"
    chmod +x "${srcdir}/linuxq3apoint-1.32b-3.x86.run"
    "${srcdir}/linuxq3apoint-1.32b-3.x86.run" --tar xf

    # Modify Launcher Scripts
    if [ "$CARCH" = "x86_64" ]; then
        #
        # x86_64 Systems
        #
        /bin/sed -i "s:IOQ3_BINARY:ioquake3.x86_64:" \
            "${srcdir}/quake3.launcher"
        /bin/sed -i "s:IOQ3_BINARY:ioq3ded.x86_64:" \
            "${srcdir}/quake3ded.launcher"
    else
        #
        # i686 Systems
        #
        /bin/sed -i "s:IOQ3_BINARY:ioquake3.i386:" \
            "${srcdir}/quake3.launcher"
        /bin/sed -i "s:IOQ3_BINARY:ioq3ded.i386:" \
            "${srcdir}/quake3ded.launcher"
    fi

    # Install Quake 3 Patch Files
    install -m 644 "${srcdir}"/baseq3/*.pk3 \
        "${pkgdir}/opt/quake3/baseq3/"

    # Install Quake 3 Expansion Pack Patch Files
    install -m 644 "${srcdir}"/missionpack/*.pk3 \
        "${pkgdir}/opt/quake3/missionpack/"

    # Install Launcher (Client)
    install -D -m 755 "${srcdir}/quake3.launcher" \
        "${pkgdir}/usr/bin/quake3"

    # Install Launcher (Server)
    install -D -m 755 "${srcdir}/quake3ded.launcher" \
        "${pkgdir}/usr/bin/quake3ded"

    # Install Desktop File
    install -D -m 644 "${srcdir}/quake3.desktop" \
        "${pkgdir}/usr/share/applications/quake3.desktop"

    # Install Icon File
    install -D -m 644 "${srcdir}/quake3/misc/quake3.png" \
        "${pkgdir}/usr/share/pixmaps/quake3.png"
}