summaryrefslogtreecommitdiff
path: root/install.sh
diff options
context:
space:
mode:
authorAndreas Mair <amair.sob@googlemail.com>2005-06-01 13:09:21 +0200
committerAndreas Mair <amair.sob@googlemail.com>2005-06-01 13:09:21 +0200
commitd6922e850779c4ff9d8bcbcef9842cf333eb8638 (patch)
tree8b6c0aa816b00ad4a83a30b1241a73ef6b57fcb2 /install.sh
parentbebe0382652e0616c8d040b3e217c2a21b81beee (diff)
downloadvdradmin-am-0.97-am3.3pre.tar.gz
vdradmin-am-0.97-am3.3pre.tar.bz2
2005-06-01: 0.97-am3.3prev0.97-am3.3pre
- Allow browsers to cache all files VDRAdmin sends, except "text/html". This should speed up VDRAdmin but changing the skin or css needs a "shift reload". - Added support for VDR v1.3.25's recording info (Submitted by vejoun). - New config option for the number of columns to display in prog_summary. - Use localized date formates. - Now using "video/x-mpegurl" MIME type instead of "audio/x-mpegurl" for streaming (Suggested by stefan.h). - Added patches supplied by stefan.h: -> using EPG's subtitle when found for AutoTimer else " " (thaht's the VDR way). -> New config option VDRVFAT to find recordings if VDR has been compiled with or without VFAT define. - Fixed calling reccmds on recordings in subdirs, manual recordings (@rectitle) and repeating timer's recordings without episode title. - Fixed streaming of manual recordings (@rectitle) and repeating timer's recordings without episode title. - VDRAdmin-AM now uses the required charsets setting in templates, so no need to write "&xyz;" things in .po files. - Reworked templates to make better use of CSS (for example: timeline colours can be set by style.css). - EPG_PRUNE now is the number of channels to fetch from VDR (had been one too less before). - Added "install.sh" and "uninstall.sh" ("./install.sh -h" for help) (Requested by several people). - Made "name" columns in lists wrapping again (Reported by vejoun). - Deleting a single recording works again (Reported by vejoun). - Fixed streaming of recordings in subdirs (Reported by vejoun). - Added missing gray sign on deactivated AutoTimers (Reported by vejoun).
Diffstat (limited to 'install.sh')
-rwxr-xr-xinstall.sh238
1 files changed, 238 insertions, 0 deletions
diff --git a/install.sh b/install.sh
new file mode 100755
index 0000000..daf77c3
--- /dev/null
+++ b/install.sh
@@ -0,0 +1,238 @@
+#!/bin/sh
+# Copyright (c) 2005 Andreas Mair
+#
+#
+# Download and patchscript for VDRAdmin-AM
+# (based on install.sh Copyright (c) 2003 Frank (xpix) Herrmann)
+
+PATH=$PATH:/sbin:/bin:/usr/sbin:/usr/bin
+DESTDIR=${DESTDIR}
+LIBDIR=${LIBDIR:-$DESTDIR/usr/share/vdradmin}
+ETCDIR=${ETCDIR:-$DESTDIR/etc/vdradmin}
+DOCDIR=${DOCDIR:-$DESTDIR/usr/share/doc/vdradmin}
+BINDIR=${BINDIR:-$DESTDIR/usr/bin}
+LOCDIR=${LOCDIR:-$DESTDIR/usr/share/locale}
+MANDIR=${MANDIR:-$DESTDIR/usr/share/man/man1}
+LOGDIR=${LOGDIR:-$DESTDIR/var/log}
+PIDFILE=${PIDFILE:-$DESTDIR/var/run/vdradmind.pid}
+VIDEODIR=${VIDEODIR:-/video}
+VDRCONF=${VDRCONF:-$VIDEODIR}
+
+LANGS="de es fr fi"
+
+function usage()
+{
+ echo ""
+ echo "usage: $(basename $0) [-c | -u | -p | -h]"
+ echo ""
+ echo -e "\t-c : Run \"vdradmind.pl -c\" after installation (=configure)."
+ echo -e "\t-u : Perform uninstall."
+ echo -e "\t-p : Only install needed Perl modules (NOT YET FINISHED!!!)."
+ echo -e "\t-h : This message."
+ echo ""
+ exit 0
+}
+
+function killRunningVDRAdmin()
+{
+ local KILLED=0
+ ps a | grep vdradmind.pl | grep perl | grep -v grep | while read PID UNWANTED
+ do
+ KILLED=1
+ kill $PID
+ done
+
+ return $KILLED
+}
+
+# $1 - the Perl module to check for.
+function checkPerlModule()
+{
+ [ -z "$1" ] && return 1
+
+ local MODULE=$1
+
+ echo -n "Checking for Perl module $MODULE... "
+ perl -ce 'BEGIN{$0 =~ /(^.*\/)/; $BASENAME = $1; unshift(@INC, $BASENAME . "lib/");} use '$MODULE >/dev/null 2>&1
+ if [ $? -eq 2 ]; then
+ echo "MISSING"
+ read -p "Do you want to install it? [y/N]"
+ [ $REPLY = "y" -o $REPLY = "Y" ] && su -c "perl -MCPAN -e 'install Locale::gettext'"
+ else
+ echo "found"
+ fi
+
+}
+
+function perlModules()
+{
+ checkPerlModule Template
+ checkPerlModule Compress::Zlib
+ checkPerlModule CGI
+ checkPerlModule IO::Socket
+ checkPerlModule Time::Local
+ checkPerlModule MIME::Base64
+ checkPerlModule File::Temp
+ checkPerlModule Locale::gettext
+}
+
+function doInstall()
+{
+ echo ""
+ echo "********* Installing VDRAdmin-AM *************"
+ echo ""
+
+ perlModules
+
+ [ ! -e $LIBDIR ] && mkdir -p $LIBDIR
+ if [ -d $LIBDIR ]; then
+ cp -r template $LIBDIR
+ cp -r lib $LIBDIR
+ else
+ echo "$LIBDIR exists but is no directory!"
+ echo "Aborting..."
+ exit 1
+ fi
+
+ [ ! -e $DOCDIR ] && mkdir -p $DOCDIR
+ if [ -d $DOCDIR ]; then
+ cp -r contrib COPYING HISTORY* INSTALL README* $DOCDIR
+ else
+ echo "$DOCDIR exists but is no directory!"
+ echo "Aborting..."
+ exit 1
+ fi
+
+ [ ! -e $MANDIR ] && mkdir -p $MANDIR
+ if [ -d $MANDIR ]; then
+ cp vdradmind.pl.1 $MANDIR
+ else
+ echo "$MANDIR exists but is no directory!"
+ echo "Aborting..."
+ exit 1
+ fi
+
+ [ ! -e $ETCDIR ] && mkdir -p $ETCDIR
+ if [ ! -d $ETCDIR ]; then
+ echo "$ETCDIR exists but is no directory!"
+ echo "Aborting..."
+ exit 1
+ fi
+
+ for lang in $LANGS
+ do
+ [ ! -e $LOCDIR/$lang/LC_MESSAGES/ ] && mkdir -p $LOCDIR/$lang/LC_MESSAGES/
+ install -m 644 locale/$lang/LC_MESSAGES/vdradmin.mo $LOCDIR/$lang/LC_MESSAGES/vdradmin.mo
+ done
+
+ local RESTART=
+ [ ! -e $BINDIR ] && mkdir -p $BINDIR
+ if [ -d $BINDIR ]; then
+ killRunningVDRAdmin
+ if [ $? -ne 0 ] ; then
+ RESTART=1
+ echo "Killed running VDRAdmin-AM..."
+ fi
+ sed <vdradmind.pl >$BINDIR/vdradmind.pl \
+ -e "s/^my \$SEARCH_FILES_IN_SYSTEM = 0;/my \$SEARCH_FILES_IN_SYSTEM = 1;/" \
+ -e "s:/usr/share/vdradmin/lib:${LIBDIR}/lib:" \
+ -e "s:/usr/share/vdradmin/template:${LIBDIR}/template:" \
+ -e "s:/etc/vdradmin/vdradmind.conf:${ETCDIR}/vdradmind.conf:" \
+ -e "s:/var/log/\$CONFIG{LOGFILE}:${LOGDIR}/\$CONFIG{LOGFILE}:" \
+ -e "s:/var/run/vdradmind.pid:${PIDFILE}:" \
+ -e "s:/etc/vdradmin/vdradmind.done:${ETCDIR}/vdradmind.done:" \
+ -e "s:/etc/vdradmin/vdradmind.at:${ETCDIR}/vdradmind.at:" \
+ -e "s:/etc/vdradmin/vdradmind.bl:${ETCDIR}/vdradmind.bl:" \
+ -e "s:/usr/share/locale:${LOCDIR}:" \
+ -e "s:$CONFIG{VIDEODIR} *= "/video";:${VIDEODIR}:" \
+ -e "s:$CONFIG{VDRCONFDIR} *= "$CONFIG{VIDEODIR}";:${VDRCONF}:"
+
+ chmod a+x $BINDIR/vdradmind.pl
+
+ if [ "$CONFIG" ]; then
+ echo "Configuring VDRAdmin-AM..."
+ $BINDIR/vdradmind.pl -c
+ fi
+
+ if [ "$RESTART" ]; then
+ echo "Restarting VDRAdmin-AM..."
+ $BINDIR/vdradmind.pl
+ fi
+ else
+ echo "$BINDIR exists but is no directory!"
+ echo "Aborting..."
+ exit 1
+ fi
+
+ echo ""
+ echo ""
+ echo "VDRAdmin-AM has been installed!"
+ echo ""
+ if [ -z "$RESTART" ]; then
+ echo "Run \"$BINDIR/vdradmind.pl\" to start VDRAdmin-AM."
+ echo ""
+ fi
+ echo "NOTE:"
+ echo "If you would like VDRAdmin-AM to start at system's boot, please modify your system's init scripts."
+ exit 0
+}
+
+function doUninstall()
+{
+ echo ""
+ echo "********* Uninstalling VDRAdmin-AM *************"
+ echo ""
+
+ killRunningVDRAdmin
+ if [ -d $DOCDIR ]; then
+ rm -rf $DOCDIR
+ fi
+ if [ -d $LIBDIR ]; then
+ rm -rf $LIBDIR
+ fi
+ if [ -e $MANDIR/vdradmind.pl.1 ]; then
+ rm -f $MANDIR/vdradmind.pl.1
+ fi
+ if [ -e $BINDIR/vdradmind.pl ]; then
+ rm -f $BINDIR/vdradmind.pl
+ fi
+ for lang in $LANGS
+ do
+ [ -e $LOCDIR/$lang/LC_MESSAGES/vdradmin.mo ] && rm -f $LOCDIR/$lang/LC_MESSAGES/vdradmin.mo
+ done
+
+ echo ""
+ echo "VDRAdmin-AM has been uninstalled!"
+ echo ""
+ if [ -d $ETCDIR ]; then
+ echo "Your configuration files located in $ETCDIR have NOT been deleted!"
+ echo "If you want to get rid of them, please delete them manually!"
+ echo ""
+ fi
+}
+
+UNINSTALL=
+CONFIG=
+PERL=
+while [ "$1" ]
+do
+ case $1 in
+ -u) UNINSTALL=1;;
+ -c) CONFIG=1;;
+ -p) PERL=1;;
+ -h) usage;;
+ *) echo "Ignoring param \"$1\$.";;
+ esac
+ shift
+done
+
+if [ $(basename $0) = "uninstall.sh" -o "$UNINSTALL" ]; then
+ doUninstall
+elif [ "$PERL" ]; then
+ echo ""
+ echo "Only LISTING needed Perl modules..."
+ perlModules
+ echo "...done."
+else
+ doInstall
+fi