[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, experimental, updated. debian/2.6.8-1-844-g7ec39d5
nfagerlund
nick.fagerlund at gmail.com
Tue May 10 08:04:51 UTC 2011
The following commit has been merged in the experimental branch:
commit c61952001509768faa7fa09e7ddc2e7d86f2981f
Author: nfagerlund <nick.fagerlund at gmail.com>
Date: Wed Feb 16 16:01:16 2011 -0800
(#1204) Move man generation task from install.rb to a rake task
Having this be commented-out code in the installer script doesn't really
make sense for our workflow; we want to be able to regenerate these manpages at will
and make sure they're always up-to-date. This will help us keep them in sync with the help text.
This commit also changes the ronn invocation to specify a manual name and organization.
diff --git a/install.rb b/install.rb
index 7627a8d..72acb24 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 0000000..752a6a7
--- /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
--
Puppet packaging for Debian
More information about the Pkg-puppet-devel
mailing list