Compile directive ZM_CGIDIR is not interpreted correctly
The INSTALL information for ZM_CGIDR says that this directive defines the directory for the cgi-bin files. I set this to /srv/www/cgi-bin/zoneminder for an OpenSuse installation and eventually found that the two zms files had been placed in the directory as specified but the data in the zm_create.sql for ZM_PATH_ZMS had /cgi-bin/nph-zms, i.e. the zoneminder part had been left out.
Whilst it may not be necessary to specify a sub-directory to cgi-bin it would be very helpful if the compile did the same thing for both the install location and the database entry. If the problem is that there is an expectation that the path ends in cgi-bin then an update to the INSTALL documentation would be helpful.
One cannot create ZM_PATH_ZMS based on ZM_CGIDIR alone. The Apache ScriptAlias must also be known, which it is not in the general case.
We currently address the ScriptAlias and overriide ZM_PATH_ZMS with information from the distro subfolder for the distro in question. See where I'm going with this? :-)
I am reasonably confident that this problem actually showed up from an rpm I had built, within which was the ScriptAlias of /srv/www/cgi-bin/zoneminder, but to be on the safe side I will repeat the exercise.
Having said that, I'm not sure I understand why a configuration parameter for cmake needs a second place to hold the same information as far as the build is concerned. I realise that from a run-time perspective separate files need to be consistent with each other but otherwise I wouldn't have expected to find that a compile time directive resulted in different output in different places.
From: Andrew Bauer [mailto:[email protected]] Sent: 16 March 2014 13:41 To: ZoneMinder/ZoneMinder Cc: David Wilcox Subject: Re: [ZoneMinder] Compile directive ZM_CGIDIR is not interpreted correctly (#347)
One cannot create ZM_PATH_ZMS based on ZM_CGIDIR alone. The Apache ScriptAlias must also be known, which it is not.
We currently address the ScriptAlias and overriide ZM_PATH_ZMS with information from the distro subfolder for the distro in question. See where I' going with this? :-)
Reply to this email directly or view https://github.com/ZoneMinder/ZoneMinder/issues/347#issuecomment-37764021 it on GitHub. <https://github.com/notifications/beacon/6486570__eyJzY29wZSI6Ik5ld3NpZXM6Qm VhY29uIiwiZXhwaXJlcyI6MTcxMDYxMDgzOCwiZGF0YSI6eyJpZCI6Mjc3OTk1NDZ9fQ==--876b 0d5ef4461d31030301995fc45b364278eecc.gif>
You've made an assumption that these two values are the same information, and I'm saying that this is not the case. The compile time directive only sets ZM_CGIDIR, the physical path where the scripts should go. It does not set ZM_PATH_ZMS, and this is by design. While the two look similar, they are not the same thing.
What you are arguing is that, if ZM_CGIDIR = /srv/www/cgi-bin/zoneminder then ZM_PATH_ZMS must be /cgi-bin/zoneminder/nph-zms, and I'm saying that is not necessarily true. It could be /some/made/up/link if the end user (or some distro) had a complicated web server and needed it to be that way. The relationship between the two values is determined by the Apache ScriptAlias directive, usually found in a file like this: httpd/conf.d/zoneminder.conf, but that file may be something different for OpenSuse.
There are three pieces of information zoneminder needs: ZM_CGIDIR ZM_PATH_ZMS ScriptAlias Directive
Only if we know two of these pieces of information can we accurately determine the third.
I have repeated the build process with ZM_CGIDIR set to /srv/www/cgi-bin/zoneminder and the ScriptAlias set in a zoneminder.conf file for apache and still ZM_PATH_ZMS is being set to /cgi-bin/nph-zms. I can't identify anything in the build process which might modify the value in zm_create.sql. Is there an issue here because there is a presumption that the directory name ends in cg-bin?
In this case there isn't a variable you can set at build time (pull requests to change this are welcome). You have to patch ConfigData.pm.in and apply that inside your rpm spec file like this: https://github.com/ZoneMinder/ZoneMinder/blob/master/distros/redhat/zoneminder-1.26.0-defaults.patch
There are several variables you will likely want to inspect and possibly change to fit OpenSuse packaging guidelines. I am planning to go over this with you in detail.
My guess is you're likely spending a lot of time, possibly just spinning your wheels, trying to figure things out. I highly recommend you create a pull request that places everything you currently have under distros/opensuse. Don't worry if it is finished or not. This way I can see what you've got, and I'll just tell you what needs to be done next.
I don't think it is critical that the two cgi files are under a specific zoneminder directory so can work with /srv/www/cgi-bin.
Will do as requested with regard to the other files.
From: Andrew Bauer [mailto:[email protected]] Sent: 18 March 2014 08:15 To: ZoneMinder/ZoneMinder Cc: David Wilcox Subject: Re: [ZoneMinder] Compile directive ZM_CGIDIR is not interpreted correctly (#347)
In this case there isn't a variable you can set at build time (pull requests to change this are welcome). You have to patch ConfigData.pm.in and apply that inside your rpm spec file like this: https://github.com/ZoneMinder/ZoneMinder/blob/master/distros/redhat/zonemind er-1.26.0-defaults.patch
There are several variables you will likely want to inspect and possibly change to fit OpenSuse packaging guidelines. I am planning to go over this with you in detail.
My guess is you're likely spending a lot of time, possibly just spinning your wheels, trying to figure things out. I highly recommend you create a pull request that places everything you currently have under distros/opensuse. Don't worry if it is finished or not. This way I can see what you've got, and I'll just tell you what needs to be done next.
Reply to this email directly or view https://github.com/ZoneMinder/ZoneMinder/issues/347#issuecomment-37925814 it on GitHub. <https://github.com/notifications/beacon/6486570__eyJzY29wZSI6Ik5ld3NpZXM6Qm VhY29uIiwiZXhwaXJlcyI6MTcxMDc2NDEyNSwiZGF0YSI6eyJpZCI6Mjc3OTk1NDZ9fQ==--7661 9a85030bc8fcba1d376d5337ea27ddf2506a.gif>
Closing, since this has been resolved.