# Contributor: Kaarle Ritvanen # Maintainer: Kaarle Ritvanen pkgname=zoneminder pkgver=1.27.0 pkgrel=9 pkgdesc="Video camera surveillance system" url="http://www.zoneminder.com/" arch="x86_64" license="GPL2+" depends="ffmpeg libbz2 libjpeg-turbo pcre perl perl-archive-zip perl-date-manip x264 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" makedepends="autoconf automake bash bzip2-dev ffmpeg-dev gnutls-dev libgcrypt-dev libjpeg-turbo-dev mysql-dev pcre-dev perl-dev php-cli" 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 zm-additional.sql 0001-scripts-BusyBox-compatibility.patch" _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 rmdir "$pkgdir/tmp" 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="9ff149baa1a0d04931fbafcdb3200fab zoneminder-1.27.0.tar.gz 13ac97abf1565b69aa154bd81af9ed1d zoneminder.initd d148970bda67b1e257bb3e1f48404f91 musl-fix.patch 775f1e13017e7cd1ad11bfe4383c2c2d zm-additional.sql f8fffdbaecf2ca29742199fd905aa709 0001-scripts-BusyBox-compatibility.patch" sha256sums="2f31c10e6c5930aedfa9f08edfa074ef1b168e5bdffb77a147d4e631bfb03ef2 zoneminder-1.27.0.tar.gz 189d07168732a9b6a65926112bed1564b4f7a25084505120fed6ccfb4773b7e6 zoneminder.initd d5c1ce946c44e1979cc144f36930827da725919b9d53c1aee0e8749c4ff719d9 musl-fix.patch 0b514a0506425e4dbde7030e7feabadb8b1d723946e0409ea0cd5f45833fee1b zm-additional.sql 1d459bd9d4315ba8933c049b8f42cdc0c3dc3682c02cacd93a3c46d4429837e4 0001-scripts-BusyBox-compatibility.patch" sha512sums="8a349558399381a9062365ddc8bd8f815e3800929914096b2e4ea63e4d6dd12054f7b849fab5bea4bcfc87ea60739479a55734c7075a74aab0622d35f1d2bb14 zoneminder-1.27.0.tar.gz 77f6001b2a8cfb04a6d684e98c0648cdaad3a5ede8259d138ee00a39e50870fa956d73ca60bccf12576bf9d339bdcc0e91cd6a0216fff7985a4276ab46eebcdf zoneminder.initd b62533a7d025afb9852b9ac6b10b20f030a900f34b16808f655c8e558a2bcf62c1913e278d7a6c8c600d0e4844d846c8cec43a9daf78332da2c1e8816a65776f musl-fix.patch 4b2e357110cb45a25953d06e0b6e70ff06642985b0607b58d1fd718f7e17cd256d46808a69f46bb6594557e38f2f2f847e2cda3137f38842b25eb2d4143efd0f zm-additional.sql 719803331bcb14da8a21f3964f14c2f02be4a310d3bcf30e6744872f20f4f129f4e8b21ae7065151289a01c36b7a653e9cf2d88522e6fdd0ed72f045d95bd6f6 0001-scripts-BusyBox-compatibility.patch"