ZoneMinder/ZoneMinder — pull request #290 by dmak (2013-12-30 20:38:49+00:00)
Title: Fix for few problems in Debian packaging

While trying to create Debian package I have faced the following problems:

* Version should be 1.26.5 otherwise build cycle fails. Perhaps this version could be automatically detected or passed to postinit script?
* `RUNDIR` and `ZM_RUNDIR` are already prefixed by `DESTDIR` in `Makefile` (`$(DESTDIR)$(ZM_RUNDIR)`) so there is no need to prepend `CURDIR` to them. Otherwise the directory where the project was checkedout to is added to `.pkg`:
`/home/workspace/ZoneMinder/debian/zoneminder/var/run`
and this result the following error when trying to reinstall the package:
`dpkg: warning: unable to delete old directory '/home/workspace/ZoneMinder/debian/zoneminder/var/run': Directory not empty`
* `zm_update-1.26.5.sql` was designed in a way that in case the changes have already been applied, it fails. Thus it is not possible to test the package. Perhaps there is another underwater stone here, as I feel that `postinst` script is constantly passed the wrong value thus `OLD_ZM_VERSION` is wrong.