Project

General

Profile

0001-Added-rake-task-pkg-deb-to-build-a-Debian-package-fo.patch

Jochen Schalanda, 07/21/2010 03:19 PM

View differences:

extras/debian/control
9 9
Package: foreman
10 10
Architecture: all
11 11
Pre-Depends: debconf
12
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}
12
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}
13 13
Recommends: libfcgi-ruby, libapache2-mod-passenger | libapache2-mod-fcgid
14 14
Suggests: thin | mongrel | httpd-cgi
15 15
Description: Systems management web interface
extras/debian/postinst
9 9
. /usr/share/debconf/confmodule
10 10
. /usr/share/dbconfig-common/dpkg/postinst
11 11

  
12
# Add the "foreman" user and group
13
getent group foreman >/dev/null || groupadd -r foreman
14
getent passwd foreman >/dev/null || \
15
    useradd -r -g foreman -G puppet -d /usr/share/foreman -s /usr/sbin/nologin -c "Foreman" foreman
16

  
12 17
chown -Rf foreman:foreman '/var/log/foreman'
13 18
chown -Rf foreman:foreman '/var/cache/foreman'
14 19
chown -Rf foreman:foreman '/var/lib/foreman'
extras/debian/preinst
3 3
set -e
4 4
#set -x
5 5

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

  
11 6
#DEBHELPER#
12 7

  
13 8
exit 0
lib/tasks/pkg.rake
1
require 'fileutils'
2

  
3
namespace :pkg do
4
  desc 'Create DEB package with `debuild`.'
5
  task :deb do
6
    # copy 'debian' directory from 'extras' into main directory
7
    FileUtils.cp_r 'extras/debian/', Rake.application.original_dir + '/debian'
8

  
9
    # run 'debuild'
10
    system 'debuild'
11

  
12
    if $? == 0
13
      # remove 'debian' directory
14
      FileUtils.rm_r Rake.application.original_dir + '/debian', :force => true
15
    else
16
      abort 'Error while building the DEB package with `debuild`. Please check the output.'
17
    end
18
  end
19
end
0
-