Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Help fix/improve www-misc/zoneminder on Gentoo
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
davidm
Guru
Guru


Joined: 26 Apr 2009
Posts: 557
Location: US

PostPosted: Thu Oct 15, 2015 8:40 pm    Post subject: Help fix/improve www-misc/zoneminder on Gentoo Reply with quote

I just installed zoneminder recently and had a heck of a time with it. Also I noticed some of the documentation on the Wiki didn't quite work or was incomplete. So I figured I would publish some of my notes and problem / solutions I had to go through to get this working (it took two days). Then after some input and other fixes from others we might make a bug report or else the maintainer might incorporate some of the fixes. Plus we might add some things to the Gentoo Wiki to help new users.

I'm a novice on a lot of things and just hacked through this so I could use your help. :)

1. I am using systemd. There does not appear to be a zoneminder.service file provided with 'Zoneminder-1.28.1'. So I had to find one. I found this:

Code:

[Unit]
Description=ZoneMinder CCTV recording and security system
After=network.target mysqld.service apache2.service
Requires=mysqld.service apache2.service

[Service]
User=apache
Type=forking
PIDFile=/run/zm/zm.pid
ExecStart=/usr/bin/zmpkg.pl start
ExecReload=/usr/bin/zmpkg.pl restart
ExecStop=/bin/bash -c '[[ "$(/usr/bin/pgrep zmdc.pl)" > 0 ]] && /usr/bin/zmpkg.$'

[Install]
WantedBy=multi-user.target


From 'christophey2k' at https://github.com/ZoneMinder/ZoneMinder/issues/511 but I added a single quote to 'ExecStop' as systemd was complaining about an unbalanced quote structure. I'm not sure this is correct.

