summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-08-21 20:11:52 +0100
committerRichard W.M. Jones <rjones@redhat.com>2012-08-21 20:33:21 +0100
commit2f97bf873b64384835f257f8916bf1ebb2af62b4 (patch)
treead9bce03b85f906e6a0bf875c3898e58fd148218
parentf1d98bbc79496947210ee0305f80440ed8557ec1 (diff)
downloadlibguestfs-2f97bf873b64384835f257f8916bf1ebb2af62b4.tar.gz
libguestfs-2f97bf873b64384835f257f8916bf1ebb2af62b4.tar.xz
libguestfs-2f97bf873b64384835f257f8916bf1ebb2af62b4.zip
podwrapper: Add --license parameter, which is required.
This adds standard LICENSE and BUGS sections to all of the man pages that are processed by podwrapper. Modify all the calls to $(PODWRAPPER) to add the right --license parameter according to the content. Note that this relaxes the license on some code example pages, making them effectively BSD-style licensed.
-rw-r--r--Makefile.am1
-rw-r--r--align/Makefile.am1
-rw-r--r--appliance/Makefile.am1
-rw-r--r--cat/Makefile.am3
-rw-r--r--df/Makefile.am1
-rw-r--r--edit/Makefile.am1
-rw-r--r--erlang/examples/Makefile.am1
-rw-r--r--examples/Makefile.am5
-rw-r--r--fish/Makefile.am5
-rw-r--r--format/Makefile.am1
-rw-r--r--fuse/Makefile.am1
-rw-r--r--inspector/Makefile.am1
-rw-r--r--java/examples/Makefile.am1
-rw-r--r--ocaml/examples/Makefile.am1
-rw-r--r--perl/examples/Makefile.am1
-rwxr-xr-xpodwrapper.pl.in121
-rw-r--r--python/examples/Makefile.am1
-rw-r--r--rescue/Makefile.am1
-rw-r--r--resize/Makefile.am1
-rw-r--r--ruby/examples/Makefile.am1
-rw-r--r--sparsify/Makefile.am1
-rw-r--r--src/Makefile.am1
-rw-r--r--sysprep/Makefile.am1
-rw-r--r--test-tool/Makefile.am1
-rw-r--r--tools/Makefile.am2
25 files changed, 156 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index 72a9960e..918d80d8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -262,6 +262,7 @@ stamp-guestfs-release-notes.pod: guestfs-release-notes.pod
--man guestfs-release-notes.1 \
--text guestfs-release-notes.txt \
--html $(top_builddir)/html/guestfs-release-notes.1.html \
+ --license GPLv2+ \
$<
touch $@
diff --git a/align/Makefile.am b/align/Makefile.am
index 13409e8f..d8b33a48 100644
--- a/align/Makefile.am
+++ b/align/Makefile.am
@@ -65,6 +65,7 @@ stamp-virt-alignment-scan.pod: virt-alignment-scan.pod
$(PODWRAPPER) \
--man virt-alignment-scan.1 \
--html $(top_builddir)/html/virt-alignment-scan.1.html \
+ --license GPLv2+ \
$<
touch $@
diff --git a/appliance/Makefile.am b/appliance/Makefile.am
index f106921d..fb1f676c 100644
--- a/appliance/Makefile.am
+++ b/appliance/Makefile.am
@@ -103,6 +103,7 @@ stamp-libguestfs-make-fixed-appliance.pod: libguestfs-make-fixed-appliance.pod
$(PODWRAPPER) \
--man libguestfs-make-fixed-appliance.1 \
--html $(top_builddir)/html/libguestfs-make-fixed-appliance.1.html \
+ --license GPLv2+ \
$<
touch $@
diff --git a/cat/Makefile.am b/cat/Makefile.am
index f7c763ac..3549248c 100644
--- a/cat/Makefile.am
+++ b/cat/Makefile.am
@@ -105,6 +105,7 @@ stamp-virt-cat.pod: virt-cat.pod
$(PODWRAPPER) \
--man virt-cat.1 \
--html $(top_builddir)/html/virt-cat.1.html \
+ --license GPLv2+ \
$<
touch $@
@@ -114,6 +115,7 @@ stamp-virt-ls.pod: virt-ls.pod
$(PODWRAPPER) \
--man virt-ls.1 \
--html $(top_builddir)/html/virt-ls.1.html \
+ --license GPLv2+ \
$<
touch $@
@@ -123,6 +125,7 @@ stamp-virt-filesystems.pod: virt-filesystems.pod
$(PODWRAPPER) \
--man virt-filesystems.1 \
--html $(top_builddir)/html/virt-filesystems.1.html \
+ --license GPLv2+ \
$<
touch $@
diff --git a/df/Makefile.am b/df/Makefile.am
index 8f239e81..b91efd38 100644
--- a/df/Makefile.am
+++ b/df/Makefile.am
@@ -69,6 +69,7 @@ stamp-virt-df.pod: virt-df.pod
$(PODWRAPPER) \
--man virt-df.1 \
--html $(top_builddir)/html/virt-df.1.html \
+ --license GPLv2+ \
$<
touch $@
diff --git a/edit/Makefile.am b/edit/Makefile.am
index ee9af97a..223322cf 100644
--- a/edit/Makefile.am
+++ b/edit/Makefile.am
@@ -61,6 +61,7 @@ stamp-virt-edit.pod: virt-edit.pod
$(PODWRAPPER) \
--man virt-edit.1 \
--html $(top_builddir)/html/virt-edit.1.html \
+ --license GPLv2+ \
$<
touch $@
diff --git a/erlang/examples/Makefile.am b/erlang/examples/Makefile.am
index 56f3ae80..af6cbc76 100644
--- a/erlang/examples/Makefile.am
+++ b/erlang/examples/Makefile.am
@@ -35,5 +35,6 @@ stamp-guestfs-erlang.pod: guestfs-erlang.pod create_disk.erl inspect_vm.erl
--html $(top_builddir)/html/guestfs-erlang.3.html \
--verbatim $(srcdir)/create_disk.erl:@EXAMPLE1@ \
--verbatim $(srcdir)/inspect_vm.erl:@EXAMPLE2@ \
+ --license examples \
$<
touch $@
diff --git a/examples/Makefile.am b/examples/Makefile.am
index 3c325d43..35bf7654 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -124,6 +124,7 @@ stamp-guestfs-examples.pod: guestfs-examples.pod create_disk.c inspect_vm.c
--html $(top_builddir)/html/guestfs-examples.3.html \
--verbatim $(srcdir)/create_disk.c:@EXAMPLE1@ \
--verbatim $(srcdir)/inspect_vm.c:@EXAMPLE2@ \
+ --license examples \
$<
touch $@
@@ -134,6 +135,7 @@ stamp-guestfs-faq.pod: guestfs-faq.pod
--section 1 \
--man guestfs-faq.1 \
--html $(top_builddir)/html/guestfs-faq.1.html \
+ --license LGPLv2+ \
$<
touch $@
@@ -144,6 +146,7 @@ stamp-guestfs-performance.pod: guestfs-performance.pod
--section 1 \
--man guestfs-performance.1 \
--html $(top_builddir)/html/guestfs-performance.1.html \
+ --license LGPLv2+ \
$<
touch $@
@@ -154,6 +157,7 @@ stamp-guestfs-recipes.pod: guestfs-recipes.pod
--section 1 \
--man guestfs-recipes.1 \
--html $(top_builddir)/html/guestfs-recipes.1.html \
+ --license examples \
$<
touch $@
@@ -164,5 +168,6 @@ stamp-guestfs-testing.pod: guestfs-testing.pod
--section 1 \
--man guestfs-testing.1 \
--html $(top_builddir)/html/guestfs-testing.1.html \
+ --license LGPLv2+ \
$<
touch $@
diff --git a/fish/Makefile.am b/fish/Makefile.am
index 27015f65..507e413a 100644
--- a/fish/Makefile.am
+++ b/fish/Makefile.am
@@ -187,6 +187,7 @@ stamp-guestfish.pod: guestfish.pod guestfish-actions.pod guestfish-commands.pod
--html $(top_builddir)/html/guestfish.1.html \
--insert $(srcdir)/guestfish-actions.pod:@ACTIONS@ \
--insert $(srcdir)/guestfish-commands.pod:@FISH_COMMANDS@ \
+ --license GPLv2+ \
$<
touch $@
@@ -196,6 +197,7 @@ stamp-virt-copy-in.pod: virt-copy-in.pod
$(PODWRAPPER) \
--man virt-copy-in.1 \
--html $(top_builddir)/html/virt-copy-in.1.html \
+ --license GPLv2+ \
$<
touch $@
@@ -205,6 +207,7 @@ stamp-virt-copy-out.pod: virt-copy-out.pod
$(PODWRAPPER) \
--man virt-copy-out.1 \
--html $(top_builddir)/html/virt-copy-out.1.html \
+ --license GPLv2+ \
$<
touch $@
@@ -214,6 +217,7 @@ stamp-virt-tar-in.pod: virt-tar-in.pod
$(PODWRAPPER) \
--man virt-tar-in.1 \
--html $(top_builddir)/html/virt-tar-in.1.html \
+ --license GPLv2+ \
$<
touch $@
@@ -223,6 +227,7 @@ stamp-virt-tar-out.pod: virt-tar-out.pod
$(PODWRAPPER) \
--man virt-tar-out.1 \
--html $(top_builddir)/html/virt-tar-out.1.html \
+ --license GPLv2+ \
$<
touch $@
diff --git a/format/Makefile.am b/format/Makefile.am
index 2aba2132..63cba519 100644
--- a/format/Makefile.am
+++ b/format/Makefile.am
@@ -62,6 +62,7 @@ stamp-virt-format.pod: virt-format.pod
$(PODWRAPPER) \
--man virt-format.1 \
--html $(top_builddir)/html/virt-format.1.html \
+ --license GPLv2+ \
$<
touch $@
diff --git a/fuse/Makefile.am b/fuse/Makefile.am
index 1793a7cd..079755b6 100644
--- a/fuse/Makefile.am
+++ b/fuse/Makefile.am
@@ -67,6 +67,7 @@ stamp-guestmount.pod: guestmount.pod
$(PODWRAPPER) \
--man guestmount.1 \
--html $(top_builddir)/html/guestmount.1.html \
+ --license GPLv2+ \
$<
touch $@
diff --git a/inspector/Makefile.am b/inspector/Makefile.am
index 3a1893d7..6e209ce4 100644
--- a/inspector/Makefile.am
+++ b/inspector/Makefile.am
@@ -87,6 +87,7 @@ stamp-virt-inspector.pod: virt-inspector.pod
$(PODWRAPPER) \
--man virt-inspector.1 \
--html $(top_builddir)/html/virt-inspector.1.html \
+ --license GPLv2+ \
$<
touch $@
diff --git a/java/examples/Makefile.am b/java/examples/Makefile.am
index 55f7b637..f611f035 100644
--- a/java/examples/Makefile.am
+++ b/java/examples/Makefile.am
@@ -37,6 +37,7 @@ stamp-guestfs-java.pod: guestfs-java.pod CreateDisk.java InspectVM.java
--html $(top_builddir)/html/guestfs-java.3.html \
--verbatim $(srcdir)/CreateDisk.java:@EXAMPLE1@ \
--verbatim $(srcdir)/InspectVM.java:@EXAMPLE2@ \
+ --license examples \
$<
touch $@
diff --git a/ocaml/examples/Makefile.am b/ocaml/examples/Makefile.am
index e435d04d..7860dc60 100644
--- a/ocaml/examples/Makefile.am
+++ b/ocaml/examples/Makefile.am
@@ -37,6 +37,7 @@ stamp-guestfs-ocaml.pod: guestfs-ocaml.pod create_disk.ml inspect_vm.ml
--html $(top_builddir)/html/guestfs-ocaml.3.html \
--verbatim $(srcdir)/create_disk.ml:@EXAMPLE1@ \
--verbatim $(srcdir)/inspect_vm.ml:@EXAMPLE2@ \
+ --license examples \
$<
touch $@
diff --git a/perl/examples/Makefile.am b/perl/examples/Makefile.am
index fb52eca3..037095ef 100644
--- a/perl/examples/Makefile.am
+++ b/perl/examples/Makefile.am
@@ -35,5 +35,6 @@ stamp-guestfs-perl.pod: guestfs-perl.pod create_disk.pl inspect_vm.pl
--html $(top_builddir)/html/guestfs-perl.3.html \
--verbatim $(srcdir)/create_disk.pl:@EXAMPLE1@ \
--verbatim $(srcdir)/inspect_vm.pl:@EXAMPLE2@ \
+ --license examples \
$<
touch $@
diff --git a/podwrapper.pl.in b/podwrapper.pl.in
index 07c8a22d..aa098530 100755
--- a/podwrapper.pl.in
+++ b/podwrapper.pl.in
@@ -93,6 +93,16 @@ you can use any string as the pattern.
=cut
+my @licenses;
+
+=item B<--license=GPLv2+|LGPLv2+|examples>
+
+Add the given license to the end of the man page. This parameter
+is required. The parameter may be given multiple times (eg. for
+mixed content).
+
+=cut
+
my $man;
=item B<--man=output.n>
@@ -158,6 +168,7 @@ $progname =~ s{.*/}{};
# Parse options.
GetOptions ("help|?" => \$help,
"html=s" => \$html,
+ "license=s" => \@licenses,
"insert=s" => \@inserts,
"man=s" => \$man,
"name=s" => \$name,
@@ -170,6 +181,9 @@ pod2usage (1) if $help;
die "$progname: missing argument: podwrapper input.pod\n" unless @ARGV == 1;
my $input = $ARGV[0];
+die "$progname: $input: missing argument: --license parameter is required\n"
+ unless @licenses >= 1;
+
# There should be at least one output.
die "$progname: $input: no output format specified. Use --man and/or --html and/or --text.\n"
unless defined $man || defined $html || defined $text;
@@ -235,6 +249,113 @@ foreach (@verbatims) {
$content =~ s/$a[1]/$replacement/ge;
}
+# Verify sections present / not present.
+die "$progname: $input: missing AUTHOR or AUTHORS section\n"
+ unless $content =~ /^=head1 AUTHOR/m;
+die "$progname: $input: missing SEE ALSO section\n"
+ unless $content =~ /^=head1 SEE ALSO/m;
+die "$progname: $input: missing COPYRIGHT section\n"
+ unless $content =~ /^=head1 COPYRIGHT/m;
+die "$progname: $input: BUGS is now added automatically, do not add it to the POD file\n"
+ if $content =~ /^=head1 (REPORTING )?BUGS/m;
+die "$progname: $input: LICENSE is now added automatically, do not add it to the POD file\n"
+ if $content =~ /^=head1 LICENSE/m;
+die "$progname: $input: GPL/LGPL should be specified using the --license parameter, not included in the POD file\n"
+ if $content =~ /This program is free software/ ||
+ $content =~ /This library is free software/;
+
+# Add standard LICENSE and BUGS sections.
+my $LGPLv2plus =
+"This library is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as published
+by the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This library 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
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA
+";
+
+my $GPLv2plus =
+"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, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+";
+
+my $examples_license =
+"This manual page contains examples which we hope you will use in
+your programs. The examples may be freely copied, modified and
+distributed for any purpose without any restrictions.
+";
+
+my $reporting_bugs =
+"=head1 BUGS
+
+To get a list of bugs against libguestfs, use this link:
+L<https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Virtualization+Tools>
+
+To report a new bug against libguestfs, use this link:
+L<https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools>
+
+When reporting a bug, please supply:
+
+\=over 4
+
+\=item *
+
+The version of libguestfs.
+
+\=item *
+
+Where you got libguestfs (eg. which Linux distro, compiled from source, etc)
+
+\=item *
+
+Describe the bug accurately and give a way to reproduce it.
+
+\=item *
+
+Run L<libguestfs-test-tool(1)> and paste the B<complete, unedited>
+output into the bug report.
+
+\=back
+";
+
+$content .= "\n\n=head1 LICENSE\n\n";
+
+foreach (@licenses) {
+ if ($_ eq "LGPLv2+") {
+ $content .= $LGPLv2plus . "\n\n";
+ }
+ elsif ($_ eq "GPLv2+") {
+ $content .= $GPLv2plus . "\n\n";
+ }
+ elsif ($_ eq "examples") {
+ $content .= $examples_license . "\n\n";
+ }
+ else {
+ die "$progname: $input: invalid --license parameter: $_\n";
+ }
+}
+
+$content .= "\n\n$reporting_bugs";
+
# Output man page.
SUBMAN: {
package Podwrapper::Man;
diff --git a/python/examples/Makefile.am b/python/examples/Makefile.am
index 199ee1e9..303d6cee 100644
--- a/python/examples/Makefile.am
+++ b/python/examples/Makefile.am
@@ -35,5 +35,6 @@ stamp-guestfs-python.pod: guestfs-python.pod create_disk.py inspect_vm.py
--html $(top_builddir)/html/guestfs-python.3.html \
--verbatim $(srcdir)/create_disk.py:@EXAMPLE1@ \
--verbatim $(srcdir)/inspect_vm.py:@EXAMPLE2@ \
+ --license examples \
$<
touch $@
diff --git a/rescue/Makefile.am b/rescue/Makefile.am
index af2d1965..d0b23cae 100644
--- a/rescue/Makefile.am
+++ b/rescue/Makefile.am
@@ -60,5 +60,6 @@ stamp-virt-rescue.pod: virt-rescue.pod
$(PODWRAPPER) \
--man virt-rescue.1 \
--html $(top_builddir)/html/virt-rescue.1.html \
+ --license GPLv2+ \
$<
touch $@
diff --git a/resize/Makefile.am b/resize/Makefile.am
index a9d27d21..fc69aa78 100644
--- a/resize/Makefile.am
+++ b/resize/Makefile.am
@@ -95,6 +95,7 @@ stamp-virt-resize.pod: virt-resize.pod
$(PODWRAPPER) \
--man virt-resize.1 \
--html $(top_builddir)/html/virt-resize.1.html \
+ --license GPLv2+ \
$<
touch $@
diff --git a/ruby/examples/Makefile.am b/ruby/examples/Makefile.am
index 75fdfd21..68e2c865 100644
--- a/ruby/examples/Makefile.am
+++ b/ruby/examples/Makefile.am
@@ -35,5 +35,6 @@ stamp-guestfs-ruby.pod: guestfs-ruby.pod create_disk.rb inspect_vm.rb
--html $(top_builddir)/html/guestfs-ruby.3.html \
--verbatim $(srcdir)/create_disk.rb:@EXAMPLE1@ \
--verbatim $(srcdir)/inspect_vm.rb:@EXAMPLE2@ \
+ --license examples \
$<
touch $@
diff --git a/sparsify/Makefile.am b/sparsify/Makefile.am
index a2e2b9c6..d36dcdda 100644
--- a/sparsify/Makefile.am
+++ b/sparsify/Makefile.am
@@ -94,6 +94,7 @@ stamp-virt-sparsify.pod: virt-sparsify.pod
$(PODWRAPPER) \
--man virt-sparsify.1 \
--html $(top_builddir)/html/virt-sparsify.1.html \
+ --license GPLv2+ \
$<
touch $@
diff --git a/src/Makefile.am b/src/Makefile.am
index ff6149c7..4d857475 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -226,5 +226,6 @@ stamp-guestfs.pod: guestfs.pod \
--insert $(srcdir)/guestfs-actions.pod:@ACTIONS@ \
--insert $(srcdir)/guestfs-availability.pod:@AVAILABILITY@ \
--insert $(srcdir)/guestfs-structs.pod:@STRUCTS@ \
+ --license LGPLv2+ \
$<
touch $@
diff --git a/sysprep/Makefile.am b/sysprep/Makefile.am
index 5551c2d5..2ee9abf7 100644
--- a/sysprep/Makefile.am
+++ b/sysprep/Makefile.am
@@ -131,6 +131,7 @@ stamp-virt-sysprep.pod: virt-sysprep.pod sysprep-extra-options.pod sysprep-opera
--insert sysprep-extra-options.pod:@EXTRA_OPTIONS@ \
--insert sysprep-operations.pod:@OPERATIONS@ \
--html $(top_builddir)/html/virt-sysprep.1.html \
+ --license GPLv2+ \
$<
touch $@
diff --git a/test-tool/Makefile.am b/test-tool/Makefile.am
index ba30a752..5e2757eb 100644
--- a/test-tool/Makefile.am
+++ b/test-tool/Makefile.am
@@ -39,5 +39,6 @@ stamp-libguestfs-test-tool.pod: libguestfs-test-tool.pod
$(PODWRAPPER) \
--man libguestfs-test-tool.1 \
--html $(top_builddir)/html/libguestfs-test-tool.1.html \
+ --license GPLv2+ \
$<
touch $@
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 32a92e26..0ae92c56 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -46,11 +46,13 @@ noinst_DATA = $(tools:%=$(top_builddir)/html/virt-%.1.html)
virt-%.1: virt-%
$(PODWRAPPER) \
--man $@ \
+ --license GPLv2+ \
$<
$(top_builddir)/html/virt-%.1.html: virt-%
$(PODWRAPPER) \
--html $@ \
+ --license GPLv2+ \
$<
# Tests.