diff --git a/man/meson.build b/man/meson.build new file mode 100644 index 000000000..438aa4c88 --- /dev/null +++ b/man/meson.build @@ -0,0 +1,24 @@ +manpage_conf = configuration_data() +manpage_conf.set('PACKAGE_NAME', meson.project_name()) +manpage_conf.set('PACKAGE_VERSION', meson.project_version()) +manpage_conf.set('PACKAGE_URL', 'http://pipewire.org') +manpage_conf.set('top_srcdir', meson.source_root()) +manpage_conf.set('top_builddir', meson.build_root()) + +manpages = ['pipewire.1', + 'pipewire-monitor.1' ] + +foreach m : manpages + infile = m + '.xml.in' + outfile = m + '.xml' + xml = configure_file(input : infile, + output : outfile, + configuration : manpage_conf) + custom_target(m + '.target', + output : m, + input : xml, + command : [xmltoman, '@INPUT@'], + capture : true, + install : true, + install_dir : 'subdir') +endforeach diff --git a/man/xmltoman b/man/xmltoman deleted file mode 100755 index 92422f037..000000000 --- a/man/xmltoman +++ /dev/null @@ -1,216 +0,0 @@ -#!/usr/bin/perl -w - -# xmltoman - simple xml to man converter -# Copyright (C) 2000-2002 Oliver Kurth -# 2003 Lennart Poettering -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, see . - -use XML::Parser; - -my $buffer = ""; -my $break_req = 0; - -my @stack; -my $stack_n = 0; - -my $para = 0; - -sub out { - my $t = shift; - - if ($t ne "") { - print $t; - $break_req=1; - } -} - -sub out_buf { - local $_; - - my $space = shift; - - $_ = $buffer; - $buffer = ""; - - s/\n/\ /gm; - s/\s+/\ /gm; - s/^\s*//gm if (!$break_req); - s/^\s$//gm if (!$space); - - out($_); -} - -sub stack_push { - my $a = shift; - - if ($stack_n == 0 or $a ne $stack[$stack_n-1]) { - out("\\fB") if $a =~ /^bold$/; - out("\\fI") if $a =~ /^italic$/; - } - - $stack[$stack_n++] = $a; -} - -sub stack_pop { - local $_; - - if ($stack_n > 0) { - $stack_n--; - - if ($stack_n > 0) { - $a = $stack[$stack_n-1]; - out("\\fB") if $a =~ /^bold$/; - out("\\fI") if $a =~ /^italic$/; - } else { - out("\\f1"); - } - } -} - -sub handle_start { - local $_; - my $expat = shift; - my $element = shift; - my %attr = @_; - - $_ = $element; - - if (/^manpage$/) { - out_buf(0); - print "\n" if ($break_req); - print ".TH " . $attr{name} . " " . $attr{section} . " User Manuals\n"; - print ".SH NAME\n"; - print $attr{name} . " \\- " . $attr{desc} . "\n"; - $break_req = 0; - } elsif (/^synopsis$/) { - out_buf(0); - print "\n" if ($break_req); - print ".SH SYNOPSIS\n"; - $section = $element; - $break_req = 0; - stack_push("bold"); - } elsif (/^description$/) { - out_buf(0); - print "\n" if ($break_req); - print ".SH DESCRIPTION\n"; - $section = $element; - $break_req = 0; - } elsif (/^options$/) { - out_buf(0); - print "\n" if ($break_req); - print ".SH OPTIONS\n"; - $section = $element; - $break_req = 0; - } elsif (/^seealso$/) { - out_buf(0); - print "\n" if ($break_req); - print ".SH SEE ALSO\n"; - $section = $element; - $break_req = 0; - } elsif (/^section$/) { - out_buf(0); - print "\n" if ($break_req); - print ".SH ".uc($attr{name})."\n"; - $section = $attr{name}; - $break_req = 0; - } elsif (/^option$/) { - out_buf(0); - print "\n" if ($break_req); - print ".TP\n"; - $break_req = 0; - } elsif (/^p$/ or /^cmd$/) { - out_buf(0); - print "\n" if ($para); - $break_req = 0; - } elsif (/^optdesc$/) { - out_buf(0); - $break_req = 0; - } elsif (/^arg$/ or /^file$/) { - out_buf(1); - stack_push("italic"); - } elsif (/^opt$/) { - out_buf(1); - stack_push("bold"); - } elsif (/^manref$/) { - out_buf(1); - stack_push("bold"); - out($attr{name} ."(" . $attr{section} . ")"); - stack_pop(); - } elsif (/^url$/) { - out_buf(1); - stack_push("bold"); - out($attr{href}); - stack_pop(); - }; - - $para = 0; -} - -sub handle_end { - local $_; - my $expat = shift; - my $element = shift; - - $_ = $element; - - $para = 0; - - if (/^description$/ or /^options$/ or /^section$/ or /^seealso$/) { - out_buf(0); - } elsif (/^p$/ or /^cmd$/) { - out_buf(0); - print "\n" if ($break_req); - $para = 1; - $break_req = 0; - } elsif (/^synopsis$/) { - out_buf(0); - stack_pop(); - } elsif (/^opt$/ or /^arg$/ or /^file$/) { - out_buf(1); - stack_pop(); - } elsif (/^manpage$/) { - out_buf(0); - print "\n" if $break_req; - $break_req = 0; - } elsif (/^optdesc$/ or /^cmd$/ or /^option$/) { - # Simply ignore - } else { - out_buf(1); - } -}; - -sub handle_char { - local $_; - my $expat = shift; - my $string = shift; - - $buffer .= $string; -} - -MAIN:{ - my $file = shift; - - if (!$file) { - print STDERR "You need to specify a file to parse\n"; - exit(1); - } - - my $parser = new XML::Parser(Handlers => { - Start => \&handle_start, - End => \&handle_end, - Char => \&handle_char}); - - $parser->parsefile($file, ProtocolEncoding => 'ISO-8859-1'); -} diff --git a/man/xmltoman.css b/man/xmltoman.css deleted file mode 100644 index aac91028d..000000000 --- a/man/xmltoman.css +++ /dev/null @@ -1,27 +0,0 @@ -/*** - This file is part of PipeWire. - - PipeWire is free software; you can redistribute it and/or modify it under - the terms of the GNU General Public License as published by the Free - Software Foundation; either version 2 of the License, or (at your - option) any later version. - - PipeWire is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with PipeWire; if not, see . -***/ - -body { color: black; background-color: white; } -a:link, a:visited { color: #900000; } -h1 { text-transform:uppercase; font-size: 18pt; } -p { margin-left:1cm; margin-right:1cm; } -.cmd { font-family:monospace; } -.file { font-family:monospace; } -.arg { text-transform:uppercase; font-family:monospace; font-style: italic; } -.opt { font-family:monospace; font-weight: bold; } -.manref { font-family:monospace; } -.option .optdesc { margin-left:2cm; } diff --git a/man/xmltoman.dtd b/man/xmltoman.dtd deleted file mode 100644 index ed9784456..000000000 --- a/man/xmltoman.dtd +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/man/xmltoman.xsl b/man/xmltoman.xsl deleted file mode 100644 index 86ce073b5..000000000 --- a/man/xmltoman.xsl +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - - - - - - - <xsl:value-of select="@name"/>(<xsl:value-of select="@section"/>) - - - -

