aboutsummaryrefslogtreecommitdiffstats
path: root/main/monit/APKBUILD
blob: d4505d737700bbfd6b10e4164fd800ec584523cb (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
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=monit
pkgver=5.14
pkgrel=0
pkgdesc="Managing and monitoring on a UNIX system"
url="http://mmonit.com/monit/"
arch="all"
license="AGPL"
depends=""
depends_dev="openssl-dev"
makedepends="$depends_dev"
install=""
subpackages="$pkgname-doc"
source="http://mmonit.com/monit/dist/monit-$pkgver.tar.gz
	musl-fix.patch
	$pkgname.initd"

_builddir="$srcdir"/$pkgname-$pkgver
prepare() {
	local i
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
}

build() {
	cd "$_builddir"
	./configure --prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		--without-pam \
		|| return 1
	make || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" install || return 1
        install -Dm 755 "$srcdir"/$pkgname.initd \
		"$pkgdir"/etc/init.d/$pkgname || return 1
	install -Dm 644 "$_builddir"/monitrc \
		"$pkgdir"/etc/monitrc
	sed -i '/allow @monit/s/^/#/' \
		"$pkgdir"/etc/monitrc || return 1
	sed -i '/allow @users readonly/s/^/#/' \
		"$pkgdir"/etc/monitrc || return 1
	rm -f "$pkgdir"/usr/lib/*.la

	# monit checks for strict permissions of monitrc at startup
	chmod 600 "$pkgdir"/etc/monitrc
}

md5sums="1b3ae1eb08a0914402a8764e5689c1c5  monit-5.14.tar.gz
a2288c7bd06f98e85e81969115912ff4  musl-fix.patch
ada1805dc5f01d1ce7b8592955607674  monit.initd"
sha256sums="d0424c3ee8ed43d670ba039184a972ac9f3ad6f45b0806ec17c23820996256c6  monit-5.14.tar.gz
92052d1642924e024a97158479138e83454e3ddbf1c4c9866691fd0664c52797  musl-fix.patch
aff2f2303aa15d6421dc9ace86099f2e1c46b7740421ebda1fbd28da8a0b3a4b  monit.initd"
sha512sums="6491434e15fab6f92e29b9f490418332a7700d110c0bd825d65e1aadd68ea082a1d9a7e2b570075b35d6cdb64ae207567bdeb2580e6e5407ba277cc6d1693c78  monit-5.14.tar.gz
7718737ca30d5ff702b97789c7dd1cb45e5a23b9c86b761e10d8e66d382e45f87a1ee268cf64739b99ad8901417f0ab0d94ac47fef7ee5a6c6f77e38a9355ce5  musl-fix.patch
94d67a995c6028d48cb729a60157ab42f2a3c15d59284f1de56c35b44bf83929ba9c42a5cbfe3bb4df0def70465cf3dff0ad6e532b6a02805840dc57785e1cc9  monit.initd"