summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 4e8b267cf8cf1f751e823d0b83435720f6263cc6 (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
# Maintainer: Tomasz Łaziuk <tlaziuk@gmail.com>

pkgname=worksnaps
pkgver=1.1.20171025
pkgrel=1
pkgdesc="Time Tracking with Screenshots for Remote Teams"
arch=('any')
url="http://www.worksnaps.com/www/download.shtml"
license=('unknown')
depends=('java-runtime')
source=("http://worksnaps-download.s3.amazonaws.com/WSClient-linux-$pkgver.zip")
md5sums=('e722ee1fce5313d1ef0caf7124b2fbbf')

prepare() {
    # the main executable file
    src='#!/usr/bin/env sh
path="/usr/lib/worksnaps/bin/run.sh"
script=$(realpath "$path")
cd $(dirname "$script")
exec "$script"'
    filename="$srcdir/worksnaps"
    echo "$src" > "$filename"
    chmod a+rx "$filename"
    # make sure everybody has access to the files
    chmod a+r "$srcdir" --recursive
    # worksnaps requires write access to the sh files, thats unsafe but otherwise a java exception is thrown
    find "$srcdir" -type f -name "*.sh" -exec chmod a+rwx {} \; 
}

package() {
    mkdir -p "$pkgdir/usr/lib"
    cp -r --preserve=mode,timestamps "$srcdir/Worksnaps" "$pkgdir/usr/lib/worksnaps"
    mkdir -p "$pkgdir/usr/bin"
    cp -r --preserve=mode,timestamps "$srcdir/worksnaps" "$pkgdir/usr/bin/worksnaps"
}