summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3c36cc7ed3f6e198f482536269027eb367e5f53f (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
56
57
58
59
60
61
62
63
64
65
66
# Maintainer: Christoph Scholz <christoph.scholz@gmail.com>
pkgname=openhab2
pkgver=2.5.12
pkgrel=1
pkgdesc="openHAB2 open source home automation software"
arch=('any')
url="http://www.openhab.org/"
license=('EPL')
depends=('java-runtime-headless=8' 'archlinux-java-run')

conflicts=('openhab-runtime' 'openhab-addons' 'openhab-beta')

backup=('etc/openhab2/services/addons.cfg'
		'etc/openhab2/services/runtime.cfg'
		'etc/default/openhab2'
		'var/lib/openhab2/etc/keystore'
		'var/lib/openhab2/etc/users.properties'
		'var/lib/openhab2/etc/keys.properties')

install="${pkgname}.install"

source=("openhab-${pkgver}.tar.gz::https://openhab.jfrog.io/artifactory/libs-release-local/org/openhab/distro/openhab/${pkgver}/openhab-${pkgver}.tar.gz"
        "openhab2.service"
	"openhab2.default"
	"openhab2.install"
	"openhab2.patch"
	"karaf_wrapper.sh")

noextract=("openhab-${pkgver}.tar.gz")

sha256sums=('24e8a71e6bc22303800163871d1c0554843fa19e9cd736e6be721aa0798bbe3a'
            'd7bb21c0e0dc27534af29a9a5538ccbcf801b08afe41ba84be738f44456510aa'
            'b149d976dc13dc18c62d2014457557e266e733ead70b0730d06dcd0372da78a7'
            'c6ddfcf9d38882ef50cdff6eb9a5df4d3577c07771a8c6d91484d1d84ad63705'
            '500118875b0a9f3a4a511bebea3aebaebaa1e8fb5fc1e5c9222e3a287530a5ab'
            'd61ebec172e2a173dbe94f534035b55250e1b09f4cab5665d275ccfcdf3e710e')

prepare() {
	if [[ ! -d ${srcdir}/openhab2 ]]; then
		mkdir ${srcdir}/openhab2
	fi
	cd ${srcdir}/openhab2
	tar xzf ${srcdir}/openhab-${pkgver}.tar.gz
	patch -p1 < ../openhab2.patch
}

package() {

	install -Dm644 openhab2.default "${pkgdir}/etc/default/openhab2"
	install -Dm644 openhab2.service "${pkgdir}/usr/lib/systemd/system/openhab2.service"
	install -Dm755 karaf_wrapper.sh "${pkgdir}/usr/share/openhab2/karaf_wrapper.sh"

	mkdir -p "${pkgdir}/etc/openhab2"
	cp -r ${srcdir}/openhab2/conf/* "${pkgdir}/etc/openhab2"

	mkdir -p "${pkgdir}/var/lib/openhab2"
	cp -r ${srcdir}/openhab2/userdata/* "${pkgdir}/var/lib/openhab2"

	mkdir -p "${pkgdir}/usr/share"
	cp -r "${srcdir}/openhab2" "${pkgdir}/usr/share"
        rm -fr "${pkgdir}/usr/share/openhab2/conf"
        rm -fr "${pkgdir}/usr/share/openhab2/userdata"

	mkdir -p "${pkgdir}/var/log/openhab2"

}