packaging config file updates, part of #2016

This commit is contained in:
fgerlits 2006-12-01 12:59:22 +00:00
parent c1c32bceb7
commit e130b16409
7 changed files with 96 additions and 86 deletions

View file

@ -27,7 +27,7 @@ case "$1" in
--postgresql-dir=/etc/postgresql/8.1/main \ --postgresql-dir=/etc/postgresql/8.1/main \
--postgresql-init-script=/etc/init.d/postgresql-8.1 --postgresql-init-script=/etc/init.d/postgresql-8.1
# register and start the livesupport scheduler daemon # register and start the Campcaster scheduler daemon
cp -f $installdir/etc/campcaster-scheduler /etc/init.d cp -f $installdir/etc/campcaster-scheduler /etc/init.d
update-rc.d campcaster-scheduler defaults 92 || true update-rc.d campcaster-scheduler defaults 92 || true
/etc/init.d/campcaster-scheduler start || true /etc/init.d/campcaster-scheduler start || true

View file

@ -37,10 +37,8 @@ ls_dbuser=campcaster
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
check_exe() { check_exe() {
if [ -x "`which $1 2> /dev/null`" ]; then if [ -x "`which $1 2> /dev/null`" ]; then
echo "Exectuable $1 found...";
return 0; return 0;
else else
echo "Exectuable $1 not found...";
return 1; return 1;
fi fi
} }
@ -48,88 +46,35 @@ check_exe() {
case "$1" in case "$1" in
remove|upgrade|failed-upgrade|abort-install|abort-upgrade) remove|upgrade|failed-upgrade|abort-install|abort-upgrade)
# remove the init script
rm -f /etc/init.d/campcaster-scheduler
update-rc.d campcaster-scheduler remove
# remove the symlink to the campcaster web pages
rm -f $apache_docroot/campcaster
# restore the old pg_hba.conf file
if [ -f $postgresql_dir/pg_hba.conf ] \
&& [ -f $postgresql_dir/pg_hba.conf.before-campcaster ] ; then
mv -f $postgresql_dir/pg_hba.conf \
$postgresql_dir/pg_hba.conf.campcaster ;
mv -f $postgresql_dir/pg_hba.conf.before-campcaster \
$postgresql_dir/pg_hba.conf ;
fi
;; ;;
purge|disappear) purge|disappear)
echo "Checking for required tools..." # check for the required tools
check_exe "psql" || psql_found=no
check_exe "psql" || exit 1; if [ "x$psql_found" != "xno" ] ; then
check_exe "odbcinst" || exit 1; # kill open connections to the Campcaster database
echo "Deleting data files...";
rm -rf $installdir/etc/campcaster-scheduler.xml
rm -rf $installdir/etc/gst-registry.xml
rm -rf $installdir/etc/pear.conf
rm -rf $installdir/var/Campcaster/htmlUI/var/html/img/*
rm -rf $installdir/var/Campcaster/htmlUI/var/templates_c/*
rm -rf $installdir/var/Campcaster/storageServer/var/stor/*
rm -rf $installdir/var/Campcaster/storageServer/var/access/*
rm -rf $installdir/var/Campcaster/storageServer/var/trans/*
rm -rf $installdir/var/Campcaster/archiveServer/var/stor/*
rm -rf $installdir/var/Campcaster/archiveServer/var/access/*
rm -rf $installdir/var/Campcaster/archiveServer/var/trans/*
echo "Removing ODBC data source and driver...";
# kill active connections to database
$postgresql_init_script stop $postgresql_init_script stop
$postgresql_init_script start $postgresql_init_script start
echo "Removing Campcaster ODBC data source..."; # remove the PostgreSQL database and user
odbcinst -u -s -l -n $ls_database || exit 1;
echo "De-registering ODBC PostgreSQL driver...";
odbcinst -u -d -n PostgreSQL_Campcaster || exit 1;
echo "Removing database and database user...";
if [ "x$ls_dbserver" == "xlocalhost" ]; then
su - $postgres_user -c \ su - $postgres_user -c \
"echo \"DROP DATABASE \\\"$ls_database\\\" \"\ "echo \"DROP DATABASE \\\"$ls_database\\\" \" | psql template1" \
| psql template1" \
|| echo "Couldn't drop database $ls_database."; || echo "Couldn't drop database $ls_database.";
su - $postgres_user -c \
su - $postgres_user -c "echo \"DROP USER $ls_dbuser \"\ "echo \"DROP USER $ls_dbuser \" | psql template1" \
| psql template1" \
|| echo "Couldn't drop database user $ls_dbuser."; || echo "Couldn't drop database user $ls_dbuser.";
else
echo "Unable to automatically drop database user and table for";
echo "remote database $ls_dbserver.";
echo "Make sure to drop database user $ls_dbuser on database";
echo "server at $ls_dbserver.";
echo "Also drop the database called $ld_database.";
echo "";
echo "The easiest way to achieve this is by issuing the";
echo "following SQL commands to PostgreSQL:";
echo "DROP DATABASE \"$ls_database\";";
echo "DROP USER $ls_dbuser;";
fi fi
# remove generated files
rm -rf $installdir/var/Campcaster/storageServer/var/stor/*
rm -rf $installdir/var/Campcaster/archiveServer/var/stor/*
;; ;;
*) *)
echo "postrm called with unknown argument \`$1'" >&2 echo "postrm called with unknown argument \`$1'" >&2
exit 1 exit 1
;;
esac esac
# dh_installdeb will replace this with shell code automatically # dh_installdeb will replace this with shell code automatically

View file

@ -15,12 +15,13 @@ set -e
# the debian-policy package # the debian-policy package
case "$1" in case "$1" in
install|upgrade) install)
if [ "$1" = "upgrade" ]; then ;;
echo "Stopping the campcaster-scheduler daemon..."
upgrade)
# stop the Campcaster scheduler daemon
/etc/init.d/campcaster-scheduler stop || true /etc/init.d/campcaster-scheduler stop || true
/etc/init.d/campcaster-scheduler kill || true /etc/init.d/campcaster-scheduler kill || true
fi
;; ;;
abort-upgrade) abort-upgrade)

View file

@ -16,12 +16,70 @@ set -e
# for details, see http://www.debian.org/doc/debian-policy/ or # for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package # the debian-policy package
installdir=/opt/campcaster
apache_docroot=/var/www
postgres_user=postgres
postgresql_dir=/etc/postgresql/8.1/main
postgresql_init_script=/etc/init.d/postgresql-8.1
ls_dbserver=localhost
ls_database=Campcaster
ls_dbuser=campcaster
#-------------------------------------------------------------------------------
# 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
return 0;
else
return 1;
fi
}
case "$1" in case "$1" in
remove|upgrade|deconfigure) remove|upgrade|deconfigure)
# stop the livesupport scheduler daemon # stop the livesupport scheduler daemon
/etc/init.d/campcaster-scheduler stop || true /etc/init.d/campcaster-scheduler stop || true
/etc/init.d/campcaster-scheduler kill || true /etc/init.d/campcaster-scheduler kill || true
# remove the init script
rm -f /etc/init.d/campcaster-scheduler
update-rc.d campcaster-scheduler remove || true
# remove the ODBC data source and driver
check_exe "odbcinst" || odbcinst_found=no
if [ "x$odbcinst_found" != "xno" ] ; then
odbcinst -u -s -l -n $ls_database
odbcinst -u -d -n PostgreSQL_Campcaster
fi
# remove the symlink to the campcaster web pages
rm -f $apache_docroot/campcaster
# restore the old pg_hba.conf file
if [ -f $postgresql_dir/pg_hba.conf ] \
&& [ -f $postgresql_dir/pg_hba.conf.before-campcaster ] ; then
mv -f $postgresql_dir/pg_hba.conf.before-campcaster \
$postgresql_dir/pg_hba.conf ;
fi
# remove generated files
rm -rf $installdir/etc/gst-registry.xml
rm -rf $installdir/etc/pear.conf
rm -rf $installdir/var/Campcaster/htmlUI/var/html/img/*
rm -rf $installdir/var/Campcaster/htmlUI/var/templates_c/*
rm -rf $installdir/var/Campcaster/storageServer/var/access/*
rm -rf $installdir/var/Campcaster/storageServer/var/trans/*
rm -rf $installdir/var/Campcaster/archiveServer/var/access/*
rm -rf $installdir/var/Campcaster/archiveServer/var/trans/*
;; ;;
failed-upgrade) failed-upgrade)

View file

@ -1,3 +1,10 @@
campcaster (1.1.0-1) dapper; urgency=low
* 1.1.0 final release
-- Ferenc Gerlits <fgerlits@campware.org> Fri, 01 Dec 2006 12:57:51 +0100
campcaster (1.1.0rc1-1) unstable; urgency=low campcaster (1.1.0rc1-1) unstable; urgency=low
* 1.1.0 first release candidate * 1.1.0 first release candidate

View file

@ -77,7 +77,7 @@ Description: A radio program automation and support tool.
Package: campcaster-station Package: campcaster-station
Architecture: any Architecture: any
Depends: ${shlibs:Depends}, Depends: ${shlibs:Depends},
campcaster-libs (>= ${dpkg:Version}), campcaster-libs (= ${dpkg:Version}),
sed, sed,
unixodbc (>= 2.2), unixodbc (>= 2.2),
odbc-postgresql, odbc-postgresql,
@ -112,7 +112,8 @@ Description: A radio program automation and support tool.
Package: campcaster-studio Package: campcaster-studio
Architecture: any Architecture: any
Depends: ${shlibs:Depends}, Depends: ${shlibs:Depends},
campcaster-libs (>= ${dpkg:Version}), campcaster-libs (= ${dpkg:Version}),
campcaster-station (= ${dpkg:Version}),
sed, sed,
unixodbc (>= 2.2), unixodbc (>= 2.2),
odbc-postgresql, odbc-postgresql,

View file

@ -81,8 +81,6 @@ install-arch:
$(CURDIR)/debian/campcaster-libs/opt/campcaster $(CURDIR)/debian/campcaster-libs/opt/campcaster
mv -f $(CURDIR)/debian/campcaster/opt/campcaster/bin/gst-* \ mv -f $(CURDIR)/debian/campcaster/opt/campcaster/bin/gst-* \
$(CURDIR)/debian/campcaster-libs/opt/campcaster/bin $(CURDIR)/debian/campcaster-libs/opt/campcaster/bin
mv -f $(CURDIR)/debian/campcaster/opt/campcaster/usr/lib/pear \
$(CURDIR)/debian/campcaster-libs/opt/campcaster/usr/lib
# now separate the station (server) files into debian/campcaster-station # now separate the station (server) files into debian/campcaster-station
mkdir -p $(CURDIR)/debian/campcaster-station mkdir -p $(CURDIR)/debian/campcaster-station