diff options
-rwxr-xr-x | install.rb | 53 | ||||
-rw-r--r-- | tasks/rake/manpages.rake | 27 |
2 files changed, 27 insertions, 53 deletions
diff --git a/install.rb b/install.rb index 7627a8d11..72acb24f5 100755 --- a/install.rb +++ b/install.rb @@ -53,18 +53,6 @@ rescue LoadError $haverdoc = false end -begin - if $haverdoc - ronn = %x{which ronn} - $haveman = true - else - $haveman = false - end -rescue - puts "Missing ronn; skipping man page creation" - $haveman = false -end - PREREQS = %w{openssl facter xmlrpc/client xmlrpc/server cgi} MIN_FACTER_VERSION = 1.5 @@ -178,15 +166,6 @@ def prepare_installation end - if $haveman - InstallOptions.man = true - if $operatingsystem == "windows" - InstallOptions.man = false - end - else - InstallOptions.man = false - end - InstallOptions.tests = true ARGV.options do |opts| @@ -198,9 +177,6 @@ def prepare_installation opts.on('--[no-]ri', 'Prevents the creation of RI output.', 'Default off on mswin32.') do |onri| InstallOptions.ri = onri end - opts.on('--[no-]man', 'Prevents the creation of man pages.', 'Default on.') do |onman| - InstallOptions.man = onman - end opts.on('--[no-]tests', 'Prevents the execution of unit tests.', 'Default on.') do |ontest| InstallOptions.tests = ontest end @@ -233,7 +209,6 @@ def prepare_installation end opts.on('--full', 'Performs a full installation. All', 'optional installation steps are run.') do |full| InstallOptions.rdoc = true - InstallOptions.man = true InstallOptions.ri = true InstallOptions.tests = true InstallOptions.configs = true @@ -368,33 +343,6 @@ def build_ri(files) end end -def build_man(bins, sbins) - return unless $haveman - begin - # Locate ronn - ronn = %x{which ronn} - ronn.chomp! - # Create puppet.conf.5 man page - %x{bin/puppetdoc --reference configuration > ./man/man5/puppetconf.5.ronn} - %x{#{ronn} -r ./man/man5/puppetconf.5.ronn} - File.move("./man/man5/puppetconf.5", "./man/man5/puppet.conf.5") - File.unlink("./man/man5/puppetconf.5.ronn") - - # Create binary man pages - binary = bins + sbins - binary.each do |bin| - b = bin.gsub( /(bin|sbin)\//, "") - %x{#{bin} --help > ./man/man8/#{b}.8.ronn} - %x{#{ronn} -r ./man/man8/#{b}.8.ronn} - File.unlink("./man/man8/#{b}.8.ronn") - end - -rescue SystemCallError - $stderr.puts "Couldn't build man pages: " + $ERROR_INFO - $stderr.puts "Continuing with install..." - end -end - def run_tests(test_list) require 'test/unit/ui/console/testrunner' $LOAD_PATH.unshift "lib" @@ -488,7 +436,6 @@ prepare_installation #run_tests(tests) if InstallOptions.tests #build_rdoc(rdoc) if InstallOptions.rdoc #build_ri(ri) if InstallOptions.ri -#build_man(bins, sbins) if InstallOptions.man do_configs(configs, InstallOptions.config_dir) if InstallOptions.configs do_bins(sbins, InstallOptions.sbin_dir) do_bins(bins, InstallOptions.bin_dir) diff --git a/tasks/rake/manpages.rake b/tasks/rake/manpages.rake new file mode 100644 index 000000000..752a6a7a6 --- /dev/null +++ b/tasks/rake/manpages.rake @@ -0,0 +1,27 @@ +# require 'fileutils' + +desc "Build Puppet manpages" +task :gen_manpages do + + sbins = Dir.glob(%w{sbin/*}) + bins = Dir.glob(%w{bin/*}) + + # Locate ronn + ronn = %x{which ronn} + ronn.chomp! + # Create puppet.conf.5 man page + %x{RUBYLIB=./lib:$RUBYLIB bin/puppetdoc --reference configuration > ./man/man5/puppetconf.5.ronn} + %x{#{ronn} --manual="Puppet manual" --organization="Puppet Labs, LLC" -r ./man/man5/puppetconf.5.ronn} + File.move("./man/man5/puppetconf.5", "./man/man5/puppet.conf.5") + File.unlink("./man/man5/puppetconf.5.ronn") + + # Create binary man pages + binary = bins + sbins + binary.each do |bin| + b = bin.gsub( /(bin|sbin)\//, "") + %x{RUBYLIB=./lib:$RUBYLIB #{bin} --help > ./man/man8/#{b}.8.ronn} + %x{#{ronn} --manual="Puppet manual" --organization="Puppet Labs, LLC" -r ./man/man8/#{b}.8.ronn} + File.unlink("./man/man8/#{b}.8.ronn") + end + +end
\ No newline at end of file |