summaryrefslogtreecommitdiffstats
path: root/main/zoneminder/APKBUILD
blob: 8dc1dd5d756ce91f87faccdc63a56bbffb93cef5 (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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# Contributor: Łukasz Jendrysik <scadu@yandex.com>
# Contributor: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>
# Maintainer: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>
pkgname=zoneminder
pkgver=1.28.1
pkgrel=2
pkgdesc="Video camera surveillance system"
url="http://www.zoneminder.com/"
arch="x86_64"
license="GPL2+"
depends="perl perl-archive-zip perl-date-manip perl-dbd-mysql perl-dbi
	perl-device-serialport perl-libwww perl-mail-tools perl-mime-lite
	perl-mime-tools perl-sys-mmap perl-time-hires php php-mysql sudo
	zip perl-php-serialization php-sockets ffmpeg"
makedepends="autoconf automake bash bzip2-dev curl-dev ffmpeg-dev gnutls-dev
             libgcrypt-dev libjpeg-turbo-dev mariadb-dev pcre-dev perl-dev
             php-cli polkit-dev vlc-dev x264-dev"
install=$pkgname.post-upgrade
subpackages=$pkgname-doc
source="zoneminder-$pkgver.tar.gz::https://github.com/ZoneMinder/ZoneMinder/archive/v${pkgver}.tar.gz
	$pkgname.initd
	musl-fix.patch
	0001-use-pthread_join-instead-of-pthread_tryjoin_np.patch
	zm-additional.sql"

_builddir=$srcdir/ZoneMinder-$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"
	./bootstrap.sh || return 1
	ZM_LOGDIR=/var/log/zoneminder \
		ZM_RUNDIR=/var/run/zoneminder \
		ZM_TMPDIR=/var/lib/zoneminder/temp \
		./configure \
		--prefix=/usr \
		--sysconfdir=/etc \
		--enable-mmap=yes \
		--enable-crashtrace=no \
		--enable-debug=no \
		--with-webdir=/usr/share/webapps/$pkgname/htdocs \
		--with-cgidir=/usr/share/webapps/$pkgname/cgi-bin \
		|| return 1
	make || return 1
}

package() {
	cd "$_builddir"
	local dir
	make install DESTDIR=$pkgdir
	find "$pkgdir" -name perllocal.pod -delete
	echo -n $pkgver > "$pkgdir/usr/share/$pkgname/version"
	install -D -m 755 "$srcdir/$pkgname.initd" "$pkgdir/etc/init.d/$pkgname"
	
	# move storage to var/lib where it belongs.
	for dir in events images sounds temp; do
		install -m 755 -d "$pkgdir"/var/lib/zoneminder/$dir
		rmdir "$pkgdir"/usr/share/webapps/zoneminder/htdocs/$dir
		ln -sf /var/lib/zoneminder/$dir \
			"$pkgdir"/usr/share/webapps/zoneminder/htdocs/$dir || return 1
	done
	install -m 755 -d "$pkgdir"/var/log/$pkgname

	# create symlinks from webapps to default http location
	mkdir -p "$pkgdir"/var/www/localhost/htdocs \
		"$pkgdir"/var/www/localhost/cgi-bin
	ln -sf /usr/share/webapps/zoneminder/htdocs \
		"$pkgdir"/var/www/localhost/htdocs/zm
	ln -sf /usr/share/webapps/zoneminder/cgi-bin \
		"$pkgdir"/var/www/localhost/cgi-bin/zm

	# update db config with new locations/settings
	cat "$srcdir"/zm-additional.sql >> \
		"$pkgdir"/usr/share/zoneminder/db/zm_create.sql
}

md5sums="e8b27b818e074e5739b2bad8c57671a1  zoneminder-1.28.1.tar.gz
96e34b42475ca3858ca257306e9dc8f5  zoneminder.initd
d148970bda67b1e257bb3e1f48404f91  musl-fix.patch
23b941874876a38c99584d2f57fd0428  0001-use-pthread_join-instead-of-pthread_tryjoin_np.patch
775f1e13017e7cd1ad11bfe4383c2c2d  zm-additional.sql"
sha256sums="e55fa6ce1fd6c27912cd1de67fca3f80fad579f330020a384dc82838704d11ba  zoneminder-1.28.1.tar.gz
d8548979a7f740d5f93e825f171113273da1ffa4a77c7ede19b146020931ba81  zoneminder.initd
d5c1ce946c44e1979cc144f36930827da725919b9d53c1aee0e8749c4ff719d9  musl-fix.patch
a1149a87136860dcf8b1c0014eb97876f988dae2298d2af75b6462e32e136d3c  0001-use-pthread_join-instead-of-pthread_tryjoin_np.patch
0b514a0506425e4dbde7030e7feabadb8b1d723946e0409ea0cd5f45833fee1b  zm-additional.sql"
sha512sums="0ae29870e12b7ad0852510a17439df49dd35245aa1486a5d0ff71e17dbf89840d08c65b4485c93739f1fbcc253599162e28e0382c28927aa84cd734248587ea1  zoneminder-1.28.1.tar.gz
ac28d707f1573303c2f304c6edb10c9dd449b6987352de7a328607a6c78ca286dcf82b65ad13d47f2e98710d3a231d0cdb6fdd9a10c370064f380f24b61f1de7  zoneminder.initd
b62533a7d025afb9852b9ac6b10b20f030a900f34b16808f655c8e558a2bcf62c1913e278d7a6c8c600d0e4844d846c8cec43a9daf78332da2c1e8816a65776f  musl-fix.patch
81175d21d33171522a9db76e36f0d506cacf35c4db737517f5612431cff440826110aad57aec4d5a00664f92d0656f3ea237825f1ae33cf1b2b8850b9d061b47  0001-use-pthread_join-instead-of-pthread_tryjoin_np.patch
4b2e357110cb45a25953d06e0b6e70ff06642985b0607b58d1fd718f7e17cd256d46808a69f46bb6594557e38f2f2f847e2cda3137f38842b25eb2d4143efd0f  zm-additional.sql"