Project

General

Profile

Feature #299 » 0002-Added-Debian-package-spec.patch

Patch to add extras/debian/ - Jochen Schalanda, 06/05/2010 06:56 AM

View differences:

extras/debian/changelog
foreman (0.1.5-1) experimental; urgency=low
* Initial Debian version
-- Ohad Levy <ohadlevy@gmail.com> Mon, 31 May 2010 23:33:11 +0800
extras/debian/compat
7
extras/debian/control
Source: foreman
Maintainer: Ohad Levy <ohadlevy@gmail.com>
Section: web
Priority: extra
Standards-Version: 3.8.4
Build-Depends: debhelper (>= 7)
Homepage: http://www.theforeman.org/
Package: foreman
Architecture: all
Depends: ${misc:Depends}, ruby, ruby1.8 (>= 1.8.7), rake (>=0.8.3), puppet (>=0.24.4)
Recommends: libfcgi-ruby, libapache2-mod-passenger | libapache2-mod-fcgid | mongrel, libdbd-sqlite3-ruby, sqlite3
Description: Systems management web interface
Foreman is aimed to be a single address for all machines life cycle management.
.
- Foreman integrates with Puppet and acts as web front end to it.
- Foreman takes care of bare bone provisioning until the point puppet is
running, allowing Puppet to do what it does best.
- Foreman shows you Systems Inventory (based on Facter) and provides real time
information about hosts status based on Puppet reports.
- Foreman creates everything you need when adding a new machine to your
network. Its goal being automatically managing everything you would
normally manage manually - that would eventually include DNS, DHCP,
TFTP, PuppetCA, CMDB and everything else you might consider useful.
- With Foreman you can always rebuild your machines from scratch.
- Foreman is designed to work in a large enterprise, where multiple domains,
subnets and puppetmasters are required.
In many cases, Foreman could help remote provisions where no experienced
technicians are available.
extras/debian/copyright
Copyright (c) 2009-2010 Ohad Levy and Paul Kelly
This program and entire repository 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 3 of the License, or
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, see <http://www.gnu.org/licenses/>.
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
extras/debian/dirs
etc/foreman
var/cache/foreman
var/lib/foreman
var/log/foreman
extras/debian/docs
README
extras/debian/foreman.default
# Start foreman on boot?
START=yes
# the location where foreman is installed
#FOREMAN_HOME=/usr/share/foreman
# the network interface which foreman web server is running at
#FOREMAN_IFACE=0.0.0.0
# the port which foreman web server is running at
# note that if the foreman user is not root, it has to be a > 1024
#FOREMAN_PORT=3000
# the user which runs the web interface
#FOREMAN_USER=foreman
# the rails environment in which foreman runs
#FOREMAN_ENV=production
extras/debian/foreman.init
#! /bin/sh
### BEGIN INIT INFO
# Provides: foreman
# Required-Start: $network $named $remote_fs $syslog
# Required-Stop: $network $named $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
### END INIT INFO
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="Foreman systems management web application"
NAME=foreman
SCRIPTNAME=/etc/init.d/$NAME
# Read configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
FOREMAN_IFACE=${FOREMAN_IFACE:-'0.0.0.0'}
FOREMAN_PORT=${FOREMAN_PORT:-'3000'}
FOREMAN_USER=${FOREMAN_USER:-'foreman'}
FOREMAN_HOME=${FOREMAN_HOME:-'/usr/share/foreman'}
FOREMAN_ENV=${FOREMAN_ENV:-'production'}
FOREMAN_PID=${FOREMAN_PID:-"${FOREMAN_HOME}/tmp/pids/server.pid"}
DAEMON="${FOREMAN_HOME}/script/server"
DAEMON_OPTS="-b ${FOREMAN_IFACE} -p ${FOREMAN_PORT} -e ${FOREMAN_ENV} -d"
. /lib/init/vars.sh
. /lib/lsb/init-functions
is_true() {
if [ "x$1" = "xtrue" -o "x$1" = "xyes" -o "x$1" = "x0" ]; then
return 0
else
return 1
fi
}
do_start()
{
if is_true "$START" ; then
start-stop-daemon --start --quiet --chuid $FOREMAN_USER --pidfile $FOREMAN_PID --exec $DAEMON -- $DAEMON_OPTS
else
echo ""
echo "${NAME} not configured to start. Please edit /etc/default/${NAME} to enable."
fi
}
do_stop()
{
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $FOREMAN_PID
RETVAL="$?"
[ "$RETVAL" = 2 ] && return 2
rm -f $FOREMAN_PID
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 -p "$FOREMAN_PID" "$DAEMON" "$NAME" && exit 0 || exit $?
;;
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|status|restart|force-reload}" >&2
exit 3
;;
esac
:
extras/debian/foreman.logrotate
/var/log/foreman/*log {
missingok
notifempty
create 0644 foreman foreman
sharedscripts
postrotate
[ -x /etc/init.d/foreman ] && /etc/init.d/foreman force-reload >/dev/null 2>&1 || true
endscript
}
extras/debian/install
# Install the basic application files
app usr/share/foreman
config usr/share/foreman
config/database.yml etc/foreman
config/email.yaml.example etc/foreman
config/settings.yaml etc/foreman
db var/lib/foreman
extras usr/share/foreman
lib usr/share/foreman
public var/lib/foreman
Rakefile usr/share/foreman
script usr/share/foreman
test usr/share/foreman
vendor/plugins usr/share/foreman/vendor
vendor/gems usr/share/foreman/vendor
vendor/rails usr/share/foreman/vendor
extras/debian/links
etc/foreman/database.yml usr/share/foreman/config/database.yml
etc/foreman/email.yaml usr/share/foreman/config/email.yaml
etc/foreman/settings.yaml usr/share/foreman/config/settings.yaml
var/cache/foreman usr/share/foreman/tmp
var/lib/foreman/db usr/share/foreman/db
var/log/foreman usr/share/foreman/log
var/lib/foreman/public usr/share/foreman/public
extras/debian/postinst
#!/bin/bash
set -e
chown 'foreman:foreman' '/var/lib/foreman'
chmod '755' '/var/lib/foreman'
chown 'foreman:foreman' '/var/lib/foreman/db'
chmod '755' '/var/lib/foreman/db'
chown 'foreman:foreman' '/var/lib/foreman/public'
chmod '755' '/var/lib/foreman/public'
chown 'foreman:foreman' '/var/lib/foreman/public/404.html'
chown 'foreman:foreman' '/var/lib/foreman/public/422.html'
chown 'foreman:foreman' '/var/lib/foreman/public/500.html'
chown 'foreman:foreman' '/var/lib/foreman/public/blank.html'
chown 'foreman:foreman' '/var/lib/foreman/public/favicon.ico'
chown 'foreman:foreman' '/var/lib/foreman/public/images'
chmod '755' '/var/lib/foreman/public/images'
chown 'foreman:foreman' '/var/lib/foreman/public/images/false.png'
chown 'foreman:foreman' '/var/lib/foreman/public/images/hosts'
chmod '755' '/var/lib/foreman/public/images/hosts'
chown 'foreman:foreman' '/var/lib/foreman/public/images/hosts/Darwin.jpg'
chown 'foreman:foreman' '/var/lib/foreman/public/images/hosts/Linux.jpg'
chown 'foreman:foreman' '/var/lib/foreman/public/images/hosts/SunOS.jpg'
chown 'foreman:foreman' '/var/lib/foreman/public/images/hosts/attention_required.png'
chown 'foreman:foreman' '/var/lib/foreman/public/images/hosts/warning.png'
chown 'foreman:foreman' '/var/lib/foreman/public/images/rails.png'
chown 'foreman:foreman' '/var/lib/foreman/public/images/true.png'
chown 'foreman:foreman' '/var/lib/foreman/public/javascripts'
chmod '755' '/var/lib/foreman/public/javascripts'
chown 'foreman:foreman' '/var/lib/foreman/public/javascripts/application.js'
chown 'foreman:foreman' '/var/lib/foreman/public/javascripts/controls.js'
chown 'foreman:foreman' '/var/lib/foreman/public/javascripts/dragdrop.js'
chown 'foreman:foreman' '/var/lib/foreman/public/javascripts/effects.js'
chown 'foreman:foreman' '/var/lib/foreman/public/javascripts/host_checkbox.js'
chown 'foreman:foreman' '/var/lib/foreman/public/javascripts/prototype.js'
chown 'foreman:foreman' '/var/lib/foreman/public/robots.txt'
chown 'foreman:foreman' '/var/lib/foreman/public/stylesheets'
chmod '755' '/var/lib/foreman/public/stylesheets'
chown 'foreman:foreman' '/var/lib/foreman/public/stylesheets/style.css'
chown 'foreman:foreman' '/var/log/foreman'
chown 'foreman:foreman' '/var/cache/foreman'
chmod '755' '/var/cache/foreman'
# initialize/migrate the database (defaults to SQLITE3)
su - foreman -s /bin/bash -c /usr/share/foreman/extras/dbmigrate >/dev/null 2>&1
#DEBHELPER#
exit 0
extras/debian/postrm
#!/bin/bash
set -e
#DEBHELPER#
exit 0
extras/debian/preinst
#!/bin/bash
set -e
# Add the "foreman" user and group
getent group foreman >/dev/null || groupadd -r foreman
getent passwd foreman >/dev/null || \
useradd -r -g foreman -G puppet -d /usr/share/foreman -s /usr/sbin/nologin -c "Foreman" foreman
#DEBHELPER#
exit 0
extras/debian/prerm
#!/bin/bash
set -e
#DEBHELPER#
exit 0
extras/debian/rules
#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1
build:
dh_testdir
clean:
dh_testdir
dh_testroot
dh_clean
install: build
dh_testdir
dh_testroot
dh_prep
dh_installdirs
dh_install
binary-indep: build install
dh_testdir
dh_testroot
dh_installchangelogs
dh_installdocs
dh_installinit
dh_installlogrotate
dh_link
dh_compress
dh_fixperms
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
binary-arch:
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch install
extras/debian/source/format
3.0 (quilt)
(3-3/3)