# $Id: /trunk/debian/dists/systune/debian/packages 265 2005-09-23T14:12:34.829745Z dexter  $

# If the debian/rules or debian/control file is missing, rebuild the file:
#
#   $ yada rebuild control
#   $ yada rebuild rules


Source: systune
Section: admin
Priority: optional
Maintainer: Piotr Roszatycki <dexter@debian.org>
Standards-Version: 3.6.2
Description: kernel tuning through the /proc file system
Copyright: GPL
 Copyright (C) 1998 Daniel Podlejski <underley@zakopane.top.pl>
           (C) 1999 Piotr Roszatycki <dexter@debian.org>
Build: sh
 make
Clean: sh
 make clean || true

Package: systune
Architecture: all
Description: kernel tuning through the /proc file system
 This program writes kernel parameters, previously saved in a configuration
 file, to the /proc filesystem.  This enables kernel performance to be
 adjusted without recompiling the kernel.
 .
 systune can be alternative to sysctl(8). It is also started after the most
 daemons and other init.d scripts, so it can be used as "second stage" sysctl.
Install: sh
 yada install -script -into /usr/sbin systune
 yada install -script -into /usr/sbin systunedump
 yada install -doc -subdir examples systune.conf
 yada install -doc -subdir examples systune.dump
 yada install -man systune.8
 yada install -man systunedump.8
Finalise: sh
 cat $CONTROL/postinst \
     | awk '{ if( $1 == "#systune.conf#" ) system("cat systune.conf"); else print }' \
     | awk '{ if( $1 == "#systune.dump#" ) system("cat systune.dump"); else print }' \
     > $CONTROL/postinst.tmp
 mv -f $CONTROL/postinst.tmp $CONTROL/postinst
 chmod 755 $CONTROL/postinst
Postinst: sh
 systune_conf () {
     cat << EOT
 #systune.conf#
 EOT
 }
 .
 systune_dump () {
     cat << EOT
 #systune.dump#
 EOT
 }
 .
 case "$1" in
     configure)
 	 if [ ! -f /etc/systune.conf ]; then
 	     systune_conf | sed 's!^/!# /!' > /etc/systune.conf
 	 fi
 	 if [ ! -f /etc/systune.dump ]; then
 	     systune_dump | sed 's!^/!# /!' > /etc/systune.dump
 	 fi
         ;;
 esac
Postrm: sh
 case "$1" in
     purge)
 	 test -f /etc/systune.conf && rm -f /etc/systune.conf
 	 test -f /etc/systune.dump && rm -f /etc/systune.dump
         ;;
 esac
Init: sh
 start 50 2 3 4 5 .
 .
 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
 PROGRAM=/usr/sbin/systune
 NAME=systune
 DESC="tuning kernel"
 .
 test -f $PROGRAM || exit 0
 set -e
 .
 case "$1" in
   start)
 	echo -n "Configuring kernel parameters..."
 	$PROGRAM
 	echo " done"
 	;;
   stop)
      ;;
   reload|restart|force-reload)
        $0 start
 	;;
   *)
 	N=/etc/init.d/$NAME
 	echo "Usage: $N {start|stop|reload|restart|force-reload}" >&2
 	exit 1
 	;;
 esac
