diff options
Diffstat (limited to 'pcr/zoneminder/PKGBUILD')
-rw-r--r-- | pcr/zoneminder/PKGBUILD | 238 |
1 files changed, 78 insertions, 160 deletions
diff --git a/pcr/zoneminder/PKGBUILD b/pcr/zoneminder/PKGBUILD index 232d15e6e..185842b80 100644 --- a/pcr/zoneminder/PKGBUILD +++ b/pcr/zoneminder/PKGBUILD @@ -1,202 +1,120 @@ -# Maintainer (Arch): Jacek Burghardt <jacek@hebe.us> -# Maintainer (Arch): Vojtech Aschenbrenner <v@asch.cz> -# Contributor (Arch): Jason Gardner <buhrietoe@gmail.com> -# Contributor (Arch): Ross melin <rdmelin@gmail.com> -# Maintainer: Márcio Silva <coadde@parabola.nu> -# Contributor: André Silva <emulatorman@parabola.nu> - -# based of debian squeeze package - -_automake=1.14 +# Contributor (Arch): Troy Will <troydwill@gmail.com> +# Contributor (Arch): /dev/rs0 </dev/rs0@secretco.de.com> +# Contributor (Arch): Jacek Burghardt <jacek@hebe.us> +# Contributor (Arch): Vojtech Aschenbrenner <v@asch.cz> +# Contributor (Arch): Jason Gardner <buhrietoe@gmail.com> +# Contributor (Arch): Ross melin <rdmelin@gmail.com> +# Maintainer: Márcio Silva <coadde@parabola.nu> +# Contributor: André Silva <emulatorman@parabola.nu> +# Orginally based on a Debian Squeeze package pkgname=zoneminder -pkgver=1.25.0 -pkgrel=28 +pkgver=1.28.0 +pkgrel=1 pkgdesc='Capture, analyse, record and monitor video security cameras' -arch=( - mips64el - x86_64 - i686 -) -backup=etc/zm.conf -url=http://www.$pkgname.com -license=GPL2 -depends=( - apache - cambozola - ffmpeg - gnutls - mariadb - perl-archive-zip - perl-date-manip - perl-dbd-mysql - perl-dbi - perl-expect - perl-libwww - perl-mime-lite - perl-mime-tools - perl-php-serialization - perl-net-sftp-foreign - perl-sys-mmap - perl-time-modules - perl-x10 - php - php-apache - php-gd - php-mcrypt -) -makedepends=netpbm -optdepends=netpbm +arch=('i686' 'x86_64' 'mips64el' 'arm') +backup=('etc/zm.conf') +url="https://github.com/ZoneMinder/ZoneMinder/releases" +license=('GPL2') +depends=('apache' 'cambozola' 'ffmpeg' 'gnutls' 'mariadb' 'perl-archive-zip' 'perl-date-manip' 'perl-dbd-mysql' 'perl-dbi' + 'perl-expect' 'perl-libwww' 'perl-mime-lite' 'perl-mime-tools' 'perl-php-serialization' 'perl-net-sftp-foreign' + 'perl-sys-mmap' 'perl-time-modules' 'perl-x10' 'php' 'php-apache' 'php-gd' 'php-mcrypt') +makedepends=('netpbm' 'cmake') +optdepends=('netpbm') options=(!libtool) install=$pkgname.install -source=( - http://www.$pkgname.com/downloads/ZoneMinder-$pkgver.tar.gz - httpd-$pkgname.conf - $pkgname.service - sysctl-$pkgname.conf - $pkgname-$pkgver-ffmpeg.patch - $pkgname-$pkgver-gcrypt.patch -) -sha512sums=( - 3e18993b0539729491052c97d8c94227ccc089eb40277c2f07682f30049033303c7cfe9734fdac6d33ae67df29c76eb72bf7fbb5dae8227e8831fa603b61c375 - 4ce0d8eba9d006d258f5b8a83920fc17f1f602b96518d37b7a47cd9b6eb84ef2587641a6ba839a469c3f0e33b46475866187279ae3f8be0d4054b074ee5d6b08 - cfb0eb87a989236c72741a496ddc6a73aa2696e5beaaca4836d3c231ddb24c7ef5e9f65e7afa49674f2115cbfa4a07c75486e1947ce294c816ddbb875f3b99cf - 7330c179f1e2db815a675560d3d84648be02f7d0292f8cbe21d6033577fe688ed71ad23b5b8c9dc309395b45ebb554f9499e7a4b57091959b69679011fa59044 - 7fc2a4663c3103bef641be065bd7992a2b3dc0699f1b99dc2fdb34c1c48e58686e490d3ade523ef7c8e29b3f04109658eef652c26ff6ee3fb9aee65453bdb6c4 - 8c9e7debcaf60be1c2dda656f95e497f6812d704edc3ca4a1c915a3b3c9dc1749c91d96bc2d60db7d90d5edfd9e2dfc39010dfe4feabfecfffd27f1fffc3d675 -) +source=(https://github.com/ZoneMinder/ZoneMinder/archive/v$pkgver.tar.gz + httpd-$pkgname.conf + $pkgname.service + sysctl-$pkgname.conf) +sha512sums=('3e18993b0539729491052c97d8c94227ccc089eb40277c2f07682f30049033303c7cfe9734fdac6d33ae67df29c76eb72bf7fbb5dae8227e8831fa603b61c375' + '4ce0d8eba9d006d258f5b8a83920fc17f1f602b96518d37b7a47cd9b6eb84ef2587641a6ba839a469c3f0e33b46475866187279ae3f8be0d4054b074ee5d6b08' + 'cfb0eb87a989236c72741a496ddc6a73aa2696e5beaaca4836d3c231ddb24c7ef5e9f65e7afa49674f2115cbfa4a07c75486e1947ce294c816ddbb875f3b99cf' + '7330c179f1e2db815a675560d3d84648be02f7d0292f8cbe21d6033577fe688ed71ad23b5b8c9dc309395b45ebb554f9499e7a4b57091959b69679011fa59044') prepare() { cd $srcdir/ZoneMinder-$pkgver - # Patch for automake - sed -i "\|^am__api_version=| s|1[.]11|$_automake|; - " configure - - # Patch for GCC - sed -i 's|^#include [<]errno[.]h[>]$|#include <errno.h>\n#include <unistd.h>|; - ' src/zm_logger.cpp - sed -i 's|^#include [<]pthread[.]h[>]$|#include <pthread.h>\n#include <unistd.h>|; - ' src/zm_thread.h - sed -i 's|^#include [<]fcntl[.]h[>]$|#include <fcntl.h>\n#include <limits.h>|; - ' src/zm_local_camera.cpp - - # Patch for type cast in linux-libre kernel 3.5 and for wrong type "suppported" - sed -i 's|enum v4l2_buf_type type = v4l2_data[.]fmt[.]type|enum v4l2_buf_type type = (v4l2_buf_type)v4l2_data.fmt.type|; - s|suppported|supported|; - ' src/zm_local_camera.cpp - - # configure crash on i686 - [[ $CARCH != i686 ]] && { - # Patch for fixing warning - sed -i 's|pdest[+][+] = ([*]blend_ptr)\[[*]pdest]\[[*]psrc[+][+]]|pdest = (*blend_ptr)[*pdest][*psrc++];\n pdest++|; - ' src/zm_image.cpp - } - - # Patch for support ffmpeg with <libavutil/mathematics.h> - #sed -i 's|^extern "C" {|extern "C" {\n#ifdef _STDINT_H\n#undef _STDINT_H\n#endif\n#include <stdint.h>|; - # s|^#include <libavutil/avutil[.]h>|#include <libavutil/avutil.h>\n#include <libavutil/mathematics.h>|; - # ' src/zm_ffmpeg.h - - # Patch for support C library - #sed -i 's|^AM_CONFIG_HEADER(config[.]h)|AM_CONFIG_HEADER(config.h)\n\nAC_SUBST([AM_CXXFLAGS], [-D__STDC_CONSTANT_MACROS])|; - # s|^AC_CHECK_HEADERS(mysql/mysql[.]h,,AC_MSG_ERROR(zm requires MySQL headers - check that MySQL development packages are installed),)|AC_CHECK_HEADERS(mysql/mysql.h,,AC_MSG_ERROR(zm requires MySQL headers - check that MySQL development packages are installed),)\nAC_LANG_PUSH([C])|; - # s|^AC_CHECK_HEADERS(libswscale/swscale[.]h,,,)|AC_CHECK_HEADERS(libswscale/swscale.h,,,)\nAC_LANG_POP([C])|; - # ' configure.ac - # Patch for disable ZM_CHECK_FOR_UPDATES sed -i '\|ZM_CHECK_FOR_UPDATES|,+1 s|yes|no|; ' scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in # Patch for support html5 video and flv - sed -i '\|ZM_MPEG_LIVE_FORMAT|,+1 s|swf|webm|; - \|ZM_MPEG_REPLAY_FORMAT|,+1 s|swf|webm|; - \|ZM_FFMPEG_FORMATS|,+1 s|mpg mpeg wmv asf avi[*] mov swf 3gp[*][*]|mpg mpeg wmv asf avi* mov flv swf 3gp** webm ogg h264|; + sed -i '\|ZM_MPEG_LIVE_FORMAT|,+1 s|swf|ogg|; + \|ZM_MPEG_REPLAY_FORMAT|,+1 s|swf|ogg|; + \|ZM_FFMPEG_FORMATS|,+1 s|mpg mpeg wmv asf avi[*] mov swf 3gp[*][*]|mpg mpeg wmv asf avi* mov flv swf 3gp** webm ogg matroska mp4 h264|; ' scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in - # Patch for change path run dir and for change ZM name to ZoneMinder - sed -i '\|ZM_PATH_SOCKS|,+1 s|TMP|RUN|; - \|ZM_WEB_TITLE_PREFIX|,+1 s|"ZM"|"ZoneMinder"|; + # Patch for change ZM name to ZoneMinder + sed -i '\|ZM_WEB_TITLE_PREFIX|,+1 s|"ZM"|"ZoneMinder"|; ' scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in - # Patch for v4l2 convert support - sed -i 's|^$ENV{SHELL} = '"'/bin/sh'"' if exists $ENV{SHELL}|$ENV{SHELL} = '"'/bin/sh'"' if exists $ENV{SHELL};\n$ENV{LD_PRELOAD} = '"'/usr/lib/libv4l/v4l2convert.so'"' |; - ' scripts/zmdc.pl.in - - # Patch for add more socket tries - sed -i '\|^$max_socket_tries = | s|3|15|; - ' web/ajax/stream.php - - # Patch for text - sed -i 's|if ( fwrite( buffer, n_bytes, 1, stdout ) )|if ( fwrite( buffer, n_bytes, 1, stdout ) != 1 )|; - ' src/zm_stream.cpp - - # Patch for remove HACK in Makefile.* + # Patch for remove HACK in Makefile.am sed -i '\|This is a HACK|d; \|^install-data-hook:$|,+5 d; s| install-data-hook||; \|^uninstall-hook:$|,+5 d; s| uninstall-hook||; - ' Makefile.{am,in} - - # Patch - for _patch in ffmpeg gcrypt; do - patch -Np1 -F99 -i $srcdir/$pkgname-$pkgver-$_patch.patch - done + ' Makefile.am } build() { cd $srcdir/ZoneMinder-$pkgver - # ZM_RUNDIR need change to run dir - export CPPFLAGS="$CPPFLAGS -D__STDC_CONSTANT_MACROS"\ - OPT_FFMPEG=yes\ - PATH_FFMPEG=/usr/bin/ffmpeg\ - ZM_LOGDIR=/var/log/$pkgname\ - ZM_RUNDIR=/tmp/$pkgname\ - ZM_SSL_LIB=libgcrypt\ - ZM_TMPDIR=/tmp/$pkgname - - ./configure --prefix=/usr\ - --enable-crashtrace=no\ - --enable-debug=no\ - --enable-mmap=yes\ - --sysconfdir=/etc\ - --with-cgidir=/srv/http/cgi-bin\ - --with-extralibs='-L/usr/lib -L/usr/lib/mysql'\ - --with-ffmpeg=/usr\ - --with-libarch=lib\ - --with-mysql=/usr\ - --with-webdir=/srv/http/$pkgname\ - --with-webgroup=http\ - --with-webhost=localhost\ - --with-webuser=http + cmake -DCMAKE_INSTALL_PREFIX=/usr \ + -DZM_TARGET_DISTRO=arch \ + -DZM_CGIDIR=/srv/http/cgi-bin \ + -DZM_CONTENTDIR=/var/cache/$pkgname \ + -DZM_LOGDIR=/var/log/$pkgname \ + -DZM_RUNDIR=/run/$pkgname \ + -DZM_SOCKDIR=/run/$pkgname \ + -DZM_TMPDIR=/var/tmp \ + -DZM_WEB_USER=http \ + -DZM_WEB_GROUP=http \ + -DZM_WEBDIR=/srv/http/$pkgname + make V=0 } package() { cd $srcdir/ZoneMinder-$pkgver - make DESTDIR=$pkgdir install - mkdir -vp $pkgdir/{etc/{httpd/conf/extra,sysctl.d},srv/http/{cgi-bin,$pkgname/socks},usr/{lib/systemd/system,share/{licenses/$pkgname,$pkgname/db}},var/{cache/$pkgname,log/$pkgname}} - chown -vR http.http $pkgdir/{etc/zm.conf,srv/http/$pkgname/socks,var/{cache/$pkgname,log/$pkgname}} - chmod -v 0700 $pkgdir/etc/zm.conf + make DESTDIR=$pkgdir install + # BEGIN CREATE_ZONEMINDER_DIRECTORIES + #mkdir -pv $pkgdir/{etc/{httpd/conf/extra,sysctl.d},srv/http/cgi-bin,usr/{lib/systemd/system,share/{licenses/$pkgname,$pkgname/db}}} + mkdir -pv $pkgdir/run/zm + chown -v http.http $pkgdir/run/zm + mkdir -pv $pkgdir/var/{cache/$pkgname,log/$pkgname} + mkdir -pv $pkgdir/srv/http/$pkgname/socks + chown -Rv http.http $pkgdir/{etc/zm.conf,var/{cache/$pkgname,log/$pkgname}} + chown -Rv http.http $pkgdir/srv/http/$pkgname/socks + chmod -v 0700 $pkgdir/etc/zm.conf + # END CREATE_ZONEMINDER_DIRECTORIES + + # Make content directories in /var/cache/$pkgname and link them for i in events images temp; do - mv -v $pkgdir/srv/http/$pkgname/$i $pkgdir/var/cache/$pkgname/$i - ln -vs /var/cache/$pkgname/$i $pkgdir/srv/http/$pkgname/$i - chown -vh http.http $pkgdir/srv/http/$pkgname/$i + #mv -v $pkgdir/srv/http/$pkgname/$i $pkgdir/var/cache/$pkgname/$i + mkdir -v $pkgdir/var/cache/$pkgname/$i + #chown -v http.http $pkgdir/var/cache/$pkgname/$i + ln -sv /var/cache/$pkgbase/$i $pkgdir/srv/http/$pkgname/$i + chown -hv http.http $pkgdir/srv/http/$pkgname/$i done - ln -vs /srv/http/cgi-bin $pkgdir/srv/http/$pkgname - chown -vh http.http $pkgdir/srv/http/{cgi-bin,$pkgname,$pkgname/cgi-bin} + # Create a link to the Zoneminder cgi binaries + ln -sv /srv/http/cgi-bin $pkgdir/srv/http/$pkgname + + chown -hv http.http $pkgdir/srv/http/{cgi-bin,$pkgname,$pkgname/cgi-bin} + # Link Cambozola ln -vs /usr/share/cambozola/cambozola.jar $pkgdir/srv/http/$pkgname - install -vDm644 $srcdir/httpd-$pkgname.conf $pkgdir/etc/httpd/conf/extra - install -vDm644 $srcdir/$pkgname.service $pkgdir/usr/lib/systemd/system - install -vDm644 $srcdir/sysctl-$pkgname.conf $pkgdir/etc/sysctl.d - install -vDm644 $srcdir/sysctl-$pkgname.conf $pkgdir/srv/http/$pkgname - install -vDm644 COPYING $pkgdir/usr/share/licenses/$pkgname - install -vDm644 db/zm*.sql $pkgdir/usr/share/$pkgname/db + # Install configuration files + #mkdir -pv $pkgdir/etc/httpd/conf/extra + install -vDm 644 $srcdir/httpd-$pkgname.conf $pkgdir/etc/httpd/conf/extra + #mkdir -pv $pkgdir/usr/lib/systemd/system + install -vDm 644 $srcdir/$pkgname.service $pkgdir/usr/lib/systemd/system + install -vDm 644 $srcdir/sysctl-$pkgname.conf $pkgdir/etc/sysctl.d + install -vDm 644 COPYING $pkgdir/usr/share/licenses/$pkgname + install -vDm 644 db/zm*.sql $pkgdir/usr/share/$pkgname/db } |