Rebuilding Zoneminder-mp package from zoneminder (non mp) source rpm for openSuse Tumbleweed

Forum for questions and support relating to the 1.30.x releases only.
Locked
User avatar
emailej
Posts: 21
Joined: Wed Aug 24, 2016 12:31 am

Rebuilding Zoneminder-mp package from zoneminder (non mp) source rpm for openSuse Tumbleweed

Post by emailej »

I've been struggling for a while to get Zoneminder-mp installed on openSuse Tumbleweed. In the end I had to rebuild from source rpm so I thought I'd share my leanings with very step-by-step instructions. This is my first run at building rpms so if anyone sees anything stupid or has suggestions to optimize please chime in. Also I tried to include instructions for doing things via yast, or in terminal depending on your preference.


Prerequisites; since we are building the Zoneminder-mp package you should have the openSuse tumbleweed packman repository configured and ffmpeg installed. There may be other libav___devel dependencies you need but those can be installed later if the rebuild fails and asks for them.

Setup rpmbuild user (not 100% necessary but recommended as it keeps rpm build environment isolated from normal user):

- Using Yast click "User and Group Management", then "Add." Enter "rpmbuild" and password and click "OK"

or

- In terminal:

Code: Select all

ej@localhost:~> sudo useradd rpmbuild
and create/change password for new user

Code: Select all

ej@localhost:~> sudo passwd rpmbuild
- Create directory structure for rpmbuild:

Code: Select all

ej@localhost:~> su rpmbuild
    rpmbuild@localhost:/home/ej> cd ~
    rpmbuild@localhost:~> mkdir rpmbuild
    rpmbuild@localhost:~> cd rpmbuild/
    rpmbuild@localhost:~/rpmbuild> mkdir SRPMS OTHER RPMS BUILDROOT BUILD SPECS SOURCES
Install rpm-build package and dependencies:

- Always a good idea to update all packages with

Code: Select all

ej@localhost:~> sudo zypper update
,

or via yast Software Management click "Package" menu, "All Packages," "Update if newer version available."

- Using yast Software Management to install rpm-build package:

Click "View > Patterns" and select "RPM Build Environment" (you may also need to have "Base Development" "C/C++" "Linux Kernel Development" and possibly others installed as I had these already installed before I started the rebuild process).
-Click Accept to install the packages, and then "Finish"

- Using zypper:

Code: Select all

ej@localhost:~> sudo zypper search -t pattern 
(to list patterns), and then

Code: Select all

ej@localhost:~> sudo zypper in -t pattern devel_rpm_build
to install the pattern(s). Repeat for other patterns you may need.

-Rebuild the package from source using rpmbuild:

Go to

https://build.opensuse.org/package/bina ... Tumbleweed

and under Architecture: x86_64 find the ZoneMinder-1.30.4-3.3.src.rpm (or latest version). On the right click Download. In order to download, you will need to login if you have an account, or sign up and login if you dont.

- In terminal and as rpmbuild user cd to your rpmbuild root directory:

Code: Select all

rpmbuild@localhost:/> cd ~/rpmbuild/
- Copy the .src.rpm there:

Code: Select all

rpmbuild@localhost:/> cp ~/Downloads/ZoneMinder-1.30.4-3.3.src.rpm .
- Rebuild the package using rpmbuild and --with mp_package:

Code: Select all

rpmbuild@localhost:~/rpmbuild> rpmbuild --rebuild ZoneMinder-1.30.4-3.3.src.rpm --with mp_package

If the rebuild fails due to missing dependencies (failed for me on the first try) install them via yast or zypper and try again. The build should take several minutes to complete. You should have new rpm files written to your ~/rpmbuild/RPMS/x86_64 directory:

Code: Select all

rpmbuild@localhost:~/rpmbuild> ls -alsrt -R RPMS/
RPMS/:
total 0
0 drwxr-xr-x 9 rpmbuild users 139 Jun 21 07:52 ..
0 drwxr-xr-x 3 rpmbuild users  20 Jun 21 07:53 .
0 drwxr-xr-x 2 rpmbuild users 157 Jun 21 07:53 x86_64

RPMS/x86_64:
total 27900
    0 drwxr-xr-x 3 rpmbuild users       20 Jun 21 07:53 ..
 7112 -rw-r--r-- 1 rpmbuild users  7278980 Jun 21 07:53 ZoneMinder-MP-1.30.4-3.3.x86_64.rpm
  188 -rw-r--r-- 1 rpmbuild users   189640 Jun 21 07:53 ZoneMinder-MP-debugsource-1.30.4-3.3.x86_64.rpm
    0 drwxr-xr-x 2 rpmbuild users      157 Jun 21 07:53 .
20600 -rw-r--r-- 1 rpmbuild users 21090380 Jun 21 07:54 ZoneMinder-MP-debuginfo-1.30.4-3.3.x86_64.rpm
- Install the newly built package: (I have a local rpm directory configured as repository in yast so I just copied the files there, and I did this using my normal user)

Code: Select all

ej@localhost:~> cd local_rpms/
    ej@localhost:~/local_rpms> cp /home/rpmbuild/rpmbuild/RPMS/x86_64/ZoneMinder-MP-* .
and installed via yast Software Management.

Finally, follow instructions on Zoneminder Wiki

https://wiki.zoneminder.com/Installing_ ... s_for_SuSE

to get everything configured and setup. There are no instructions specific to tumbleweed as of this writing but just follow instructions for "openSUSE 12.1 and newer (systemd)."

That's it. You should now have a working install of zoneminder-mp on openSUSE Tumbleweed. Its pretty easy once you figure it out so I hope this helps.

Cheers,

Eric
Locked