From b4da026bdfda41f68fcbe4530c30d8ec0243950a Mon Sep 17 00:00:00 2001 From: Knniggett Date: Sat, 21 Sep 2013 16:34:23 -0500 Subject: [PATCH] Add fedora files to zoneminder source tree --- distros/{redhat => fedora}/README.Fedora | 0 distros/fedora/redalart.wav | 1 + .../fedora/zoneminder-1.24.3-runlevel.patch | 11 +++ .../fedora/zoneminder-1.24.4-installfix.patch | 22 ++++++ .../fedora/zoneminder-1.26.3-dbinstall.patch | 72 +++++++++++++++++++ .../fedora/zoneminder-1.26.3-noffmpeg.patch | 26 +++++++ distros/fedora/zoneminder.conf | 45 ++++++++++++ distros/fedora/zoneminder.logrotate | 8 +++ distros/fedora/zoneminder.service | 12 ++++ distros/redhat/README.SuSE | 17 ----- 10 files changed, 197 insertions(+), 17 deletions(-) rename distros/{redhat => fedora}/README.Fedora (100%) create mode 120000 distros/fedora/redalart.wav create mode 100644 distros/fedora/zoneminder-1.24.3-runlevel.patch create mode 100644 distros/fedora/zoneminder-1.24.4-installfix.patch create mode 100644 distros/fedora/zoneminder-1.26.3-dbinstall.patch create mode 100644 distros/fedora/zoneminder-1.26.3-noffmpeg.patch create mode 100644 distros/fedora/zoneminder.conf create mode 100644 distros/fedora/zoneminder.logrotate create mode 100644 distros/fedora/zoneminder.service delete mode 100644 distros/redhat/README.SuSE diff --git a/distros/redhat/README.Fedora b/distros/fedora/README.Fedora similarity index 100% rename from distros/redhat/README.Fedora rename to distros/fedora/README.Fedora diff --git a/distros/fedora/redalart.wav b/distros/fedora/redalart.wav new file mode 120000 index 000000000..eec3dce64 --- /dev/null +++ b/distros/fedora/redalart.wav @@ -0,0 +1 @@ +../redhat/redalert.wav \ No newline at end of file diff --git a/distros/fedora/zoneminder-1.24.3-runlevel.patch b/distros/fedora/zoneminder-1.24.3-runlevel.patch new file mode 100644 index 000000000..de7b49b0b --- /dev/null +++ b/distros/fedora/zoneminder-1.24.3-runlevel.patch @@ -0,0 +1,11 @@ +diff -up ./scripts/zm.in.runlevel ./scripts/zm.in +--- ./scripts/zm.in.runlevel 2010-11-28 15:22:05.000000000 -0600 ++++ ./scripts/zm.in 2011-03-24 21:39:01.973010160 -0500 +@@ -1,6 +1,6 @@ + #!/bin/sh + # description: ZoneMinder is the top Linux video camera security and surveillance solution. ZoneMinder is intended for use in single or multi-camera video security applications.Copyright: Philip Coombes, Corey DeLasaux 2003-2008 +-# chkconfig: 2345 99 00 ++# chkconfig: - 99 00 + # processname: zmpkg.pl + + # Source function library. diff --git a/distros/fedora/zoneminder-1.24.4-installfix.patch b/distros/fedora/zoneminder-1.24.4-installfix.patch new file mode 100644 index 000000000..8831d597a --- /dev/null +++ b/distros/fedora/zoneminder-1.24.4-installfix.patch @@ -0,0 +1,22 @@ +diff -up ./Makefile.am.installfix ./Makefile.am +--- ./Makefile.am.installfix 2011-06-19 15:51:14.000000000 -0500 ++++ ./Makefile.am 2011-08-13 20:33:30.288587436 -0500 +@@ -21,12 +21,12 @@ EXTRA_DIST = \ + # Yes, you are correct. This is a HACK! + install-data-hook: + ( cd $(DESTDIR)$(sysconfdir); chown $(webuser):$(webgroup) $(sysconf_DATA); chmod 600 $(sysconf_DATA) ) +- ( if ! test -e $(ZM_RUNDIR); then mkdir -p $(ZM_RUNDIR); fi; if test "$(ZM_RUNDIR)" != "/var/run"; then chown $(webuser):$(webgroup) $(ZM_RUNDIR); chmod u+w $(ZM_RUNDIR); fi ) +- ( if ! test -e $(ZM_TMPDIR); then mkdir -m 700 -p $(ZM_TMPDIR); fi; if test "$(ZM_TMPDIR)" != "/tmp"; then chown $(webuser):$(webgroup) $(ZM_TMPDIR); chmod u+w $(ZM_TMPDIR); fi ) +- ( if ! test -e $(ZM_LOGDIR); then mkdir -p $(ZM_LOGDIR); fi; if test "$(ZM_LOGDIR)" != "/var/log"; then chown $(webuser):$(webgroup) $(ZM_LOGDIR); chmod u+w $(ZM_LOGDIR); fi ) ++ ( if ! test -e $(DESTDIR)$(ZM_RUNDIR); then mkdir -p $(DESTDIR)$(ZM_RUNDIR); fi; if test "$(DESTDIR)$(ZM_RUNDIR)" != "/var/run"; then chown $(webuser):$(webgroup) $(DESTDIR)$(ZM_RUNDIR); chmod u+w $(DESTDIR)$(ZM_RUNDIR); fi ) ++ ( if ! test -e $(DESTDIR)$(ZM_TMPDIR); then mkdir -m 700 -p $(DESTDIR)$(ZM_TMPDIR); fi; if test "$(DESTDIR)$(ZM_TMPDIR)" != "/tmp"; then chown $(webuser):$(webgroup) $(DESTDIR)$(ZM_TMPDIR); chmod u+w $(DESTDIR)$(ZM_TMPDIR); fi ) ++ ( if ! test -e $(DESTDIR)$(ZM_LOGDIR); then mkdir -p $(DESTDIR)$(ZM_LOGDIR); fi; if test "$(DESTDIR)$(ZM_LOGDIR)" != "/var/log"; then chown $(webuser):$(webgroup) $(DESTDIR)$(ZM_LOGDIR); chmod u+w $(DESTDIR)$(ZM_LOGDIR); fi ) + + uninstall-hook: + @-( cd $(DESTDIR)$(webdir); rm -rf events graphics images sounds temp ) +- @-( if test "$(ZM_RUNDIR)" != "/var/run"; then rm -rf $(ZM_RUNDIR); fi ) +- @-( if test "$(ZM_TMPDIR)" != "/tmp"; then rm -rf $(ZM_TMPDIR); fi ) +- @-( if test "$(ZM_LOGDIR)" != "/var/log"; then rm -rf $(ZM_LOGDIR); fi ) ++ @-( if test "$(DESTDIR)$(ZM_RUNDIR)" != "/var/run"; then rm -rf $(DESTDIR)$(ZM_RUNDIR); fi ) ++ @-( if test "$(DESTDIR)$(ZM_TMPDIR)" != "/tmp"; then rm -rf $(DESTDIR)$(ZM_TMPDIR); fi ) ++ @-( if test "$(DESTDIR)$(ZM_LOGDIR)" != "/var/log"; then rm -rf $(DESTDIR)$(ZM_LOGDIR); fi ) diff --git a/distros/fedora/zoneminder-1.26.3-dbinstall.patch b/distros/fedora/zoneminder-1.26.3-dbinstall.patch new file mode 100644 index 000000000..04af9e8b2 --- /dev/null +++ b/distros/fedora/zoneminder-1.26.3-dbinstall.patch @@ -0,0 +1,72 @@ +--- configure.ac 2013-09-05 10:33:08.000000000 -0500 ++++ configure.ac.dbinstall 2013-09-05 17:23:28.555553447 -0500 +@@ -1,13 +1,11 @@ + AC_PREREQ(2.59) +-AC_INIT(zm,1.26.3,[http://www.zoneminder.com/forums/ - Please check FAQ first],ZoneMinder,http://www.zoneminder.com/downloads.html) ++AC_INIT(zm,1.26.3,[http://www.zoneminder.com/forums/ - Please check FAQ first],zoneminder,http://www.zoneminder.com/downloads.html) + AM_INIT_AUTOMAKE + AC_CONFIG_SRCDIR(src/zm.h) + AC_CONFIG_HEADERS(config.h) + + AC_SUBST([AM_CXXFLAGS], [-D__STDC_CONSTANT_MACROS]) + +-PATH_BUILD=`pwd` +-AC_SUBST(PATH_BUILD) + TIME_BUILD=`date +'%s'` + AC_SUBST(TIME_BUILD) + +@@ -354,6 +352,8 @@ AC_PROG_PERL_MODULES(X10::ActiveHome,,AC + + 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(ZM_PID,"$ZM_RUNDIR/zm.pid") + AC_DEFINE_DIR([SYSCONFDIR],[sysconfdir],[Expanded configuration directory]) + AC_SUBST(ZM_CONFIG,"$SYSCONFDIR/zm.conf") +diff -up ./db/Makefile.am.dbinstall ./db/Makefile.am +--- ./db/Makefile.am.dbinstall 2009-10-14 04:42:46.000000000 -0500 ++++ ./db/Makefile.am 2011-03-24 22:50:14.173912137 -0500 +@@ -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 \ +diff -up ./scripts/zmupdate.pl.in.dbinstall ./scripts/zmupdate.pl.in +--- ./scripts/zmupdate.pl.in.dbinstall 2011-08-27 15:44:05.335602405 -0500 ++++ ./scripts/zmupdate.pl.in 2011-08-26 02:51:37.000000000 -0500 +@@ -424,7 +424,7 @@ if ( $version ) + } + else + { +- $command .= ZM_PATH_BUILD."/db"; ++ $command .= ZM_PATH_DATA."/db"; + } + $command .= "/zm_update-".$version.".sql"; + +diff -up ./zm.conf.in.dbinstall ./zm.conf.in +--- ./zm.conf.in.dbinstall 2008-07-25 04:48:16.000000000 -0500 ++++ ./zm.conf.in 2011-03-24 22:50:14.175912077 -0500 +@@ -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@ diff --git a/distros/fedora/zoneminder-1.26.3-noffmpeg.patch b/distros/fedora/zoneminder-1.26.3-noffmpeg.patch new file mode 100644 index 000000000..e8e8d4b3e --- /dev/null +++ b/distros/fedora/zoneminder-1.26.3-noffmpeg.patch @@ -0,0 +1,26 @@ +--- configure.ac 2013-09-10 12:42:56.000000000 -0500 ++++ configure.ac.noffmpeg 2013-09-14 17:25:41.988388970 -0500 +@@ -284,15 +284,15 @@ + AC_CHECK_LIB(pcre,pcre_compile,,AC_MSG_WARN(libpcre.a may be required for remote/network camera support)) + AC_CHECK_LIB(z,zlibVersion) + AC_CHECK_LIB(x264,x264_predict_16x16_init) +-AC_CHECK_LIB(avutil,av_malloc,,AC_MSG_WARN(libavutil.a may be required for MPEG streaming)) ++dnl AC_CHECK_LIB(avutil,av_malloc,,AC_MSG_WARN(libavutil.a may be required for MPEG streaming)) + # Don't bother to warn about this one +-AC_CHECK_LIB(avcore,av_image_copy,,) +-AC_CHECK_LIB(avcodec,avcodec_version,,AC_MSG_WARN(libavcodec.a is required for MPEG streaming)) +-AC_CHECK_LIB(avformat,avformat_version,,AC_MSG_WARN(libavformat.a is required for MPEG streaming)) +-#AC_CHECK_LIB(avcodec,avcodec_open,,AC_MSG_WARN(libavcodec.a is required for MPEG streaming)) +-#AC_CHECK_LIB(avformat,av_new_stream,,AC_MSG_WARN(libavformat.a is required for MPEG streaming)) +-AC_CHECK_LIB(avdevice,avdevice_register_all,,AC_MSG_WARN(libavdevice.a may be required for MPEG streaming)) +-AC_CHECK_LIB(swscale,sws_scale,,,-lswscale) ++dnl AC_CHECK_LIB(avcore,av_image_copy,,) ++dnl AC_CHECK_LIB(avcodec,avcodec_version,,AC_MSG_WARN(libavcodec.a is required for MPEG streaming)) ++dnl AC_CHECK_LIB(avformat,avformat_version,,AC_MSG_WARN(libavformat.a is required for MPEG streaming)) ++dnl AC_CHECK_LIB(avcodec,avcodec_open,,AC_MSG_WARN(libavcodec.a is required for MPEG streaming)) ++dnl AC_CHECK_LIB(avformat,av_new_stream,,AC_MSG_WARN(libavformat.a is required for MPEG streaming)) ++dnl AC_CHECK_LIB(avdevice,avdevice_register_all,,AC_MSG_WARN(libavdevice.a may be required for MPEG streaming)) ++dnl AC_CHECK_LIB(swscale,sws_scale,,,-lswscale) + AC_CHECK_LIB(bz2,BZ2_bzCompress,,AC_MSG_WARN(zm requires libbz2.a for recent versions of ffmpeg)) + AC_CHECK_LIB(z,compress,,) + diff --git a/distros/fedora/zoneminder.conf b/distros/fedora/zoneminder.conf new file mode 100644 index 000000000..597ea2bd2 --- /dev/null +++ b/distros/fedora/zoneminder.conf @@ -0,0 +1,45 @@ +# The Zoneminder web interface has been disabled by default due to a small +# security issue in the default install. +# +# When using Zoneminder's own authentication, recorded CCTV images are +# accessible from the web directly without passing the authentication. This +# means any attacker could see your CCTV images without a password. In order +# to avoid this you can disable Zoneminder's authentication and configure +# standard Apache authentication (see the Apache documentation for details on +# this). +# +# If you still wish to use Zoneminder's own authentication, or have an +# internal site which needs no authentication, you need to delete the line +# marked below and restart Apache. + +Alias /zm "/usr/share/zoneminder/www" + + Options -Indexes +MultiViews +FollowSymLinks + AllowOverride All + + # Apache 2.4 + Require all granted + + + # Apache 2.2 + Order deny,allow + Allow from all + + # The code unfortunately uses short tags in many places + php_value short_open_tag 1 + + +ScriptAlias /cgi-bin/zm "/usr/libexec/zoneminder/cgi-bin" + + AllowOverride All + Options ExecCGI + + # Apache 2.4 + Require all granted + + + # Apache 2.2 + Order deny,allow + Allow from all + + diff --git a/distros/fedora/zoneminder.logrotate b/distros/fedora/zoneminder.logrotate new file mode 100644 index 000000000..7bd1d189b --- /dev/null +++ b/distros/fedora/zoneminder.logrotate @@ -0,0 +1,8 @@ +/var/log/zoneminder/*.log { + missingok + notifempty + sharedscripts + postrotate + /usr/bin/zmpkg.pl logrot 2> /dev/null > /dev/null || : + endscript +} diff --git a/distros/fedora/zoneminder.service b/distros/fedora/zoneminder.service new file mode 100644 index 000000000..d59fc6796 --- /dev/null +++ b/distros/fedora/zoneminder.service @@ -0,0 +1,12 @@ +[Unit] +Description=Video security and surveillance system + +[Service] +Type=forking +ExecStart=/usr/bin/zmpkg.pl start +ExecReload=/usr/bin/zmpkg.pl reload +PIDFile=/run/zoneminder/zm.pid + +[Install] +WantedBy=multi-user.target + diff --git a/distros/redhat/README.SuSE b/distros/redhat/README.SuSE deleted file mode 100644 index ff7f64f95..000000000 --- a/distros/redhat/README.SuSE +++ /dev/null @@ -1,17 +0,0 @@ -After install run "zm_database_init" to create -the database and the zm database user (zm_admin). -The config file is automaticly adjusted with the -entered password for zm_admin. - -If you want to use X10 thwn install the the required -perl module with cpan. - -information: -during the run of zm_database_init a .my.cnf will -be created/updated (in the home directory of root) -so that root can access the database without password. -It Does not delete the .my.cnf when it exists, but checks -whether it has an entry for the mysql client [client] which -contains as username root. When the entry not exist or -the username is not root the .my.cnf will be modified -to fit the above requirements. \ No newline at end of file