Merge pull request #200 from knnniggett/zm_path_data

Create ZM_PATH_DATA and point zmupdate to ZM_PATH_DATA/db
This commit is contained in:
Kfir Itzhak 2013-10-06 10:36:20 -07:00
commit a248bc9a10
3 changed files with 6 additions and 2 deletions

View File

@ -324,6 +324,7 @@ set(ZM_PID "${ZM_RUNDIR}/zm.pid")
set(ZM_CONFIG "/${CMAKE_INSTALL_SYSCONFDIR}/zm.conf") set(ZM_CONFIG "/${CMAKE_INSTALL_SYSCONFDIR}/zm.conf")
set(VERSION "${ZoneMinder_VERSION}") set(VERSION "${ZoneMinder_VERSION}")
set(PATH_BUILD "${PROJECT_SOURCE_DIR}") set(PATH_BUILD "${PROJECT_SOURCE_DIR}")
set(PKGDATADIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/zoneminder")
set(TIME_BUILD "1000000") # Don't have a solution for this one yet set(TIME_BUILD "1000000") # Don't have a solution for this one yet
set(BINDIR "${CMAKE_INSTALL_FULL_BINDIR}") set(BINDIR "${CMAKE_INSTALL_FULL_BINDIR}")
set(LIBDIR "${CMAKE_INSTALL_FULL_LIBDIR}") set(LIBDIR "${CMAKE_INSTALL_FULL_LIBDIR}")

View File

@ -429,7 +429,7 @@ if ( $version )
} }
else else
{ {
$command .= ZM_PATH_BUILD."/db"; $command .= ZM_PATH_DATA."/db";
} }
$command .= "/zm_update-".$version.".sql"; $command .= "/zm_update-".$version.".sql";
@ -1030,7 +1030,7 @@ if ( $version )
if ( $version ge '1.26.0' ) { if ( $version ge '1.26.0' ) {
my @files; my @files;
$updateDir = ZM_PATH_BUILD."/db" if ! $updateDir; $updateDir = ZM_PATH_DATA."/db" if ! $updateDir;
opendir( my $dh, $updateDir ) || die "Can't open updateDir $!"; opendir( my $dh, $updateDir ) || die "Can't open updateDir $!";
@files = sort grep { (!/^\./) && /^zm_update\-[\d\.]+\.sql$/ && -f "$updateDir/$_" } readdir($dh); @files = sort grep { (!/^\./) && /^zm_update\-[\d\.]+\.sql$/ && -f "$updateDir/$_" } readdir($dh);
closedir $dh; closedir $dh;

View File

@ -15,6 +15,9 @@ ZM_VERSION=@VERSION@
# Path to build directory, used mostly for finding DB upgrade scripts # Path to build directory, used mostly for finding DB upgrade scripts
ZM_PATH_BUILD=@PATH_BUILD@ 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 # Build time, used to record when to trigger various checks
ZM_TIME_BUILD=@TIME_BUILD@ ZM_TIME_BUILD=@TIME_BUILD@