Name

-

- - -

- - - -
- - -

- -

-
- - -

- -

-
- - - - - - - - - - - - - - -
- -
-
- - -

Synopsis

- -
- - -

Synopsis

- -
- - -

Description

- -
- - -

Options

- -
- - -

- -
- - -
-
- - - - - () - - - () - - - - - - - - -
diff --git a/meson.build b/meson.build index 0581862b6..5b991b212 100644 --- a/meson.build +++ b/meson.build @@ -51,7 +51,7 @@ cdata.set('PACKAGE', '"pipewire"') cdata.set('PACKAGE_NAME', '"PipeWire"') cdata.set('PACKAGE_STRING', '"PipeWire @0@"'.format(pipewire_version)) cdata.set('PACKAGE_TARNAME', '"pipewire"') -cdata.set('PACKAGE_URL', '""') +cdata.set('PACKAGE_URL', '"http://pipewire.org"') cdata.set('PACKAGE_VERSION', '"@0@"'.format(pipewire_version)) cdata.set('MODULEDIR', '"@0@/@1@/pipewire-@2@"'.format(pipewire_libdir,apiversion)) cdata.set('PIPEWIRE_CONFIG_DIR', '"@0@/pipewire"'.format(pipewire_sysconfdir)) @@ -147,3 +147,10 @@ if doxygen.found() else message('Documentation disabled without doxygen') endif + +xmltoman = find_program('xmltoman', required: false) +if xmltoman.found() + subdir('man') +else + message('Man page disabled without xmltoman') +endif