forked from theforeman/smart-proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile.dist
32 lines (27 loc) · 1.02 KB
/
Rakefile.dist
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
require 'rake/clean'
BUILDDIR = File.expand_path(ENV['BUILDDIR'] || '_build')
PREFIX = ENV['PREFIX'] || '/usr/local'
BINDIR = ENV['BINDIR'] || "#{PREFIX}/bin"
LIBDIR = ENV['LIBDIR'] || "#{PREFIX}/lib"
SBINDIR = ENV['SBINDIR'] || "#{PREFIX}/sbin"
INCLUDEDIR = ENV['INCLUDEDIR'] || "#{PREFIX}/include"
SYSCONFDIR = ENV['SYSCONFDIR'] || "#{PREFIX}/etc"
LOCALSTATEDIR = ENV['LOCALSTATEDIR'] || "#{PREFIX}/var"
SHAREDSTAREDIR = ENV['SHAREDSTAREDIR'] || "#{LOCALSTATEDIR}/lib"
DATAROOTDIR = DATADIR = ENV['DATAROOTDIR'] || "#{PREFIX}/share"
MANDIR = ENV['MANDIR'] || "#{DATAROOTDIR}/man"
file BUILDDIR do
mkdir BUILDDIR
end
file "#{BUILDDIR}/foreman-prepare-realm.8.gz" => "man/foreman-prepare-realm.8.asciidoc" do |t|
sh "a2x -d manpage -f manpage -D #{BUILDDIR}/ #{t.prerequisites[0]}"
sh "gzip -f9 #{BUILDDIR}/foreman-prepare-realm.8"
end
task :build => [
BUILDDIR,
"#{BUILDDIR}/foreman-prepare-realm.8.gz",
]
task :install => :build do |t|
mkdir_p "#{MANDIR}/man8"
cp "#{BUILDDIR}/foreman-prepare-realm.8.gz", "#{MANDIR}/man8/"
end