1 Star 0 Fork 8

openKylin-origin/foreman

forked from openKylin-backup/foreman 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Rakefile.dist 2.39 KB
一键复制 编辑 原始数据 按行查看 历史
require 'rake/clean'
load File.join(__dir__, 'lib', 'tasks', 'pkg.rake')
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"
def is_redhat; File.exist?("/etc/redhat-release"); end
def is_debian; File.exist?("/etc/debian-release"); end
file BUILDDIR do
mkdir BUILDDIR
end
file "#{BUILDDIR}/foreman-rake.8.gz" => "man/foreman-rake.8.asciidoc" do |t|
sh "a2x -d manpage -f manpage -D #{BUILDDIR}/ #{t.prerequisites[0]}"
sh "gzip -f9 #{BUILDDIR}/foreman-rake.8"
end
file "#{BUILDDIR}/foreman-debug.8.gz" => "man/foreman-debug.8.asciidoc" do |t|
sh "a2x -d manpage -f manpage -D #{BUILDDIR}/ #{t.prerequisites[0]}"
sh "gzip -f9 #{BUILDDIR}/foreman-debug.8"
end
file "#{BUILDDIR}/foreman-tail.8.gz" => "man/foreman-tail.8.asciidoc" do |t|
sh "a2x -d manpage -f manpage -D #{BUILDDIR}/ #{t.prerequisites[0]}"
sh "gzip -f9 #{BUILDDIR}/foreman-tail.8"
end
task :build => [
BUILDDIR,
"#{BUILDDIR}/foreman-rake.8.gz",
"#{BUILDDIR}/foreman-debug.8.gz",
"#{BUILDDIR}/foreman-tail.8.gz",
]
task :install => :build do |t|
mkdir_p "#{MANDIR}/man8"
cp "#{BUILDDIR}/foreman-rake.8.gz", "#{MANDIR}/man8/"
cp "#{BUILDDIR}/foreman-debug.8.gz", "#{MANDIR}/man8/"
cp "#{BUILDDIR}/foreman-tail.8.gz", "#{MANDIR}/man8/"
# foreman-tail
TAILDIR = ENV['TAILDIR'] || "script/foreman-tail.d"
mkdir_p "#{DATAROOTDIR}/foreman/#{TAILDIR}"
cp Dir.glob("#{TAILDIR}/common/*"), "#{DATAROOTDIR}/foreman/#{TAILDIR}/", :verbose => true
if is_redhat
cp Dir.glob("#{TAILDIR}/redhat/*"), "#{DATAROOTDIR}/foreman/#{TAILDIR}/", :verbose => true
elsif is_debian
cp Dir.glob("#{TAILDIR}/debian/*"), "#{DATAROOTDIR}/foreman/#{TAILDIR}/", :verbose => true
else
raise "Unsupported system"
end
# foreman-debug
DEBUGDIR = ENV['DEBUGDIR'] || "script/foreman-debug.d"
mkdir_p "#{DATAROOTDIR}/foreman/#{DEBUGDIR}"
# ssh
mkdir_p "#{DATAROOTDIR}/foreman/.ssh"
end
task :default => :build
CLEAN.include [
'_build',
]
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Ruby
1
https://gitee.com/open-kylin-origin/foreman.git
git@gitee.com:open-kylin-origin/foreman.git
open-kylin-origin
foreman
foreman
develop

搜索帮助