2. You can follow the Gentoo Wiki entry for Zoneminder here and it helps a lot but seems to be missing some stuff (along with referring to the service file which doesn't seem to be packaged)

a. Don't forget to set up your apache2 modules. You can do this in make.conf. I have:

Code:

APACHE2_MODULES="authz_host actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias"


^ This works for me but is probably not all needed and not the best. If you define none however zoneminder won't work and you will see strange errors. The first error will probably be due to the lack of 'authz_host'.

b. The default script alias for virtual hosts conflicts with the '/etc/apache2/vhosts.d/10_zoneminder.conf' suggested in the Gentoo Wiki. The result seems to be a socket write error and the symptom that when you click on your monitor/camera to view it, it will just be white.

I found the way to fix this was to comment out some entries in 'default_vhost.include' where the scriptalias for default cgi-bin is defined.

Code:

        # ScriptAlias /cgi-bin/ "/var/www/localhost/cgi-bin/"
</IfModule>

# "/var/www/localhost/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#<Directory "/var/www/localhost/cgi-bin">
#       AllowOverride None
#       Options None
#       Order allow,deny
#       Allow from all
#</Directory>

# vim: ts=4 filetype=apache


Note: The top line being commented was definitely needed under my setup. I am not so sure about those thereafter.

Now if all is correct otherwise you should be able to see your camera stream.

3. There are issues with permissions with zoneminder. I found you need to 'mkdir /run/zm' 'chown apache:apache /run/zm' to even get it to start. It seems like I have to do this with every reboot but I have not tested much yet. Will update. Even so there are remaining issues with sockets and permissions with zoneminder on Gentoo. Things we should probably resolve in the .ebuild and Wiki entry to make the experience better.

Will update as I run into more things and fix (hack) them. Please share fixes, improvement, knowledge, etc. In a few days or a week I will file bug reports and change the Wiki as needed if no one else does based on triaging here. Don't be afraid to correct me for I already admit I had to hack through this (it took two days so far!) and I feel we really need to make the experience installing Zoneminder on Gentoo a lot better. :)
Back to top
View user's profile Send private message
RayDude
Advocate
Advocate


Joined: 29 May 2004
Posts: 2062
Location: San Jose, CA

PostPosted: Sun Nov 15, 2015 1:14 am    Post subject: Reply with quote

I've been running zoneminder for years. But, 1.28.1 killed me. It's been dead for months and I can't get it to work.

In the past I had the permission issue. And it took me a while to get the recordings off my SSD and on to my raid array... I did that a long time ago. It was all working until the upgrade, then it all stopped. My neighborhood has has multiple break ins and my cameras are useless. It's damn frustrating. I suspect the issue is somehow related to ffmpeg even though I'm not using an ffmpeg camera. The two cameras I have running are mjpeg and viewing the cameras works.

Recording works. I know because when I set the monitors to mocord, they record. But when I set it to modect (what I want) zms / zmc crash and restart when ever there is a motion.

I get absolutely no useful error messages as far as I can tell. They just die with a "crash" message.

I'm glad you got it working. I'm going to compare my apache modules to yours. Can you post your use="" line from make.conf and all the files in /etc/portage/package.use/ ?

This is driving me crazy...

Thanks.

Update: I just put the cameras in mocord and then back to modect and they've started working... I wonder how long it will last...
_________________
Some day there will only be free software.
Back to top
View user's profile Send private message
davidm
Guru
Guru


Joined: 26 Apr 2009
Posts: 557
Location: US

PostPosted: Sun Nov 15, 2015 1:34 am    Post subject: Reply with quote

Hello, sorry I ended up taking the camera I bought back as the camera (480p) really wasn't good enough for my use case. I've yet to buy another one.

I was able to get it working but something really wonky occurred when I first installed it. I'm not sure what exactly. I had figured it was something with the ebuild but upon looking at the ebuild it seems it was pretty decent and should have handled things fine (minus the service file). I was debating whether I should come back and update the thread to say this but opted just to let it go since no one replied.

There is an issue with 1.28.1 though where sometimes if you lose the signal for whatever reason you will get a blue screen and it can even crash Apache. From a forum conversation on their forum I gathered that the git version is supposed to fix this bug. I tried my hand at modifying the ebuild to pull in the get source and it mostly seemed to work but I found some problems occurred -- I'm thinking I botched something on the ebuild.

I thought I had deleted it but I think I found the ebuild I used.

Caution though. It should be considered incomplete and probably won't work well. I never did have time to mess with it. But I'll post it on the off chance that it helps someone. :)

The main change was just adding "EGIT_REPO_URI="https://github.com/ZoneMinder/ZoneMinder.git"" to pull in the master source as I recall.

Custom ZoneMinder-9999 (probably not working fully, you will have to modify more than likely)
Code:

# 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 git-2

MY_PN="ZoneMinder"

DESCRIPTION="ZoneMinder allows you to capture, analyse, record and monitor any cameras attached to your system"
HOMEPAGE="http://www.zoneminder.com/"
EGIT_REPO_URI="https://github.com/ZoneMinder/ZoneMinder.git"
SRC_URI=""

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."
}



As I recall the problem was a lot of images weren't displaying and the web interface was only half functional when trying the live build. I'm not sure if it was path related or perhaps had something to do with the database. I did try a clean install erasing hte old database but ran into the same issue.

Good luck! It's a pretty cool program when you can get it working.
Back to top
View user's profile Send private message
RayDude
Advocate
Advocate


Joined: 29 May 2004
Posts: 2062
Location: San Jose, CA

PostPosted: Sun Nov 15, 2015 6:23 am    Post subject: Reply with quote

Thanks.

I'll give it a shot.
_________________
Some day there will only be free software.
Back to top
View user's profile Send private message
trumee
Guru
Guru


Joined: 02 Mar 2003
Posts: 551
Location: London,UK

PostPosted: Sat Nov 28, 2015 4:15 pm    Post subject: Reply with quote

Wanted to add my two bits.

