summaryrefslogtreecommitdiff
path: root/testing/hinsightd/APKBUILD
blob: 316474c9187e957bba1bb6d6f65e3f62ec6918ff (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
67
68
69
70
# Contributor: Alexandru Campeanu <tiotags1@gmail.com>
# Maintainer: Alexandru Campeanu <tiotags1@gmail.com>
pkgname=hinsightd
pkgver=0.9.15
pkgrel=0
pkgdesc="hinsightd a http/1.1 webserver with (hopefully) minimal goals"
url="https://tiotags.gitlab.io/hinsightd"
arch="all"
license="BSD-3-Clause"
makedepends="cmake libcap lua-dev openssl-dev zlib-dev liburing-dev linux-headers"
options="!check" # no test suite
pkgusers="$pkgname"
pkggroups="$pkgname"
subpackages="$pkgname-dbg $pkgname-openrc"
source="
	https://gitlab.com/tiotags/hin9/-/archive/v$pkgver/hin9-v$pkgver.tar.gz
	compile.patch
	"
builddir="$srcdir"/hin9-v$pkgver

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DCMAKE_BUILD_TYPE=None \
		-DUSE_FCGI=1 \
		-DUSE_OPENSSL=1 \
		-DUSE_RPROXY=1 \
		$CMAKE_CROSSOPTS .
	cmake --build build
}

package() {
	install -D -m755 "$builddir"/build/hin9 \
		"$pkgdir"/usr/sbin/hinsightd
	setcap cap_net_bind_service+eip "$pkgdir"/usr/sbin/hinsightd
	install -D -m755 "$builddir"/build/hin9_pid_helper \
		"$pkgdir"/usr/bin/hin9_pid_helper

	# create dirs
	install -d -m2750 -o $pkgusers -g $pkggroups \
		"$pkgdir"/var/log/hinsightd/
	install -d -m755 \
		"$pkgdir"/etc/hinsightd/ \
		"$pkgdir"/etc/hinsightd/config/ \
		"$pkgdir"/var/www/localhost/htdocs

	install -m755 -D "$builddir"/external/packaging/$pkgname.initd.sh \
		"$pkgdir"/etc/init.d/$pkgname
	install -m644 -D "$builddir"/external/packaging/$pkgname.confd.sh \
		"$pkgdir"/etc/conf.d/$pkgname
	install -m644 -D "$builddir"/external/packaging/$pkgname.logrotate.sh \
		"$pkgdir"/etc/logrotate.d/$pkgname

	# config files
	local i; for i in main.lua lib.lua
	do
		install -m644 "$builddir"/workdir/"$i" "$pkgdir"/etc/$pkgname/"$i"
	done
	install -m644 -D "$builddir"/workdir/config/* -t "$pkgdir"/etc/$pkgname/config/

}

sha512sums="
1bc926fa4ddedd794e7cc5e781ff98f4dd20b64c6b85cb3a42dcfc04516741424e0dbb280edf7f89ff26ccef6b678df5155be225f10c9e9bc03f8dbca37ac321  hin9-v0.9.15.tar.gz
04bb68392bbf470a928c776dcb3d4d326c3f2c1a7c886ef2749f3f86b10c24b9af17d97d608ffb2bd8e90275260bd312f01bfa67515c248216bbf48601541fe6  compile.patch
"