summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2532401545ddfcf37ea8265b3d01eecb1284bfaa (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
# This is an example PKGBUILD file. Use this as a start to creating your own,
# and remove these comments. For more information, see 'man PKGBUILD'.
# NOTE: Please fill out the license field for your package! If it is unknown,
# then please put 'unknown'.

# Maintainer: Thorsten Lanfer <tlanfer@gmail.com>
pkgname=openhab-runtime
pkgver=1.8.0
pkgrel=1
pkgdesc="openHAB automation runtime"
arch=('any')
url="http://www.openhab.org/"
license=('EPL')
depends=('java-runtime-headless>=7')
makedepends=('unzip')
optdepends=('openhab-addons: bindings and actions')
backup=('etc/openhab/openhab.cfg'
				'etc/conf.d/openhab')
source=("https://bintray.com/artifact/download/openhab/bin/distribution-$pkgver-runtime.zip"
				"openhab"
				"openhab.service"
				"openhab-startsh.patch")
noextract=("distribution-$pkgver-runtime.zip")
md5sums=('0bc4b3a590771c344ff16e70157ab30d'
         'e06c404f7174ac0b1d9c2e9e429c3b5f'
         '18299bfcb7865fec55d06890e25c8668'
         '481370e7c473aff7e9267e2e4f6fe68c')

prepare() {
	mkdir "$srcdir/openhab-runtime"
	cd "$srcdir/openhab-runtime"

	unzip "$srcdir/distribution-$pkgver-runtime.zip"

}

build() {
	patch -p1 < openhab-startsh.patch
}

package() {
	cd $pkgdir
	mkdir -p opt
	mkdir -p etc/openhab/addons-enabled
	mkdir -p etc/conf.d
	mkdir -p usr/lib/systemd/system
	cp $srcdir/openhab.service usr/lib/systemd/system
	cp -r $srcdir/openhab-runtime opt
	cp $srcdir/openhab etc/conf.d
	mv opt/openhab-runtime/configurations etc/openhab/configurations
	ln -s /etc/openhab/configurations opt/openhab-runtime/configurations
	ln -s /etc/openhab/addons-enabled opt/openhab-runtime/addons
}