--- powerman-2.3.5.orig/debian/README.Debian +++ powerman-2.3.5/debian/README.Debian @@ -0,0 +1,12 @@ +powerman for Debian +------------------- + +This package allows to manage Power Distribution Units (PDU) in two ways: +- directly, by only using the present powerman package, +- or in a more "standard" and overall way throug the nut and nut-powerman +packages. Note that NUT has a broader Power Devices scope, and also currently +manages UPSs. + +Either ways, you will obviously need to configure Powerman yourself! + + -- Arnaud Quette Thu, 20 Nov 2008 16:42:56 +0100 --- powerman-2.3.5.orig/debian/TODO.Debian +++ powerman-2.3.5/debian/TODO.Debian @@ -0,0 +1,4 @@ +- watch for dh_installinit to handle upstream init file #499486 +- docbase and htdocs/ (is it worth) +- watch file for SF + --- powerman-2.3.5.orig/debian/changelog +++ powerman-2.3.5/debian/changelog @@ -0,0 +1,30 @@ +powerman (2.3.5-1build1) bionic; urgency=high + + * No change rebuild to pick up -fPIE compiler default + + -- Balint Reczey Tue, 03 Apr 2018 12:39:51 +0000 + +powerman (2.3.5-1) unstable; urgency=low + + * New upstream release + * debian/control: + - update Standards-Version + - add ${misc:Depends} to libpowerman0 and libpowerman0-dev (from Ubuntu) + * debian/copyright: fix Copyright letter case and precise GPL v2 for the + Debian packages Copyright (from Ubuntu) + * debian/watch: added with fix (from Ubuntu) + * debian/lintian-override: removed since *.dev files are really conffiles + (from Patrick Matthäi) (Closes: #553562) + * debian/rules: remove the binary-predeb hook for .dev files + * debian/powerman.dirs: remove /var/run/powerman from the list since its + creation is already handled by preinst + * debian/powerman.prerm: remove /var/run/powerman upon remove + + -- Arnaud Quette Wed, 25 Nov 2009 15:46:29 +0100 + +powerman (2.3.3-1) unstable; urgency=low + + * Initial release (Closes: #506903) + + -- Arnaud Quette Thu, 19 Jan 2009 16:42:56 +0100 + --- powerman-2.3.5.orig/debian/compat +++ powerman-2.3.5/debian/compat @@ -0,0 +1 @@ +7 --- powerman-2.3.5.orig/debian/control +++ powerman-2.3.5/debian/control @@ -0,0 +1,45 @@ +Source: powerman +Section: admin +Priority: extra +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Arnaud Quette +Build-Depends: cdbs, debhelper (>= 7), autotools-dev, libgenders0-dev, libwrap0-dev, libcurl4-gnutls-dev, libncurses5-dev +Standards-Version: 3.8.3 +Homepage: http://powerman.sourceforge.net +Vcs-Browser: http://powerman.svn.sourceforge.net/viewvc/powerman/ +Vcs-Svn: https://powerman.svn.sourceforge.net/svnroot/powerman/trunk + +Package: powerman +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, adduser +Description: Centralized Power Distribution Unit (PDU) management + PowerMan is a tool for manipulating Power Distribution Units (PDUs) from a + central location. It is suitable for remote operation in data centers or + compute cluster environment. + . + Several RPC varieties are supported natively by PowerMan and + Expect-like configurability simplifies the addition of new devices. + . + This package contains the core system, and includes support for Genders, HTTP + devices and NCurses user interface. + +Package: libpowerman0 +Architecture: any +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: Client library for Powerman - Centralized PDU management + PowerMan is a tool for manipulating Power Distribution Units (PDUs) from a + central location. It is suitable for remote operation in data centers or + compute cluster environment. + . + This package contains the shared client library. + +Package: libpowerman0-dev +Section: libdevel +Architecture: any +Depends: ${misc:Depends}, libpowerman0 (= ${binary:Version}), ${shlibs:Depends} +Description: Development files for Powerman - Centralized PDU management + PowerMan is a tool for manipulating Power Distribution Units (PDUs) from a + central location. It is suitable for remote operation in data centers or + compute cluster environment. + . + This package contains the development files. --- powerman-2.3.5.orig/debian/copyright +++ powerman-2.3.5/debian/copyright @@ -0,0 +1,71 @@ +This package was debianized by Arnaud Quette on +Thu, 20 Nov 2008 16:42:56 +0100. + +It was downloaded from http://sourceforge.net/projects/powerman + +Upstream Authors: + + Andrew Uselton + Jim Garlick + Al Chu + Chris Dunlap + +Copyright: + + Copyright (c) 2002-2008 The Regents of the University of California. + Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + Written by Andrew Uselton + Jim Garlick + Al Chu + + This work was produced at the University of California, Lawrence Livermore + National Laboratory (UC LLNL) under contract no. W-7405-ENG-48 (Contract 48) + between the U.S. Department of Energy (DOE) and The Regents of the + University of California (University) for the operation of UC LLNL. + The rights of the Federal Government are reserved under Contract 48 subject + to the restrictions agreed upon by the DOE and University as allowed under + DOE Acquisition Letter 97-1. + + Some files are from LSD-Tools (the LLNL Software Development Toolbox): + Copyright (c) 2002-2008 The Regents of the University of California. + Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + Written by Chris Dunlap . + + DISCLAIMER + + This work was prepared as an account of work sponsored by an agency of the + United States Government. Neither the United States Government nor the + University of California nor any of their employees, makes any warranty, + express or implied, or assumes any liability or responsibility for the + accuracy, completeness, or usefulness of any information, apparatus, + product, or process disclosed, or represents that its use would not infringe + privately-owned rights. Reference herein to any specific commercial + products, process, or service by trade name, trademark, manufacturer or + otherwise does not necessarily constitute or imply its endorsement, + recommendation, or favoring by the United States Government or the + University of California. The views and opinions of authors expressed + herein do not necessarily state or reflect those of the United States + Government or the University of California, and shall not be used for + advertising or product endorsement purposes. + +License: + + This program 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. + + This program 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 + this program; if not, write to the Free Software Foundation, Inc., 51 Franklin + St, Fifth Floor, Boston, MA 02110-1301, USA. + + On Debian systems, the full text of the GNU General Public License + may be found in /usr/share/common-licenses/GPL. + +The Debian packaging is (c) Copyright 2009, Arnaud Quette +and is licensed under the GPLv2, see `/usr/share/common-licenses/GPL-2'. --- powerman-2.3.5.orig/debian/docs +++ powerman-2.3.5/debian/docs @@ -0,0 +1,4 @@ +NEWS +README +TODO +ChangeLog-1.0 --- powerman-2.3.5.orig/debian/libpowerman0-dev.install +++ powerman-2.3.5/debian/libpowerman0-dev.install @@ -0,0 +1,6 @@ +debian/tmp/usr/lib/libpowerman.so +debian/tmp/usr/lib/libpowerman.a +debian/tmp/usr/lib/libpowerman.la +debian/tmp/usr/lib/pkgconfig/ +debian/tmp/usr/include + --- powerman-2.3.5.orig/debian/libpowerman0.install +++ powerman-2.3.5/debian/libpowerman0.install @@ -0,0 +1 @@ +debian/tmp/usr/lib/libpowerman.so.* --- powerman-2.3.5.orig/debian/powerman.dirs +++ powerman-2.3.5/debian/powerman.dirs @@ -0,0 +1,3 @@ +/etc/powerman +/usr/bin +/usr/sbin --- powerman-2.3.5.orig/debian/powerman.init +++ powerman-2.3.5/debian/powerman.init @@ -0,0 +1,568 @@ +#!/bin/sh +############################################################################### +# $Id: powerman.init.in 808 2008-01-09 19:20:23Z dun $ +############################################################################### +# Originally written by Chris Dunlap for ConMan: +# Copyright (C) 2007-2008 Lawrence Livermore National Security, LLC. +# Copyright (C) 2001-2007 The Regents of the University of California. +# UCRL-CODE-2002-009. +############################################################################### +# chkconfig: 2345 95 5 +# Description: Start/Stop the PowerMan (remote power manager) daemon. +############################################################################### +### BEGIN INIT INFO +# Provides: powerman +# Required-Start: $local_fs $named $network +# Required-Stop: $local_fs $named $network +# Should-Start: $remote_fs $syslog $time +# Should-Stop: $remote_fs $syslog $time +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Start/Stop the PowerMan (remote power manager) daemon. +### END INIT INFO +############################################################################### + +unset DESC DAEMON DAEMON_ARGS CONFIG PIDFILE NICE USER SIGHUP_RELOAD + +prefix="/usr" +exec_prefix="${prefix}" +sbindir="${exec_prefix}/sbin" +sysconfdir="/etc" +localstatedir="/var" + +DESC="PowerMan" +DAEMON="$sbindir/powermand" +#DAEMON_ARGS= +#CONFIG= +PIDFILE="$localstatedir/run/powerman/powermand.pid" +#NICE= +USER=powerman +#SIGHUP_RELOAD= + +############################################################################### + +service_init () +{ +# Determine the system type and initialize the environment. +# +# Note that the shell positional parameters must be preserved when calling +# this function in order for SuSE to initialize its environment properly. +## + PATH=/sbin:/usr/sbin:/bin:/usr/bin + DAEMON_NAME="`basename \"$DAEMON\"`" + SCRIPT_NAME="`basename \"$0\" .init | sed 's/^[SK][0-9][0-9]*//'`" + SIGTERM_TIMEOUT="3" + STATUS=0 + + # Read configuration defaults to override variables: + # $DAEMON_ARGS, $CONFIG, $PIDFILE, $USER, $NICE, $SIGHUP_RELOAD + ## + for dir in "$sysconfdir/default" "$sysconfdir/sysconfig"; do + [ -r "$dir/$SCRIPT_NAME" ] && . "$dir/$SCRIPT_NAME" + done + [ -z "$DAEMON_ARGS" -a -n "$OPTIONS" ] && DAEMON_ARGS="$OPTIONS" + [ "`id | sed 's/^uid=\([0-9]*\).*/\1/'`" -ne 0 ] && unset USER + expr -- "$NICE" : '[0-9]*$' >/dev/null 2>&1 && NICE="+$NICE" + [ -n "$SIGHUP_RELOAD" -a "$SIGHUP_RELOAD" != 0 ] \ + && RELOAD=1 || unset RELOAD + + if [ -f /etc/debian_version -a -x /sbin/start-stop-daemon ]; then + SYSTEM="DEBIAN" + [ -x "$DAEMON" ] || exit 0 # pkg removed but not purged + [ -r /etc/default/rcS ] && . /etc/default/rcS + [ -r /lib/init/vars.sh ] && . /lib/init/vars.sh + [ -r /lib/lsb/init-functions ] && . /lib/lsb/init-functions + elif [ -f /etc/redhat-release -a -r /etc/init.d/functions ]; then + SYSTEM="REDHAT" + . /etc/init.d/functions + RH_SUBSYS="/var/lock/subsys/$DAEMON_NAME" + elif [ -f /etc/SuSE-release -a -r /etc/rc.status ]; then + SYSTEM="SUSE" + . /etc/rc.status + rc_reset + elif [ -r /lib/lsb/init-functions ]; then + SYSTEM="LSB" + . /lib/lsb/init-functions + else + SYSTEM="OTHER" + fi + + # Exit if the package has been removed. + ## + [ -x "$DAEMON" ] || exit 5 # LSB: program not installed + + # Exit if the configuration has been removed. + ## + [ -z "$CONFIG" -o -r "$CONFIG" ] || exit 6 # LSB: program not configured +} + +service_fini () +{ +# Return the exit status. +## + case $SYSTEM in + SUSE) + rc_exit + ;; + DEBIAN|REDHAT|LSB|*) + exit $STATUS + ;; + esac +} + +service_start () +{ +# Start the service. +# +# Required by LSB, where running "start" on a service already running should be +# considered successful. +## + log_init "Starting $DESC" "$DAEMON_NAME" + case $SYSTEM in + DEBIAN) + if $0 status >/dev/null 2>&1; then + STATUS=0 + else + ERRMSG=`start-stop-daemon --start --quiet \ + ${NICE:+"--nicelevel"} ${NICE:+"$NICE"} \ + ${USER:+"--chuid"} ${USER:+"$USER"} \ + ${PIDFILE:+"--pidfile"} ${PIDFILE:+"$PIDFILE"} \ + --exec "$DAEMON" -- $DAEMON_ARGS 2>&1` + STATUS=$? + fi + ;; + REDHAT) + if $0 status >/dev/null 2>&1; then + STATUS=0 + else + daemon ${NICE:+"$NICE"} ${USER:+"--user"} ${USER:+"$USER"} \ + "$DAEMON" $DAEMON_ARGS + STATUS=$? + fi + [ $STATUS -eq 0 ] && touch "$RH_SUBSYS" >/dev/null 2>&1 + ;; + SUSE) + ERRMSG=`startproc ${NICE:+"-n"} ${NICE:+"$NICE"} \ + ${USER:+"-u"} ${USER:+"$USER"} \ + ${PIDFILE:+"-p"} ${PIDFILE:+"$PIDFILE"} \ + "$DAEMON" $DAEMON_ARGS 2>&1` + rc_status -v + STATUS=$? + ;; + LSB) + if [ -n "$USER" ]; then + ERRMSG=`su "$USER" -c "/sbin/start_daemon \ + ${NICE:+\"-n\"} ${NICE:+\"$NICE\"} \ + ${PIDFILE:+\"-p\"} ${PIDFILE:+\"$PIDFILE\"} \ + \"$DAEMON\" $DAEMON_ARGS" 2>&1` + else + ERRMSG=`start_daemon ${NICE:+"-n"} ${NICE:+"$NICE"} \ + ${PIDFILE:+"-p"} ${PIDFILE:+"$PIDFILE"} "$DAEMON" $DAEMON_ARGS 2>&1` + fi + STATUS=$? + ;; + *) + if $0 status >/dev/null 2>&1; then + STATUS=0 + else + [ -n "$NICE" ] && nice="nice -n $NICE" + if [ -n "$USER" ]; then + ERRMSG=`su "$USER" -c "$nice \"$DAEMON\" $DAEMON_ARGS" 2>&1` + else + ERRMSG=`$nice "$DAEMON" $DAEMON_ARGS 2>&1` + fi + STATUS=$? + fi + ;; + esac + log_fini "$STATUS" "$ERRMSG" +} + +service_stop () +{ +# Stop the service. +# +# Required by LSB, where running "stop" on a service already stopped or not +# running should be considered successful. +## + log_init "Stopping $DESC" "$DAEMON_NAME" + case $SYSTEM in + DEBIAN) + if ! $0 status >/dev/null 2>&1; then + STATUS=0 + else + start-stop-daemon --stop --quiet \ + ${PIDFILE:+"--pidfile"} ${PIDFILE:+"$PIDFILE"} \ + --name "$DAEMON_NAME" ${SIGTERM_TIMEOUT:+"--retry"} \ + ${SIGTERM_TIMEOUT:+"$SIGTERM_TIMEOUT"} >/dev/null 2>&1 + STATUS=$? + fi + ;; + REDHAT) + if ! $0 status >/dev/null 2>&1; then + STATUS=0 + else + killproc "$DAEMON" + STATUS=$? + fi + [ $STATUS -eq 0 ] && rm -f "$RH_SUBSYS" >/dev/null 2>&1 + ;; + SUSE) + killproc ${PIDFILE:+"-p"} ${PIDFILE:+"$PIDFILE"} \ + ${SIGTERM_TIMEOUT:+"-t"} ${SIGTERM_TIMEOUT:+"$SIGTERM_TIMEOUT"} \ + "$DAEMON" + rc_status -v + ;; + LSB) + killproc ${PIDFILE:+"-p"} ${PIDFILE:+"$PIDFILE"} "$DAEMON" + STATUS=$? + ;; + *) + signal_process "$DAEMON" + rc=$? + [ $rc -eq 0 -o $rc -eq 2 ] && STATUS=0 || STATUS=1 + ;; + esac + log_fini "$STATUS" + [ -f "$PIDFILE" ] && rm -f "$PIDFILE" +} + +service_restart () +{ +# Stop and restart the service if it is already running; +# otherwise, start the service. +# +# Required by LSB, where running "restart" on a service already stopped or not +# running should be considered successful. +## + if $0 status >/dev/null 2>&1; then + $0 stop && $0 start + else + $0 start + fi + + case $SYSTEM in + SUSE) + rc_status + ;; + DEBIAN|REDHAT|LSB|*) + STATUS=$? + ;; + esac +} + +service_try_restart () +{ +# Restart the service if it is already running. +# +# Optional for LSB, where running "try-restart" on a service already stopped or +# not running should be considered successful. +# Also known as "condrestart" by RedHat. +## + case $SYSTEM in + REDHAT) + [ -f "$RH_SUBSYS" ] && $0 restart || : + STATUS=$? + ;; + SUSE) + $0 status >/dev/null 2>&1 && $0 restart || rc_reset + rc_status + ;; + DEBIAN|LSB|*) + $0 status >/dev/null 2>&1 && $0 restart || : + STATUS=$? + ;; + esac +} + +service_reload () +{ +# Reload the configuration without stopping and restarting the service. +# +# Optional for LSB. +## + [ -z "$RELOAD" ] && STATUS=3 # LSB: unimplemented feature + + log_init "Reloading $DESC" "$DAEMON_NAME" + case $SYSTEM in + DEBIAN) + if [ -n "$RELOAD" ]; then + start-stop-daemon --stop --quiet --signal HUP \ + ${PIDFILE:+"--pidfile"} ${PIDFILE:+"$PIDFILE"} \ + --name "$DAEMON_NAME" >/dev/null 2>&1 + STATUS=$? + fi + ;; + REDHAT) + if [ -n "$RELOAD" ]; then + killproc "$DAEMON" -HUP + STATUS=$? + else + echo_failure + fi + ;; + SUSE) + if [ -n "$RELOAD" ]; then + killproc -HUP ${PIDFILE:+"-p"} ${PIDFILE:+"$PIDFILE"} "$DAEMON" + else + rc_failed $STATUS + fi + rc_status -v + ;; + LSB) + if [ -n "$RELOAD" ]; then + killproc ${PIDFILE:+"-p"} ${PIDFILE:+"$PIDFILE"} "$DAEMON" -HUP + STATUS=$? + fi + ;; + *) + if [ -n "$RELOAD" ]; then + signal_process "$DAEMON" "HUP" + STATUS=$? + fi + ;; + esac + log_fini "$STATUS" +} + +service_force_reload () +{ +# Reload the configuration if the service supports this; +# otherwise, restart the service if it is already running. +# +# Required by LSB, where running "force-reload" on a service already stopped or +# not running should be considered successful. +## + if [ -n "$RELOAD" ]; then + $0 reload + else + $0 try-restart + fi + + case $SYSTEM in + SUSE) + rc_status + ;; + DEBIAN|REDHAT|LSB|*) + STATUS=$? + ;; + esac +} + +service_status () +{ +# Print the current status of the service. +# +# Required by LSB. +## + case $SYSTEM in + REDHAT) + status "$DAEMON" + STATUS=$? + ;; + SUSE) + printf "Checking for service $DESC: " + checkproc ${PIDFILE:+"-p"} ${PIDFILE:+"$PIDFILE"} "$DAEMON" + rc_status -v + ;; + LSB) + printf "Checking status of $DESC: " + pids=`pidofproc ${PIDFILE:+"-p"} ${PIDFILE:+"$PIDFILE"} \ + "$DAEMON" 2>/dev/null` + STATUS=$? + if [ $STATUS -eq 0 -a -n "$pids" ]; then + echo "running." + elif [ $STATUS -ne 0 -a -s "$PIDFILE" ]; then + echo "dead." + else + echo "stopped." + fi + ;; + DEBIAN|*) + printf "Checking status of $DESC: " + pids=`query_pids "$DAEMON" "$PIDFILE"` + rc=$? + if [ $rc -eq 0 -a -n "$pids" ]; then + echo "running." + STATUS=0 # LSB: program is running + elif [ $rc -ne 0 -a -s "$PIDFILE" ]; then + echo "dead." + STATUS=1 # LSB: program is dead & pidfile exists + elif [ $rc -ne 0 ]; then + echo "stopped." + STATUS=3 # LSB: program is not running + else + echo "unknown." + STATUS=4 # LSB: program status unknown + fi + ;; + esac +} + +query_pids () +{ +# Writes the matching PIDs to stdout. +# Returns 0 on success (ie, pids found). +## + PROCNAME="$1" + PIDFILE="$2" + + if type pgrep >/dev/null 2>&1; then + pids=`pgrep -d ' ' -x "\`basename \"$PROCNAME\"\`" 2>/dev/null` + rc=$? + elif type pidof >/dev/null 2>&1; then + pids=`pidof -o $$ -x "$PROCNAME" 2>/dev/null` + rc=$? + else + pids=`(ps awx -o pid -o command || ps -e -f -o pid -o args) 2>/dev/null \ + | tail +2 | egrep "( |/)$PROCNAME( |$)" | grep -v egrep \ + | sed 's/ *\([0-9]*\).*/\1/' | sort -n | tr '\012' ' '` + [ -n "$pids" ] && rc=0 || rc=1 + fi + + unset pids_running + if [ -n "$pids" -a -r "$PIDFILE" ]; then + read pid_line < "$PIDFILE" + for pid in $pid_line; do + expr -- "$pid" : '[0-9]*$' >/dev/null 2>&1 \ + && expr -- " $pids " : ".* $pid .*" >/dev/null 2>&1 \ + && pids_running="$pids_running $pid" + done + [ -n "$pids_running" ] && pids=$pids_running + fi + + echo $pids + return $rc +} + +signal_process () +{ +# Returns 0 on success, 1 if kill failed, 2 if PROCNAME is not running. +## + PROCNAME="$1" + SIGNUM="$2" + + pids=`query_pids "$DAEMON" "$PIDFILE"` + [ $? -ne 0 -o -z "$pids" ] && return 2 + + kill ${SIGNUM:+"-$SIGNUM"} $pids >/dev/null 2>&1 + [ $? -ne 0 ] && return 1 + [ -n "$SIGNUM" ] && return 0 + + pids=`query_pids "$DAEMON" "$PIDFILE"` + [ $? -ne 0 -o -z "$pids" ] && return 0 + [ -z "$SIGTERM_TIMEOUT" ] && return 1 + + sleep "$SIGTERM_TIMEOUT" + kill -KILL $pids >/dev/null 2>&1 + pids=`query_pids "$DAEMON" "$PIDFILE"` + [ $? -ne 0 -o -z "$pids" ] && return 0 + return 1 +} + +log_init () +{ +# Output informational message at beginning of action. +## + MESSAGE="$1" + PROCNAME="$2" + + case $SYSTEM in + DEBIAN) + if [ "$VERBOSE" != no ]; then + if type log_daemon_msg >/dev/null 2>&1; then + log_daemon_msg "$MESSAGE" "$PROCNAME" + else + printf "$MESSAGE: $PROCNAME" + fi + fi + ;; + REDHAT|SUSE|LSB|*) + printf "$MESSAGE: $PROCNAME" + ;; + esac +} + +log_fini () +{ +# Output informational/error message at end of action. +## + STATUS="$1" + ERRMSG="$2" + + case $SYSTEM in + DEBIAN) + if [ "$VERBOSE" != no ]; then + if ( type log_end_msg && type log_failure_msg ) >/dev/null 2>&1; then + log_end_msg "$STATUS" + [ $STATUS -eq 0 -o -z "$ERRMSG" ] || log_failure_msg "$ERRMSG" + else + [ $STATUS -eq 0 ] && echo "." || echo " (failed)." + [ $STATUS -eq 0 -o -z "$ERRMSG" ] || echo "$ERRMSG" >&2 + fi + fi + ;; + REDHAT) + echo + ;; + SUSE) + [ $STATUS -eq 0 -o -z "$ERRMSG" ] || echo "$ERRMSG" >&2 + ;; + LSB|*) + [ $STATUS -eq 0 ] && echo "." || echo " (failed)." + [ $STATUS -eq 0 -o -z "$ERRMSG" ] || echo "$ERRMSG" >&2 + ;; + esac +} + +check_config() +{ +# check if powerman is configured, and exit if it is not + if [ -z "`grep -v '^#' /etc/powerman/powerman.conf`" ]; then + echo "##################################################" + echo "## PowerMan is not configured ##" + echo "## ##" + echo "## Please read the Manual page powerman.conf(5) ##" + echo "##################################################" + exit 0 + fi +} + +service_init "$@" + +case "$1" in + start) + check_config + service_start + ;; + stop) + check_config + service_stop + ;; + restart) + check_config + service_restart + ;; + try-restart|condrestart) + check_config + service_try_restart + ;; + reload) + check_config + service_reload + ;; + force-reload) + check_config + service_force_reload + ;; + status) + service_status + ;; + *) + echo "Usage: `basename \"$0\"`" \ + "(start|stop|restart|try-restart|reload|force-reload|status)" >&2 + exit 2 # LSB: invalid or excess argument(s) + ;; +esac + +service_fini --- powerman-2.3.5.orig/debian/powerman.install +++ powerman-2.3.5/debian/powerman.install @@ -0,0 +1,3 @@ +debian/tmp/etc/powerman/* +debian/tmp/usr/bin/* +debian/tmp/usr/sbin/* --- powerman-2.3.5.orig/debian/powerman.manpages +++ powerman-2.3.5/debian/powerman.manpages @@ -0,0 +1,5 @@ +debian/tmp/usr/share/man/man1/powerman.1 +debian/tmp/usr/share/man/man5/powerman.conf.5 +debian/tmp/usr/share/man/man5/powerman.dev.5 +debian/tmp/usr/share/man/man7/powerman-devices.7 +debian/tmp/usr/share/man/man8/powermand.8 --- powerman-2.3.5.orig/debian/powerman.preinst +++ powerman-2.3.5/debian/powerman.preinst @@ -0,0 +1,35 @@ +#!/bin/sh +# preinst script for powerman +# +# see: dh_installdeb(1) + +set -e + +case "$1" in + + install) + # add a powerman system user + if [ -z "`getent passwd powerman`" ]; then + adduser --quiet --system --home /var/run/powerman --no-create-home powerman + fi + # create the runtime directory + if [ ! -d /var/run/powerman ]; then + mkdir -p /var/run/powerman + fi + # ensure the permissions are right + chown powerman:root /var/run/powerman + ;; + + upgrade|abort-upgrade) + # do nothing + ;; + + *) + echo "$0: incorrect arguments: $*" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 --- powerman-2.3.5.orig/debian/powerman.prerm +++ powerman-2.3.5/debian/powerman.prerm @@ -0,0 +1,33 @@ +#!/bin/sh +# prerm script for powerman +# +# see: dh_installdeb(1) + +set -e + +case "$1" in + remove) + # remove a powerman system user + if [ -n "`getent passwd powerman`" ]; then + deluser powerman + fi + # remove the runtime directory + if [ ! -d /var/run/powerman ]; then + rm -rf /var/run/powerman + fi + ;; + failed-upgrade|upgrade|deconfigure) + # do nothing + ;; + + *) + echo "$0 called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 + + --- powerman-2.3.5.orig/debian/rules +++ powerman-2.3.5/debian/rules @@ -0,0 +1,18 @@ +#!/usr/bin/make -f + +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/class/autotools.mk + +# Configure flags +DEB_CONFIGURE_EXTRA_FLAGS := --with-httppower --with-genders --with-ncurses --with-user=powerman + +# additional manpages +DEB_INSTALL_MANPAGES_powerman := debian/tmp/usr/share/man/man8/httppower.8 \ + debian/tmp/usr/share/man/man8/plmpower.8 \ + debian/tmp/usr/share/man/man8/vpcd.8 \ + debian/tmp/usr/share/man/man1/pm.1 + +# DEB_DH_INSTALLINIT_ARGS := --no-start + +# docbase + --- powerman-2.3.5.orig/debian/watch +++ powerman-2.3.5/debian/watch @@ -0,0 +1,2 @@ +version=3 +http://sf.net/powerman/powerman-(.+)\.tar\.bz2