Comment # 21 on bug 4393 from
I've made further progress on this.

(In reply to Xavier Bachelot from comment #19)
> A couple more comments on the spec...
> 
> - Which supported distro/releases don't have %make_build ?
>   Thus, is this really needed :
> """
> # In some cases older distros do not have this macro defined
> %{!?make_build: %global make_build %{__make} %{?_smp_mflags} }
> """

A stock CentOS 6 does not have this macro defined in the rpm macro file.
Instead, one must install the "epel-rpm-macros" package which defines
%make_build. This won't affect the rpmfusion build system, and there is only a
small chance an end user might run into if/when building locally. i.e. me.
In any case, I've gone ahead and removed the line in question from the spec
file as I don't think it is worth adding epel-rpm-macros as a centos6-only
buildrequires.


> - I believe the with_php_mysqlnd and with_php_mysql can be replaced by a
> simple "Requires: php-mysqli" which is a virtual provides for the proper
> package depending on the distro/release.
> 

There does not appear to be php-mysqli package in fedora or rhel. dnf/yum
install/whatprovides returns no package found. 

> - Isn't "%global _hardened_build 1" the default anyway ?
>   

This became the default beginning with F23, but it is not the default in EL7.
I've gone ahead and removed it from the specfile. I'm not sure this had any
effect on EL7 anyway since the macro definition is commented out in the rpm
macro file on EL7.

> - Source: should be a full URL. I realize that 1.30.1 was not released nor
> even tagged, I assume that's the reason, but this needs to be fixed. You
> might also want to use the more common Source0 rather than Source.
> 

Completed.

> - Multiple (Build)Requires: on one line are not very legible.
> 

Completed.

> - The added Requires: are most probably already auto-detected at build time.
> Only add the ones that are not autodetected, if any.
> 

After building zoneminder with the current list of Requires and then again
without any of them, I did a comparison. I was able to remove a few unnecessary
Requires. The Requires still showing in the specfile are not auto-detected and
definitely are needed for zoneminder to function correctly. Some packages are
easy to explain why rpm could not autodetect them while others, like the perl
modules, I can't explain at all why rpm did not pick them up. We can go through
them one by one, if you really want to.

> - Unless I'm missing something
> """
> %dir %{_libexecdir}/zoneminder
> %{_libexecdir}/zoneminder/cgi-bin
> %dir %{_datadir}/zoneminder
> %{_datadir}/zoneminder/db
> %{_datadir}/zoneminder/www
> """
>   can be written as
> """
> %{_libexecdir}/zoneminder/
> %{_datadir}/zoneminder/
> """

Completed.

> - Use macros in the paths for 
> %dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/log/zoneminder
> %dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/spool/zoneminder-upload
> %dir %attr(755,%{zmuid_final},%{zmgid_final}) %ghost /var/run/zoneminder
> 

Completed.

> - No need to use %attr(644,root,root) or %attr(755,root,root), this is the
> default (unless the install script don't do the right thing).
> 
> 

I still need to verify this. In the past there have been issues with
permissions on certain files not being set correctly, which is why they are
being forced in the specfile. We have since switched to building with cmake,
rather than make, and I have not verified what still needs to be forced and
what does not.


location of latest specfile:
https://github.com/ZoneMinder/ZoneMinder/blob/master/distros/redhat/zoneminder.spec

same thing, just raw text:
https://raw.githubusercontent.com/ZoneMinder/ZoneMinder/master/distros/redhat/zoneminder.spec


You are receiving this mail because: