summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 51ee47da562c2c0baaeb8e6e56279e6ca1891869 (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
100
101
102
103
104
105
106
# Maintainer: Slash <demodevil5[at]yahoo[dot]com>

pkgname=wolf
pkgver=1.41b
pkgrel=5
pkgdesc="Return to Castle Wolfenstein is a single and multiplayer first person shooter. You need the retail game files to play."
arch=('i686' 'x86_64')
url="https://web.archive.org/web/20190805003933/http://zerowing.idsoftware.com/linux/wolf/"
license=('custom')
depends_i686=('libgl' 'libxext')
depends_x86_64=('lib32-libgl' 'lib32-libxext')
optdepends=('xdg-utils: for opening urls'
            'et-sdl-sound: for sdl/alsa support')
install='wolf.install'
source=('wolfsp.desktop' 'wolfmp.desktop' \
'wolf.launcher' 'wolfsp.launcher' 'wolfmp.launcher' 'wolfded.launcher' \
'https://aur.slashbunny.com/wolf/libstdc++-libc6.2-2.so.3' \
"https://aur.slashbunny.com/wolf/wolf-linux-${pkgver}.x86.run")
sha256sums=('20adb799ec0e1adef579acc02ecbd63486dc9bfe90ef48a72e1ea9049d017558'
            'f8dc16a01bf3c5fc7d3914315ffec570f5ae4f148fccffdd05326a589dabf060'
            '7fca88d5c2ca1ad9d5f782f7a7c092246f91112db8918a032234f827de123a7e'
            'ed85d6984e73a33e153269d964e7077eea7333aa6894737248119374bda02c65'
            '7fca88d5c2ca1ad9d5f782f7a7c092246f91112db8918a032234f827de123a7e'
            'b9fc003949be3b5b5265aa94611df087f0aa11c4036050cdb14ee33f5548b776'
            'cadd9a1d2bf0f991f0a0f8977c76701cbcc9a3e8ffeaba2838c98969fee340e6'
            '2921425c1b429147c1bc6f0c6a8664bec502ae86a2d6bccfaa1162f75dce89f3')

package() {
    # Create Destination Directories
    install -d "${pkgdir}/opt/wolf/" "${pkgdir}/usr/bin/" "${srcdir}/wolf/"

    # Set Install Files to Executable
    chmod +x "${srcdir}/wolf-linux-${pkgver}.x86.run"

    # Extract Linux Game Files
    cd "${srcdir}/wolf/"
    "${srcdir}/wolf-linux-${pkgver}.x86.run" --noexec --tar xf --group=root --owner=root

    # Move Binaries to Main Directory
    cp "${srcdir}/wolf/bin/Linux/x86/"{wolf.x86,wolfded.x86,wolfsp.x86} \
        "${srcdir}/wolf/"

    # Remove Unneeded Files and Directories
    rm -r "${srcdir}/wolf/"{bin,setup.data,setup.sh,CHANGES~}

    # Fix Permissions (Owner, Directory, and File Permissions)
    /bin/chown -R root:root "${srcdir}/wolf/"
    /bin/chmod 0755 "${srcdir}/wolf/Docs/PunkBuster"
    /bin/chmod 0644 "${srcdir}/wolf/"{Docs/{PunkBuster/{admins/index.htm,players/index.htm},Update_readme.htm},RTCW-README-1.4.txt}

    # Move Data to Package Directory
    mv "${srcdir}/wolf/" "${pkgdir}/opt/"

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

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

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

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

    # Install old libstdc++ library needed for Wolf to run
    install -D -m 644 "${srcdir}/libstdc++-libc6.2-2.so.3"  \
        "${pkgdir}/opt/wolf/libstdc++-libc6.2-2.so.3"

    # Install License (Return to Castle Wolfenstein)
    install -D -m 644 "${pkgdir}/opt/wolf/Docs/License.txt" \
        "${pkgdir}/usr/share/licenses/${pkgname}/License.txt"

    # Install License (PunkBuster)
    install -D -m 644 "${pkgdir}/opt/wolf/pb/PB_EULA.txt" \
        "${pkgdir}/usr/share/licenses/${pkgname}/PB_EULA.txt"

    # Install Desktop File (Single Player)
    install -D -m 644 "${srcdir}/wolfsp.desktop" \
        "${pkgdir}/usr/share/applications/wolfsp.desktop"

    # Install Desktop File (Multi Player)
    install -D -m 644 "${srcdir}/wolfmp.desktop" \
        "${pkgdir}/usr/share/applications/wolfmp.desktop"

    # Install Icon File (Single Player)
    install -D -m 644 "${pkgdir}/opt/wolf/WolfSP.xpm" \
        "${pkgdir}/usr/share/pixmaps/WolfSP.xpm"

    # Install Icon File (Multi Player)
    install -D -m 644 "${pkgdir}/opt/wolf/WolfMP.xpm" \
        "${pkgdir}/usr/share/pixmaps/WolfMP.xpm"

    # Remove Licenses from Data Directory
    rm "${pkgdir}/opt/wolf/Docs/License.txt"
    rm "${pkgdir}/opt/wolf/pb/PB_EULA.txt"

    # Use a more modern way for opening urls
    rm "${pkgdir}/opt/wolf/openurl.sh"
    ln -sf /usr/bin/xdg-open "${pkgdir}/opt/wolf/openurl.sh"
}