From 8c8c57295518bc87a40e92faff44b44ef63a757c Mon Sep 17 00:00:00 2001 From: Petr Baudis <pasky@ucw.cz> Date: Fri, 16 Mar 2012 03:09:51 +0100 Subject: [PATCH] Add debian packaging --- debian/changelog | 5 ++ debian/compat | 1 + debian/compctl.init | 139 ++++++++++++++++++++++++++++++++++++++++++++ debian/control | 16 +++++ debian/copyright | 31 ++++++++++ debian/dirs | 5 ++ debian/docs | 2 + debian/manpages | 1 + debian/postinst | 39 +++++++++++++ debian/postrm | 37 ++++++++++++ debian/prerm | 38 ++++++++++++ debian/rules | 16 +++++ 12 files changed, 330 insertions(+) create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/compctl.init create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/dirs create mode 100644 debian/docs create mode 100644 debian/manpages create mode 100644 debian/postinst create mode 100644 debian/postrm create mode 100644 debian/prerm create mode 100755 debian/rules diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..13dcf4a --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +compctl (0.5-1) unstable; urgency=low + + * Initial package release + + -- Petr Baudis <pasky@ucw.cz> Fri, 16 Mar 2012 01:52:50 +0100 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..7f8f011 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +7 diff --git a/debian/compctl.init b/debian/compctl.init new file mode 100644 index 0000000..7eff381 --- /dev/null +++ b/debian/compctl.init @@ -0,0 +1,139 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: compctl +# Required-Start: $local_fs $remote_fs +# Required-Stop: $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Computations under control - control daemon +# Description: This daemon handles the priviledged cgroup management +# tasks for compctl. +### END INIT INFO + +# Author: Petr Baudis <pasky@ucw.cz> + +# PATH should only include /usr/* if it runs after the mountnfs.sh script +PATH=/sbin:/usr/sbin:/bin:/usr/bin +DESC=compctl # Introduce a short description here +NAME=compctl # Introduce the short server's name here +DAEMON=/usr/sbin/compctld # Introduce the server's location here +DAEMON_ARGS="" # Arguments to run the daemon with +PIDFILE= +SCRIPTNAME=/etc/init.d/$NAME + +# Exit if the package is not installed +[ -x $DAEMON ] || exit 0 + +# Read configuration variable file if it is present +[ -r /etc/default/$NAME ] && . /etc/default/$NAME + +# Load the VERBOSE setting and other rcS variables +. /lib/init/vars.sh + +# Define LSB log_* functions. +# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. +. /lib/lsb/init-functions + +# +# Function that starts the daemon/service +# +do_start() +{ + # Return + # 0 if daemon has been started + # 1 if daemon was already running + # 2 if daemon could not be started + start-stop-daemon --start --quiet --exec $DAEMON --test > /dev/null \ + || return 1 + start-stop-daemon --start --quiet --exec $DAEMON -- \ + $DAEMON_ARGS \ + || return 2 + # Add code here, if necessary, that waits for the process to be ready + # to handle requests from services started subsequently which depend + # on this one. As a last resort, sleep for some time. +} + +# +# Function that stops the daemon/service +# +do_stop() +{ + # Return + # 0 if daemon has been stopped + # 1 if daemon was already stopped + # 2 if daemon could not be stopped + # other if a failure occurred + start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME + RETVAL="$?" + [ "$RETVAL" = 2 ] && return 2 + # Wait for children to finish too if this is a daemon that forks + # and if the daemon is only ever run from this initscript. + # If the above conditions are not satisfied then add some other code + # that waits for the process to drop all resources that could be + # needed by services started subsequently. A last resort is to + # sleep for some time. + start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON + [ "$?" = 2 ] && return 2 + return "$RETVAL" +} + + +case "$1" in + start) + [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME" + do_start + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + stop) + [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" + do_stop + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + status) + status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? + ;; + #reload|force-reload) + # + # If do_reload() is not implemented then leave this commented out + # and leave 'force-reload' as an alias for 'restart'. + # + #log_daemon_msg "Reloading $DESC" "$NAME" + #do_reload + #log_end_msg $? + #;; + restart|force-reload) + # + # If the "reload" option is implemented then remove the + # 'force-reload' alias + # + log_daemon_msg "Restarting $DESC" "$NAME" + do_stop + case "$?" in + 0|1) + do_start + case "$?" in + 0) log_end_msg 0 ;; + 1) log_end_msg 1 ;; # Old process is still running + *) log_end_msg 1 ;; # Failed to start + esac + ;; + *) + # Failed to stop + log_end_msg 1 + ;; + esac + ;; + *) + #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 + echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 + exit 3 + ;; +esac + +: diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..39f99ac --- /dev/null +++ b/debian/control @@ -0,0 +1,16 @@ +Source: compctl +Section: ucw +Priority: extra +Maintainer: Petr Baudis <pasky@ucw.cz> +Build-Depends: debhelper (>= 7.0.50~) +Standards-Version: 3.8.4 +Vcs-Git: git://repo.or.cz/compctl.git +Vcs-Browser: http://repo.or.cz/w/compctl.git + +Package: compctl +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Computations under control + Computations under control will run a specificed program as + a non-interactive computation process, allowing it to be listed + and regulated by the user of the computer. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..6b0c1bf --- /dev/null +++ b/debian/copyright @@ -0,0 +1,31 @@ +This work was packaged for Debian by: + + Petr Baudis <pasky@ucw.cz> on Fri, 16 Mar 2012 01:52:50 +0100 + +Upstream Author(s): + + Petr Baudis <pasky@ucw.cz> too + +Copyright: + + Copyright (C) 2012 Petr Baudis + +License: + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + IN THE SOFTWARE. diff --git a/debian/dirs b/debian/dirs new file mode 100644 index 0000000..101d7da --- /dev/null +++ b/debian/dirs @@ -0,0 +1,5 @@ +usr/bin +usr/sbin +etc/init.d +usr/share/man/man1 +usr/share/doc/compctl diff --git a/debian/docs b/debian/docs new file mode 100644 index 0000000..198c2b0 --- /dev/null +++ b/debian/docs @@ -0,0 +1,2 @@ +README +README.client diff --git a/debian/manpages b/debian/manpages new file mode 100644 index 0000000..cb217e5 --- /dev/null +++ b/debian/manpages @@ -0,0 +1 @@ +compctl.1 diff --git a/debian/postinst b/debian/postinst new file mode 100644 index 0000000..638a306 --- /dev/null +++ b/debian/postinst @@ -0,0 +1,39 @@ +#!/bin/sh +# postinst script for compctl +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * <postinst> `configure' <most-recently-configured-version> +# * <old-postinst> `abort-upgrade' <new version> +# * <conflictor's-postinst> `abort-remove' `in-favour' <package> +# <new-version> +# * <postinst> `abort-remove' +# * <deconfigured's-postinst> `abort-deconfigure' `in-favour' +# <failed-install-package> <version> `removing' +# <conflicting-package> <version> +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + configure) + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/postrm b/debian/postrm new file mode 100644 index 0000000..fb6ff71 --- /dev/null +++ b/debian/postrm @@ -0,0 +1,37 @@ +#!/bin/sh +# postrm script for #PACKAGE# +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * <postrm> `remove' +# * <postrm> `purge' +# * <old-postrm> `upgrade' <new-version> +# * <new-postrm> `failed-upgrade' <old-version> +# * <new-postrm> `abort-install' +# * <new-postrm> `abort-install' <old-version> +# * <new-postrm> `abort-upgrade' <old-version> +# * <disappearer's-postrm> `disappear' <overwriter> +# <overwriter-version> +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/prerm b/debian/prerm new file mode 100644 index 0000000..4be3659 --- /dev/null +++ b/debian/prerm @@ -0,0 +1,38 @@ +#!/bin/sh +# prerm script for #PACKAGE# +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * <prerm> `remove' +# * <old-prerm> `upgrade' <new-version> +# * <new-prerm> `failed-upgrade' <old-version> +# * <conflictor's-prerm> `remove' `in-favour' <package> <new-version> +# * <deconfigured's-prerm> `deconfigure' `in-favour' +# <package-being-installed> <version> `removing' +# <conflicting-package> <version> +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + remove|upgrade|deconfigure) + ;; + + failed-upgrade) + ;; + + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..4e1eb24 --- /dev/null +++ b/debian/rules @@ -0,0 +1,16 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +%: + dh $@ + +override_dh_auto_install: + $(MAKE) DESTDIR=$$(pwd)/debian/compctl PREFIX=/usr install -- GitLab