summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 17bdaedc54f29b1d597e664f094bc5bf10156cb5 (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
# Maintainer: Yurii Kolesnykov <root@yurikoles.com>
#
# Upwork allows to download Linux binaries only for logged-in users.
# Download a deb package from https://www.upwork.com/ab/downloads/os/linux/
# and place it in the same directory as this PKGBUILD file, then run makepkg.

pkgname=upwork
pkgver=5.6.10.13
_pkgname='Upwork'
pkgrel=2
pkgdesc='Upwork Desktop Application'
arch=(x86_64)
url='https://www.upwork.com/ab/downloads/os/linux/'
license=(custom)
depends=(alsa-lib gtk3 libxss nss)
source=(file://upwork_${pkgver}_amd64.deb
        LICENSE)
sha256sums=('c3e1ecf14c99596f434edf93a2e08f031fbaa167025d1280cf19f68b829d6b79'
            '793d8d7bc0f088c48798bda3d5483972636c6b8c5dcd9aeaf85411f7d4547b38')

prepare() {
    bsdtar -xpf data.tar.xz
}

package() {
    # Base
    install -dm755 $pkgdir/opt/${_pkgname}
    cp -dr --no-preserve=ownership opt/${_pkgname}/* $pkgdir/opt/${_pkgname}/

    # Code ref: https://github.com/electron-userland/electron-builder/blob/master/packages/app-builder-lib/templates/linux/after-install.tpl
    # SUID chrome-sandbox for Electron 5+
    test -e $pkgdir/opt/${_pkgname}/chrome-sandbox && chmod 4755 $pkgdir/opt/${_pkgname}/chrome-sandbox || true

    # Exec
    install -dm755 $pkgdir/usr/bin/
    ln -s /opt/${_pkgname}/${pkgname} $pkgdir/usr/bin/

    # Menu
    install -Dm644 usr/share/applications/$pkgname.desktop $pkgdir/usr/share/applications/$pkgname.desktop

    # Icons
    install -dm755 $pkgdir/usr/share
    cp -dr --no-preserve=ownership usr/share/icons "${pkgdir}/usr/share"

    # License
    install -Dm644 LICENSE $pkgdir/usr/share/licenses/$pkgname/LICENSE
}