diff --git a/.gitignore b/.gitignore index 070bbc3d8..ec021d210 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,52 @@ scripts/ZoneMinder/blib Makefile.in Makefile docs/_build + +config.guess +config.h +config.log +config.status +config.sub +db/zm_create.sql +misc/apache.conf +misc/com.zoneminder.systemctl.policy +misc/com.zoneminder.systemctl.rules +misc/logrotate.conf +misc/syslog.conf +scripts/ZoneMinder/MYMETA.yml +scripts/ZoneMinder/lib/ZoneMinder/Base.pm +scripts/ZoneMinder/lib/ZoneMinder/Config.pm +scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm +scripts/ZoneMinder/lib/ZoneMinder/Memory.pm +scripts/ZoneMinder/pm_to_blib +scripts/zm +scripts/zmaudit.pl +scripts/zmcamtool.pl +scripts/zmcontrol.pl +scripts/zmdbbackup +scripts/zmdbrestore +scripts/zmdc.pl +scripts/zmeventdump +scripts/zmfilter.pl +scripts/zmlogrotate.conf +scripts/zmpkg.pl +scripts/zmsystemctl.pl +scripts/zmtrack.pl +scripts/zmtrigger.pl +scripts/zmupdate.pl +scripts/zmvideo.pl +scripts/zmwatch.pl +scripts/zmx10.pl +src/.deps/ +src/*.o +src/zm_config.h +src/zm_config_defines.h +src/zma +src/zmc +src/zmf +src/zms +src/zmstreamer +src/zmu +web/includes/config.php +zm.conf +zmconfgen.pl diff --git a/utils/travis/bootstrap-zm.sh b/utils/travis/bootstrap-zm.sh new file mode 100644 index 000000000..397a8f90e --- /dev/null +++ b/utils/travis/bootstrap-zm.sh @@ -0,0 +1,29 @@ +#!/bin/bash -x + +set -e +set -o pipefail +set -x + +with_timestamps() { + while read -r line; do + echo -e "$(date +%T)\t$line"; + done +} + + +bootstrap_zm() { + + if [ "$ZM_BUILDMETHOD" = "autotools" ]; then libtoolize --force; fi + if [ "$ZM_BUILDMETHOD" = "autotools" ]; then aclocal; fi + if [ "$ZM_BUILDMETHOD" = "autotools" ]; then autoheader; fi + if [ "$ZM_BUILDMETHOD" = "autotools" ]; then automake --force-missing --add-missing; fi + if [ "$ZM_BUILDMETHOD" = "autotools" ]; then autoconf; fi + + mysql -uroot -e "CREATE DATABASE IF NOT EXISTS zm" + mysql -uroot -e "GRANT ALL ON zm.* TO 'zmuser'@'localhost' IDENTIFIED BY 'zmpass'"; + mysql -uroot -e "FLUSH PRIVILEGES" + mysql -uzmuser -pzmpass < ${TRAVIS_BUILD_DIR}/db/zm_create.sql + +} + +bootstrap_zm | with_timestamps diff --git a/utils/travis/build-zm.sh b/utils/travis/build-zm.sh new file mode 100644 index 000000000..2d758f61b --- /dev/null +++ b/utils/travis/build-zm.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +set -e +set -o pipefail + +with_timestamps() { + while read -r line; do + echo -e "$(date +%T)\t$line"; + done +} + +cd $TRAVIS_BUILD_DIR + +build_zm() { + + if [ "$ZM_BUILDMETHOD" = "autotools" ]; then + ./configure --prefix=/usr --with-libarch=lib/$DEB_HOST_GNU_TYPE --host=$DEB_HOST_GNU_TYPE --build=$DEB_BUILD_GNU_TYPE --with-mysql=/usr --with-ffmpeg=/usr --with-webdir=/usr/share/zoneminder/www --with-cgidir=/usr/libexec/zoneminder/cgi-bin --with-webuser=www-data --with-webgroup=www-data --enable-crashtrace=yes --disable-debug --enable-mmap=yes ZM_SSL_LIB=openssl + fi + + if [ "$ZM_BUILDMETHOD" = "cmake" ]; then + cmake -DCMAKE_INSTALL_PREFIX="/usr" + fi + + make + sudo make install + + if [ "$ZM_BUILDMETHOD" = "cmake" ]; then + sudo ./zmlinkcontent.sh + fi + +} + +build_zm | with_timestamps diff --git a/utils/travis/install-deps.sh b/utils/travis/install-deps.sh new file mode 100644 index 000000000..d7981cb5a --- /dev/null +++ b/utils/travis/install-deps.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +set -e +set -o pipefail + +with_timestamps() { + while read -r line; do + echo -e "$(date +%T)\t$line"; + done +} + + +install_deps() { + + sudo apt-get update -qq + sudo apt-get install -y -qq zlib1g-dev apache2 mysql-server php5 php5-mysql build-essential libmysqlclient-dev libssl-dev libbz2-dev libpcre3-dev libdbi-perl libarchive-zip-perl libdate-manip-perl libdevice-serialport-perl libmime-perl libwww-perl libdbd-mysql-perl libsys-mmap-perl yasm automake autoconf cmake libjpeg-turbo8-dev apache2-mpm-prefork libapache2-mod-php5 php5-cli libtheora-dev libvorbis-dev libvpx-dev libx264-dev 2>&1 > /dev/null + +} + +install_deps | with_timestamps diff --git a/utils/travis/install-ffmpeg.sh b/utils/travis/install-ffmpeg.sh new file mode 100644 index 000000000..c2a2e9733 --- /dev/null +++ b/utils/travis/install-ffmpeg.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +set -e + + +git clone --depth=10 --branch=master git://source.ffmpeg.org/ffmpeg.git +cd ffmpeg +./configure --enable-shared --enable-swscale --enable-gpl --enable-libx264 --enable-libvpx --enable-libvorbis --enable-libtheora +make -j `grep processor /proc/cpuinfo|wc -l` +sudo make install +sudo make install-libs diff --git a/utils/travis/run-tests.sh b/utils/travis/run-tests.sh new file mode 100644 index 000000000..c3bb392d9 --- /dev/null +++ b/utils/travis/run-tests.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +set -e +set -o pipefail + +with_timestamps() { + while read -r line; do + echo -e "$(date +%T)\t$line"; + done +} + +run_tests() { + mysql -uzmuser -pzmpass zm < ../../db/test.monitor.sql + sudo zmu -l + sudo zmc -m1 & + sudo zma -m1 & + sudo zmu -l + sudo grep ERR /var/log/syslog + sudo zmpkg.pl start + sudo zmfilter.pl -f purgewhenfull +} + +run_tests | with_timestamps