Saturday, May 06, 2006

Minding it

I am experimenting with Zoneminder . It looks like a promising digital video recorder (DVR) for closed circuit cameras. My interest is primarily for IP based cameras. In theory, this should be easy. IP based cameras usually have a URL that you could pick up frames or even video streams. So building a DVR software should not be that difficult.
I always start with an RPM because I use Mandriva and this helps keeps updates in check. Also I respect the fact that someone invested time in building a package, so why reinvent the wheel. There were RPMs for Mandriva and tried those. I read the instructions in the manual and strangely enough there were instructions on what to do before installing. Wait a minute, isn't an RPM supposed to handle this. That is one of the points of using an RPM. But the request wasn't demanding, just that apache, mysql and php be installed. So I did that. Installing it using urpmi should have resolved dependancies but I wanted to choose which version to be installed anyway and the GUI tool was better at that. When I finally used urpmi to install it, it complained of some missing perl libraries. Great, I thought, a trek to CSPAN to download the libraries and compile them by hand. I later found out that the libraries were for an optional component and not really necessary. But even after the rpm was installed, the instruction asked me to manually edit a file and run a configuration program.. which was broken. Apparently the package author decided to use MySQL-Max and put in code to detect the version of MySQL that was running. At least he made it easier by clearly marking the offending section in the script file with #FIX ME. Finally, I managed to get the components running and configured the program to capture images from my IP camera.
Or so I thought. I couldn't figure out why my settings would not work when I have read the manuals (two of them) and follows almost every instruction there is. I checked the logs and I found out that the program that was picking up the images was crashing. Apparently it requested memory space incorrectly. Wait a minute, this was serious. This is a beta-level error on a 1.2++ version. Problems with memory allocation should have been delt with a long time ago. This only means one thing.. recompile.
I got the latest STABLE sources and tried to compile it. It got worse. The configure command still required parameters passed in.. for the default web directory and location for mysql? If it can't detect that, what is the program actually doing? The more I fed it CLI parameters, the more it asked. In the end there was about 10 odd CLI parameters. And it still wouldn't compile, complaining about the c compiler unable to create executables! What?!
I little more reading led me to a more stable version, a couple of revisions back. No more c compiler complaints. Now it was the normal missing library files that had to be installed, specifically libjpeg.a (libjpeg), libz.a (zlib-devel) and libmysqlclient.a (libmysql-devel). Configure exited and asked to run a configuration program. Which did a lot of what confgure is supposed to do, esp when it came to component detection. It asked a lot of questions, nearly 30 in all. Most of them should have just been set to default. Too late already. Will compile tommorow.
Lessons Learnt.
  1. Good practise for building packages is to seperate the core and optional components.
  2. When building a package make sure all dependancies are included.
  3. Set up DEFAULTS!!
Oh, I am tired.

No comments:

Post a Comment

Recently Popular