Skip to contentSkip to conversation

build: doc: "make" builds & installs a full set of man pages

PATCH In review Duncan Roe 3 participants 6 messages Feb 8, 2020 – Feb 23, 2020

Subsystems (2)
lore
Share & tools
lore

Duncan Roe

author
#0 lore raw

PATCH 1/1 build: doc: "make" builds & installs a full set of man pages

This enables one to enter "man <any nfq function>" and get the appropriate group man page created by doxygen.

- New makefile in doxygen directory. Rebuilds documentation if any sources change that contain doxygen comments, or if fixmanpages.sh changes
- New shell script fixmanpages.sh which
- Renames each group man page to the first function listed therein
- Creates symlinks for subsequently listed functions (if any)
- Deletes _* temp files
- Update top-level makefile to visit new subdir doxygen
- Update top-level configure to only build documentation if doxygen installed

---
 Makefile.am         |  2 +-
 configure.ac        | 10 +++++++++
 doxygen/Makefile.am | 23 ++++++++++++++++++++
 fixmanpages.sh      | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 96 insertions(+), 1 deletion(-)
 create mode 100644 doxygen/Makefile.am
 create mode 100755 fixmanpages.sh
Makefile.am +1 -1
index 6b4ef77..a5b347b 100644
@@ -2,7 +2,7 @@ ACLOCAL_AMFLAGS = -I m4
 
 EXTRA_DIST = $(man_MANS) include/linux
 
-SUBDIRS = src utils include examples
+SUBDIRS = src utils include examples doxygen
 
 man_MANS = #nfnetlink_queue.3 nfnetlink_queue.7
 
configure.ac +10 -0
index 0c08459..e99b07a 100644
@@ -33,5 +33,15 @@ dnl Output the makefiles
 AC_CONFIG_FILES([Makefile src/Makefile utils/Makefile examples/Makefile
         libnetfilter_queue.pc doxygen.cfg
 	include/Makefile include/libnetfilter_queue/Makefile
+	doxygen/Makefile
 	include/linux/Makefile include/linux/netfilter/Makefile])
 AC_OUTPUT
