Project

General

Profile

Feature #355 » 0001-Improved-Debian-package.patch

Jochen Schalanda, 07/18/2010 03:49 PM

View differences:

extras/debian/changelog
foreman (0.1.5-2) experimental; urgency=low
* Bugfixes, added support for dbconfig-common and split packages.
-- Jochen Schalanda <jochen@schalanda.name> Mon, 07 Jul 2010 17:25:04 +0800
foreman (0.1.5-1) experimental; urgency=low
* Initial Debian version
extras/debian/conf/database-sqlite.yml.template
production:
adapter: _DBC_DBTYPE_
database: _DBC_BASEPATH_/_DBC_DBNAME_
encoding: utf8
extras/debian/conf/database.yml.template
production:
adapter: _DBC_DBTYPE_
database: _DBC_DBNAME_
host: _DBC_DBSERVER_
port: _DBC_DBPORT_
username: _DBC_DBUSER_
password: _DBC_DBPASS_
encoding: utf8
extras/debian/config
#!/bin/sh
# config maintainer script for foreman
set -e
#set -x
# source debconf stuff
. /usr/share/debconf/confmodule
if [ -f /usr/share/dbconfig-common/dpkg/config ]; then
. /usr/share/dbconfig-common/dpkg/config
dbc_dbuser="foreman"
dbc_dbname="foreman"
dbc_dbtypes="mysql, pgsql, sqlite3"
dbc_go foreman $@
fi
extras/debian/control
Section: web
Priority: extra
Standards-Version: 3.8.4
Build-Depends: debhelper (>= 7)
Build-Depends: debhelper (>= 7), cdbs
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
Pre-Depends: debconf
Depends: ruby, ruby1.8 (>= 1.8.7), rubygems, rubygems1.8, rake (>=0.8.3), libjs-prototype (>= 1.6.1), libjs-scriptaculous (>= 1.8.2), puppet (>=0.24.4), dbconfig-common, foreman-sqlite3 | foreman-mysql | foreman-pgsql, ${misc:Depends}
Recommends: libfcgi-ruby, libapache2-mod-passenger | libapache2-mod-fcgid
Suggests: thin | mongrel | httpd-cgi
Description: Systems management web interface
Foreman is aimed to be a single address for all machines life cycle management.
.
......
subnets and puppetmasters are required.
In many cases, Foreman could help remote provisions where no experienced
technicians are available.
Package: foreman-mysql
Architecture: all
Depends: libdbd-mysql-ruby, mysql-client | virtual-mysql-client, ${misc:Depends}
Suggests: mysql-server
Description: metapackage providing MySQL dependencies for Foreman
This package only provides MySQL dependencies for Foreman, a
flexible systems management web application. Install this
one if you want to use a MySQL database with Foreman.
.
Foreman package should be installed along with this package.
Package: foreman-pgsql
Architecture: all
Depends: libdbd-pg-ruby, postgresql-client, ${misc:Depends}
Suggests: postgresql
Description: metapackage providing PostgreSQL dependencies for Foreman
This package provides PostgreSQL dependencies for Foreman, a
flexible systems management web application. Install this
one if you want to use a PostgreSQL database with Foreman.
.
Foreman package should be installed along with this package.
Package: foreman-sqlite3
Architecture: all
Depends: libdbd-sqlite3-ruby, sqlite3, ${misc:Depends}
Description: metapackage providing sqlite dependencies for Foreman
This package provides sqlite dependencies for Foreman, a
flexible systems management web application. Install this
one if you want to use a SQLite database with Foreman.
.
Foreman package should be installed along with this package.
extras/debian/copyright
Copyright (c) 2009-2010 Ohad Levy and Paul Kelly
This package was debianized by Jochen Schalanda <jochen@schalanda.name>
on Sun, 18 Jul 2010 10:09:29 +0302
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.
It was downloaded from: http://www.theforeman.org/
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.
Upstream Author(s):
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Ohad Levy
Paul Kelly
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
Copyright:
Copyright (C) 2009-2010 by Ohad Levy and Paul Kelly
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'.
Packaging:
Copyright (C) 2010 by Jochen Schalanda <jochen@schalanda.name>
released under the GPL-3, see '/usr/share/common-licenses/GPL-3'.
Files: vendor/gems/googlecharts-1.3.6
Copyright: 2007 Matt Aimonetti
License: MIT
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.
Files: vendor/plugins/acts_as_audited
Copyright: 2008 Brandon Keepers - Collective Idea
License: MIT
Files: vendor/plugins/google_visualr
Copyright: 2010 Winston Teo Yong Wei
License: MIT
Files: vendor/plugins/has_many_polymorphs
Copyright: Cloudburst, LLC
License: AFL-3 (http://www.rosenlaw.com/AFL3.0.htm)
Files: vendor/plugins/proxy
Copyright: 2009 Ohad Levy
License: MIT
Files: vendor/plugins/ruby-net-ldap
Copyright: Francis Cianfrocca
License: GPL-2
On Debian systems, the complete text of the GNU General
Public License can be found in `/usr/share/common-licenses/GPL-2'.
Files: vendor/plugins/searchlogic
Copyright: 2009 Ben Johnson of Binary Logic
License: MIT
Files: vendor/plugins/will_paginate
Copyright: 2007 PJ Hyett and Mislav Marohnić
License: MIT
Files: vendor/rails/actionmailer
Copyright: 2004-2010 David Heinemeier Hansson
License: MIT
Files: vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3
Copyright: Jeff Hodges
License: LGPL-2.1
On Debian systems, the complete text of the GNU Lesser General
Public License can be found in `/usr/share/common-licenses/LGPL-2.1'.
Files: vendor/rails/actionpack
Copyright: 2004-2010 David Heinemeier Hansson
License: MIT
Files: vendor/rails/activerecord
Copyright: 2004-2010 David Heinemeier Hansson
License: MIT
Files: vendor/rails/activeresource
Copyright: 2006-2010 David Heinemeier Hansson
License: MIT
Files: vendor/rails/activesupport
Copyright: 2005-2010 David Heinemeier Hansson
License: MIT
Files: vendor/rails/railties
Copyright: 2004-2010 David Heinemeier Hansson
License: MIT
extras/debian/foreman.default
# Start foreman on boot?
START=yes
START=no
# the location where foreman is installed
#FOREMAN_HOME=/usr/share/foreman
extras/debian/foreman.init
{
if is_true "$START" ; then
start-stop-daemon --start --quiet --chuid "${FOREMAN_USER}" --pidfile "${FOREMAN_PID}" \
--chdir "${FOREMAN_HOME}" --exec "${DAEMON}" -- $DAEMON_OPTS
--chdir "${FOREMAN_HOME}" --exec "${DAEMON}" -- $DAEMON_OPTS >/dev/null
else
echo ""
echo "${NAME} not configured to start. Please edit /etc/default/${NAME} to enable."
extras/debian/foreman.logrotate
/var/log/foreman/*log {
# Foreman logs:
/var/log/foreman/*.log {
daily
missingok
rotate 14
compress
delaycompress
notifempty
create 0644 foreman foreman
sharedscripts
postrotate
[ -x /etc/init.d/foreman ] && /etc/init.d/foreman force-reload >/dev/null 2>&1 || true
endscript
copytruncate
}
extras/debian/install
# Install the basic application files
app usr/share/foreman
config usr/share/foreman
config/database.yml etc/foreman
#config/database.yml etc/foreman
config/email.yaml.example etc/foreman
config/settings.yaml etc/foreman
db var/lib/foreman
......
vendor/plugins usr/share/foreman/vendor
vendor/gems usr/share/foreman/vendor
vendor/rails usr/share/foreman/vendor
debian/conf/*.template usr/share/foreman/templates
extras/debian/links
var/lib/foreman/db usr/share/foreman/db
var/log/foreman usr/share/foreman/log
var/lib/foreman/public usr/share/foreman/public
# Link to libjs-prototype
usr/share/javascript/prototype/prototype.js var/lib/foreman/public/javascripts/prototype.js
usr/share/javascript/prototype/prototype.js usr/share/foreman/vendor/plugins/has_many_polymorphs/test/integration/app/public/javascripts/prototype.js
usr/share/javascript/prototype/prototype.js usr/share/foreman/vendor/rails/actionpack/test/fixtures/public/javascripts/prototype.js
usr/share/javascript/prototype/prototype.js usr/share/foreman/vendor/rails/railties/html/javascripts/prototype.js
# Link to libjs-scriptaculous
usr/share/javascript/scriptaculous/controls.js var/lib/foreman/public/javascripts/controls.js
usr/share/javascript/scriptaculous/dragdrop.js var/lib/foreman/public/javascripts/dragdrop.js
usr/share/javascript/scriptaculous/effects.js var/lib/foreman/public/javascripts/effects.js
extras/debian/postinst
#!/bin/bash
#!/bin/sh
# postinst script for foreman
#
# see: dh_installdeb(1)
set -e
#set -x
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
. /usr/share/debconf/confmodule
. /usr/share/dbconfig-common/dpkg/postinst
chown -Rf foreman:foreman '/var/log/foreman'
chown -Rf foreman:foreman '/var/cache/foreman'
chown -Rf foreman:foreman '/var/lib/foreman'
chmod 755 '/var/lib/foreman'
chmod 755 '/var/lib/foreman/db'
chmod 755 '/var/lib/foreman/public'
chmod 755 '/var/lib/foreman/public/images'
chmod 755 '/var/lib/foreman/public/images/hosts'
chmod 755 '/var/lib/foreman/public/javascripts'
chmod 755 '/var/lib/foreman/public/stylesheets'
chmod 755 '/var/cache/foreman'
# Database setup
dbc_generate_include='template:/etc/foreman/database.yml'
dbc_generate_include_owner='foreman:foreman'
dbc_generate_include_perms='640'
dbc_dbfile_owner='foreman:foreman'
dbc_dbfile_perms='0660'
db_get foreman/database-type || true
DB_TYPE=${RET}
case "${DB_TYPE}" in
sqlite3)
dbc_generate_include_args='-o template_infile=/usr/share/foreman/templates/database-sqlite.yml.template'
;;
mysql|pgsql)
dbc_generate_include_args='-o template_infile=/usr/share/foreman/templates/database.yml.template'
;;
*)
exit 1;
;;
esac
dbc_go foreman $@
# initialize/migrate the database
su - foreman -s /bin/sh -c /usr/share/foreman/extras/dbmigrate >/dev/null 2>&1
#DEBHELPER#
extras/debian/postrm
#!/bin/bash
#!/bin/sh
set -e
#set -x
if [ -f /usr/share/debconf/confmodule ]; then
. /usr/share/debconf/confmodule
fi
case "$1" in
remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
;;
purge)
if [ -f /usr/share/dbconfig-common/dpkg/postrm ]; then
. /usr/share/dbconfig-common/dpkg/postrm
db_purge
fi
if which ucf >/dev/null 2>&1; then
ucf --purge /etc/foreman/database.yml
ucf --purge /etc/foreman/email.yml
ucf --purge /etc/foreman/session.yml
fi
# package-generated or runtime files are removed
rm -f /usr/share/foreman/db/schema.db
rm -rf /var/run/foreman
rm -rf /var/log/foreman
rm -rf /usr/share/foreman/tmp
rm -rf /var/lib/foreman/*/sessions
rm -rf /var/cache/foreman
rm -rf /etc/foreman
;;
*)
echo "postrm called with unknown argument \`$1'" >&2
exit 1
;;
esac
#DEBHELPER#
extras/debian/preinst
#!/bin/bash
#!/bin/sh
set -e
#set -x
# Add the "foreman" user and group
getent group foreman >/dev/null || groupadd -r foreman
extras/debian/prerm
#!/bin/bash
#!/bin/sh
set -e
#set -x
. /usr/share/debconf/confmodule
. /usr/share/dbconfig-common/dpkg/prerm
dbc_go foreman $@
#DEBHELPER#
extras/debian/rules
#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1
build:
dh_testdir
# -*- makefile -*-
clean:
dh_testdir
dh_testroot
dh_clean
include /usr/share/cdbs/1/rules/debhelper.mk
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
# Uncomment this to turn on verbose mode.
#DEB_VERBOSE_ALL=1
#DH_VERBOSE=1
binary-arch:
DEB_STRIP_EXCLUDE="debian/foreman/usr/share/foreman/extras/jumpstart/curl"
DEB_DH_SHLIBDEPS_ARGS=-X debian/foreman/usr/share/foreman/extras/jumpstart/curl
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch install
binary-install/foreman::
# Cleanup unused files
find debian/foreman -name '.cvsignore' -type f | xargs rm -f
find debian/foreman -name '.gitignore' -type f | xargs rm -f
find debian/foreman -name '.git' -type d | xargs rm -rf
find debian/foreman -name '.svn' -type d | xargs rm -rf
# Mark scripts as executable
chmod a+x debian/foreman/usr/share/foreman/vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/blankslate.rb
chmod a+x debian/foreman/usr/share/foreman/vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder.rb
chmod a+x debian/foreman/usr/share/foreman/vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder/blankslate.rb
chmod a+x debian/foreman/usr/share/foreman/vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder/css.rb
chmod a+x debian/foreman/usr/share/foreman/vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder/xchar.rb
chmod a+x debian/foreman/usr/share/foreman/vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder/xmlbase.rb
chmod a+x debian/foreman/usr/share/foreman/vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder/xmlevents.rb
chmod a+x debian/foreman/usr/share/foreman/vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder/xmlmarkup.rb
# Remove executable bit from files where not necessary
chmod a-x debian/foreman/usr/share/foreman/extras/jumpstart/rules.ok
chmod a-x debian/foreman/usr/share/foreman/vendor/rails/actionmailer/lib/action_mailer/vendor/text-format-0.6.3/text/format.rb
chmod a-x debian/foreman/usr/share/foreman/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/*.rb
chmod a-x debian/foreman/usr/share/foreman/vendor/rails/actionpack/lib/action_controller/request.rb
chmod a-x debian/foreman/usr/share/foreman/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
chmod a-x debian/foreman/usr/share/foreman/vendor/rails/activerecord/lib/active_record/*.rb
chmod a-x debian/foreman/usr/share/foreman/vendor/rails/activerecord/test/cases/base_test.rb
chmod a-x debian/foreman/usr/share/foreman/vendor/rails/railties/bin/rails
chmod a-x debian/foreman/usr/share/foreman/vendor/rails/railties/fresh_rakefile
chmod a-x debian/foreman/usr/share/foreman/vendor/rails/railties/guides/files/javascripts/*.js
chmod a-x debian/foreman/usr/share/foreman/vendor/rails/railties/guides/files/stylesheets/*.css
chmod a-x debian/foreman/usr/share/foreman/vendor/rails/railties/lib/commands/generate.rb
# Remove license files
rm -f debian/foreman/usr/share/foreman/vendor/gems/googlecharts-1.3.6/License.txt
rm -f debian/foreman/usr/share/foreman/vendor/plugins/acts_as_audited/LICENSE
rm -f debian/foreman/usr/share/foreman/vendor/plugins/google_visualr/MIT-LICENSE
rm -f debian/foreman/usr/share/foreman/vendor/plugins/has_many_polymorphs/LICENSE
rm -f debian/foreman/usr/share/foreman/vendor/plugins/proxy/MIT-LICENSE
rm -f debian/foreman/usr/share/foreman/vendor/plugins/ruby-net-ldap/COPYING
rm -f debian/foreman/usr/share/foreman/vendor/plugins/ruby-net-ldap/LICENSE
rm -f debian/foreman/usr/share/foreman/vendor/plugins/searchlogic/LICENSE
rm -f debian/foreman/usr/share/foreman/vendor/plugins/will_paginate/LICENSE
rm -f debian/foreman/usr/share/foreman/vendor/rails/actionmailer/MIT-LICENSE
rm -f debian/foreman/usr/share/foreman/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/COPYING
rm -f debian/foreman/usr/share/foreman/vendor/rails/actionpack/MIT-LICENSE
rm -f debian/foreman/usr/share/foreman/vendor/rails/activerecord/MIT-LICENSE
rm -f debian/foreman/usr/share/foreman/vendor/rails/activeresource/MIT-LICENSE
rm -f debian/foreman/usr/share/foreman/vendor/rails/activesupport/MIT-LICENSE
rm -f debian/foreman/usr/share/foreman/vendor/rails/railties/MIT-LICENSE
rm -f debian/foreman/usr/share/foreman/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/MIT-LICENSE
# Fix scripts
sed -e 's:/usr/local/bin/ruby:/usr/bin/env ruby:' -i debian/foreman/usr/share/foreman/vendor/plugins/has_many_polymorphs/test/integration/app/public/dispatch.cgi
sed -e 's:/usr/local/bin/ruby:/usr/bin/env ruby:' -i debian/foreman/usr/share/foreman/vendor/plugins/has_many_polymorphs/test/integration/app/public/dispatch.rb
    (1-1/1)