summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 554fd85b965107a10fc471e90d9144795513fad1 (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
# Maintainer: Fabian <plusfabi[AT+thegoogleadress]>
pkgname=pokemon-revolution-online-bin
pkgver=0.95.4.20160724
pkgrel=1
pkgdesc="A free-to-play, fan-made, MMO game that is predicated around the official Pokémon games."
arch=('x86_64')
url="http://pokemon-revolution-online.net"
license=('custom')
depends=('gcc-libs-multilib' 'xdg-utils' 'desktop-file-utils')
makedepends=('unzip')
optdepends=('gtk2: required for the Unity ScreenSelector plugin')
conflicts=('pokemon-revolution-online')
changelog="change.log"
install="INSTALL"
source=('net.pokemon-revolution-online.desktop' 'change.log' 'pokemonrevolution' 'copyright' 'pokemonrevolution.svg')
md5sums=('3215173b6f1673d868e71f1d953ed9d2'
         'f4ea86d56e5504e0a5a2f315710af174'
         '1b667f450341675b6b2c1750e034516c'
         '0efcd0393015ff149217f9ced4670513'
         '8446ead3097e1b87e3a63b667d956569')

package() {
    cd "${srcdir}"

    # Variables
    ## i know this isnt a good thing and nobody wants to see this on aur, but itll make things easier for me #Fabian
    ## directory files naming is usually VNAMING_Date, binary VNAMING.x86_64 
    __VNAMING="PROLinux95_42" 
    
    __DLDIR=$(xdg-user-dir DOWNLOAD) ##downloaddirectory
    __DDLA="http://tiny.cc/PROLinux" ##download link
    __DDLFN="PROLinux95_42.zip" ##filename
    __DDLFMD5="6a8a52236dfebfe949818553f708d472" #md5sum
    
    ## "Something's missing"? -> No One Cares - Atreyu c;
    if [ ! -f ${__DLDIR}/${__DDLFN} ]; then
    {
        echo "${__DLDIR}/${__DDLFN} not found, please download it"
        echo "Download: ${__DDLA}"
        exit 1
    }
    fi
    ## lets check the md5sum
    if [ "$(md5sum ${__DLDIR}/${__DDLFN} | awk '{print $1}')" != "${__DDLFMD5}" ]; then 
    { 
        echo "${__DLDIR}/${__DDLFN} MD5 MISMATCH, please remove the old file before downloading"
        echo "rm \"${__DLDIR}/${__DDLFN}\""
        echo "Download: ${__DDLA}"
        echo
        echo "maybe this pkgbuild is out-of-date. please report this:"
        echo "https://aur.archlinux.org/packages/pokemon-revolution-online-bin/"
        exit 1
    } 
    fi
    
    #bsdtar -x -p -f "${__DLDIR}/${__DDLFN}"
    ## we're using unzip for now, since bsdtar cant handle the zip file 
    ## bsdtar: Invalid central directory signature
    ## bsdtar: Error exit delayed from previous errors.
    unzip "${__DLDIR}/${__DDLFN}"
    
    # CREATE FOLDERS
    ## copy the folderstructure of the original without content.    
    /usr/bin/find "." -type d -exec \
        install -d -m755 "${pkgdir}/opt/Pokemon Revolution/{}" \;

    # MOVE CONTENT
    ## minimize memory usage by using mv instead of install
    ## this also fits more in our "permissions" to use it hashtag copyright, hashtag do NOT modify anything
    /usr/bin/find "./${__VNAMING}_Data" \
        -type f -exec /usr/bin/mv "{}" "${pkgdir}/opt/Pokemon Revolution/{}" \; -exec /usr/bin/chmod 644 "${pkgdir}/opt/Pokemon Revolution/{}" \;
    ## move to new position
    /usr/bin/mv "${srcdir}/${__VNAMING}.x86_64" "${pkgdir}/opt/Pokemon Revolution/${__VNAMING}.x86_64"
    ## set permission
    /usr/bin/chmod 755 "${pkgdir}/opt/Pokemon Revolution/${__VNAMING}.x86_64"

    #MOVE ICON
    ## cause we can not use the iroginal icon, we use a *.svg version.
    install -D -m644 "${srcdir}/pokemonrevolution.svg" \
    "${pkgdir}/usr/share/pixmaps/pokemonrevolution.svg"

    # DESKTOP FILE
    ## Set the path to our pokemon scriptfile
    /usr/bin/sed -i "s/GAMEEXECPATHSETBYPKGBUILD/\/usr\/bin\/pokemonrevolution/" "${srcdir}/net.pokemon-revolution-online.desktop"
    ## let's Install the *.desktop file
    install -D -m644 "${srcdir}/net.pokemon-revolution-online.desktop" \
    "${pkgdir}/usr/share/applications/net.pokemon-revolution-online.desktop" 

    # START SCRIPT
    ## set the correct directory
    /usr/bin/sed -i "s/GAMEDIRNAMESETBYPKGBUILD/\/opt\/Pokemon\ Revolution/" "${srcdir}/pokemonrevolution"
    ## set the correct filename
    /usr/bin/sed -i "s/GAMEBINARYNAMESETBYPKGBUILD/${__VNAMING}.x86_64/" "${srcdir}/pokemonrevolution"

    ## move it!
    install -D -m755 "${srcdir}/pokemonrevolution" \
    "${pkgdir}/usr/bin/pokemonrevolution"

    # COPYRIGHT FILE
    ## move the copyright text
    install -D -m644 "${srcdir}/copyright" \
    "${pkgdir}/usr/share/licenses/pokemon-revolution-online-bin/copyright"
}