+
+dnl Only run doxygen Makefile if doxygen installed
+
+AC_CHECK_PROGS([DOXYGEN], [doxygen])
+if test -z "$DOXYGEN";
+	then AC_MSG_WARN([Doxygen not found - continuing without Doxygen support])
+fi
+
+ AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"])
doxygen/Makefile.am new file +23 -0
new file mode 100644
index 0000000..ef468e0
@@ -0,0 +1,23 @@
+if HAVE_DOXYGEN
+doc_srcs = $(top_srcdir)/src/libnetfilter_queue.c  \
+           $(top_srcdir)/src/nlmsg.c               \
+           $(top_srcdir)/src/extra/checksum.c      \
+           $(top_srcdir)/src/extra/ipv6.c          \
+           $(top_srcdir)/src/extra/ipv4.c          \
+           $(top_srcdir)/src/extra/tcp.c           \
+           $(top_srcdir)/src/extra/udp.c           \
+           $(top_srcdir)/src/extra/pktbuff.c
+
+doxyfile.stamp: $(doc_srcs) $(top_srcdir)/fixmanpages.sh
+	rm -rf html man && cd .. && doxygen doxygen.cfg && ./fixmanpages.sh
+	touch doxyfile.stamp
+
+CLEANFILES = doxyfile.stamp
+
+all-local: doxyfile.stamp
+clean-local:
+	rm -rf $(top_srcdir)/doxygen/man $(top_srcdir)/doxygen/html
+install-data-local:
+	mkdir -p $(DESTDIR)$(mandir)/man3
+	cp --no-dereference --preserve=links,mode,timestamps man/man3/*.3 $(DESTDIR)$(mandir)/man3/
+endif
fixmanpages.sh new file +62 -0

62 lines not on this page · raw message

Signature · 1 line
2.14.5
#1 lore raw
Quoted 11 lines · Duncan Roe

This enables one to enter "man <any nfq function>" and get the appropriate group man page created by doxygen.

- New makefile in doxygen directory. Rebuilds documentation if any sources change that contain doxygen comments, or if fixmanpages.sh changes
- New shell script fixmanpages.sh which
- Renames each group man page to the first function listed therein
- Creates symlinks for subsequently listed functions (if any)
- Deletes _* temp files
- Update top-level makefile to visit new subdir doxygen
- Update top-level configure to only build documentation if doxygen installed

I'd prefer people to keep this infrastructure out of tree. Thanks.

maintainer
#2 lore raw
Quoted 13 lines · Pablo Neira Ayuso
Quoted 11 lines · Duncan Roe

This enables one to enter "man <any nfq function>" and get the appropriate group man page created by doxygen.

- New makefile in doxygen directory. Rebuilds documentation if any sources change that contain doxygen comments, or if fixmanpages.sh changes
- New shell script fixmanpages.sh which
- Renames each group man page to the first function listed therein
- Creates symlinks for subsequently listed functions (if any)
- Deletes _* temp files
- Update top-level makefile to visit new subdir doxygen
- Update top-level configure to only build documentation if doxygen installed

Quoted 1 line

I'd prefer people to keep this infrastructure out of tree. Thanks.

Hmm, why?

#3 lore raw
Quoted 14 lines · Florian Westphal
Quoted 13 lines · Pablo Neira Ayuso
Quoted 11 lines · Duncan Roe

This enables one to enter "man <any nfq function>" and get the appropriate group man page created by doxygen.

- New makefile in doxygen directory. Rebuilds documentation if any sources change that contain doxygen comments, or if fixmanpages.sh changes
- New shell script fixmanpages.sh which
- Renames each group man page to the first function listed therein
- Creates symlinks for subsequently listed functions (if any)
- Deletes _* temp files
- Update top-level makefile to visit new subdir doxygen
- Update top-level configure to only build documentation if doxygen installed

Quoted 3 lines
Quoted 1 line

I'd prefer people to keep this infrastructure out of tree. Thanks.

Hmm, why?

Would you like to allow to generate manpage per function in the library? We never had this so far.

Probably a single manpage in the style of libnftables(3)?

maintainer
#4 lore raw
Quoted 15 lines · Pablo Neira Ayuso
Quoted 14 lines · Florian Westphal
Quoted 13 lines · Pablo Neira Ayuso
Quoted 11 lines · Duncan Roe

This enables one to enter "man <any nfq function>" and get the appropriate group man page created by doxygen.

- New makefile in doxygen directory. Rebuilds documentation if any sources change that contain doxygen comments, or if fixmanpages.sh changes
- New shell script fixmanpages.sh which
- Renames each group man page to the first function listed therein
- Creates symlinks for subsequently listed functions (if any)
- Deletes _* temp files
- Update top-level makefile to visit new subdir doxygen
- Update top-level configure to only build documentation if doxygen installed

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

I'd prefer people to keep this infrastructure out of tree. Thanks.

Hmm, why?

Would you like to allow to generate manpage per function in the library? We never had this so far.

Probably a single manpage in the style of libnftables(3)?

I like it. I mean, its up to distros to package this, I guess most of them will place this into some extra doc sub-package.

$ man 3 ssl-<tab>
zsh: do you wish to see all 416 possibilities (70 lines)?

... so there are libraries that do this.
Also, from what I understand, there is not a single man-page per function, the extra ones are just aliases.

#5 lore raw

Hi Florian,

Quoted 28 lines · Florian Westphal
Quoted 15 lines · Pablo Neira Ayuso
Quoted 14 lines · Florian Westphal
Quoted 13 lines · Pablo Neira Ayuso
Quoted 11 lines · Duncan Roe

This enables one to enter "man <any nfq function>" and get the appropriate group man page created by doxygen.

- New makefile in doxygen directory. Rebuilds documentation if any sources change that contain doxygen comments, or if fixmanpages.sh changes
- New shell script fixmanpages.sh which
- Renames each group man page to the first function listed therein
- Creates symlinks for subsequently listed functions (if any)
- Deletes _* temp files
- Update top-level makefile to visit new subdir doxygen
- Update top-level configure to only build documentation if doxygen installed

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

I'd prefer people to keep this infrastructure out of tree. Thanks.

Hmm, why?

Would you like to allow to generate manpage per function in the library? We never had this so far.

Probably a single manpage in the style of libnftables(3)?

I like it. I mean, its up to distros to package this, I guess most of them will place this into some extra doc sub-package.

Quoted 6 lines
$ man 3 ssl-<tab>
zsh: do you wish to see all 416 possibilities (70 lines)?

... so there are libraries that do this.
Also, from what I understand, there is not a single man-page per function, the extra ones are just aliases.

I was not familiar with this fine-grain manpage approach, thanks for explaining.

Please, go ahead and apply this patch.

Thanks.