Project

General

Profile

Feature #550 ยป 0001-Fixes-feature-550-Added-Debian-package-specification.patch

Debian package specifications - Jochen Schalanda, 02/08/2011 08:34 PM

View differences:

extra/debian/changelog
foreman-proxy (0.0.2-1) unstable; urgency=low
* Initial release
-- Jochen Schalanda <jochen@schalanda.name> Tue, 08 Feb 2011 22:02:53 +0100
extra/debian/compat
7
extra/debian/control
Source: foreman-proxy
Section: net
Priority: extra
Maintainer: Jochen Schalanda <jochen@schalanda.name>
Build-Depends: debhelper (>= 7.0.50~)
Standards-Version: 3.9.1
Homepage: http://theforeman.org/projects/smart-proxy
Vcs-Git: git://github.com/ohadlevy/smart-proxy.git
Vcs-Browser: https://github.com/ohadlevy/smart-proxy
Package: foreman-proxy
Architecture: all
Depends: ruby, rubygems, libopenssl-ruby, libsinatra-ruby, libjson-ruby, libnet-ping-ruby, rake, ${misc:Depends}
Description: RESTful proxies for DNS, DHCP, TFTP, and Puppet
Smart-Proxy is a project which provides a RESTful API to various sub-systems
like DNS, DHCP, TFTP, and Puppet.
.
Its goal is to provide API for a higher level orchestration tools.
Smart-Proxy provides an easy way to add or extended existing
sub-systems and APIs.
extra/debian/copyright
This work was packaged for Debian by:
Jochen Schalanda <jochen@schalanda.name> on Tue, 08 Feb 2011 22:02:53 +0100
It was downloaded from:
http://theforeman.org/projects/smart-proxy
Upstream Author(s):
Ohad Levy <ohadlevy@gmail.com>
Copyright:
Copyright (C) 2010-2011 Ohad Levy <ohadlevy@gmail.com>
License:
GPL-3
On any Debian system, you can find the complete text of the GNU GPL
(GNU General Public License) in the file '/usr/share/common-licenses/GPL-3'.
The Debian packaging is:
Copyright (C) 2011 Jochen Schalanda <jochen@schalanda.name>
and is licensed under the GPL version 3,
see "/usr/share/common-licenses/GPL-3".
extra/debian/default
# Defaults for smart-proxy initscript
# sourced by /etc/init.d/foreman-proxy
DAEMON_USER="foreman-proxy:foreman-proxy"
DAEMON_HOME="/usr/share/foreman-proxy"
DAEMON_ARGS=""
extra/debian/dirs
etc/foreman-proxy
usr/share/foreman-proxy/logs
var/log/foreman-proxy
extra/debian/docs
README
extra/debian/init.d
#!/bin/sh
### BEGIN INIT INFO
# Provides: foreman-proxy
# Required-Start: $network $local_fs $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: RESTful proxies for DNS, DHCP, TFTP, and Puppet
# Description: Smart-Proxy is a project which provides a RESTful API to various sub-systems
# like DNS, DHCP, TFTP, and Puppet.
### END INIT INFO
# Author: Jochen Schalanda <jochen@schalanda.name>
# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC=foreman-proxy
NAME=foreman-proxy
DAEMON=/usr/share/$NAME/bin/smart-proxy
DAEMON_ARGS=""
PIDFILE=/var/run/$NAME/$NAME.pid
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()
{
PIDFILE_DIR=$(dirname $PIDFILE)
if [ ! -x $PIDFILE_DIR ]
then
mkdir -p $PIDFILE_DIR && chown $DAEMON_USER $PIDFILE_DIR
fi
# 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 --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
|| return 1
start-stop-daemon --start --quiet --chuid $DAEMON_USER --pidfile $PIDFILE --exec $DAEMON -- \
$DAEMON_ARGS \
|| return 2
}
#
# 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 --pidfile $PIDFILE
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
# Many daemons don't delete their pidfiles when they exit.
rm -f $PIDFILE
return "$RETVAL"
}
#
# Function that sends a SIGHUP to the daemon/service
#
do_reload() {
#
# If the daemon can reload its configuration without
# restarting (for example, when it is sent a SIGHUP),
# then implement that here.
#
start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
return 0
}
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 -p "$PIDFILE" "$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
:
extra/debian/install
bin usr/share/foreman-proxy
config usr/share/foreman-proxy
lib usr/share/foreman-proxy
public usr/share/foreman-proxy
Rakefile usr/share/foreman-proxy
tasks usr/share/foreman-proxy
views usr/share/foreman-proxy
debian/settings.yml etc/foreman-proxy
extra/debian/links
etc/foreman-proxy/settings.yml usr/share/foreman-proxy/config/settings.yml
extra/debian/logrotate
/var/log/foreman-proxy/*log {
missingok
notifempty
create 0644 foreman-proxy foreman-proxy
sharedscripts
rotate 5
compress
daily
postrotate
[ -e /etc/init.d/foreman-proxy ] && /etc/init.d/foreman-proxy restart >/dev/null 2>&1 || true
endscript
}
extra/debian/postinst
#!/bin/sh
# postinst script for smart-proxy
#
# 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)
getent group foreman-proxy >/dev/null || groupadd -r foreman-proxy
getent passwd foreman-proxy >/dev/null || \
useradd -r -g foreman-proxy -d /usr/share/foreman-proxy -s /usr/sbin/nologin -c "Foreman Smart-Proxy" foreman-proxy
chown 'foreman-proxy:foreman-proxy' '/usr/share/foreman-proxy/logs'
chown 'foreman-proxy:foreman-proxy' '/var/log/foreman-proxy'
;;
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
extra/debian/rules
#!/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 $@
extra/debian/settings.yml
---
# SSL Setup
# if enabled, all communication would be verfied via SSL
# NOTE that both certificates need to be signed by the same CA in order for this to work
# see http://theforeman.org/projects/smart-proxy/wiki/SSL for more information
#:ssl_certificate: ssl/certs/fqdn.pem
#:ssl_ca_file: ssl/certs/ca.pem
#:ssl_private_key: ssl/private_keys/fqdn.key
# the hosts which the proxy accepts connections from
# commenting the following lines would mean every verified SSL connection allowed
#:trusted_hosts:
#- foreman.prod.domain
#- foreman.dev.domain
# enable the daemon to run in the background
:daemon: true
:daemon_pid: /var/run/foreman-proxy/foreman-proxy.pid
# port used by the proxy
:port: 8443
# Enable TFTP management
#:tftp: true
#:tftproot: /tmp/tftpboot
# Enable DNS management
#:dns: true
#:dns_key: /home/proxy/keys/Kapi.+157+47848.private
#:dns_server: dns.domain.com
# Enable DHCP management
#:dhcp: true
# The vendor can be either isc or native_ms
#:dhcp_vendor: isc
# Settings for Ubuntu ISC
#:dhcp_config: /etc/dhcp3/dhcpd.conf
#:dhcp_leases: /var/lib/dhcp3/dhcpd.leases
# enable PuppetCA management
#:puppetca: true
# enable Puppet management
#:puppet: true
# Where our proxy log files are stored
# filename or STDOUT
:log_file: /var/log/foreman-proxy/foreman-proxy.log
# valid options are
# Logger::WARN, Logger::DEBUG, Logger::Error, Logger::Fatal, Logger:INFO, LOGGER::UNKNOWN
#:log_level: Logger::DEBUG
    (1-1/1)