aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2002-11-29 15:00:58 +0000
committerRichard Levitte <levitte@openssl.org>2002-11-29 15:00:58 +0000
commitdb3758923b4db690feb6ca64562d21cc3d1f3abe (patch)
tree767dfb94c2b3a8355507d07192c6fd31037aca17
parent5e4a75e79f530600cf71e1c6d7f6bfd0feb7ad0b (diff)
downloadopenssl-db3758923b4db690feb6ca64562d21cc3d1f3abe.tar.gz
Make it so all names mentioned in the NAME section of each manpage becomes a
symlink to said manpage. PR: 242
-rw-r--r--Makefile.org16
-rw-r--r--util/extract-names.pl22
2 files changed, 34 insertions, 4 deletions
diff --git a/Makefile.org b/Makefile.org
index fd9a10d8fb..3ad0a68914 100644
--- a/Makefile.org
+++ b/Makefile.org
@@ -534,22 +534,30 @@ install_docs:
for i in doc/apps/*.pod; do \
fn=`basename $$i .pod`; \
if [ "$$fn" = "config" ]; then sec=5; else sec=1; fi; \
- echo "installing man$$sec/`basename $$i .pod`.$$sec"; \
+ echo "installing man$$sec/$$fn.$$sec"; \
(cd `$(PERL) util/dirname.pl $$i`; \
sh -c "$$pod2man \
--section=$$sec --center=OpenSSL \
--release=$(VERSION) `basename $$i`") \
- > $(INSTALL_PREFIX)$(MANDIR)/man$$sec/`basename $$i .pod`.$$sec; \
+ > $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$$sec; \
+ $(PERL) util/extract-names.pl < $$i | grep -v "^$$fn" | \
+ while read n; do \
+ util/point.sh $$fn.$$sec $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$n.$$sec; \
+ done; \
done; \
for i in doc/crypto/*.pod doc/ssl/*.pod; do \
fn=`basename $$i .pod`; \
if [ "$$fn" = "des_modes" ]; then sec=7; else sec=3; fi; \
- echo "installing man$$sec/`basename $$i .pod`.$$sec"; \
+ echo "installing man$$sec/$$fn.$$sec"; \
(cd `$(PERL) util/dirname.pl $$i`; \
sh -c "$$pod2man \
--section=$$sec --center=OpenSSL \
--release=$(VERSION) `basename $$i`") \
- > $(INSTALL_PREFIX)$(MANDIR)/man$$sec/`basename $$i .pod`.$$sec; \
+ > $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$$sec; \
+ $(PERL) util/extract-names.pl < $$i | grep -v "^$$fn" | \
+ while read n; do \
+ util/point.sh $$fn.$$sec $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$n.$$sec; \
+ done; \
done
# DO NOT DELETE THIS LINE -- make depend depends on it.
diff --git a/util/extract-names.pl b/util/extract-names.pl
new file mode 100644
index 0000000000..d413a045cc
--- /dev/null
+++ b/util/extract-names.pl
@@ -0,0 +1,22 @@
+#!/usr/bin/perl
+
+$/ = ""; # Eat a paragraph at once.
+while(<STDIN>) {
+ chop;
+ s/\n/ /gm;
+ if (/^=head1 /) {
+ $name = 0;
+ } elsif ($name) {
+ if (/ - /) {
+ s/ - .*//;
+ s/[ \t,]+/ /g;
+ push @words, split ' ';
+ }
+ }
+ if (/^=head1 *NAME *$/) {
+ $name = 1;
+ }
+}
+
+print join("\n", @words),"\n";
+