0002-Added-Debian-package-spec.patch

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

Download (14.5 KB)

 
b/extras/debian/changelog
1
foreman (0.1.5-1) experimental; urgency=low
2

  
3
  * Initial Debian version
4

  
5
 -- Ohad Levy <ohadlevy@gmail.com>  Mon, 31 May 2010 23:33:11 +0800
b/extras/debian/control
1
Source: foreman
2
Maintainer: Ohad Levy <ohadlevy@gmail.com>
3
Section: web
4
Priority: extra
5
Standards-Version: 3.8.4
6
Build-Depends: debhelper (>= 7)
7
Homepage: http://www.theforeman.org/
8

  
9
Package: foreman
10
Architecture: all
11
Depends: ${misc:Depends}, ruby, ruby1.8 (>= 1.8.7), rake (>=0.8.3), puppet (>=0.24.4)
12
Recommends: libfcgi-ruby, libapache2-mod-passenger | libapache2-mod-fcgid | mongrel, libdbd-sqlite3-ruby, sqlite3
13
Description: Systems management web interface
14
 Foreman is aimed to be a single address for all machines life cycle management.
15
 .
16
  - Foreman integrates with Puppet and acts as web front end to it.
17
  - Foreman takes care of bare bone provisioning until the point puppet is
18
    running, allowing Puppet to do what it does best.
19
  - Foreman shows you Systems Inventory (based on Facter) and provides real time
20
    information about hosts status based on Puppet reports.
21
  - Foreman creates everything you need when adding a new machine to your
22
    network. Its goal being automatically managing everything you would
23
    normally manage manually - that would eventually include DNS, DHCP,
24
    TFTP, PuppetCA, CMDB and everything else you might consider useful.
25
  - With Foreman you can always rebuild your machines from scratch.
26
  - Foreman is designed to work in a large enterprise, where multiple domains,
27
    subnets and puppetmasters are required.
28
    In many cases, Foreman could help remote provisions where no experienced
29
    technicians are available.
b/extras/debian/copyright
1
Copyright (c) 2009-2010 Ohad Levy and Paul Kelly
2

  
3
This program and entire repository is free software: you can redistribute it and/or modify
4
it under the terms of the GNU General Public License as published by
5
the Free Software Foundation, either version 3 of the License, or
6
any later version.
7

  
8
This program is distributed in the hope that it will be useful,
9
but WITHOUT ANY WARRANTY; without even the implied warranty of
10
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
GNU General Public License for more details.
12

  
13
You should have received a copy of the GNU General Public License
14
along with this program.  If not, see <http://www.gnu.org/licenses/>.
15

  
16
On any Debian system, you can find the complete text of the GNU GPL
17
(GNU General Public License) in the file /usr/share/common-licenses/GPL-3
b/extras/debian/dirs
1
etc/foreman
2
var/cache/foreman
3
var/lib/foreman
4
var/log/foreman
b/extras/debian/foreman.default
1
# Start foreman on boot?
2
START=yes
3

  
4
# the location where foreman is installed
5
#FOREMAN_HOME=/usr/share/foreman
6

  
7
# the network interface which foreman web server is running at
8
#FOREMAN_IFACE=0.0.0.0
9

  
10
# the port which foreman web server is running at
11
# note that if the foreman user is not root, it has to be a > 1024
12
#FOREMAN_PORT=3000
13

  
14
# the user which runs the web interface
15
#FOREMAN_USER=foreman
16

  
17
# the rails environment in which foreman runs
18
#FOREMAN_ENV=production
b/extras/debian/foreman.init
1
#! /bin/sh
2
### BEGIN INIT INFO
3
# Provides:          foreman
4
# Required-Start:    $network $named $remote_fs $syslog
5
# Required-Stop:     $network $named $remote_fs $syslog
6
# Default-Start:     2 3 4 5
7
# Default-Stop:      0 1 6
8
### END INIT INFO 
9

  
10
PATH=/sbin:/usr/sbin:/bin:/usr/bin
11
DESC="Foreman systems management web application"
12
NAME=foreman
13
SCRIPTNAME=/etc/init.d/$NAME
14

  
15
# Read configuration variable file if it is present
16
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
17

  
18
FOREMAN_IFACE=${FOREMAN_IFACE:-'0.0.0.0'}
19
FOREMAN_PORT=${FOREMAN_PORT:-'3000'}
20
FOREMAN_USER=${FOREMAN_USER:-'foreman'}
21
FOREMAN_HOME=${FOREMAN_HOME:-'/usr/share/foreman'}
22
FOREMAN_ENV=${FOREMAN_ENV:-'production'}
23
FOREMAN_PID=${FOREMAN_PID:-"${FOREMAN_HOME}/tmp/pids/server.pid"}
24

  
25
DAEMON="${FOREMAN_HOME}/script/server"
26
DAEMON_OPTS="-b ${FOREMAN_IFACE} -p ${FOREMAN_PORT} -e ${FOREMAN_ENV} -d"
27

  
28
. /lib/init/vars.sh
29
. /lib/lsb/init-functions
30

  
31
is_true() {
32
	if [ "x$1" = "xtrue" -o "x$1" = "xyes" -o "x$1" = "x0" ]; then
33
		return 0
34
	else
35
		return 1
36
	fi
37
}
38

  
39
do_start()
40
{
41
	if is_true "$START" ; then
42
		start-stop-daemon --start --quiet --chuid $FOREMAN_USER --pidfile $FOREMAN_PID --exec $DAEMON -- $DAEMON_OPTS
43
	else
44
		echo ""
45
		echo "${NAME} not configured to start. Please edit /etc/default/${NAME} to enable."
46
	fi
47
}
48

  
49
do_stop()
50
{
51
	start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $FOREMAN_PID
52
	RETVAL="$?"
53
	[ "$RETVAL" = 2 ] && return 2
54
	
55
	rm -f $FOREMAN_PID
56
	return "$RETVAL"
57
}
58

  
59
case "$1" in
60
  start)
