summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 8649a234d6467d48abd84593ca7c1637f8104ad6 (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
# Maintainer: Daniel Bermond <dbermond@archlinux.org>

pkgname=torrentzip.net-git
pkgver=r117.g911adca
pkgrel=1
pkgdesc='Torrentzip utility with mutli core processing capability (git version)'
arch=('any')
url='http://www.romvault.com/trrntzip/'
license=('MIT')
depends=('mono' 'sh' 'hicolor-icon-theme')
makedepends=('git' 'icoutils')
provides=('torrentzip.net')
conflicts=('torrentzip.net')
source=('git+https://github.com/RomVault/RVWorld.git'
        'TrrntZip.NET'
        'TrrntZipUI'
        'torrentzip.net.desktop'
        '010-torrentzip.net-no-ilrepack.patch'
        '020-torrentzip.net-fix-case.patch')
sha256sums=('SKIP'
            'fcec85063da4f78dc853f443493709458ae627aaf8968476c7ea02056b0982b0'
            'af32f3a2609a9eae37a2c836b0a4961230cfdffec6080d23fc94c5a0c4a181f0'
            '3c5d111bca9db45bb093c7eef68194251a4c8e5659f6f632cb6f1d9789cef983'
            'fd8835e88f4db12f2e57294903c1a90ccb6d7eddf20f23433c054a9ab2e74fd4'
            '5612ae7151aca3e376bd886cd2fccada031366830ab380092cc4a9d89c5f2946')

prepare() {
    patch -d RVWorld -Np1 -i "${srcdir}/010-torrentzip.net-no-ilrepack.patch"
    patch -d RVWorld -Np1 -i "${srcdir}/020-torrentzip.net-fix-case.patch"
    icotool -x RVWorld/TrrntZipUI/memory-rom.ico -o RVWorld/TrrntZipUI
}

pkgver() {
    printf 'r%s.g%s' "$(git -C RVWorld rev-list --count HEAD)" "$(git -C RVWorld rev-parse --short HEAD)"
}

build() {
    printf '%s\n' '  -> Building TorrnetZip.NET CLI...'
    cd RVWorld/TrrntZipCMD
    xbuild /p:Configuration='Release' TrrntZipCMD.csproj
    
    printf '%s\n' '  -> Building TorrnetZip.NET GUI...'
    cd "${srcdir}/RVWorld/TrrntZipUI"
    xbuild /p:Configuration='Release' TrrntZipUI.csproj
}

package() {
    # launchers
    install -D -m755 TrrntZip.NET -t "${pkgdir}/usr/bin"
    install -D -m755 TrrntZipUI   -t "${pkgdir}/usr/bin"
    ln -s TrrntZip.NET "${pkgdir}/usr/bin/trrntzip.net"
    ln -s TrrntZipUI   "${pkgdir}/usr/bin/trrntzip.net-ui"
    
    # binaries
    install -D -m644 RVWorld/Trrntzip/bin//Release/{Compress,RVIO,Trrntzip}.{dll,pdb} -t "${pkgdir}/usr/lib/${pkgname%-git}"
    install -D -m644 RVWorld/TrrntZipCMD/obj/Release/TrrntZip.NET.{exe,pdb} -t "${pkgdir}/usr/lib/${pkgname%-git}"
    install -D -m644 RVWorld/TrrntZipUI/obj/Release/TrrntZipUI.{exe,pdb} -t "${pkgdir}/usr/lib/${pkgname%-git}"
    
    # desktop file
    install -D -m644 "${srcdir}/torrentzip.net.desktop" -t "${pkgdir}/usr/share/applications"
    
    # icons
    local _file
    local _res
    while read -r -d '' _file
    do
        _res="$(printf '%s' "$_file" | sed 's/\.png$//;s/^.*_//;s/x.*$//')"
        install -D -m644 "$_file" "${pkgdir}/usr/share/icons/hicolor/${_res}x${_res}/apps/${pkgname%-git}.png"
    done < <(find RVWorld/TrrntZipUI -maxdepth 1 -type f -name 'memory-rom_*_*x*x*.png' -print0)
    
    # license
    install -D -m644 RVWorld/LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname%-git}"
}