For sftp upload to work dev-perl/Net-SFTP-Foreign, unfortunately the package in the tree has a bug as mentioned here https://rt.cpan.org/Public/Bug/Display.html?id=106559 and https://forums.zoneminder.com/viewtopic.php?t=23358#p89157.

The solution is to clone the ebuild and use version MODULE_VERSION=1.79 in the ebuild.

Sftp upload works after this change.
.
Back to top
View user's profile Send private message
davidm
Guru
Guru


Joined: 26 Apr 2009
Posts: 557
Location: US

PostPosted: Tue Jan 19, 2016 5:52 pm    Post subject: Reply with quote

Well I just bought two modest D-link network cameras so it appears I'm back on this. :)

It looks like release 1.29 is probably going to occur within a month with some release candidates available already:
https://forums.zoneminder.com/viewtopic.php?f=34&t=23834
https://github.com/ZoneMinder/ZoneMinder/releases

This is great news considering that with some wireless configurations there is a very nasty bug with the current release and the new rc versions fix it along with many other bugs. Has anyone managed to get a working ebuild yet with the rc? I'll probably be trying my hand on getting one going in the next few days so if anyone wants to try to work together, etc. on it please let me know.
Back to top
View user's profile Send private message
davidm
Guru
Guru


Joined: 26 Apr 2009
Posts: 557
Location: US

PostPosted: Mon Jan 25, 2016 11:09 pm    Post subject: Reply with quote

Trying to get 1.29.0 working proved to be too difficult for a first real ebuild for me. Plus I'm very short on time at the moment and needed to just get osmething workign for my security. I did however get 1.28.1 working on systemd and noted a few changes that might help someone using systemd (as far as I see the gentoo ebuild currently isn't really systemd aware).

/etc/systemd/system/zoneminder.service :
Code:

[Unit]
Description=ZoneMinder CCTV recording and security system
After=network.target mysqld.service apache2.service
Requires=mysqld.service apache2.service

[Service]
User=apache
Type=forking
PIDFile=/run/zm/zm.pid
ExecStart=/usr/bin/zmpkg.pl start
ExecReload=/usr/bin/zmpkg.pl restart
ExecStop=/usr/bin/zmpkg.pl stop

[Install]
WantedBy=multi-user.target


/usr/lib/tmpfiles.d/zoneminder-tmpfiles.conf :

Code:

D /var/run/zm/ 0755 apache apache
D /var/tmp/zm/ 0755 apache apache
D /run/zm/ 0755 apache apache
Back to top
View user's profile Send private message
RayDude
Advocate
Advocate


Joined: 29 May 2004
Posts: 2062
Location: San Jose, CA

PostPosted: Sun Feb 14, 2016 7:05 pm    Post subject: Reply with quote

I'm trying to get an ebuild working now, but the tar.gz file that downloads won't build.

Code:
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:13 (message):
  The git submodules are not available.  Please run

  git submodule update --init --recursive


I think that's the error. Apparently the tar.gz file doesn't include the sub modules, but I can't get it to update on the fly...

I added a src_prepare section:

Code:
src_prepare() {
        git submodule update --init --recursive
}


But it doesn't work.

Code:
>>> Preparing source in /var/tmp/portage/www-misc/zoneminder-1.29.0/work/ZoneMinder-1.29.0 ...
fatal: Not a git repository (or any of the parent directories): .git
>>> Source prepared.

_________________
Some day there will only be free software.
Back to top
View user's profile Send private message
undrwater
Guru
Guru


Joined: 28 Jan 2003
Posts: 312
Location: Caucasia

PostPosted: Thu Mar 10, 2016 8:06 pm    Post subject: Reply with quote

Working from davidm's ebuild, I got one that seems to work for openrc. I did have to modify a bit based on the docs from zoneminder here:

http://zoneminder.readthedocs.org/en/stable/installationguide/ubuntu.html

I had to add the following:

Code:

git submodule init
git submodule update


Final ebuild looks like this:

Quote:

# 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.apache multilib flag-o-matic git-2

MY_PN="ZoneMinder"

