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-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
update-rc.d campcaster-scheduler defaults 92 || true
/etc/init.d/campcaster-scheduler start || true

View File

@ -37,99 +37,44 @@ ls_dbuser=campcaster
#-------------------------------------------------------------------------------
check_exe() {
if [ -x "`which $1 2> /dev/null`" ]; then
echo "Exectuable $1 found...";
return 0;
else
echo "Exectuable $1 not found...";
return 1;
fi
}
case "$1" in
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
;;
remove|upgrade|failed-upgrade|abort-install|abort-upgrade)
;;
purge|disappear)
echo "Checking for required tools..."
purge|disappear)
# check for the required tools
check_exe "psql" || psql_found=no
check_exe "psql" || exit 1;
check_exe "odbcinst" || exit 1;
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
if [ "x$psql_found" != "xno" ] ; then
# kill open connections to the Campcaster database
$postgresql_init_script stop
$postgresql_init_script start
echo "Removing Campcaster ODBC data source...";
odbcinst -u -s -l -n $ls_database || exit 1;
# remove the PostgreSQL database and user
su - $postgres_user -c \
"echo \"DROP DATABASE \\\"$ls_database\\\" \" | psql template1" \
|| echo "Couldn't drop database $ls_database.";
su - $postgres_user -c \
"echo \"DROP USER $ls_dbuser \" | psql template1" \
|| echo "Couldn't drop database user $ls_dbuser.";
fi
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 \
"echo \"DROP DATABASE \\\"$ls_database\\\" \"\
| psql template1" \
|| echo "Couldn't drop database $ls_database.";
su - $postgres_user -c "echo \"DROP USER $ls_dbuser \"\
| psql template1" \
|| 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
;;
# 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
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically

View File

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

View File

@ -16,12 +16,70 @@ set -e
# for details, see http://www.debian.org/doc/debian-policy/ or
# 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
remove|upgrade|deconfigure)
# stop the livesupport scheduler daemon
/etc/init.d/campcaster-scheduler stop || 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)

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
* 1.1.0 first release candidate

View File

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

View File

@ -81,8 +81,6 @@ install-arch:
$(CURDIR)/debian/campcaster-libs/opt/campcaster
mv -f $(CURDIR)/debian/campcaster/opt/campcaster/bin/gst-* \
$(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
mkdir -p $(CURDIR)/debian/campcaster-station