HOME
CONTACT

Click Here Software Co

Creating computer software
Since 1983

ZoneMinder130 Home --> source code

ZoneMinder130 Source Code

Current Release V1.30.13-1
Released December 5, 2024

This page is for those who wish to build the ZoneMinder130 deb file rather than downloading and installing the deb file that is already prepared for you. You might do this if your system is similar to one of the supported Debian or Ubuntu systems, but not quite the same. It is rather easy to adapt the source to work on most any Debian based system. If you wish to build the ZoneMinder130 deb file yourself, it's easy because I've done all the hard work for you. Be sure to do the development on the same machine you intend to run ZoneMinder130 on or at least on a machine that is running the same Debian or Ubuntu version as the one you will be compiling for.

Download the source tarball you wish to work on and follow the instructions below.

Debian 11 bullseye

Debian 12 bookworm

Debian 13 trixie

Ubuntu 22.04 jammy

Ubuntu 24.04 noble

Before proceeding, the build process needs to enter your name and email address into the deb package. This is a Debian and Ubuntu requirement. So, in your home directory, edit the .bashrc file. Load it into a text editor such as pico:


pico .bashrc

Scroll to the bottom of the text and add the following lines:


DEBEMAIL="yourname@youremail.com"
DEBFULLNAME="Firstname Lastname"
export DEBEMAIL DEBFULLNAME

Enter your email address on the DEBMAIL line and your first name and last name on the DEBFULLNAME line. Then use CTRL-x to save the file and exit.

Make the above changes in the .bashrc file take effect by logging out and then logging back in.

Now that you have the file downloaded, prepare a location for the build process. In my case, I use /usr/local/src for the building of the deb package. In these instructions, that is the location we will use, but you can use whatever suits you. So, login as root and navigate to the following directory:


cd /usr/local/src

Next, create the root directory of our build location:


mkdir zoneminder130-dev

Next, copy the source code file you downloaded to this newly created directory and then navigate into the zoneminder130-dev directory and unpack the tar.gz file:


cd /usr/local/src/zoneminder130-dev
tar -xvf zoneminder130_1.30.13-1+deb12.orig.tar.gz

The above filename might be different than what you downloaded, depending on the version number, release number, and distro. For this example, we will use the above filename. Once unpacked you will find a directory named zoneminder130_release and a file name howtobuild.txt which is a copy of what you are reading right now. You won't have to keep referring to this web page. Just load that file into a text editor and follow along.

Navigate into the release directory:


cd zoneminder130_release

Next, we need to install all the development tools we will need along with all the dev dependencies and libraries that are needed. So, still as root, and during the very first time setting up this development machine, issue the following two commands:


apt install devscripts equivs
mk-build-deps -ir ./debian/control

The above two commands will not have to be repeated on this machine.

Then navigate above the development directory:


cd /usr/local/src

And assign your normal user to every file in the development directory:


chown -R username:username zoneminder130-dev/

Be sure to substitute your username on this machine in place of username in the command above.

You may now exit as root and login as the regular user that you changed ownership of the files to. You will always do the source editing and compiling as a normal user.

Enter the release directory:


cd /usr/local/src/zoneminder130-dev/zoneminder130_release

Next, do the following two commands only the first time or anytime after you have modified certain cmake files such as CMakeLists.txt or various config files or .in files:


debuild -- clean
cmake ./

After running cmake, delete the cache file or the build will fail with an error:


rm CMakeCache.txt

When you build the new package, any tar.gz file contained in the zoneminder130-dev directory will be deleted. So, if you still have the original source tar.gz file there, copy it to somewhere else in case you have to start all over again.

You are now ready to build the zoneminder130 deb package. You will use the build.sh script to do the building for you. Issue the following command. If you make changes to the source code, just use build.sh to build another package to test your changes.


./build.sh 1 nosign

A new deb file will be built and stored in the parent directory along with an updated version of the source code in a tar.gz file. The deb file will look something like this:

zoneminder130_1.30.13-1+deb12_amd64.deb

It will also create some or all of the following files:

zoneminder130_1.30.13-1+deb12_amd64.build
zoneminder130_1.30.13-1+deb12_amd64.buildinfo
zoneminder130_1.30.13-1+deb12_amd64.changes
zoneminder130_1.30.13-1+deb12.debian.tar.xz
zoneminder130_1.30.13-1+deb12.dsc

The only difference in the filenames might be the distro part.

The only file you really need is the deb file.

If you wish to change the version number, which in this case is 1.30.13, edit the "version" file.

If you wish to change the release number you will change it in the build.sh command line like this:


./build.sh 2 nosign

The nosign option will build the deb package without a need for signing it. You can do this since you are not sharing the package with anyone but yourself. If you wish to build a signed package, that will require a little more work so that you have a gpg signing key to work with.

The above example will make the new deb package with a filename that looks like this:

zoneminder130_1.30.13-2+deb12_amd64.deb

You can find the deb file one directory up. Log in as root or use sudo and use apt to install ZoneMinder130:


apt install /usr/local/src/zoneminder130-dev/zoneminder130_1.30.13-2+deb12_amd64.deb

If this is the first time doing the installation, apt will install all the dependencies required by ZoneMinder130 including apache2, ffmpeg, mariadb, perl, and php, as well as many other needed libraries and files.

If this is not the first time installing, then apt will perform an upgrade of ZoneMinder130. Just be sure to increment the release number to a higher number each time. For instance, use 3 the next time. If you edit the version file and change the version number to something like 1.30.500, you can then change the release number back to 1. If a version number is lower, or the release number is lower with the same version number, apt will see it as a downgrade.

The other options to the build.sh script are binary and nostrip. These are used in place of the nosign option. The binary option will create a signed deb package. The nostrip option will also create a signed deb package but without stripping the debug symbols from the binary files that are included in the package. The nosign option as used above is the one that most people will use as they are testing changes or just creating the package for their own use and not intending to share it with the rest of the world.

Building a signed package

It is not necessary to build a signed package unless you plan to release your own version of ZoneMinder130 and share it with the rest of the world such as in a respository that is accessed by apt. Before doing so, make sure you can build an unsigned package by following all the instructions up to this point. Make sure the package installs cleanly and runs well and without issues. Once you have done that, you can proceed to build a signed package. The only real difference is that the package will be signed and you will also have to supply a signing key to distribute with it.

To test if you already have a key to use, test it with the build.sh script as follows:


./build.sh 1 binary

If the build went all the way through and asked you for a password and finished without errors, then you have already created a signing key for your email address and you need not go any further. If it failed due to not finding a key, you will have to create one. There are many sites on the internet that explain this, some explain it well and some just go off in many different directions and fail to explain it clearly. This might be a good one to check:

keyring.debian.org/creating-key.html

And if you have any problems, please try to figure it out yourself. You might have made a change that you forgot about and finding it and undoing that change can be time consuming. Making changes to the source code of ZoneMinder130 can be very tricky. Make your changes carefully. Several different people have been involved in the original ZoneMinder project over the years. Some of the code formatting still needs some cleaning up. I haven't taken the time to clean it all up yet as there is so much of it. It was very difficult for me to figure out all the parts that I needed to work on. There is still a lot more that I want to do and I will tackle each part as I go along.

Have fun...

Maurice Randall