DESCRIPTION="ZoneMinder allows you to capture, analyse, record and monitor any cameras attached to your system"
HOMEPAGE="http://www.zoneminder.com/"
EGIT_REPO_URI="https://github.com/ZoneMinder/ZoneMinder.git"
SRC_URI=""
EGIT_HAS_SUBMODULES=2

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() {
:
}

src_unpack() {
git-2_src_unpack
cd $EGIT_SOURCEDIR
git submodule --init
git submodule --update
}

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."
}

_________________
Open-mindedness is painful...
Back to top
View user's profile Send private message
trumee
Guru
Guru


Joined: 02 Mar 2003
Posts: 551
Location: London,UK

PostPosted: Sun Mar 13, 2016 12:17 am    Post subject: Reply with quote

undrwater wrote:
Working from davidm's ebuild, I got one that seems to work for openrc. I did have to modify a bit based on the docs from zoneminder here:



Is this for version 1.29?
Back to top
View user's profile Send private message
undrwater
Guru
Guru


Joined: 28 Jan 2003
Posts: 312
Location: Caucasia

PostPosted: Sun Mar 20, 2016 9:49 pm    Post subject: Reply with quote

trumee wrote:
undrwater wrote:
Working from davidm's ebuild, I got one that seems to work for openrc. I did have to modify a bit based on the docs from zoneminder here:



Is this for version 1.29?


Correct. It pulls from git. ebuild is zoneminder-9999.ebuild
_________________
Open-mindedness is painful...
Back to top
View user's profile Send private message
chrisk2305
Tux's lil' helper
Tux's lil' helper


Joined: 05 Sep 2007
Posts: 110

PostPosted: Mon Aug 01, 2016 8:33 am    Post subject: Reply with quote

Hi,

I have some issues with the 9999 ebuild. First of all it depends on dev-perl/DateManip which is now dev-perl/Date-Manip but that was an easy fix.

The other thing is that the ebuild cannot locate my PHP Installation:

Code:

>>>  '/var/tmp/portage/www-misc/zoneminder-9999/temp/build.log'
>>> Jobs: 11 of 12 complete, 1 failed               Load avg: 0.99, 0.42, 0.39
 * Package:    www-misc/zoneminder-9999
 * Repository: zugaina
 * USE:        abi_x86_64 amd64 elibc_glibc kernel_linux userland_GNU
 * FEATURES:   preserve-libs sandbox userpriv usersandbox
 * ERROR: www-misc/zoneminder-9999::zugaina failed (setup phase):
 *   Unable to find an installed dev-lang/php package
 *
 * Call stack:
 *                ebuild.sh, line 115:  Called pkg_setup
 *   zoneminder-9999.ebuild, line  54:  Called require_php_with_use 'mysql' 'sockets' 'apache2'
 *        depend.php.eclass, line 117:  Called has_php
 *        depend.php.eclass, line  84:  Called die
 * The specific snippet of code:
 *         die "Unable to find an installed dev-lang/php package"
 *
 * If you need support, post the output of `emerge --info '=www-misc/zoneminder-9999::zugaina'`,
 * the complete build log and the output of `emerge -pqv '=www-misc/zoneminder-9999::zugaina'`.
 * The complete build log is located at '/var/tmp/portage/www-misc/zoneminder-9999/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/www-misc/zoneminder-9999/temp/die.env'.
 * Working directory: '/usr/lib64/python2.7/site-packages'
 * S: '/var/tmp/portage/www-misc/zoneminder-9999/work/zoneminder-9999'


PHP 7 is of course installed. Can somebody point me in the right direction?

Thanks,
Christian

Edit: My fault, need to have a slotted version of php5 installed. Now everything fine except that I have to create /var/run/zm directory everytime I reboot.
Back to top
View user's profile Send private message
Mr. Death
n00b
n00b


Joined: 14 Jan 2012
Posts: 10

