Zoneminder RPM & SRPMS for Red Hat & CentOS 6

If you've made a patch to quick fix a bug or to add a new feature not yet in the main tree then post it here so others can try it out.
Post Reply
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Zoneminder RPM & SRPMS for Red Hat & CentOS 6

Post by knight-of-ni »

UPDATE Sep 5, 2014
DEPRECIATED

The steps outlined in this post are now depreciated in favor of the newly developed zmrepo repository.

Instructions for the new repository have been placed in the WiKi:
http://www.zoneminder.com/wiki/index.ph ... ed_distros

For those that have previously used the method described below, first disable the rpmforge, rpmfusion, and epel repos and then follow the WiKi instructions to add zmrepo to your system. I recommend you keep yum priorities installed and assign zmrepo a priority that is lower (i.e. higher number) than the rest of your installed repo(s).

------------------------------------------------------------------------------------------------------------------------------------------------------
IMPORTANT: You must follow ALL of the instructions below BEFORE you install the zoneminder rpm.
These zoneminder rpms will not install or work properly if you do not first set up your system according to what is stated under prerequisites!

UPDATE Mar 15, 2014
Zoneminder 1.27.0 Released!
This release contains additional camera support via the new libvlc and libcurl methods.
A new tool, zmcamtool.pl, has been added to allow one to import and export camera and ptz configs.

Cambozola has been integrated into the zoneminder package, and thus it is no longer necessary to install separately.
Please report any issues.

Zoneminder 1.27
IMPORTANT: If you are upgrading, note the repositories have changed! See the section titled Prerequisites.
Zoneminder 1.26
This is the latest version of ZoneMinder. Please test these and provide feedback!
Please report any package related issues to this thread and report any other issues here.

Prerequisites
Before you can install any of the ZoneMinder rpm's, you must add the following prerequisites.
NOTE: The perl-Sys-Mmap rpms listed above contain a special bugfix related to the use of zmtrigger and the x10 modules.
See issue 295 on github: https://github.com/ZoneMinder/ZoneMinder/issues/295

SELinux
The ZoneMinder RPM's will automatically create and install a custom SELinux policy module.
You may run SELinux in any mode you would like. If you discover any SELinux issues with ZoneMinder, please report them to this thread.
Please post the relevant AVC messages from your system log files per the instructions found here:
http://wiki.centos.org/HowTos/SELinux#h ... 191c257c01

Installation
First, my apologies. Zoneminder now requires three repositories to be added to your system, and unfortunately these repos do conflict with one another so care must be taken. I believe, however, that the added complexity I am about to describe will be worth it. The RPM Fusion repo contains newer versions of vlc and ffmpeg, which I have found to give significantly better camera support.

Follow these steps to install the ZoneMinder RPM:
  1. Add all three repositories listed under Prerequisites to your system, but do not perform a yum update yet!
  2. Install Yum Priorities onto your system by executing the following:

    Code: Select all

    sudo yum install yum-plugin-priorities
  3. Read the instructions for using yum priorities and then assign the following priorities to your repos:
    Base -> priority=1
    Updates -> priority=1
    RPM Fusion -> priority=10
    EPEL -> priority=20
    RPMForge -> priority=30
  4. Manually download and install the perl modules listed under Prerequisites. Yes, you have to install every one of these even if you aren't planning to use x10.

    Code: Select all

    sudo yum install perl-X10-0.03-1.noarch.rpm perl-Astro-SunTime-0.01-1.noarch.rpm perl-Sys-Mmap-0.14-2.el6.x86_64.rpm
  5. Users Upgrading from a previous ZoneMinder RPM must now perform a "sudo yum update" to upgrade the versions of vlc, ffmpeg, and their dependencies. It will fail, but take note of the failed dependencies. You must now manually remove the conflicting packages. Refer to the Troubleshooting section below for instructions on removing the conflicting packages.
  6. Install the ZoneMinder RPM.

    Code: Select all

    sudo yum install zoneminder-1.27.0-1.el6.x86_64.rpm
  7. Finish the installation by following the steps outlines in the README.CentOS file. These instructions can be found on your local hard drive under /usr/share/doc/zoneminder. The latest copy of this file can always be found here: https://github.com/ZoneMinder/ZoneMinde ... DME.CentOS
