Code: Select all
#!/bin/bash
HOMEDIR=~
FFMPEG_EXTRAS=
echo "Enter MYSQL root password to use"
read -s MYSQL_ROOTPW
cd $HOMEDIR
sudo apt-get update
sudo tasksel install lamp-server
sudo apt-get install build-essential git-core checkinstall yasm texi2html libx11-dev libxfixes-dev libxvidcore-dev zlib1g-dev pkg-config
git clone git://git.videolan.org/x264
cd x264
./configure --enable-shared
make
sudo make install
sudo ldconfig
cd $HOMEDIR
git clone git://git.videolan.org/ffmpeg.git
cd ffmpeg/
git checkout oldabi
./configure --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-pthreads --enable-libx264 --enable-libxvid --enable-x11grab --enable-shared $FFMPEG_EXTRAS
make
sudo make install
sudo ldconfig
ffmpeg -codecs | grep 264
cd $HOMEDIR
wget http://www2.zoneminder.com/downloads/ZoneMinder-1.24.3.tar.gz
tar xvf ./ZoneMinder-1.24.3.tar.gz
cd ZoneMinder-1.24.3/
sudo apt-get install mysql-client libmysqlclient-dev libjpeg-dev openssl libssl-dev libdate-manip-perl libphp-serialization-perl libcache-mmap-perl libgnutls-dev
sudo perl -MCPAN -e "install Sys::Mmap"
./configure --with-webdir=/usr/share/zoneminder --with-cgidir=/usr/lib/cgi-bin --with-webuser=www-data --with-webgroup=www-data --with-ffmpeg=/usr/local/lib CPPFLAGS="-D__STDC_CONSTANT_MACROS"
make
sudo make install
echo "create database zm" | mysql -u root -p$MYSQL_ROOTPW mysql
mysql -u root -p$MYSQL_ROOTPW mysql < ./db/zm_create.sql
echo "grant select,insert,update,delete on zm.* to 'zmuser'@localhost identified by 'zmpass'" | mysql -u root -p$MYSQL_ROOTPW zm
mysqladmin -u root -p$MYSQL_ROOTPW reload
sudo zmpkg.pl start
cd $HOMEDIR