Feature #356 ยป 0001-Added-rake-task-pkg-deb-to-build-a-Debian-package-fo.patch
extras/debian/control | ||
---|---|---|
Package: foreman
|
||
Architecture: all
|
||
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}
|
||
Depends: ruby, ruby1.8 (>= 1.8.7), rubygems, rubygems1.8, rake (>=0.8.1), libjs-prototype (>= 1.6.0), libjs-scriptaculous (>= 1.8.1), 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
|
extras/debian/postinst | ||
---|---|---|
. /usr/share/debconf/confmodule
|
||
. /usr/share/dbconfig-common/dpkg/postinst
|
||
# 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
|
||
chown -Rf foreman:foreman '/var/log/foreman'
|
||
chown -Rf foreman:foreman '/var/cache/foreman'
|
||
chown -Rf foreman:foreman '/var/lib/foreman'
|
extras/debian/preinst | ||
---|---|---|
set -e
|
||
#set -x
|
||
# 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
|
lib/tasks/pkg.rake | ||
---|---|---|
require 'fileutils'
|
||
namespace :pkg do
|
||
desc 'Create DEB package with `debuild`.'
|
||
task :deb do
|
||
# copy 'debian' directory from 'extras' into main directory
|
||
FileUtils.cp_r 'extras/debian/', Rake.application.original_dir + '/debian'
|
||
# run 'debuild'
|
||
system 'debuild'
|
||
if $? == 0
|
||
# remove 'debian' directory
|
||
FileUtils.rm_r Rake.application.original_dir + '/debian', :force => true
|
||
else
|
||
abort 'Error while building the DEB package with `debuild`. Please check the output.'
|
||
end
|
||
end
|
||
end
|