Troubleshooting
GENERAL
Please read! The following is more of a general note. I've noticed in the forums that some of you are going off track a bit. The intent behind what I am providing here is to remove all, 100%, of the need to compile anything at all to get your zoneminder system installed and working. This includes the perl modules!

To put it another way, if you run into an issue and think you need to compile something from source or CPAN then stop! Re-read the instructions sated above and make sure you've got all the prerequisites installed properly. If you believe you have everything in order then please post to the end of this thread, and I'll take a look at it.

RESOLVING CONFLICTS
After adding the new RPM Fusion repo to their system, users attempting to upgrade a previous installation may notice repo conflicts when attempting to use yum. The basic method to fix these is to note the names of the packages that yum is complaining about and then remove them manually like so:

Code: Select all

sudo rpm -e --nodeps <name of package yum complained about>
Rinse and repeat until "yum update" completes successfully.

On my system, the error message looked like this:
Transaction Check Error:
file /usr/lib64/libpostproc.so.51.2.0 from install of ffmpeg-compat-0.6.7-1.el6.x86_64 conflicts with file from package ffmpeg-libpostproc-0.6.5-1.el6.rf.x86_64
I resolved it, but executing the following command, followed by another "yum update":

Code: Select all

sudo rpm -e --nodeps ffmpeg-libpostproc
Your system will now have much more recent versions of VLC and FFMPEG on it. This is a very good thing.
Last edited by knight-of-ni on Tue Oct 21, 2014 10:48 pm, edited 50 times in total.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Zoneminder RPM & SRPMS for Red Hat & CentOS 6

Post by knight-of-ni »

Almost forgot.

This RPM will place Zoneminder files in places you might not expect.
Its done that way to conform to the CentOS/RedHat way of doing things.

For starters, the html files are placed here:
/usr/share/zoneminder/www

And then Aliased into Apache as "/zm"

This is done in the following file:
/etc/httpd/conf.d/zoneminder.conf
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
ozbren
Posts: 1
Joined: Wed Apr 18, 2012 12:44 am

Re: Zoneminder RPM & SRPMS for Red Hat & CentOS 6

Post by ozbren »

Kudos knnniggett

I successfully installed on Scientific Linux 6.2 with ffmpeg-0.6.5-1 from rpmforge and your zoneminder 1.25 RPM. Much appreciated.

I added one line to the zoneminder.conf httpd/apache file:
ScriptAlias /cgi-bin/nph-zms "/usr/libexec/zoneminder/cgi-bin/nph-zms"
as my feeds weren't showing in the browser and they were looking for this binary. Not sure if other people will need the same, but just adding in case.
TheShniz
Posts: 6
Joined: Tue Apr 19, 2011 9:34 pm

Re: Zoneminder RPM & SRPMS for Red Hat & CentOS 6

Post by TheShniz »

I've got both rpmforge & epel repos installed and tested working, but... when I try to install the rpm of zoneminder, I keep getting:

Code: Select all

cambozola is needed by zoneminder-1.25.0svn3639-1.el6.x86_64
libavcodec.so.52()(64bit) is needed by zoneminder-1.25.0svn3639-1.el6.x86_64
libavcodec.so.52(LIBAVCODEC_52)(64bit) is needed by zoneminder-1.25.0svn3639-1.el6.x86_64
libavdevice.so.52()(64bit) is needed by zoneminder-1.25.0svn3639-1.el6.x86_64
libavformat.so.52()(64bit) is needed by zoneminder-1.25.0svn3639-1.el6.x86_64
libavformat.so.52(LIBAVFORMAT_52)(64bit) is needed by zoneminder-1.25.0svn3639-1.el6.x86_64
libavutil.so.50()(64bit) is needed by zoneminder-1.25.0svn3639-1.el6.x86_64
libavutil.so.50(LIBAVUTIL_50)(64bit) is needed by zoneminder-1.25.0svn3639-1.el6.x86_64
libswscale.so.0()(64bit) is needed by zoneminder-1.25.0svn3639-1.el6.x86_64
libswscale.so.0(LIBSWSCALE_0)(64bit) is needed by zoneminder-1.25.0svn3639-1.el6.x86_64
libx264.so.107()(64bit) is needed by zoneminder-1.25.0svn3639-1.el6.x86_64
It doesn't even appear to be trying to resolve the dependencies (this is on CentOS 6.3).
Any ideas?