61
	[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
62
	do_start
63
	case "$?" in
64
		0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
65
		2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
66
	esac
67
	;;
68
  stop)
69
	[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
70
	do_stop
71
	case "$?" in
72
		0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
73
		2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
74
	esac
75
	;;
76
  status)
77
       status_of_proc -p "$FOREMAN_PID" "$DAEMON" "$NAME" && exit 0 || exit $?
78
       ;;
79
  restart|force-reload)
80
	#
81
	# If the "reload" option is implemented then remove the
82
	# 'force-reload' alias
83
	#
84
	log_daemon_msg "Restarting $DESC" "$NAME"
85
	do_stop
86
	case "$?" in
87
	  0|1)
88
		do_start
89
		case "$?" in
90
			0) log_end_msg 0 ;;
91
			1) log_end_msg 1 ;; # Old process is still running
92
			*) log_end_msg 1 ;; # Failed to start
93
		esac
94
		;;
95
	  *)
96
	  	# Failed to stop
97
		log_end_msg 1
98
		;;
99
	esac
100
	;;
101
  *)
102
	echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
103
	exit 3
104
	;;
105
esac
106

  
107
:
b/extras/debian/foreman.logrotate
1
/var/log/foreman/*log {
2
  missingok
3
  notifempty
4
  create 0644 foreman foreman
5
  sharedscripts
6
  postrotate
7
    [ -x /etc/init.d/foreman ] && /etc/init.d/foreman force-reload >/dev/null 2>&1 || true
8
  endscript
9
}
b/extras/debian/install
1
# Install the basic application files
2
app usr/share/foreman
3
config usr/share/foreman
4
config/database.yml etc/foreman
5
config/email.yaml.example etc/foreman
6
config/settings.yaml etc/foreman
7
db var/lib/foreman
8
extras usr/share/foreman
9
lib usr/share/foreman
10
public var/lib/foreman
11
Rakefile usr/share/foreman
12
script usr/share/foreman
13
test usr/share/foreman
14
vendor/plugins usr/share/foreman/vendor
15
vendor/gems usr/share/foreman/vendor
16
vendor/rails usr/share/foreman/vendor
b/extras/debian/links
1
etc/foreman/database.yml	usr/share/foreman/config/database.yml
2
etc/foreman/email.yaml		usr/share/foreman/config/email.yaml
3
etc/foreman/settings.yaml	usr/share/foreman/config/settings.yaml
4
var/cache/foreman		usr/share/foreman/tmp
5
var/lib/foreman/db		usr/share/foreman/db
6
var/log/foreman			usr/share/foreman/log
7
var/lib/foreman/public		usr/share/foreman/public
b/extras/debian/postinst
1
#!/bin/bash
2

  
3
set -e
4

  
5
chown 'foreman:foreman' '/var/lib/foreman'
6
chmod '755' '/var/lib/foreman'
7
chown 'foreman:foreman' '/var/lib/foreman/db'
8
chmod '755' '/var/lib/foreman/db'
9
chown 'foreman:foreman' '/var/lib/foreman/public'
10
chmod '755' '/var/lib/foreman/public'
11
chown 'foreman:foreman' '/var/lib/foreman/public/404.html'
12
chown 'foreman:foreman' '/var/lib/foreman/public/422.html'
13
chown 'foreman:foreman' '/var/lib/foreman/public/500.html'
14
chown 'foreman:foreman' '/var/lib/foreman/public/blank.html'
15
chown 'foreman:foreman' '/var/lib/foreman/public/favicon.ico'
16
chown 'foreman:foreman' '/var/lib/foreman/public/images'
17
chmod '755' '/var/lib/foreman/public/images'
18
chown 'foreman:foreman' '/var/lib/foreman/public/images/false.png'
19
chown 'foreman:foreman' '/var/lib/foreman/public/images/hosts'
20
chmod '755' '/var/lib/foreman/public/images/hosts'
21
chown 'foreman:foreman' '/var/lib/foreman/public/images/hosts/Darwin.jpg'
22
chown 'foreman:foreman' '/var/lib/foreman/public/images/hosts/Linux.jpg'
23
chown 'foreman:foreman' '/var/lib/foreman/public/images/hosts/SunOS.jpg'
24
chown 'foreman:foreman' '/var/lib/foreman/public/images/hosts/attention_required.png'
25
chown 'foreman:foreman' '/var/lib/foreman/public/images/hosts/warning.png'
26
chown 'foreman:foreman' '/var/lib/foreman/public/images/rails.png'
27
chown 'foreman:foreman' '/var/lib/foreman/public/images/true.png'
28
chown 'foreman:foreman' '/var/lib/foreman/public/javascripts'
29
chmod '755' '/var/lib/foreman/public/javascripts'
30
chown 'foreman:foreman' '/var/lib/foreman/public/javascripts/application.js'
31
chown 'foreman:foreman' '/var/lib/foreman/public/javascripts/controls.js'
32
chown 'foreman:foreman' '/var/lib/foreman/public/javascripts/dragdrop.js'
33
chown 'foreman:foreman' '/var/lib/foreman/public/javascripts/effects.js'
34
chown 'foreman:foreman' '/var/lib/foreman/public/javascripts/host_checkbox.js'
35
chown 'foreman:foreman' '/var/lib/foreman/public/javascripts/prototype.js'
36
chown 'foreman:foreman' '/var/lib/foreman/public/robots.txt'
37
chown 'foreman:foreman' '/var/lib/foreman/public/stylesheets'
38
chmod '755' '/var/lib/foreman/public/stylesheets'
39
chown 'foreman:foreman' '/var/lib/foreman/public/stylesheets/style.css'
40
chown 'foreman:foreman' '/var/log/foreman'
41
chown 'foreman:foreman' '/var/cache/foreman'
42
chmod '755' '/var/cache/foreman'
43

  
44
# initialize/migrate the database (defaults to SQLITE3)
45
su - foreman -s /bin/bash -c /usr/share/foreman/extras/dbmigrate >/dev/null 2>&1
46

  
47
#DEBHELPER# 
48
    
49
exit 0
b/extras/debian/postrm
1
#!/bin/bash
2

  
3
set -e
4

  
5
#DEBHELPER# 
6
    
7
exit 0
b/extras/debian/preinst
1
#!/bin/bash
2

  
3
set -e
4

  
5
# Add the "foreman" user and group
6
getent group foreman >/dev/null || groupadd -r foreman
7
getent passwd foreman >/dev/null || \
8
    useradd -r -g foreman -G puppet -d /usr/share/foreman -s /usr/sbin/nologin -c "Foreman" foreman
9

  
10
#DEBHELPER# 
11
    
12
exit 0
b/extras/debian/prerm
1
#!/bin/bash
2

  
3
set -e
4

  
5
#DEBHELPER# 
6
    
7
exit 0
b/extras/debian/rules
1
#!/usr/bin/make -f
2
# Uncomment this to turn on verbose mode.
3
export DH_VERBOSE=1
4

  
5
build: 
6
	dh_testdir
7

  
8
clean:
9
	dh_testdir
10
	dh_testroot
11
	dh_clean
12

  
13
install: build
14
	dh_testdir
15
	dh_testroot
16
	dh_prep
17
	dh_installdirs
18
	dh_install
19

  
20
binary-indep: build install
21
	dh_testdir
22
	dh_testroot
23
	dh_installchangelogs
24
	dh_installdocs
25
	dh_installinit
26
	dh_installlogrotate
27
	dh_link
28
	dh_compress
29
	dh_fixperms
30
	dh_installdeb
31
	dh_gencontrol
32
	dh_md5sums
33
	dh_builddeb
34

  
35
binary-arch:
36

  
37
binary: binary-indep binary-arch
38
.PHONY: build clean binary-indep binary-arch install
b/extras/debian/source/format
1
3.0 (quilt)
0
-