--- db/Makefile.am.orig 2006-12-27 23:50:07.000000000 +0000 +++ db/Makefile.am 2006-12-27 23:50:21.000000000 +0000 @@ -1,7 +1,16 @@ AUTOMAKE_OPTIONS = gnu +zmdbdatadir = $(pkgdatadir)/db + EXTRA_DIST = \ zm_create.sql.in \ + $(dbupgrade_scripts) + +dist_zmdbdata_DATA = \ + zm_create.sql \ + $(dbupgrade_scripts) + +dbupgrade_scripts = \ zm_update-0.0.1.sql \ zm_update-0.9.7.sql \ zm_update-0.9.8.sql \ --- scripts/zmupdate.pl.orig 2006-12-27 23:59:20.000000000 +0000 +++ scripts/zmupdate.pl 2006-12-27 23:59:35.000000000 +0000 @@ -320,7 +320,7 @@ $command .= " -p".$db_pass; } } - $command .= " ".ZM_DB_NAME." < ".ZM_PATH_BUILD."/db/zm_update-".$version.".sql"; + $command .= " ".ZM_DB_NAME." < ".ZM_PATH_DATA."/db/zm_update-".$version.".sql"; print( "Executing '$command'\n" ) if ( DBG_LEVEL > 0 ); my $output = qx($command); --- configure.in.orig 2006-12-27 23:55:41.000000000 +0000 +++ configure.in 2006-12-27 23:59:07.000000000 +0000 -PATH_BUILD=`pwd` -AC_SUBST(PATH_BUILD) TIME_BUILD=`date +'%s'` AC_SUBST(TIME_BUILD) @@ -216,8 +214,10 @@ AC_DEFINE_DIR([BINDIR],[bindir],[Expanded binary directory]) AC_DEFINE_DIR([LIBDIR],[libdir],[Expanded library directory]) +AC_DEFINE_DIR([DATADIR],[datadir],[Expanded data directory]) +AC_SUBST(PKGDATADIR,"$DATADIR/$PACKAGE") AC_SUBST(RUNDIR,"/var/run") -AC_SUBST(ZM_RUNDIR,"$RUNDIR/zm") +AC_SUBST(ZM_RUNDIR,"$RUNDIR/$PACKAGE") AC_SUBST(ZM_PID,"$ZM_RUNDIR/zm.pid") AC_DEFINE_DIR([SYSCONFDIR],[sysconfdir],[Expanded configuration directory]) AC_SUBST(ZM_CONFIG,"$SYSCONFDIR/zm.conf") --- zm.conf.in.orig 2006-12-27 23:53:38.000000000 +0000 +++ zm.conf.in 2006-12-27 23:59:11.000000000 +0000 @@ -12,8 +12,8 @@ # Current version of ZoneMinder ZM_VERSION=@VERSION@ -# Path to build directory, used mostly for finding DB upgrade scripts -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@ --- scripts/zm.in.dbinstall 2007-04-03 00:41:48.000000000 +0100 +++ scripts/zm.in 2007-04-03 00:42:46.000000000 +0100 @@ -6,10 +6,10 @@ # Source function library. . /etc/rc.d/init.d/functions -prog=ZoneMinder +prog="@PACKAGE@" ZM_CONFIG="@ZM_CONFIG@" pidfile="@ZM_RUNDIR@" -LOCKFILE=/var/lock/subsys/zm +LOCKFILE=/var/lock/subsys/$prog loadconf() { @@ -27,9 +27,8 @@ start() { zmupdate || return $? - loadconf || return $? #Make sure the directory for our PID folder exists or create one. - [ ! -d /var/run/zm ] \ + [ ! -d $pidfile ] \ && mkdir -m 774 $pidfile \ && chown $ZM_WEB_USER:$ZM_WEB_GROUP $pidfile #Make sure the folder for the socks file exists or create one @@ -49,7 +48,6 @@ stop() { - loadconf echo -n $"Stopping $prog: " $command stop RETVAL=$? @@ -60,22 +58,21 @@ zmstatus() { - loadconf result=`$command status` if [ "$result" = "running" ]; then - echo "ZoneMinder is running" + echo "$prog is running" $ZM_PATH_BIN/zmu -l RETVAL=0 else - echo "ZoneMinder is stopped" + echo "$prog is stopped" RETVAL=1 fi } zmupdate() { - if [ -x $ZM_PATH_BIN/zm_update ]; then - $ZM_PATH_BIN/zm_update noi + if [ -x $ZM_PATH_BIN/zmupdate.pl ]; then + $ZM_PATH_BIN/zmupdate.pl --freshen >/dev/null fi } @@ -92,7 +89,6 @@ start ;; 'condrestart') - loadconf result=`$ZM_PATH_BIN/zmdc.pl check` if [ "$result" = "running" ]; then $ZM_PATH_BIN/zmdc.pl shutdown > /dev/null