summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 10d5defe7d921dd151724f55f15bbd1003a40d0f (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.20150618
pkgrel=3
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=('7bc4f74ac3d7ed0e889172596c32eff7')

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 an 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"
}