This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

PKGBUILD

By: a guest on Aug 31st, 2012  |  syntax: None  |  size: 4.42 KB  |  views: 37  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. # Maintainer:  Vojtech Aschenbrenner     <v@asch.cz>
  2. # Contributor: Jason Gardner             <buhrietoe@gmail.com>
  3. # Contributor: Ross melin                <rdmelin@gmail.com>
  4.  
  5. pkgname=zoneminder
  6. pkgver=1.25.0
  7. pkgrel=11
  8. pkgdesc="Capture, analyse, record and monitor video security cameras."
  9. arch=('i686' 'x86_64' 'arm')
  10. url="http://www.zoneminder.com"
  11. license=('GPL')
  12. depends=('cambozola' 'apache' 'php' 'php-gd' 'php-mcrypt' 'mysql' 'pcre' 'openssl' 'ffmpeg' 'perl-libwww' 'perl-date-manip' 'perl-unicode-map' 'perl-dbi' 'perl-dbd-mysql' 'perl-io-stringy' 'perl-mime-lite' 'perl-timedate' 'perl-x10' 'perl-time-modules' 'perl-net-smtp-ssl' 'perl-sys-mmap' 'perl-net-sftp-foreign' 'perl-mime-tools' 'perl-io-tty' 'sudo' 'libv4l' 'libjpeg' 'gnutls' 'php-apache')
  13. makedepends=()
  14. install=zoneminder.install
  15. source=("http://www.zoneminder.com/downloads/ZoneMinder-${pkgver}.tar.gz"
  16.           zm.rc.d
  17.           Controls_Orbit.sql
  18.           zminit.arch
  19.           customdb
  20.           httpd-zm.conf
  21.           zmeventbackup
  22.           patch-ffmpeg-0.11.patch
  23.           patch-libavcodec-detection.patch
  24.           zoneminder-1.25.0-kernel35.patch
  25.           arm-context.patch)
  26.  
  27. md5sums=('eaefa14befd482154970541252aa1a39'
  28.          '9fb81f81b056c18be6eef3f1c8e0dd6d'
  29.          '5033bc098bf497c8aed1fc1b3c9c5f9c'
  30.          'f9720872736f26d17bc49d8725b75ae4'
  31.          '942f6641c744ffe7d64846a5c34d84f1'
  32.          'e63262d1417105ae24c7a03d98b2c64c'
  33.          '1a6d7c43af79c786b27cc88f7ba7ed3e'
  34.          'b872dd86926ab00c5d4733e7e38eaa9c'
  35.          '94bf5d95fe5429f7df458ddfbabf0c12'
  36.          '88bd124dfb841320cecb0a757b2a78c1'
  37.          'b28c8eb392a7e7b6ef665817d7fe61f4')
  38.  
  39. build() {
  40.   cd "$srcdir/ZoneMinder-$pkgver"
  41.  
  42.   # Patch for GCC 4.7.x
  43.   sed -i -e '1 s/^/#include <unistd.h>\n/;' src/zm_logger.cpp
  44.   sed -i -e '1 s/^/#include <unistd.h>\n/;' src/zm_thread.h
  45.  
  46.   # Patch for build/upgrade path
  47.   sed -i -e 's#ZM_PATH_BUILD=@PATH_BUILD@#ZM_PATH_BUILD=/srv/zoneminder/upgrade\nZM_PATH_UPDATE=/srv/zoneminder/upgrade#' zm.conf.in
  48.  
  49.   # Patch for support new ffmpeg
  50.   patch -p1 < ../patch-ffmpeg-0.11.patch
  51.  
  52.   # Patch for correct libavcodec detection
  53.   patch -p0 < ../patch-libavcodec-detection.patch
  54.  
  55.   # Patch for type cast in kernel3.5
  56.   patch -p0 < ../zoneminder-1.25.0-kernel35.patch
  57.  
  58.   # Patch for ARM
  59.   if test "$CARCH" == arm; then
  60.     patch -p0 < ../arm-context.patch
  61.   fi
  62.  
  63.   # Add some more configs into DB
  64.   cat ../Controls_Orbit.sql >> db/zm_create.sql.in
  65.  
  66.   ./configure --prefix=/usr \
  67.     --sysconfdir=/etc \
  68.     --with-webuser=http  \
  69.     --with-webgroup=http \
  70.     --with-mysql=/usr  \
  71.     --with-webdir=/srv/zoneminder/www  \
  72.     --with-cgidir=/srv/zoneminder/cgi-bin \
  73.     --bindir=/srv/zoneminder/bin \
  74.     ZM_SSL_LIB=openssl \
  75.     CPPFLAGS=-D__STDC_CONSTANT_MACROS
  76.  
  77.   # chown line mucks everything up, we'll chown it in the install script
  78.   sed -i '/chown/d' Makefile
  79.  
  80.   # modify hard-coded paths
  81.   sed -i 's#/var/lib/zm#/srv/zoneminder/backup#' scripts/zmdbrestore.in
  82.   sed -i 's#/var/lib/zm#/srv/zoneminder/backup#' scripts/zmlogrotate.conf.in
  83.   sed -i 's#/var/lib/zm#/srv/zoneminder/backup#' scripts/zmdbbackup.in
  84.  
  85.   # Build it!
  86.   make || return 1
  87.   make DESTDIR="$pkgdir" install || return 1
  88.  
  89.   install -D -m 700 $startdir/src/zminit.arch  $startdir/pkg/srv/zoneminder/bin/zminit
  90.   install -D -m 755 $startdir/src/zm.rc.d  $startdir/pkg/etc/rc.d/zm
  91.   install -D -m 700 scripts/zmdbbackup  $startdir/pkg/srv/zoneminder/bin/zmdbbackup
  92.   install -D -m 700 scripts/zmdbbackup  $startdir/pkg/srv/zoneminder/bin/zmdbbackup
  93.   install -D -m 700 scripts/zmdbrestore  $startdir/pkg/srv/zoneminder/bin/zmdbrestore
  94.   install -D -m 700 scripts/zmeventdump  $startdir/pkg/srv/zoneminder/bin/zmeventdump
  95.   install -D -m 700 scripts/zmlogrotate.conf  $startdir/pkg/etc/logrotate.d/zm
  96.   install -D -m 700 $startdir/src/zmeventbackup  $startdir/pkg/etc/cron.hourly/zmeventbackup
  97.  
  98.   mkdir -p  $startdir/pkg/etc/httpd/conf/extra/
  99.   install -m 644 $startdir/src/httpd-zm.conf $startdir/pkg/etc/httpd/conf/extra/httpd-zm.conf
  100.  
  101.   install -D -m 700 $startdir/src/customdb $startdir/pkg/srv/zoneminder/upgrade/customdb
  102.   install -D  db/zm*.sql $startdir/pkg/srv/zoneminder/upgrade/
  103.  
  104.   mkdir -p $startdir/pkg/var/run/zm
  105.  
  106.   ### remove special files
  107.   find $startdir/pkg/ -name "perllocal.pod" \
  108.     -o -name ".packlist"                \
  109.     -o -name "*.bs"                     \
  110.     |xargs -i rm -f {}
  111.  
  112. }
  113.  
  114. # vim:set ft=sh ts=2 sw=2 et:
clone this paste RAW Paste Data