From 277144d4ee297728a95242c7016730b65728c984 Mon Sep 17 00:00:00 2001 From: fgerlits Date: Fri, 5 Aug 2005 11:32:03 +0000 Subject: [PATCH] added initial version --- .../scheduler/bin/createGstreamerRegistry.sh | 158 ++++++++++++++++++ 1 file changed, 158 insertions(+) create mode 100644 livesupport/products/scheduler/bin/createGstreamerRegistry.sh diff --git a/livesupport/products/scheduler/bin/createGstreamerRegistry.sh b/livesupport/products/scheduler/bin/createGstreamerRegistry.sh new file mode 100644 index 000000000..348a04bfc --- /dev/null +++ b/livesupport/products/scheduler/bin/createGstreamerRegistry.sh @@ -0,0 +1,158 @@ +#!/bin/sh +#------------------------------------------------------------------------------- +# Copyright (c) 2004 Media Development Loan Fund +# +# This file is part of the LiveSupport project. +# http://livesupport.campware.org/ +# To report bugs, send an e-mail to bugs@campware.org +# +# LiveSupport is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# LiveSupport is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with LiveSupport; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# +# Author : $Author: fgerlits $ +# Version : $Revision: 1.1 $ +# Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/bin/Attic/createGstreamerRegistry.sh,v $ +#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------- +# This script registers Gstremer plugins. +# +# Invoke as: +# ./bin/createGstreamerRegistry.sh +# +# To get usage help, try the -h option +#------------------------------------------------------------------------------- + +#------------------------------------------------------------------------------- +# Determine directories, files +#------------------------------------------------------------------------------- +reldir=`dirname $0`/.. +basedir=`cd $reldir; pwd;` +bindir=$basedir/bin +etcdir=$basedir/etc +docdir=$basedir/doc +tmpdir=$basedir/tmp +usrdir=$basedir/usr + + +#------------------------------------------------------------------------------- +# Print the usage information for this script. +#------------------------------------------------------------------------------- +printUsage() +{ + echo "LiveSupport scheduler Gstreamer registry creating script."; + echo "parameters"; + echo ""; + echo " -d, --directory The installation directory, required."; + echo " -h, --help Print this message and exit."; + echo ""; +} + + +#------------------------------------------------------------------------------- +# Process command line parameters +#------------------------------------------------------------------------------- +CMD=${0##*/} + +opts=$(getopt -o D:h -l directory:,help -n $CMD -- "$@") || exit 1 +eval set -- "$opts" +while true; do + case "$1" in + -d|--directory) + installdir=$2; + shift; shift;; + -h|--help) + printUsage; + exit 0;; + --) + shift; + break;; + *) + echo "Unrecognized option $1."; + printUsage; + exit 1; + esac +done + +if [ "x$installdir" == "x" ]; then + echo "Required parameter install directory not specified."; + printUsage; + exit 1; +fi + +echo "Registering Gstreamer plugins for LiveSupport station."; +echo ""; +echo "Using the following installation parameters:"; +echo ""; +echo " installation directory: $installdir"; +echo "" + + +#------------------------------------------------------------------------------- +# The details of installation +#------------------------------------------------------------------------------- +install_lib=$installdir/lib +install_etc=$installdir/etc +install_bin=$installdir/bin + + +#------------------------------------------------------------------------------- +# Function to check for the existence of an executable on the PATH +# +# @param $1 the name of the exectuable +# @return 0 if the executable exists on the PATH, non-0 otherwise +#------------------------------------------------------------------------------- +check_exe() { + if [ -x "`which $1 2> /dev/null`" ]; then + echo "Executable $1 found..."; + return 0; + else + echo "Executable $1 not found..."; + return 1; + fi +} + + +#------------------------------------------------------------------------------- +# Check to see if this script is being run as root +#------------------------------------------------------------------------------- +if [ `whoami` != "root" ]; then + echo "Please run this script as root."; + exit ; +fi + + +#------------------------------------------------------------------------------- +# Check for required tools +#------------------------------------------------------------------------------- +echo "Checking for required tools..." + +check_exe "find" || exit 1; + + +#------------------------------------------------------------------------------- +# Create the ODBC data source and driver +#------------------------------------------------------------------------------- +gstreamer_dir=`find $install_lib -type d -name "gstreamer-*"` +export LD_LIBRARY_PATH=$install_lib +export GST_REGISTRY=$install_etc/gst-registry.xml +export GST_PLUGIN_PATH=$gstreamer_dir +$install_bin/gst-register > /dev/null 2>&1 + + +#------------------------------------------------------------------------------- +# Say goodbye +#------------------------------------------------------------------------------- +echo "Done." +