summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 9c9ace390d4b093b64db01b92675b837ce1b38f5 (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
# Maintainer: Moviuro <moviuro+aur at gmail dot com>

pkgname=dungeons-2-gog
pkgver=2.0.0.1
pkgrel=2
pkgdesc="The Dungeon Lord is back – and this time he’s serious!"
arch=("x86_64")
url="http://www.gog.com/game/dungeons_2"
license=("custom:commercial")
depends=("libx11" "libxcursor" "libxrandr" "libglvnd" "libxext" "libxcb"
         "libxrender" "libxfixes" "libxau" "libxdmcp")
# requires aur/lgogdownloader or the game file directly next to the PKGBUILD
#DLAGENTS+=('gogdownloader::/usr/bin/lgogdownloader --download-file=%u -o %o')
source=("${pkgname}.desktop"
        "${pkgname}.in"
        "gog_dungeons_2_${pkgver}.sh::gogdownloader://dungeons_2/en3installer1")
sha256sums=("e28ce7cacca9d7585b557f8f946696d93f2640924e74770f82d2841e039310ea"
            "ce8cd95969a904b55ec3626fe0b01d89510a26fece6043eefa4331127d9169f8"
            "e9ab64e2f428201e22b1ee445e559898746b9249335d1c4765b50a40597559aa")

# Disable compression of the package
PKGEXT='.pkg.tar'

package() {
    # Data
    # Hardlink files to save the disk space and time spent copying them (they are large)
    mkdir -p "$pkgdir/opt/$pkgname/game/"
    cp -Ral -t "$pkgdir/opt/$pkgname/game/" "$srcdir/data/noarch/game/"*
    find "$pkgdir/opt/$pkgname/game/" -type d -print0 | xargs -0 chmod 755
    find "$pkgdir/opt/$pkgname/game/" -type f -print0 | xargs -0 chmod 644
    chmod 755 "$pkgdir/opt/$pkgname/game/mono/bin/mono"
    chmod 755 "$pkgdir/opt/$pkgname/game/Dungeons2.x86_64"

    # Remove a pointless broken script
    rm "$pkgdir/opt/$pkgname/game/Dungeons2"

    # Docs
    install -m755 -d "$pkgdir/opt/$pkgname/docs/"
    find "$srcdir/data/noarch/docs/" -maxdepth 1 -type f -print0 | \
        xargs -0 install -m644 -t "$pkgdir/opt/$pkgname/docs/"

    # Icon
    install -m755 -d "$pkgdir/opt/$pkgname/"
    install -m644 -t "$pkgdir/opt/$pkgname/" "$srcdir/data/noarch/support/icon.png"

    #
    # System integration
    #

    # /bin
    install -m755 -d "$pkgdir/usr/bin/"
    sed "s!@PKGDEST@!/opt/$pkgname/game/!" "$pkgname.in" > "$pkgdir/usr/bin/$pkgname"
    chmod 755 "$pkgdir/usr/bin/$pkgname"

    # License
    install -m755 -d "$pkgdir/usr/share/licenses/$pkgname/"
    ln -s "/opt/$pkgname/docs/End User License Agreement.txt" "$pkgdir/usr/share/licenses/$pkgname/EULA"

    # Icon
    install -m755 -d "$pkgdir/usr/share/pixmaps/"
    ln -s "/opt/$pkgname/icon.png" "$pkgdir/usr/share/pixmaps/${pkgname}.png"

    # .desktop File
    install -m755 -d "$pkgdir/usr/share/applications/"
    install -m644 -t "$pkgdir/usr/share/applications/" "$srcdir/${pkgname}.desktop"

    # Doc
    install -m755 -d "$pkgdir/usr/share/doc/"
    ln -s "/opt/$pkgname/docs" "$pkgdir/usr/share/doc/$pkgname"
}