summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 42f21745b599ed5a6d64f459d8a56affbf1390a6 (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
# Maintainer: Franco Masotti <franco dot masotti at student dot unife dot it>
# Contributor: Franco Masotti <franco dot masotti at student dot unife dot it>
pkgname=swish-cplint
pkgver=r1849.519a5ac
pkgrel=1
pkgdesc="SWI-Prolog for SHaring: a SWI-Prolog web IDE integrated with the cplint suite"
arch=('x86_64')
url="https://github.com/friguzzi/swish"
license=('BSD')
depends=('bash'
         'coreutils'
         'gawk'
         'git'
         'graphviz'
         'libxinerama'
         'libxpm'
         'rserve-sandbox-docker'
         'swi-prolog-devel')
makedepends=('git'
             'make'
             'bower'
             'sed')
conflicts=('swish'
           'swish-cplint-bin')
install=.install
source=('git+https://github.com/friguzzi/swish#branch=master')
md5sums=('SKIP')

build() {
    cd ${srcdir}/swish
    bower --allow-root install
    make src
    # Patch
    cp ../../run.pl .
    cp ../../run.sh .
    cp ../../install_web_iface_deps.pl .
}

pkgver () {
    cd ${srcdir}/swish
    ( set -o pipefail
      git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
      printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
    )
}

package() {
    cd ${srcdir}
    install -d "${pkgdir}"/usr/share/"${pkgname}"
    install -d "${pkgdir}"/usr/bin
    cp -r swish/* "${pkgdir}"/usr/share/"${pkgname}"
    install -D -m644 swish/LICENSE "${pkgdir}"/usr/share/licenses/"${pkgname}"/LICENSE
    install -D -m644 ../"${pkgname}".service ${pkgdir}/usr/lib/systemd/system/"${pkgname}".service
    ln -s /usr/share/"${pkgname}"/run.sh "${pkgdir}"/usr/bin/"${pkgname}"
}