diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2015-08-08 13:49:04 -0700 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2015-08-08 17:38:18 -0700 |
commit | 56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch) | |
tree | 3f91093cdb475e565ae857f1c5a7fd339e2d781e /www-misc/zoneminder | |
download | gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2 gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip |
proj/gentoo: Initial commit
This commit represents a new era for Gentoo:
Storing the gentoo-x86 tree in Git, as converted from CVS.
This commit is the start of the NEW history.
Any historical data is intended to be grafted onto this point.
Creation process:
1. Take final CVS checkout snapshot
2. Remove ALL ChangeLog* files
3. Transform all Manifests to thin
4. Remove empty Manifests
5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$
5.1. Do not touch files with -kb/-ko keyword flags.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests
X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project
X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration
X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn
X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts
X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration
X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging
X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'www-misc/zoneminder')
-rw-r--r-- | www-misc/zoneminder/Manifest | 3 | ||||
-rw-r--r-- | www-misc/zoneminder/files/10_zoneminder.conf | 18 | ||||
-rw-r--r-- | www-misc/zoneminder/files/README.gentoo | 27 | ||||
-rw-r--r-- | www-misc/zoneminder/files/conf.d | 6 | ||||
-rw-r--r-- | www-misc/zoneminder/files/init.d | 26 | ||||
-rw-r--r-- | www-misc/zoneminder/files/zoneminder-1.24.2-db_upgrade_script_location.patch | 11 | ||||
-rw-r--r-- | www-misc/zoneminder/files/zoneminder-1.26.5-automagic.patch | 34 | ||||
-rw-r--r-- | www-misc/zoneminder/metadata.xml | 17 | ||||
-rw-r--r-- | www-misc/zoneminder/zoneminder-1.27.0.ebuild | 131 | ||||
-rw-r--r-- | www-misc/zoneminder/zoneminder-1.28.0.ebuild | 149 | ||||
-rw-r--r-- | www-misc/zoneminder/zoneminder-1.28.1.ebuild | 149 |
11 files changed, 571 insertions, 0 deletions
diff --git a/www-misc/zoneminder/Manifest b/www-misc/zoneminder/Manifest new file mode 100644 index 000000000000..f62a219ad90c --- /dev/null +++ b/www-misc/zoneminder/Manifest @@ -0,0 +1,3 @@ +DIST zoneminder-1.27.0.tar.gz 1262653 SHA256 2f31c10e6c5930aedfa9f08edfa074ef1b168e5bdffb77a147d4e631bfb03ef2 SHA512 8a349558399381a9062365ddc8bd8f815e3800929914096b2e4ea63e4d6dd12054f7b849fab5bea4bcfc87ea60739479a55734c7075a74aab0622d35f1d2bb14 WHIRLPOOL 869811e289e11343ff0cd0bd078a477db3511ed3cc96574d71163e1ab9eaf703e26f7c526841164a41f8d1e1aae47eb7f198831999b0c39f2729199fe81f43c0 +DIST zoneminder-1.28.0.tar.gz 2804199 SHA256 b9ee65635753e094dcad6cdb480acc42bff8b8f023ee008790883a4308273ca2 SHA512 ac2a036adac436d76db8bb0b161d063111cc7cc7f6bcb9ca1b46862cfb0285b291926df716df645c0be47b7465bbbf3b1050c85529ff5068bdcc34f1c8ba6df1 WHIRLPOOL 012a088ab6411cf7a1ec1e0c4d9c9f1e61889c3729ea736baafb5174a20f61a82c280b7c5bfd669e031b3e1844abe1de0a577e73f82295b080d88b4ae43b627b +DIST zoneminder-1.28.1.tar.gz 3864811 SHA256 e55fa6ce1fd6c27912cd1de67fca3f80fad579f330020a384dc82838704d11ba SHA512 0ae29870e12b7ad0852510a17439df49dd35245aa1486a5d0ff71e17dbf89840d08c65b4485c93739f1fbcc253599162e28e0382c28927aa84cd734248587ea1 WHIRLPOOL 62a52810437c0360fb83eb6f8210d6f089448bc6b9cf7b46e6ad8db7f952c3e3ba9832f2e25be65a476655991e3dd7ae70ed83198c7a4563cff68283e7f06226 diff --git a/www-misc/zoneminder/files/10_zoneminder.conf b/www-misc/zoneminder/files/10_zoneminder.conf new file mode 100644 index 000000000000..277d680d24b4 --- /dev/null +++ b/www-misc/zoneminder/files/10_zoneminder.conf @@ -0,0 +1,18 @@ +ScriptAlias /cgi-bin/zms "/usr/libexec/zoneminder/cgi-bin/zms" +ScriptAlias /cgi-bin/nph-zms "/usr/libexec/zoneminder/cgi-bin/nph-zms" + +<Directory "/usr/libexec/zoneminder/cgi-bin"> + AllowOverride All + Options ExecCGI + Order allow,deny + Allow from all +</Directory> + +Alias /zoneminder "%ZM_WEBDIR%" + +<Directory "%ZM_WEBDIR%"> + Options -Indexes MultiViews FollowSymLinks + AllowOverride All + Order allow,deny + Allow from all +</Directory> diff --git a/www-misc/zoneminder/files/README.gentoo b/www-misc/zoneminder/files/README.gentoo new file mode 100644 index 000000000000..2ada7c7d0a45 --- /dev/null +++ b/www-misc/zoneminder/files/README.gentoo @@ -0,0 +1,27 @@ +1. If this is a new installation, you will need to create a MySQL + database for zoneminder to use + (see https://wiki.gentoo.org/wiki/MySQL/Startup_Guide). + E.g., when logged into mysql as root, + mysql> CREATE DATABASE \`zm\`; + mysql> GRANT ALL ON zm.* TO 'zmuser'@'localhost' IDENTIFIED BY 'topsecretpassword'; + Once you completed that you should execute the following: + cd /usr/share/zoneminder + mysql -u zmuser -p < db/zm_create.sql + +2. Set your database settings in /etc/zm.conf, including above topsecretpassword + +3. Configure apache to use zoneminder, see /usr/share/doc/zoneminder*/10_zoneminder.conf + for an example configuration snippet. + +4. Enable PHP in your webserver configuration, + enable short_open_tags in php.ini, + set the time zone in php.ini, + and restart/reload the webserver. + +5. Start the zoneminder daemon: + /etc/init.d/zoneminder start + +6. Finally point your browser to http://your.webserver/zoneminder + +If you are upgrading, you will need to run the zmupdate.pl script: + /usr/bin/zmupdate.pl --version=oldversionnumber [--user=zmuser --pass=topsecretpassword] diff --git a/www-misc/zoneminder/files/conf.d b/www-misc/zoneminder/files/conf.d new file mode 100644 index 000000000000..d2e03363867a --- /dev/null +++ b/www-misc/zoneminder/files/conf.d @@ -0,0 +1,6 @@ +ZM_SCRIPT=/usr/bin/zmpkg.pl + +# Commands for starting and stopping the server + +CMD_START="${ZM_SCRIPT} start" +CMD_STOP="${ZM_SCRIPT} stop" diff --git a/www-misc/zoneminder/files/init.d b/www-misc/zoneminder/files/init.d new file mode 100644 index 000000000000..06435b85f108 --- /dev/null +++ b/www-misc/zoneminder/files/init.d @@ -0,0 +1,26 @@ +#!/sbin/runscript +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +depend() { + need mysql + need apache2 +} + +start_pre() { + checkpath -d -m 0775 -o apache:apache /var/run/zm + checkpath -d -m 0775 -o apache:apache /var/tmp/zm +} + +start() { + ebegin "Starting zoneminder" + ${CMD_START} + eend $? +} + +stop() { + ebegin "Stopping zoneminder" + ${CMD_STOP} + eend $? +} diff --git a/www-misc/zoneminder/files/zoneminder-1.24.2-db_upgrade_script_location.patch b/www-misc/zoneminder/files/zoneminder-1.24.2-db_upgrade_script_location.patch new file mode 100644 index 000000000000..41b537c4167a --- /dev/null +++ b/www-misc/zoneminder/files/zoneminder-1.24.2-db_upgrade_script_location.patch @@ -0,0 +1,11 @@ +--- ZoneMinder-1.24.1/zm.conf.in.orig 2009-03-23 13:55:43.000000000 +0000 ++++ ZoneMinder-1.24.1/zm.conf.in 2009-03-23 13:57:22.000000000 +0000 +@@ -13,7 +13,7 @@ + ZM_VERSION=@VERSION@ + + # Path to build directory, used mostly for finding DB upgrade scripts +-ZM_PATH_BUILD=@PATH_BUILD@ ++ZM_PATH_BUILD=/usr/share/zoneminder + + # Build time, used to record when to trigger various checks + ZM_TIME_BUILD=@TIME_BUILD@ diff --git a/www-misc/zoneminder/files/zoneminder-1.26.5-automagic.patch b/www-misc/zoneminder/files/zoneminder-1.26.5-automagic.patch new file mode 100644 index 000000000000..266bd649baa6 --- /dev/null +++ b/www-misc/zoneminder/files/zoneminder-1.26.5-automagic.patch @@ -0,0 +1,34 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 83e9d81..8619c8b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -171,6 +171,7 @@ else(PCRE_LIBRARIES) + set(optlibsnotfound "${optlibsnotfound} PCRE") + endif(PCRE_LIBRARIES) + ++if(HAVE_GCRYPT) + # gcrypt (using find_library and find_path) + find_library(GCRYPT_LIBRARIES gcrypt) + if(GCRYPT_LIBRARIES) +@@ -187,7 +188,11 @@ if(GCRYPT_LIBRARIES) + else(GCRYPT_LIBRARIES) + set(optlibsnotfound "${optlibsnotfound} GCrypt") + endif(GCRYPT_LIBRARIES) ++else(HAVE_GCRYPT) ++ set(optlibsnotfound "${optlibsnotfound} GCrypt") ++endif(HAVE_GCRYPT) + ++if(HAVE_GNUTLS) + # gnutls (using find_library and find_path) + find_library(GNUTLS_LIBRARIES gnutls) + if(GNUTLS_LIBRARIES) +@@ -205,6 +210,9 @@ if(GNUTLS_LIBRARIES) + else(GNUTLS_LIBRARIES) + set(optlibsnotfound "${optlibsnotfound} GnuTLS") + endif(GNUTLS_LIBRARIES) ++else(HAVE_GNUTLS) ++ set(optlibsnotfound "${optlibsnotfound} GnuTLS") ++endif(HAVE_GNUTLS) + + # mysqlclient (using find_library and find_path) + find_library(MYSQLCLIENT_LIBRARIES mysqlclient PATH_SUFFIXES mysql) diff --git a/www-misc/zoneminder/metadata.xml b/www-misc/zoneminder/metadata.xml new file mode 100644 index 000000000000..3332f01d1a32 --- /dev/null +++ b/www-misc/zoneminder/metadata.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer> + <email>dilfridge@gentoo.org</email> + <name>Andreas K. Huettel</name> + </maintainer> + <use> + <flag name="curl">Enable using net-misc/curl for streaming from cameras</flag> + <flag name="gcrypt">...</flag> + <flag name="vlc">Enable using media-libs/vlc for streaming from cameras</flag> + <flag name="openssl">...</flag> + </use> + <upstream> + <remote-id type="github">ZoneMinder/ZoneMinder</remote-id> + </upstream> +</pkgmetadata> diff --git a/www-misc/zoneminder/zoneminder-1.27.0.ebuild b/www-misc/zoneminder/zoneminder-1.27.0.ebuild new file mode 100644 index 000000000000..7870564c22b4 --- /dev/null +++ b/www-misc/zoneminder/zoneminder-1.27.0.ebuild @@ -0,0 +1,131 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +# TO DO: +# * ffmpeg support can be disabled in CMakeLists.txt but it does not build then +# $(cmake-utils_useno ffmpeg ZM_NO_FFMPEG) +# * dependencies of unknown status: +# dev-perl/Archive-Zip +# dev-perl/Device-SerialPort +# dev-perl/MIME-Lite +# dev-perl/MIME-tools +# dev-perl/PHP-Serialization +# virtual/perl-Archive-Tar +# virtual/perl-libnet +# virtual/perl-Module-Load + +EAPI=5 + +PERL_EXPORT_PHASE_FUNCTIONS=no + +inherit perl-module readme.gentoo eutils base cmake-utils depend.php depend.apache multilib flag-o-matic + +MY_PN="ZoneMinder" + +DESCRIPTION="ZoneMinder allows you to capture, analyse, record and monitor any cameras attached to your system" +HOMEPAGE="http://www.zoneminder.com/" +SRC_URI="https://github.com/${MY_PN}/${MY_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="GPL-2" +KEYWORDS="~amd64" +IUSE="curl gcrypt gnutls +mmap +openssl vlc" +SLOT="0" + +REQUIRED_USE=" + || ( openssl gnutls ) +" + +DEPEND=" + dev-lang/perl:= + dev-libs/libpcre + dev-perl/DateManip + dev-perl/DBD-mysql + dev-perl/DBI + dev-perl/libwww-perl + sys-libs/zlib + virtual/ffmpeg + virtual/jpeg + virtual/mysql + virtual/perl-ExtUtils-MakeMaker + virtual/perl-Getopt-Long + virtual/perl-Sys-Syslog + virtual/perl-Time-HiRes + curl? ( net-misc/curl ) + gcrypt? ( dev-libs/libgcrypt ) + gnutls? ( net-libs/gnutls ) + mmap? ( dev-perl/Sys-Mmap ) + openssl? ( dev-libs/openssl ) + vlc? ( media-video/vlc ) +" +RDEPEND="${DEPEND}" + +# we cannot use need_httpd_cgi here, since we need to setup permissions for the +# webserver in global scope (/etc/zm.conf etc), so we hardcode apache here. +need_apache +need_php_httpd + +S=${WORKDIR}/${MY_PN}-${PV} + +PATCHES=( + "${FILESDIR}/${PN}-1.26.5"-automagic.patch +) + +MY_ZM_WEBDIR=/usr/share/zoneminder/www + +pkg_setup() { + require_php_with_use mysql sockets apache2 +} + +src_configure() { + append-cxxflags -D__STDC_CONSTANT_MACROS + perl_set_version + + mycmakeargs=( + -DZM_PERL_SUBPREFIX=${VENDOR_LIB} + -DZM_TMPDIR=/var/tmp/zm + -DZM_WEB_USER=apache + -DZM_WEB_GROUP=apache + -DZM_WEBDIR=${MY_ZM_WEBDIR} + $(cmake-utils_useno mmap ZM_NO_MMAP) + -DZM_NO_X10=OFF + -DZM_NO_FFMPEG=OFF + $(cmake-utils_useno curl ZM_NO_CURL) + $(cmake-utils_useno vlc ZM_NO_LIBVLC) + $(cmake-utils_useno openssl CMAKE_DISABLE_FIND_PACKAGE_OpenSSL) + $(cmake-utils_use_has gnutls) + $(cmake-utils_use_has gcrypt) + ) + + cmake-utils_src_configure +} + +src_install() { + cmake-utils_src_install + + # the log directory + keepdir /var/log/zm + fowners apache:apache /var/log/zm + + # now we duplicate the work of zmlinkcontent.sh + dodir /var/lib/zoneminder /var/lib/zoneminder/images /var/lib/zoneminder/events + fperms -R 0775 /var/lib/zoneminder + fowners -R apache:apache /var/lib/zoneminder + dosym /var/lib/zoneminder/images ${MY_ZM_WEBDIR}/images + dosym /var/lib/zoneminder/events ${MY_ZM_WEBDIR}/events + + # the configuration file + fperms 0640 /etc/zm.conf + fowners root:apache /etc/zm.conf + + # init scripts etc + newinitd "${FILESDIR}"/init.d zoneminder + newconfd "${FILESDIR}"/conf.d zoneminder + + cp "${FILESDIR}"/10_zoneminder.conf "${T}"/10_zoneminder.conf + sed -i "${T}"/10_zoneminder.conf -e "s:%ZM_WEBDIR%:${MY_ZM_WEBDIR}:g" + + dodoc AUTHORS BUGS ChangeLog INSTALL NEWS README.md TODO "${T}"/10_zoneminder.conf + + readme.gentoo_src_install +} diff --git a/www-misc/zoneminder/zoneminder-1.28.0.ebuild b/www-misc/zoneminder/zoneminder-1.28.0.ebuild new file mode 100644 index 000000000000..0168b2a2e5f2 --- /dev/null +++ b/www-misc/zoneminder/zoneminder-1.28.0.ebuild @@ -0,0 +1,149 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +# TO DO: +# * ffmpeg support can be disabled in CMakeLists.txt but it does not build then +# $(cmake-utils_useno ffmpeg ZM_NO_FFMPEG) +# * dependencies of unknown status: +# dev-perl/Archive-Zip +# dev-perl/Device-SerialPort +# dev-perl/MIME-Lite +# dev-perl/MIME-tools +# dev-perl/PHP-Serialization +# virtual/perl-Archive-Tar +# virtual/perl-libnet +# virtual/perl-Module-Load + +EAPI=5 + +PERL_EXPORT_PHASE_FUNCTIONS=no + +inherit perl-module readme.gentoo eutils base cmake-utils depend.php depend.apache multilib flag-o-matic + +MY_PN="ZoneMinder" + +DESCRIPTION="ZoneMinder allows you to capture, analyse, record and monitor any cameras attached to your system" +HOMEPAGE="http://www.zoneminder.com/" +SRC_URI="https://github.com/${MY_PN}/${MY_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="GPL-2" +KEYWORDS="~amd64" +IUSE="curl gcrypt gnutls +mmap +openssl vlc" +SLOT="0" + +REQUIRED_USE=" + || ( openssl gnutls ) +" + +DEPEND=" + app-eselect/eselect-php[apache2] + dev-lang/perl:= + dev-lang/php[apache2,cgi,curl,inifile,pdo,mysql,mysqli,sockets] + dev-libs/libpcre + dev-perl/Archive-Zip + dev-perl/DateManip + dev-perl/DBD-mysql + dev-perl/DBI + dev-perl/URI-Encode + dev-perl/libwww-perl + sys-auth/polkit + sys-libs/zlib + virtual/ffmpeg + virtual/jpeg + virtual/mysql + virtual/perl-ExtUtils-MakeMaker + virtual/perl-Getopt-Long + virtual/perl-Sys-Syslog + virtual/perl-Time-HiRes + www-servers/apache + curl? ( net-misc/curl ) + gcrypt? ( dev-libs/libgcrypt ) + gnutls? ( net-libs/gnutls ) + mmap? ( dev-perl/Sys-Mmap ) + openssl? ( dev-libs/openssl ) + vlc? ( media-video/vlc[live] ) +" +RDEPEND="${DEPEND}" + +# we cannot use need_httpd_cgi here, since we need to setup permissions for the +# webserver in global scope (/etc/zm.conf etc), so we hardcode apache here. +need_apache +need_php_httpd + +S=${WORKDIR}/${MY_PN}-${PV} + +PATCHES=( + "${FILESDIR}/${PN}-1.26.5"-automagic.patch +) + +MY_ZM_WEBDIR=/usr/share/zoneminder/www + +pkg_setup() { + require_php_with_use mysql sockets apache2 +} + +src_configure() { + append-cxxflags -D__STDC_CONSTANT_MACROS + perl_set_version + + mycmakeargs=( + -DZM_PERL_SUBPREFIX=${VENDOR_LIB#/usr} + -DZM_TMPDIR=/var/tmp/zm + -DZM_SOCKDIR=/var/run/zm + -DZM_WEB_USER=apache + -DZM_WEB_GROUP=apache + -DZM_WEBDIR=${MY_ZM_WEBDIR} + $(cmake-utils_useno mmap ZM_NO_MMAP) + -DZM_NO_X10=OFF + -DZM_NO_FFMPEG=OFF + $(cmake-utils_useno curl ZM_NO_CURL) + $(cmake-utils_useno vlc ZM_NO_LIBVLC) + $(cmake-utils_useno openssl CMAKE_DISABLE_FIND_PACKAGE_OpenSSL) + $(cmake-utils_use_has gnutls) + $(cmake-utils_use_has gcrypt) + ) + + cmake-utils_src_configure +} + +src_install() { + cmake-utils_src_install + + # the log directory + keepdir /var/log/zm + fowners apache:apache /var/log/zm + + # now we duplicate the work of zmlinkcontent.sh + dodir /var/lib/zoneminder /var/lib/zoneminder/images /var/lib/zoneminder/events + fperms -R 0775 /var/lib/zoneminder + fowners -R apache:apache /var/lib/zoneminder + dosym /var/lib/zoneminder/images ${MY_ZM_WEBDIR}/images + dosym /var/lib/zoneminder/events ${MY_ZM_WEBDIR}/events + + # bug 523058 + keepdir ${MY_ZM_WEBDIR}/temp + fowners -R apache:apache ${MY_ZM_WEBDIR}/temp + + # the configuration file + fperms 0640 /etc/zm.conf + fowners root:apache /etc/zm.conf + + # init scripts etc + newinitd "${FILESDIR}"/init.d zoneminder + newconfd "${FILESDIR}"/conf.d zoneminder + + cp "${FILESDIR}"/10_zoneminder.conf "${T}"/10_zoneminder.conf + sed -i "${T}"/10_zoneminder.conf -e "s:%ZM_WEBDIR%:${MY_ZM_WEBDIR}:g" + + dodoc AUTHORS BUGS ChangeLog INSTALL NEWS README.md TODO "${T}"/10_zoneminder.conf + + perl_delete_packlist + + readme.gentoo_src_install +} + +pkg_postinst() { + local myold=${REPLACING_VERSIONS} + [ "${myold}" = ${PV} ] || elog "You have upgraded zoneminder and may have to upgrade your database now." +} diff --git a/www-misc/zoneminder/zoneminder-1.28.1.ebuild b/www-misc/zoneminder/zoneminder-1.28.1.ebuild new file mode 100644 index 000000000000..0168b2a2e5f2 --- /dev/null +++ b/www-misc/zoneminder/zoneminder-1.28.1.ebuild @@ -0,0 +1,149 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +# TO DO: +# * ffmpeg support can be disabled in CMakeLists.txt but it does not build then +# $(cmake-utils_useno ffmpeg ZM_NO_FFMPEG) +# * dependencies of unknown status: +# dev-perl/Archive-Zip +# dev-perl/Device-SerialPort +# dev-perl/MIME-Lite +# dev-perl/MIME-tools +# dev-perl/PHP-Serialization +# virtual/perl-Archive-Tar +# virtual/perl-libnet +# virtual/perl-Module-Load + +EAPI=5 + +PERL_EXPORT_PHASE_FUNCTIONS=no + +inherit perl-module readme.gentoo eutils base cmake-utils depend.php depend.apache multilib flag-o-matic + +MY_PN="ZoneMinder" + +DESCRIPTION="ZoneMinder allows you to capture, analyse, record and monitor any cameras attached to your system" +HOMEPAGE="http://www.zoneminder.com/" +SRC_URI="https://github.com/${MY_PN}/${MY_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="GPL-2" +KEYWORDS="~amd64" +IUSE="curl gcrypt gnutls +mmap +openssl vlc" +SLOT="0" + +REQUIRED_USE=" + || ( openssl gnutls ) +" + +DEPEND=" + app-eselect/eselect-php[apache2] + dev-lang/perl:= + dev-lang/php[apache2,cgi,curl,inifile,pdo,mysql,mysqli,sockets] + dev-libs/libpcre + dev-perl/Archive-Zip + dev-perl/DateManip + dev-perl/DBD-mysql + dev-perl/DBI + dev-perl/URI-Encode + dev-perl/libwww-perl + sys-auth/polkit + sys-libs/zlib + virtual/ffmpeg + virtual/jpeg + virtual/mysql + virtual/perl-ExtUtils-MakeMaker + virtual/perl-Getopt-Long + virtual/perl-Sys-Syslog + virtual/perl-Time-HiRes + www-servers/apache + curl? ( net-misc/curl ) + gcrypt? ( dev-libs/libgcrypt ) + gnutls? ( net-libs/gnutls ) + mmap? ( dev-perl/Sys-Mmap ) + openssl? ( dev-libs/openssl ) + vlc? ( media-video/vlc[live] ) +" +RDEPEND="${DEPEND}" + +# we cannot use need_httpd_cgi here, since we need to setup permissions for the +# webserver in global scope (/etc/zm.conf etc), so we hardcode apache here. +need_apache +need_php_httpd + +S=${WORKDIR}/${MY_PN}-${PV} + +PATCHES=( + "${FILESDIR}/${PN}-1.26.5"-automagic.patch +) + +MY_ZM_WEBDIR=/usr/share/zoneminder/www + +pkg_setup() { + require_php_with_use mysql sockets apache2 +} + +src_configure() { + append-cxxflags -D__STDC_CONSTANT_MACROS + perl_set_version + + mycmakeargs=( + -DZM_PERL_SUBPREFIX=${VENDOR_LIB#/usr} + -DZM_TMPDIR=/var/tmp/zm + -DZM_SOCKDIR=/var/run/zm + -DZM_WEB_USER=apache + -DZM_WEB_GROUP=apache + -DZM_WEBDIR=${MY_ZM_WEBDIR} + $(cmake-utils_useno mmap ZM_NO_MMAP) + -DZM_NO_X10=OFF + -DZM_NO_FFMPEG=OFF + $(cmake-utils_useno curl ZM_NO_CURL) + $(cmake-utils_useno vlc ZM_NO_LIBVLC) + $(cmake-utils_useno openssl CMAKE_DISABLE_FIND_PACKAGE_OpenSSL) + $(cmake-utils_use_has gnutls) + $(cmake-utils_use_has gcrypt) + ) + + cmake-utils_src_configure +} + +src_install() { + cmake-utils_src_install + + # the log directory + keepdir /var/log/zm + fowners apache:apache /var/log/zm + + # now we duplicate the work of zmlinkcontent.sh + dodir /var/lib/zoneminder /var/lib/zoneminder/images /var/lib/zoneminder/events + fperms -R 0775 /var/lib/zoneminder + fowners -R apache:apache /var/lib/zoneminder + dosym /var/lib/zoneminder/images ${MY_ZM_WEBDIR}/images + dosym /var/lib/zoneminder/events ${MY_ZM_WEBDIR}/events + + # bug 523058 + keepdir ${MY_ZM_WEBDIR}/temp + fowners -R apache:apache ${MY_ZM_WEBDIR}/temp + + # the configuration file + fperms 0640 /etc/zm.conf + fowners root:apache /etc/zm.conf + + # init scripts etc + newinitd "${FILESDIR}"/init.d zoneminder + newconfd "${FILESDIR}"/conf.d zoneminder + + cp "${FILESDIR}"/10_zoneminder.conf "${T}"/10_zoneminder.conf + sed -i "${T}"/10_zoneminder.conf -e "s:%ZM_WEBDIR%:${MY_ZM_WEBDIR}:g" + + dodoc AUTHORS BUGS ChangeLog INSTALL NEWS README.md TODO "${T}"/10_zoneminder.conf + + perl_delete_packlist + + readme.gentoo_src_install +} + +pkg_postinst() { + local myold=${REPLACING_VERSIONS} + [ "${myold}" = ${PV} ] || elog "You have upgraded zoneminder and may have to upgrade your database now." +} |