File: Rakefile

package info (click to toggle)
chake 0.17.1-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 212 kB
  • sloc: ruby: 668; sh: 36; sed: 4; makefile: 3
file content (22 lines) | stat: -rw-r--r-- 677 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
task :default => 'man/chake.1'

file 'man/chake.1' => ['man/chake.adoc'] do
  sh 'asciidoctor --backend manpage --out-file man/chake.1 man/chake.adoc'
end

file 'man/chake.adoc' => ['README.md', 'man/readme2man.sed'] do |t|
  sh "sed -f man/readme2man.sed README.md > #{t.name} || (rm -f #{t.name}; false)"
end

task :install => 'man/chake.1' do
  prefix = ENV['PREFIX'] || File.exists?('debian/rules') && '/usr' || '/usr/local'
  target = [ENV["DESTDIR"], prefix , 'share/man/man1'].compact
  man = File.join(*target)
  sh 'install', '-d', '-m', '0755', man
  sh 'install', '-m', '0644', 'man/chake.1', man
end

task :clean do
  rm_f 'man/chake.1'
  rm_f 'man/chake.adoc'
end