rev 4513 - in kde-extras/icecream: tags tags/0.7.14-2/debian
trunk/debian
Fathi Boudra
fboudra-guest at costa.debian.org
Sun Sep 17 21:42:45 UTC 2006
Author: fboudra-guest
Date: 2006-09-17 21:42:44 +0000 (Sun, 17 Sep 2006)
New Revision: 4513
Added:
kde-extras/icecream/tags/0.7.14-2/
Modified:
kde-extras/icecream/tags/0.7.14-2/debian/changelog
kde-extras/icecream/tags/0.7.14-2/debian/icecc.config
kde-extras/icecream/tags/0.7.14-2/debian/icecc.dirs
kde-extras/icecream/tags/0.7.14-2/debian/icecc.init
kde-extras/icecream/tags/0.7.14-2/debian/icecc.postinst
kde-extras/icecream/tags/0.7.14-2/debian/icecc.postrm
kde-extras/icecream/tags/0.7.14-2/debian/rules
kde-extras/icecream/trunk/debian/changelog
kde-extras/icecream/trunk/debian/icecc.config
kde-extras/icecream/trunk/debian/icecc.dirs
kde-extras/icecream/trunk/debian/icecc.init
kde-extras/icecream/trunk/debian/icecc.postinst
kde-extras/icecream/trunk/debian/icecc.postrm
kde-extras/icecream/trunk/debian/rules
Log:
tags icecc 0.7.14-2
Copied: kde-extras/icecream/tags/0.7.14-2 (from rev 4509, kde-extras/icecream/trunk)
Modified: kde-extras/icecream/tags/0.7.14-2/debian/changelog
===================================================================
--- kde-extras/icecream/trunk/debian/changelog 2006-09-17 12:10:26 UTC (rev 4509)
+++ kde-extras/icecream/tags/0.7.14-2/debian/changelog 2006-09-17 21:42:44 UTC (rev 4513)
@@ -1,12 +1,11 @@
icecc (0.7.14-2) unstable; urgency=low
- * TODO:
- * use icecc.default instead of embedding it in postinst
- * fix init.d-script-missing-lsb-section /etc/init.d/icecc
+ * Add LSB section to init script
+ * Use icecc.default instead of embedding it in postinst
* Unmark Default field as translatable in debconf templates (Closes: #387521)
* Rewrite long description (Closes: #387096)
- -- Fathi Boudra <fboudra at free.fr> Mon, 11 Sep 2006 22:06:47 +0200
+ -- Fathi Boudra <fboudra at free.fr> Sun, 17 Sep 2006 23:26:54 +0200
icecc (0.7.14-1) unstable; urgency=low
Modified: kde-extras/icecream/tags/0.7.14-2/debian/icecc.config
===================================================================
--- kde-extras/icecream/trunk/debian/icecc.config 2006-09-17 12:10:26 UTC (rev 4509)
+++ kde-extras/icecream/tags/0.7.14-2/debian/icecc.config 2006-09-17 21:42:44 UTC (rev 4513)
@@ -1,36 +1,27 @@
#!/bin/sh
# icecc package configuration script
-conffile="/etc/default/icecc"
+set -e
-get_config_file()
-{
- config_field=$1
- db_field=$2
-
- if [ -f "$conffile" ] ; then
- VALUE="$(grep "^[ ]*$config_field" $conffile | sed -e "s/^$config_field *= *\"\(.*\)\"/\1/g")"
- if [ -n "$VALUE" ] ; then
- db_set $db_field "$VALUE"
- fi
- fi
-}
+# configure some variables
+CONFIGFILE=/etc/default/icecc
-# Source debconf library -- we have a Depends line
-# to make sure it is there...
+# source debconf stuff
. /usr/share/debconf/confmodule
db_version 2.0
-if [ "$1" = configure -o "$1" = reconfigure ] ; then
-
- get_config_file START_ICECC icecc/daemon
- db_input medium icecc/daemon || true
- db_go
-
- get_config_file START_ICECC_SCHEDULER icecc/scheduler
- db_input medium icecc/scheduler || true
- db_go
-
+# source configuration file if exists
+if [ -e $CONFIGFILE ]; then
+ . $CONFIGFILE || true
+
+ # set configuration file values in debconf database
+ db_set icecc/daemon "$START_ICECC"
+ db_set icecc/scheduler "$START_ICECC_SCHEDULER"
fi
+# ask questions
+db_input medium icecc/daemon || true
+db_input medium icecc/scheduler || true
+db_go || true
+
exit 0
Modified: kde-extras/icecream/tags/0.7.14-2/debian/icecc.dirs
===================================================================
--- kde-extras/icecream/trunk/debian/icecc.dirs 2006-09-17 12:10:26 UTC (rev 4509)
+++ kde-extras/icecream/tags/0.7.14-2/debian/icecc.dirs 2006-09-17 21:42:44 UTC (rev 4513)
@@ -1 +1 @@
-var/cache/icecc
\ No newline at end of file
+var/cache/icecc
etc/icecc
\ No newline at end of file
Modified: kde-extras/icecream/tags/0.7.14-2/debian/icecc.init
===================================================================
--- kde-extras/icecream/trunk/debian/icecc.init 2006-09-17 12:10:26 UTC (rev 4509)
+++ kde-extras/icecream/tags/0.7.14-2/debian/icecc.init 2006-09-17 21:42:44 UTC (rev 4513)
@@ -1,26 +1,25 @@
#!/bin/sh
-#
-# iceccd Debian init.d script contributed by Jason Thomas. (Debian #161136)
-#
-# skeleton example file to build /etc/init.d/ scripts.
-# This file should be used to construct scripts for /etc/init.d.
-#
-# Written by Miquel van Smoorenburg <miquels at cistron.nl>.
-# Modified for Debian GNU/Linux
-# by Ian Murdock <imurdock at gnu.ai.mit.edu>
-# by Carsten Wolff <carsten at wolffcarsten.de>.
-#
-# Version: @(#)skeleton 1.9.1 08-Apr-2002 miquels at cistron.nl
-#
+### BEGIN INIT INFO
+# Provides: icecc
+# Required-Start: $local_fs $remote_fs
+# Required-Stop: $local_fs $remote_fs
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: control icecc daemon and scheduler start at boot time
+# Description: control icecc daemon and scheduler start at boot time by
+# sourcing /etc/default/icecc and /etc/icecc/icecc.conf.
+### END INIT INFO
DAEMONNAME=iceccd
DAEMON=/usr/sbin/$DAEMONNAME
SCHEDULERNAME=icecc-scheduler
SCHEDULER=/usr/sbin/$SCHEDULERNAME
DEFAULT=/etc/default/icecc
+CONF=/etc/icecc/icecc.conf
DESC="Distributed Compiler Daemon"
-# Reads config file
+# Read configuration files
+[ -r $CONF ] && . $CONF
[ -r $DEFAULT ] && . $DEFAULT
test -x $DAEMON || exit 0
@@ -29,63 +28,55 @@
netname=
if test -n "$ICECC_NETNAME"; then
- netname="-n $ICECC_NETNAME"
+ netname="-n $ICECC_NETNAME"
fi
-
-
start_daemon() {
- logfile=""
- if test -n "$ICECC_LOG_FILE"; then
- logfile="-l $ICECC_LOG_FILE"
- fi
- nice=
- if test -n "$ICECC_NICE_LEVEL"; then
- nice="--nice $ICECC_NICE_LEVEL"
- fi
- scheduler=
- if test -n "$ICECC_SCHEDULER_HOST"; then
- scheduler="-s $ICECC_SCHEDULER_HOST"
- fi
- basedir=
- if test -n "$ICECC_BASEDIR"; then
- basedir="-b $ICECC_BASEDIR"
- fi
- maxjobs=
- if test -n "$ICECC_MAX_JOBS"; then
- maxjobs="-m $ICECC_MAX_JOBS"
- fi
- start-stop-daemon --start --quiet --exec $DAEMON -- \
- -d "$logfile" $nice $scheduler $netname -u icecc $basedir $maxjobs
+ logfile=""
+ if test -n "$ICECC_LOG_FILE"; then
+ logfile="-l $ICECC_LOG_FILE"
+ fi
+ nice=
+ if test -n "$ICECC_NICE_LEVEL"; then
+ nice="--nice $ICECC_NICE_LEVEL"
+ fi
+ scheduler=
+ if test -n "$ICECC_SCHEDULER_HOST"; then
+ scheduler="-s $ICECC_SCHEDULER_HOST"
+ fi
+ basedir=
+ if test -n "$ICECC_BASEDIR"; then
+ basedir="-b $ICECC_BASEDIR"
+ fi
+ maxjobs=
+ if test -n "$ICECC_MAX_JOBS"; then
+ maxjobs="-m $ICECC_MAX_JOBS"
+ fi
+
+ start-stop-daemon --start --quiet --exec $DAEMON -- \
+ -d "$logfile" $nice $scheduler $netname -u icecc $basedir $maxjobs
}
-
-
stop_daemon() {
- start-stop-daemon --stop --quiet --signal TERM --oknodo --exec $DAEMON
+ start-stop-daemon --stop --quiet --signal TERM --oknodo --exec $DAEMON
}
-
-
start_scheduler() {
- if test -z "$ICECC_SCHEDULER_LOG_FILE"; then
- ICECC_SCHEDULER_LOG_FILE="/var/log/icecc_scheduler"
- fi
- logfile="-l $ICECC_SCHEDULER_LOG_FILE"
- : > $ICECC_SCHEDULER_LOG_FILE
- chown icecc $ICECC_SCHEDULER_LOG_FILE
- start-stop-daemon --start --quiet --chuid icecc \
- --exec $SCHEDULER -- -d $logfile $netname
+ if test -z "$ICECC_SCHEDULER_LOG_FILE"; then
+ ICECC_SCHEDULER_LOG_FILE="/var/log/icecc_scheduler"
+ fi
+
+ logfile="-l $ICECC_SCHEDULER_LOG_FILE"
+ : > $ICECC_SCHEDULER_LOG_FILE
+ chown icecc $ICECC_SCHEDULER_LOG_FILE
+ start-stop-daemon --start --quiet --chuid icecc \
+ --exec $SCHEDULER -- -d $logfile $netname
}
-
-
stop_scheduler() {
- start-stop-daemon --stop --quiet --signal TERM --oknodo --exec $SCHEDULER
+ start-stop-daemon --stop --quiet --signal TERM --oknodo --exec $SCHEDULER
}
-
-
case "$1" in
start)
if [ "$START_ICECC" == "true" ]; then
@@ -145,4 +136,3 @@
exit 0
-
Modified: kde-extras/icecream/tags/0.7.14-2/debian/icecc.postinst
===================================================================
--- kde-extras/icecream/trunk/debian/icecc.postinst 2006-09-17 12:10:26 UTC (rev 4509)
+++ kde-extras/icecream/tags/0.7.14-2/debian/icecc.postinst 2006-09-17 21:42:44 UTC (rev 4513)
@@ -1,68 +1,53 @@
#!/bin/sh -e
# postinst script for icecc
-conffile="/etc/default/icecc"
+set -e
-update_config_file()
-{
- db_field=$1
- config_field=$2
-
- RET=false
- db_get $db_field
- if grep -q "^$config_field" $conffile ; then
- # keep any admin changes, while replacing the variable content
- sed "s#^[ ]*$config_field=\".*\"#$config_field=\"$RET\"#" < $conffile > $conffile.new &&
- mv $conffile.new $conffile
- else
- echo "$config_field=\"$RET\"" >> $conffile
- fi
-}
+# configure some variables
+CONFIGFILE=/etc/default/icecc
+ICECC_GROUP=icecc
+ICECC_USER=icecc
+ICECC_HOME=/var/cache/icecc
+# source debconf stuff
. /usr/share/debconf/confmodule
db_version 2.0
-case "$1" in
- configure)
- if [ -f $conffile ] ; then
- sed -e "s/^[ ]*START_ICECC/START_ICECC/g" $conffile > $conffile.new
- mv $conffile.new $conffile
- sed -e "s/^[ ]*START_ICECC_SCHEDULER/START_ICECC_SCHEDULER/g" $conffile > $conffile.new
- mv $conffile.new $conffile
- else
- fi
+# generate configuration file
+echo "# Defaults for icecc initscript" > $CONFIGFILE
+echo "# sourced by /etc/init.d/icecc" >> $CONFIGFILE
+echo "START_ICECC=" >> $CONFIGFILE
+echo "START_ICECC_SCHEDULER=" >> $CONFIGFILE
- update_config_file icecc/daemon START_ICECC
- update_config_file icecc/scheduler START_ICECC_SCHEDULER
+# retrieve various configuration options from debconf
+db_get icecc/daemon
+START_ICECC="$RET"
- ICECC_GROUP=icecc
- ICECC_USER=icecc
- ICECC_HOME=/var/cache/icecc
+db_get icecc/scheduler
+START_ICECC_SCHEDULER="$RET"
- # Create group
- grep -q $ICECC_GROUP /etc/group || \
- ( echo Creating $ICECC_GROUP group... ; \
- addgroup --quiet --system $ICECC_GROUP)
+# done with debconf
+db_stop
- # Create user
- grep -q $ICECC_USER /etc/passwd || \
- ( echo Creating $ICECC_USER user... ; \
- adduser --quiet --system --ingroup $ICECC_GROUP \
- --home $ICECC_HOME --no-create-home $ICECC_USER )
+cp -a -f $CONFIGFILE $CONFIGFILE.tmp
- chown $ICECC_USER:$ICECC_GROUP $ICECC_HOME
+sed -e "s/^ *START_ICECC=.*/START_ICECC=\"$START_ICECC\"/" \
+ -e "s/^ *START_ICECC_SCHEDULER=.*/START_ICECC_SCHEDULER=\"$START_ICECC_SCHEDULER\"/" \
+ < $CONFIGFILE > $CONFIGFILE.tmp
- db_stop
- ;;
- abort-upgrade|abort-remove|abort-deconfigure)
- ;;
-
- *)
- echo "postinst called with unknown argument \`$1'" >&2
- exit 1
- ;;
-esac
+mv -f $CONFIGFILE.tmp $CONFIGFILE
+# create group
+grep -q $ICECC_GROUP /etc/group || ( echo Creating $ICECC_GROUP group... ; \
+addgroup --quiet --system $ICECC_GROUP)
+
+# create user
+grep -q $ICECC_USER /etc/passwd || ( echo Creating $ICECC_USER user... ; \
+adduser --quiet --system --ingroup $ICECC_GROUP \
+--home $ICECC_HOME --no-create-home $ICECC_USER )
+
+chown $ICECC_USER:$ICECC_GROUP $ICECC_HOME
+
#DEBHELPER#
exit 0
Modified: kde-extras/icecream/tags/0.7.14-2/debian/icecc.postrm
===================================================================
--- kde-extras/icecream/trunk/debian/icecc.postrm 2006-09-17 12:10:26 UTC (rev 4509)
+++ kde-extras/icecream/tags/0.7.14-2/debian/icecc.postrm 2006-09-17 21:42:44 UTC (rev 4513)
@@ -3,16 +3,12 @@
set -e
-conffile="/etc/default/icecc"
+# configure some variables
+ICECC_GROUP=icecc
+ICECC_USER=icecc
case "$1" in
purge)
- ICECC_GROUP=icecc
- ICECC_USER=icecc
- ICECC_HOME=/var/cache/icecc
-
- rm -f $conffile
-
grep -q $ICECC_USER /etc/passwd && \
(echo Deleting $ICECC_USER user... ; \
deluser --quiet --system $ICECC_USER)
@@ -21,7 +17,9 @@
(echo Deleting $ICECC_GROUP group... ; \
delgroup --quiet --system $ICECC_GROUP)
- rm -rf $ICECC_HOME
+ rm -rf /etc/icecc
+ rm -rf /var/cache/icecc
+ rm -f /etc/default/icecc
;;
remove)
;;
Modified: kde-extras/icecream/tags/0.7.14-2/debian/rules
===================================================================
--- kde-extras/icecream/trunk/debian/rules 2006-09-17 12:10:26 UTC (rev 4509)
+++ kde-extras/icecream/tags/0.7.14-2/debian/rules 2006-09-17 21:42:44 UTC (rev 4513)
@@ -15,6 +15,9 @@
/usr/bin/docbook2x-man $$i; \
done
+install/icecc::
+ install -D -p -m0644 debian/icecc.conf debian/icecc/etc/icecc/icecc.conf
+
clean::
rm -f *.1
Modified: kde-extras/icecream/trunk/debian/changelog
===================================================================
--- kde-extras/icecream/trunk/debian/changelog 2006-09-17 15:06:56 UTC (rev 4512)
+++ kde-extras/icecream/trunk/debian/changelog 2006-09-17 21:42:44 UTC (rev 4513)
@@ -1,12 +1,11 @@
icecc (0.7.14-2) unstable; urgency=low
- * TODO:
- * use icecc.default instead of embedding it in postinst
- * fix init.d-script-missing-lsb-section /etc/init.d/icecc
+ * Add LSB section to init script
+ * Use icecc.default instead of embedding it in postinst
* Unmark Default field as translatable in debconf templates (Closes: #387521)
* Rewrite long description (Closes: #387096)
- -- Fathi Boudra <fboudra at free.fr> Mon, 11 Sep 2006 22:06:47 +0200
+ -- Fathi Boudra <fboudra at free.fr> Sun, 17 Sep 2006 23:26:54 +0200
icecc (0.7.14-1) unstable; urgency=low
Modified: kde-extras/icecream/trunk/debian/icecc.config
===================================================================
--- kde-extras/icecream/trunk/debian/icecc.config 2006-09-17 15:06:56 UTC (rev 4512)
+++ kde-extras/icecream/trunk/debian/icecc.config 2006-09-17 21:42:44 UTC (rev 4513)
@@ -1,36 +1,27 @@
#!/bin/sh
# icecc package configuration script
-conffile="/etc/default/icecc"
+set -e
-get_config_file()
-{
- config_field=$1
- db_field=$2
-
- if [ -f "$conffile" ] ; then
- VALUE="$(grep "^[ ]*$config_field" $conffile | sed -e "s/^$config_field *= *\"\(.*\)\"/\1/g")"
- if [ -n "$VALUE" ] ; then
- db_set $db_field "$VALUE"
- fi
- fi
-}
+# configure some variables
+CONFIGFILE=/etc/default/icecc
-# Source debconf library -- we have a Depends line
-# to make sure it is there...
+# source debconf stuff
. /usr/share/debconf/confmodule
db_version 2.0
-if [ "$1" = configure -o "$1" = reconfigure ] ; then
-
- get_config_file START_ICECC icecc/daemon
- db_input medium icecc/daemon || true
- db_go
-
- get_config_file START_ICECC_SCHEDULER icecc/scheduler
- db_input medium icecc/scheduler || true
- db_go
-
+# source configuration file if exists
+if [ -e $CONFIGFILE ]; then
+ . $CONFIGFILE || true
+
+ # set configuration file values in debconf database
+ db_set icecc/daemon "$START_ICECC"
+ db_set icecc/scheduler "$START_ICECC_SCHEDULER"
fi
+# ask questions
+db_input medium icecc/daemon || true
+db_input medium icecc/scheduler || true
+db_go || true
+
exit 0
Modified: kde-extras/icecream/trunk/debian/icecc.dirs
===================================================================
--- kde-extras/icecream/trunk/debian/icecc.dirs 2006-09-17 15:06:56 UTC (rev 4512)
+++ kde-extras/icecream/trunk/debian/icecc.dirs 2006-09-17 21:42:44 UTC (rev 4513)
@@ -1 +1 @@
-var/cache/icecc
\ No newline at end of file
+var/cache/icecc
etc/icecc
\ No newline at end of file
Modified: kde-extras/icecream/trunk/debian/icecc.init
===================================================================
--- kde-extras/icecream/trunk/debian/icecc.init 2006-09-17 15:06:56 UTC (rev 4512)
+++ kde-extras/icecream/trunk/debian/icecc.init 2006-09-17 21:42:44 UTC (rev 4513)
@@ -1,26 +1,25 @@
#!/bin/sh
-#
-# iceccd Debian init.d script contributed by Jason Thomas. (Debian #161136)
-#
-# skeleton example file to build /etc/init.d/ scripts.
-# This file should be used to construct scripts for /etc/init.d.
-#
-# Written by Miquel van Smoorenburg <miquels at cistron.nl>.
-# Modified for Debian GNU/Linux
-# by Ian Murdock <imurdock at gnu.ai.mit.edu>
-# by Carsten Wolff <carsten at wolffcarsten.de>.
-#
-# Version: @(#)skeleton 1.9.1 08-Apr-2002 miquels at cistron.nl
-#
+### BEGIN INIT INFO
+# Provides: icecc
+# Required-Start: $local_fs $remote_fs
+# Required-Stop: $local_fs $remote_fs
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: control icecc daemon and scheduler start at boot time
+# Description: control icecc daemon and scheduler start at boot time by
+# sourcing /etc/default/icecc and /etc/icecc/icecc.conf.
+### END INIT INFO
DAEMONNAME=iceccd
DAEMON=/usr/sbin/$DAEMONNAME
SCHEDULERNAME=icecc-scheduler
SCHEDULER=/usr/sbin/$SCHEDULERNAME
DEFAULT=/etc/default/icecc
+CONF=/etc/icecc/icecc.conf
DESC="Distributed Compiler Daemon"
-# Reads config file
+# Read configuration files
+[ -r $CONF ] && . $CONF
[ -r $DEFAULT ] && . $DEFAULT
test -x $DAEMON || exit 0
@@ -29,63 +28,55 @@
netname=
if test -n "$ICECC_NETNAME"; then
- netname="-n $ICECC_NETNAME"
+ netname="-n $ICECC_NETNAME"
fi
-
-
start_daemon() {
- logfile=""
- if test -n "$ICECC_LOG_FILE"; then
- logfile="-l $ICECC_LOG_FILE"
- fi
- nice=
- if test -n "$ICECC_NICE_LEVEL"; then
- nice="--nice $ICECC_NICE_LEVEL"
- fi
- scheduler=
- if test -n "$ICECC_SCHEDULER_HOST"; then
- scheduler="-s $ICECC_SCHEDULER_HOST"
- fi
- basedir=
- if test -n "$ICECC_BASEDIR"; then
- basedir="-b $ICECC_BASEDIR"
- fi
- maxjobs=
- if test -n "$ICECC_MAX_JOBS"; then
- maxjobs="-m $ICECC_MAX_JOBS"
- fi
- start-stop-daemon --start --quiet --exec $DAEMON -- \
- -d "$logfile" $nice $scheduler $netname -u icecc $basedir $maxjobs
+ logfile=""
+ if test -n "$ICECC_LOG_FILE"; then
+ logfile="-l $ICECC_LOG_FILE"
+ fi
+ nice=
+ if test -n "$ICECC_NICE_LEVEL"; then
+ nice="--nice $ICECC_NICE_LEVEL"
+ fi
+ scheduler=
+ if test -n "$ICECC_SCHEDULER_HOST"; then
+ scheduler="-s $ICECC_SCHEDULER_HOST"
+ fi
+ basedir=
+ if test -n "$ICECC_BASEDIR"; then
+ basedir="-b $ICECC_BASEDIR"
+ fi
+ maxjobs=
+ if test -n "$ICECC_MAX_JOBS"; then
+ maxjobs="-m $ICECC_MAX_JOBS"
+ fi
+
+ start-stop-daemon --start --quiet --exec $DAEMON -- \
+ -d "$logfile" $nice $scheduler $netname -u icecc $basedir $maxjobs
}
-
-
stop_daemon() {
- start-stop-daemon --stop --quiet --signal TERM --oknodo --exec $DAEMON
+ start-stop-daemon --stop --quiet --signal TERM --oknodo --exec $DAEMON
}
-
-
start_scheduler() {
- if test -z "$ICECC_SCHEDULER_LOG_FILE"; then
- ICECC_SCHEDULER_LOG_FILE="/var/log/icecc_scheduler"
- fi
- logfile="-l $ICECC_SCHEDULER_LOG_FILE"
- : > $ICECC_SCHEDULER_LOG_FILE
- chown icecc $ICECC_SCHEDULER_LOG_FILE
- start-stop-daemon --start --quiet --chuid icecc \
- --exec $SCHEDULER -- -d $logfile $netname
+ if test -z "$ICECC_SCHEDULER_LOG_FILE"; then
+ ICECC_SCHEDULER_LOG_FILE="/var/log/icecc_scheduler"
+ fi
+
+ logfile="-l $ICECC_SCHEDULER_LOG_FILE"
+ : > $ICECC_SCHEDULER_LOG_FILE
+ chown icecc $ICECC_SCHEDULER_LOG_FILE
+ start-stop-daemon --start --quiet --chuid icecc \
+ --exec $SCHEDULER -- -d $logfile $netname
}
-
-
stop_scheduler() {
- start-stop-daemon --stop --quiet --signal TERM --oknodo --exec $SCHEDULER
+ start-stop-daemon --stop --quiet --signal TERM --oknodo --exec $SCHEDULER
}
-
-
case "$1" in
start)
if [ "$START_ICECC" == "true" ]; then
@@ -145,4 +136,3 @@
exit 0
-
Modified: kde-extras/icecream/trunk/debian/icecc.postinst
===================================================================
--- kde-extras/icecream/trunk/debian/icecc.postinst 2006-09-17 15:06:56 UTC (rev 4512)
+++ kde-extras/icecream/trunk/debian/icecc.postinst 2006-09-17 21:42:44 UTC (rev 4513)
@@ -1,68 +1,53 @@
#!/bin/sh -e
# postinst script for icecc
-conffile="/etc/default/icecc"
+set -e
-update_config_file()
-{
- db_field=$1
- config_field=$2
-
- RET=false
- db_get $db_field
- if grep -q "^$config_field" $conffile ; then
- # keep any admin changes, while replacing the variable content
- sed "s#^[ ]*$config_field=\".*\"#$config_field=\"$RET\"#" < $conffile > $conffile.new &&
- mv $conffile.new $conffile
- else
- echo "$config_field=\"$RET\"" >> $conffile
- fi
-}
+# configure some variables
+CONFIGFILE=/etc/default/icecc
+ICECC_GROUP=icecc
+ICECC_USER=icecc
+ICECC_HOME=/var/cache/icecc
+# source debconf stuff
. /usr/share/debconf/confmodule
db_version 2.0
-case "$1" in
- configure)
- if [ -f $conffile ] ; then
- sed -e "s/^[ ]*START_ICECC/START_ICECC/g" $conffile > $conffile.new
- mv $conffile.new $conffile
- sed -e "s/^[ ]*START_ICECC_SCHEDULER/START_ICECC_SCHEDULER/g" $conffile > $conffile.new
- mv $conffile.new $conffile
- else
- fi
+# generate configuration file
+echo "# Defaults for icecc initscript" > $CONFIGFILE
+echo "# sourced by /etc/init.d/icecc" >> $CONFIGFILE
+echo "START_ICECC=" >> $CONFIGFILE
+echo "START_ICECC_SCHEDULER=" >> $CONFIGFILE
- update_config_file icecc/daemon START_ICECC
- update_config_file icecc/scheduler START_ICECC_SCHEDULER
+# retrieve various configuration options from debconf
+db_get icecc/daemon
+START_ICECC="$RET"
- ICECC_GROUP=icecc
- ICECC_USER=icecc
- ICECC_HOME=/var/cache/icecc
+db_get icecc/scheduler
+START_ICECC_SCHEDULER="$RET"
- # Create group
- grep -q $ICECC_GROUP /etc/group || \
- ( echo Creating $ICECC_GROUP group... ; \
- addgroup --quiet --system $ICECC_GROUP)
+# done with debconf
+db_stop
- # Create user
- grep -q $ICECC_USER /etc/passwd || \
- ( echo Creating $ICECC_USER user... ; \
- adduser --quiet --system --ingroup $ICECC_GROUP \
- --home $ICECC_HOME --no-create-home $ICECC_USER )
+cp -a -f $CONFIGFILE $CONFIGFILE.tmp
- chown $ICECC_USER:$ICECC_GROUP $ICECC_HOME
+sed -e "s/^ *START_ICECC=.*/START_ICECC=\"$START_ICECC\"/" \
+ -e "s/^ *START_ICECC_SCHEDULER=.*/START_ICECC_SCHEDULER=\"$START_ICECC_SCHEDULER\"/" \
+ < $CONFIGFILE > $CONFIGFILE.tmp
- db_stop
- ;;
- abort-upgrade|abort-remove|abort-deconfigure)
- ;;
-
- *)
- echo "postinst called with unknown argument \`$1'" >&2
- exit 1
- ;;
-esac
+mv -f $CONFIGFILE.tmp $CONFIGFILE
+# create group
+grep -q $ICECC_GROUP /etc/group || ( echo Creating $ICECC_GROUP group... ; \
+addgroup --quiet --system $ICECC_GROUP)
+
+# create user
+grep -q $ICECC_USER /etc/passwd || ( echo Creating $ICECC_USER user... ; \
+adduser --quiet --system --ingroup $ICECC_GROUP \
+--home $ICECC_HOME --no-create-home $ICECC_USER )
+
+chown $ICECC_USER:$ICECC_GROUP $ICECC_HOME
+
#DEBHELPER#
exit 0
Modified: kde-extras/icecream/trunk/debian/icecc.postrm
===================================================================
--- kde-extras/icecream/trunk/debian/icecc.postrm 2006-09-17 15:06:56 UTC (rev 4512)
+++ kde-extras/icecream/trunk/debian/icecc.postrm 2006-09-17 21:42:44 UTC (rev 4513)
@@ -3,16 +3,12 @@
set -e
-conffile="/etc/default/icecc"
+# configure some variables
+ICECC_GROUP=icecc
+ICECC_USER=icecc
case "$1" in
purge)
- ICECC_GROUP=icecc
- ICECC_USER=icecc
- ICECC_HOME=/var/cache/icecc
-
- rm -f $conffile
-
grep -q $ICECC_USER /etc/passwd && \
(echo Deleting $ICECC_USER user... ; \
deluser --quiet --system $ICECC_USER)
@@ -21,7 +17,9 @@
(echo Deleting $ICECC_GROUP group... ; \
delgroup --quiet --system $ICECC_GROUP)
- rm -rf $ICECC_HOME
+ rm -rf /etc/icecc
+ rm -rf /var/cache/icecc
+ rm -f /etc/default/icecc
;;
remove)
;;
Modified: kde-extras/icecream/trunk/debian/rules
===================================================================
--- kde-extras/icecream/trunk/debian/rules 2006-09-17 15:06:56 UTC (rev 4512)
+++ kde-extras/icecream/trunk/debian/rules 2006-09-17 21:42:44 UTC (rev 4513)
@@ -15,6 +15,9 @@
/usr/bin/docbook2x-man $$i; \
done
+install/icecc::
+ install -D -p -m0644 debian/icecc.conf debian/icecc/etc/icecc/icecc.conf
+
clean::
rm -f *.1
More information about the pkg-kde-commits
mailing list