diff --git a/configure.ac b/configure.ac index 7ce0942a7..d1592368a 100644 --- a/configure.ac +++ b/configure.ac @@ -10,6 +10,7 @@ PATH_BUILD=`pwd` AC_SUBST(PATH_BUILD) TIME_BUILD=`date +'%s'` AC_SUBST(TIME_BUILD) +AC_SUBST(VERSION) AC_ARG_VAR(ZM_DB_HOST,[Hostname where ZoneMinder database located, default localhost]) AC_ARG_VAR(ZM_DB_NAME,[Name of ZoneMinder database, default zm]) diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Base.pm.in b/scripts/ZoneMinder/lib/ZoneMinder/Base.pm.in index 37119f725..3f10e9137 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Base.pm.in +++ b/scripts/ZoneMinder/lib/ZoneMinder/Base.pm.in @@ -32,6 +32,8 @@ require Exporter; our @ISA = qw(Exporter); +use constant ZM_VERSION => "@VERSION@"; + # Items to export into callers namespace by default. Note: do not export # names by default without a very good reason. Use EXPORT_OK instead. # Do not simply export all your public functions/methods/constants. @@ -39,7 +41,7 @@ our @ISA = qw(Exporter); # This allows declaration use ZoneMinder ':all'; # If you do not need this, moving things directly into @EXPORT or @EXPORT_OK # will save memory. -our %EXPORT_TAGS = ( 'all' => [ qw() ] ); +our %EXPORT_TAGS = ( 'all' => [ qw(ZM_VERSION) ] ); our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); diff --git a/scripts/zmdbbackup.in b/scripts/zmdbbackup.in index 303cf86be..37879b5f1 100644 --- a/scripts/zmdbbackup.in +++ b/scripts/zmdbbackup.in @@ -20,6 +20,8 @@ # Edit these to suit your configuration ZM_CONFIG=@ZM_CONFIG@ source $ZM_CONFIG +# ZM_VERSION in the config is now deprecated but will likely still exist in people's config files. This will override it. +ZM_VERSION=@VERSION@ MYSQLDUMP=/usr/bin/mysqldump BACKUP_PATH=/var/lib/zm diff --git a/scripts/zmeventdump.in b/scripts/zmeventdump.in index 342b665b0..fad82db37 100644 --- a/scripts/zmeventdump.in +++ b/scripts/zmeventdump.in @@ -23,6 +23,8 @@ # Edit these to suit your configuration ZM_CONFIG=@ZM_CONFIG@ +# ZM_VERSION in the config is now deprecated but will likely still exist in people's config files. This will override it. +ZM_VERSION=@VERSION@ MYSQLDUMP=/usr/bin/mysqldump # The rest should not need editing diff --git a/web/includes/config.php.in b/web/includes/config.php.in index 91612cbdf..a592e41bc 100644 --- a/web/includes/config.php.in +++ b/web/includes/config.php.in @@ -22,6 +22,8 @@ // This section contains options substituted by the zmconfig.pl utility, do not edit these directly // define( "ZM_CONFIG", "@ZM_CONFIG@" ); // Path to config file +// Define, and override any given in config file +define( "ZM_VERSION", "@VERSION@" ); // Version $configFile = ZM_CONFIG; $localConfigFile = basename($configFile); diff --git a/zm.conf.in b/zm.conf.in index f4c426c65..dc3fd086f 100644 --- a/zm.conf.in +++ b/zm.conf.in @@ -9,18 +9,15 @@ # or installations. # -# Current version of ZoneMinder -ZM_VERSION=@VERSION@ - # Path to build directory ZM_PATH_BUILD=@PATH_BUILD@ -# Path to installed data directory, used mostly for finding DB upgrade scripts -ZM_PATH_DATA=@PKGDATADIR@ - # Build time, used to record when to trigger various checks ZM_TIME_BUILD=@TIME_BUILD@ +# Path to installed data directory, used mostly for finding DB upgrade scripts +ZM_PATH_DATA=@PKGDATADIR@ + # Path to ZoneMinder binaries ZM_PATH_BIN=@BINDIR@ @@ -40,6 +37,9 @@ ZM_PATH_CGI=@CGI_PREFIX@ ZM_WEB_USER=@WEB_USER@ ZM_WEB_GROUP=@WEB_GROUP@ +# ZoneMinder database type: so far only mysql is supported +ZM_DB_TYPE=@ZM_DB_TYPE@ + # ZoneMinder database hostname or ip address ZM_DB_HOST=@ZM_DB_HOST@ @@ -51,3 +51,6 @@ ZM_DB_USER=@ZM_DB_USER@ # ZoneMinder database password ZM_DB_PASS=@ZM_DB_PASS@ + +# Host of this machine +ZM_SERVER_HOST=