- J
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Zoneminder RPM & SRPMS for Red Hat & CentOS 6

Post by knight-of-ni »

Here are a new set of RPM's.

ffmpeg is now listed as a requirement for this rpm (fixes the issue in the previous post). If you use Yum then it will automatically grab it from the rpmforge repository. It also checks to make sure you have the right version, but if you are using the ffmpeg from rpmforge then there won't be a problem.

RPM:
zoneminder-1.25.0svn3827-2.el6.x86_64.rpm
All dependencies are (should be) taken care of. Mysql, ffmpeg, perl modules, etc... when using yum to install this rpm, they will all get downloaded and installed for you. Well, except for Cambozola. See Below.

SRPM:
zoneminder-1.25.0svn3827-2.el6.src.rpm

Cambolzoa (Required by zoneminder):
cambozola-0.92-6.el6.noarch.rpm
The Cambozola RPM is a straight rebuild of the latest package I could find in the Fedora repositories.

Here are some very basic install steps when starting from a fresh install of CentOS:
  • Recommend Disable SELinux
  • yum update
  • install rpmforge & epel repositories
  • yum install libjpeg-turbo
  • yum localinstall --nogpgcheck cambozola-0.92-6.el6.noarch.rpm
  • yum localinstall --nogpgcheck zoneminder-1.25.0svn3827-1.el6.x86_64.rpm
  • Follow the steps to create the database
  • Modify /etc/httpd/conf.d/zoneminder.conf to allow remote access (it's off by default)
  • Restart httpd
  • Start zoneminder
08/07/13 EDIT:
Discovered a problem. Despite the fact that this worked fine with previous builds, if building svn3827 with ZM_SSL_LIB="openssl" then AUTH_RELAY would not work correctly if set to "hashed". Symptoms were zms would segfault and no live image would appear in the monitor. Rebuilding with gnutls, instead, resolved the issue. The links above have been modified to point to the latest RPM's without this issue.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Zoneminder RPM & SRPMS for Red Hat & CentOS 6

Post by knight-of-ni »

This RPM represents the kifr-proper branch on github.

Per the github summary page, this is nextime's feature branch from https://github.com/nextime/zum, with perfpatches from masteroftheknife, plugin support and other patches.

As with the previous RPM's, the source has been patched to make it more RHEL/CentOS compliant.

RPM:
zoneminder-1.25.0kfirproper-2.el6.x86_64.rpm

SRPM:
zoneminder-1.25.0kfirproper-2.el6.src.rpm

Note that I do not consider these to be entirely error free. They appear to be running fine on my system, but I'd like your feedback if you see anything out of the ordinary.

If you are installing over an existing 1.25 system, be aware of the following:
  • You may have to force the installation on top of your existing like this: rpm-Uvh --force zoneminder-1.25.0kfirproper-1.el6.x86_64.rpm
  • You will need to alter the mysql schema from the command line like this:

    Code: Select all

    mysql -uroot -p

    Code: Select all

    ALTER TABLE `Monitors` ADD `Colours` TINYINT UNSIGNED NOT NULL DEFAULT '1' AFTER `Height`;
    ALTER TABLE `Monitors` ADD `Deinterlacing` INT UNSIGNED NOT NULL DEFAULT '0' AFTER `Orientation`;
    ALTER TABLE `Controls` MODIFY column Type enum('Local', 'Remote', 'File', 'Ffmpeg') not null default 'Local';
    exit;
  • When starting the zoneminder service for the first time, you may get the following error messge:

    Code: Select all

    No option 'ZM_LOCAL_BGR_INVERT' found, removing at /usr/share/perl5/ZoneMinder/ConfigAdmin.pm line 89.
    No option 'ZM_V4L2_CAPTURE_FIELDS' found, removing at /usr/share/perl5/ZoneMinder/ConfigAdmin.pm line 89.
    No option 'ZM_Y_IMAGE_DELTAS' found, removing at /usr/share/perl5/ZoneMinder/ConfigAdmin.pm line 89.
    This message appears after starting the service for the first time only. These variables appear to no longer be used.
EDIT:
Please read the previous posts that discuss the repository requirements and don't forget to download cambozola as well.
Last edited by knight-of-ni on Sat Aug 17, 2013 5:53 pm, edited 1 time in total.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
christophe_y2k
Posts: 102
Joined: Mon Oct 12, 2009 8:47 am
Location: EUROPE-FRANCE-MANDELIEU

Re: Zoneminder RPM & SRPMS for Red Hat & CentOS 6

Post by christophe_y2k »

Hi, could you send an tar.gz for manual installation ?
and if you have an svn sources ...

see you :wink:
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Zoneminder RPM & SRPMS for Red Hat & CentOS 6

Post by knight-of-ni »

The source code is from the kfir-proper branch. You can download that here if all you want is the source:
https://github.com/ZoneMinder/ZoneMinde ... fir-proper

Zip download button is on the right-middle-bottom

If you also want to look at the rpm spec file and the various patches, then download the source rpm from the provided link.

Once you download the srpm, then do this as a normal uiser (not root):

Code: Select all

rpm -ivh zoneminder-1.25.0kfirproper-2.el6.src.rpm
It should put the source, the spec file, and the patch files under your home folder.
From what I can tell Gentoo can read RPM's.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Zoneminder RPM & SRPMS for Red Hat & CentOS 6

Post by knight-of-ni »

And here we have Zoneminder 1.26.0 Beta

This does contain performance patches from masteroftheknife.

As with the previous RPM's, the source has been patched to make it more RHEL/CentOS compliant.

RPM:
zoneminder-1.26.0beta-2.el6.x86_64.rpm

SRPM:
zoneminder-1.26.0beta-2.el6.src.rpm

EDIT:
Please read the previous posts that discuss the repository requirements and don't forget to download cambozola as well.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
mastertheknife
Posts: 678
Joined: Wed Dec 16, 2009 4:32 pm
Location: Israel

Re: Zoneminder RPM & SRPMS for Red Hat & CentOS 6

Post by mastertheknife »

Tested the RPM on a fresh CentOS 6.4 x86-64 installation with just nfs, samba, ntpd and httpd installed:
https://gist.github.com/mastertheknife/6363545

It pulls too many dependencies though. I definitely do not need libX11, mesa and gtk on my server box.

mastertheknife
Kfir Itzhak.
mastertheknife
Posts: 678
Joined: Wed Dec 16, 2009 4:32 pm
Location: Israel

Re: Zoneminder RPM & SRPMS for Red Hat & CentOS 6

Post by mastertheknife »

Okay, for local cameras, there is one extra step:

Code: Select all

gpasswd -a apache video
And the selinux policy isn't working properly. ZM will show in console as "Stopped" despite all processes running just fine. Also its not possible to view events. Switching selinux to permissive mode solves these issues for now:

Code: Select all

setenforce 0
We are missing few syscalls in the policy. I will work on it.
Kfir Itzhak.
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Zoneminder RPM & SRPMS for Red Hat & CentOS 6

Post by knight-of-ni »

mastertheknife wrote:Tested the RPM on a fresh CentOS 6.4 x86-64 installation with just nfs, samba, ntpd and httpd installed:
https://gist.github.com/mastertheknife/6363545

It pulls too many dependencies though. I definitely do not need libX11, mesa and gtk on my server box.

mastertheknife
Yeah, that's kind of annoying when some package tries to pull in a bunch of X libs onto your server.

Looks like those dependencies are coming from java, required by cambozola. Not sure exactly what I can do about that, but I'll see if I can find a package with a /usr/bin/java that doesn't require those X dependencies.

mastertheknife wrote:Okay, for local cameras, there is one extra step:

Code: Select all

gpasswd -a apache video
Done.
mastertheknife wrote: And the selinux policy isn't working properly. ZM will show in console as "Stopped" despite all processes running just fine. Also its not possible to view events. Switching selinux to permissive mode solves these issues for now:

Code: Select all

setenforce 0
We are missing few syscalls in the policy. I will work on it.
Thanks for the help. Despite having used redhat based products for many years, I have never taken the time to truly understand how to configure selinux. The disable button is just too easy to push.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Zoneminder RPM & SRPMS for Red Hat & CentOS 6

Post by knight-of-ni »

While I was able to eliminate some of the X library dependencies by specifying the java requirement as "java-1.6.0-openjdk" rather than just "java", I was not able to eliminate them all. Consequently, I removed Cambozola as a dependency, since it was only needed for Internet Explorer as far as I know.

So the only dependency left is mesa, but that is required by the ffmpeg build in the rpmforge repository. At the moment, I don't know of an easy way to work around that. I noticed a different repository, called rpmfusion, has newer versions of ffmpeg, but that isn't something I plan to look into for the short term beta test.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
mastertheknife
Posts: 678
Joined: Wed Dec 16, 2009 4:32 pm
Location: Israel

Re: Zoneminder RPM & SRPMS for Red Hat & CentOS 6

Post by mastertheknife »

knnniggett wrote:While I was able to eliminate some of the X library dependencies by specifying the java requirement as "java-1.6.0-openjdk" rather than just "java", I was not able to eliminate them all. Consequently, I removed Cambozola as a dependency, since it was only needed for Internet Explorer as far as I know.

So the only dependency left is mesa, but that is required by the ffmpeg build in the rpmforge repository. At the moment, I don't know of an easy way to work around that. I noticed a different repository, called rpmfusion, has newer versions of ffmpeg, but that isn't something I plan to look into for the short term beta test.
Ah, a bit late, too bad not earlier! This is how i managed to get rid of cambozola (without getting it to remove ZM) and to get rid of all its dependencies (just java actually, but java has lots of dependencies) as well:

Code: Select all

rpm -e --nodeps cambozola
yum install yum-plugin-remove-with-leaves
yum remove --remove-leaves java
Yeah, i agree, removing cambozola as a dependency is the correct thing to do. BTW, i'm not sure why does cambozola need java as a dependency? it only needs java on the client, not the server. cambozola is just a file that is downloaded by the client, it should have zero dependencies.

Mesa isn't bad. At least we got rid of java and plenty other packages:

Code: Select all

[root@atom pluginconf.d]# yum remove --remove-leaves java
....
Removed:
  java-1.5.0-gcj.x86_64 0:1.5.0.0-29.1.el6                                      

Dependency Removed:
  atk.x86_64 0:1.28.0-2.el6                                                     
  cairo.x86_64 0:1.8.8-3.1.el6                                                  
  fontconfig.x86_64 0:2.8.0-3.el6                                               
  freetype.x86_64 0:2.3.11-14.el6_3.1                                           
  gtk2.x86_64 0:2.18.9-12.el6                                                   
  hicolor-icon-theme.noarch 0:0.11-1.1.el6                                      
  jasper-libs.x86_64 0:1.900.1-15.el6_1.1                                       
  java_cup.x86_64 1:0.10k-5.el6                                                 
  jpackage-utils.noarch 0:1.7.5-3.12.el6                                        
  libICE.x86_64 0:1.0.6-1.el6                                                   
  libSM.x86_64 0:1.2.1-2.el6                                                    
  libXcomposite.x86_64 0:0.4.3-4.el6                                            
  libXcursor.x86_64 0:1.1.13-2.el6                                              
  libXft.x86_64 0:2.3.1-2.el6                                                   
  libXi.x86_64 0:1.6.1-3.el6                                                    
  libXinerama.x86_64 0:1.1.2-2.el6                                              
  libXrandr.x86_64 0:1.4.0-1.el6                                                
  libXrender.x86_64 0:0.9.7-2.el6                                               
  libXtst.x86_64 0:1.2.1-2.el6                                                  
  libart_lgpl.x86_64 0:2.3.20-5.1.el6                                           
  libgcj.x86_64 0:4.4.7-3.el6                                                   
  libthai.x86_64 0:0.1.12-3.el6                                                 
  pango.x86_64 0:1.28.1-7.el6_3                                                 
  pixman.x86_64 0:0.26.2-5.el6_4                                                
  sinjdoc.x86_64 0:0.5-9.1.el6                                                  
  zip.x86_64 0:3.0-1.el6                                                        

Complete!
mastertheknife
Kfir Itzhak.
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Zoneminder RPM & SRPMS for Red Hat & CentOS 6

Post by knight-of-ni »

The spec file originally came from Fedora so I just went along with the basic framework in which they were doing things. Requiring Cambozola as a standalone rpm package was one of them. In hindsight, it sure seems like a lot of extra dependencies for just one file, so I made the following change.

The only file we really need, cambozola.jar, has been extracted from the source tar-ball and incorporated into the zoneminder rpm. I also included the cambozola documentation files to keep things kosher.

Download links have been updated to the new rpms.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
Post Reply