summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Turnbull <james@lovedthanlost.net>2008-03-22 15:00:19 +1100
committerJames Turnbull <james@lovedthanlost.net>2008-03-22 15:00:19 +1100
commite5b16b26fff6b8b358975d27d46a274407891a69 (patch)
treeb5a2f4774e29098fa66508471c013b6c4d1529f3
parent18320b8e3271f7d1d1702907be1ff420acfc8d2b (diff)
downloadpuppet-e5b16b26fff6b8b358975d27d46a274407891a69.tar.gz
puppet-e5b16b26fff6b8b358975d27d46a274407891a69.tar.xz
puppet-e5b16b26fff6b8b358975d27d46a274407891a69.zip
Ported #198 man page creation functionality to 0.24.x branch
-rwxr-xr-xinstall.rb51
-rw-r--r--lib/puppet/defaults.rb6
2 files changed, 54 insertions, 3 deletions
diff --git a/install.rb b/install.rb
index 6c418119b..c7472a111 100755
--- a/install.rb
+++ b/install.rb
@@ -47,6 +47,18 @@ rescue LoadError
$haverdoc = false
end
+begin
+ if $haverdoc
+ rst2man = %x{which rst2man.py}
+ $haveman = true
+ else
+ $haveman = false
+ end
+rescue
+ puts "Missing rst2man; skipping man page creation"
+ $haveman = false
+end
+
PREREQS = %w{openssl facter xmlrpc/client xmlrpc/server cgi}
InstallOptions = OpenStruct.new
@@ -112,6 +124,17 @@ def prepare_installation
InstallOptions.rdoc = false
InstallOptions.ri = false
end
+
+
+ if $haveman
+ InstallOptions.man = true
+ if RUBY_PLATFORM == "i386-mswin32"
+ InstallOptions.man = false
+ end
+ else
+ InstallOptions.man = false
+ end
+
InstallOptions.tests = true
ARGV.options do |opts|
@@ -123,6 +146,9 @@ 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', 'Presents 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
@@ -212,6 +238,30 @@ def build_ri(files)
end
end
+def build_man(bins)
+ return unless $haveman
+ begin
+ # Locate rst2man
+ rst2man = %x{which rst2man.py}
+ rst2man.chomp!
+ # Create puppet.conf.8 man page
+ %x{bin/puppetdoc --reference configuration > ./puppet.conf.rst}
+ %x{#{rst2man} ./puppet.conf.rst ./man/man8/puppet.conf.8}
+ File.unlink("./puppet.conf.rst")
+
+ # Create binary man pages
+ bins.each do |bin|
+ b = bin.gsub( "bin/", "")
+ %x{#{bin} --help > ./#{b}.rst}
+ %x{#{rst2man} ./#{b}.rst ./man/man8/#{b}.8}
+ File.unlink("./#{b}.rst")
+ end
+ rescue SystemCallError
+ $stderr.puts "Couldn't build man pages: " + $!
+ $stderr.puts "Continuing with install..."
+ end
+end
+
def run_tests(test_list)
begin
require 'test/unit/ui/console/testrunner'
@@ -309,6 +359,7 @@ prepare_installation
run_tests(tests) if InstallOptions.tests
#build_rdoc(rdoc) if InstallOptions.rdoc
#build_ri(ri) if InstallOptions.ri
+build_man(bins) if InstallOptions.man
do_bins(sbins, InstallOptions.sbin_dir)
do_bins(bins, InstallOptions.bin_dir)
do_libs(libs)
diff --git a/lib/puppet/defaults.rb b/lib/puppet/defaults.rb
index 407a47d07..964c544ba 100644
--- a/lib/puppet/defaults.rb
+++ b/lib/puppet/defaults.rb
@@ -346,11 +346,11 @@ module Puppet
:ssl_client_header => ["HTTP_X_CLIENT_DN", "The header containing an authenticated
client's SSL DN. Only used with Mongrel. This header must be set by the proxy
to the authenticated client's SSL DN (e.g., ``/CN=puppet.reductivelabs.com``).
- See the `UsingMongrel`:trac: wiki page for more information."],
+ See http://reductivelabs.com/puppet/trac/wiki/UsingMongrel for more information."],
:ssl_client_verify_header => ["HTTP_X_CLIENT_VERIFY", "The header containing the status
message of the client verification. Only used with Mongrel. This header must be set by the proxy
to 'SUCCESS' if the client successfully authenticated, and anything else otherwise.
- See the `UsingMongrel`:trac: wiki page for more information."]
+ See http://reductivelabs.com/puppet/trac/wiki/UsingMongrel for more information."]
)
self.setdefaults(:puppetd,
@@ -600,7 +600,7 @@ module Puppet
setdefaults(:ldap,
:ldapnodes => [false,
"Whether to search for node configurations in LDAP. See
- `LdapNodes`:trac: for more information."],
+ http://reductivelabs.com/puppet/trac/wiki/LdapNodes/ for more information."],
:ldapssl => [false,
"Whether SSL should be used when searching for nodes.
Defaults to false because SSL usually requires certificates