PostPosted: Thu Aug 25, 2016 11:26 am    Post subject: Reply with quote

Hello, I've found some kind of bug related with 1.28.1 and libjpeg-turbo 1.5.0. It fails to refresh camera images. I've downloaded and compiled libjpeg-turbo 1.4.2 and it works, there isn't any ebuild for older libjpeg-turbo in portage. Error should be fixed in ZoneMinder 1.30 but there isn't any ebuild.
The error is described here:
https://github.com/ZoneMinder/ZoneMinder/issues/1547

Is there someone who could prepare new release? Thanks in advance.
Back to top
View user's profile Send private message
gkmac
Guru
Guru


Joined: 19 Jan 2003
Posts: 333
Location: West Sussex, UK

PostPosted: Thu Aug 25, 2016 8:28 pm    Post subject: Reply with quote

Mr. Death wrote:
Error should be fixed in ZoneMinder 1.30 but there isn't any ebuild.

Is there someone who could prepare new release? Thanks in advance.
There is an ebuild for Zoneminder 1.30 at the bottom of this bug report. I've yet to try it myself though...
_________________
If ~amd64 ebuilds are cutting edge, then git-9999 ebuilds are chainsaws.
"Not everyone can ride a unicycle, does that mean we should put another wheel on it?" - Lokheed
Back to top
View user's profile Send private message
Mr. Death
n00b
n00b


Joined: 14 Jan 2012
Posts: 10

PostPosted: Thu Aug 25, 2016 9:14 pm    Post subject: Reply with quote

Thank you! I'll try soon.
Back to top
View user's profile Send private message
Mr. Death
n00b
n00b


Joined: 14 Jan 2012
Posts: 10

PostPosted: Sun Aug 28, 2016 8:43 pm    Post subject: Reply with quote

Now I'm on 1.30.0 there is bug on free disk space:
Warning: disk_total_space(): No such file or directory in /usr/share/zoneminder/www/includes/functions.php on line 1411

I've temporarily fixed it with absolute path, problem is in ZM_DIR_EVENTS variable.

And also something wrong with executable test, but it works even with those errors:
Can't exec "sudo": No such file or directory at /usr/lib64/perl5/vendor_perl/5.20.2/ZoneMinder/General.pm line 110.
Use of uninitialized value $output in scalar chomp at /usr/lib64/perl5/vendor_perl/5.20.2/ZoneMinder/General.pm line 119.
Use of uninitialized value $output in concatenation (.) or string at /usr/lib64/perl5/vendor_perl/5.20.2/ZoneMinder/General.pm line 120.


EDIT: Quick fix in function.php to fix free space error:
line 1411: $total = disk_total_space("/usr/share/zoneminder/www/".ZM_DIR_EVENTS);
line 1416: $free = disk_free_space("/usr/share/zoneminder/www/".ZM_DIR_EVENTS);
Back to top
View user's profile Send private message
undrwater
Guru
Guru


Joined: 28 Jan 2003
Posts: 312
Location: Caucasia

PostPosted: Tue Oct 17, 2017 10:27 pm    Post subject: Reply with quote

I've got an updated ebuild working for zoneminder from git:

Code:
# 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.apache multilib flag-o-matic git-r3

MY_PN="ZoneMinder"

DESCRIPTION="ZoneMinder allows you to capture, analyse, record and monitor any cameras attached to your system"
HOMEPAGE="http://www.zoneminder.com/"
EGIT_REPO_URI="https://github.com/ZoneMinder/ZoneMinder.git"
SRC_URI=""
# EGIT_SUBMODULES=(init update)

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/Date-Manip
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_unpack() {
#git-2_src_unpack
#cd $EGIT_SOURCEDIR
#git submodule init
#git submodule update
#:
#}

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
dosym /var/lib/zoneminder/api_tmp ${MY_ZM_WEBDIR}/api/app/tmp

# 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."
}


Mr. Death's fix above is useful as well.
_________________
Open-mindedness is painful...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum