[pacman-dev] [PATCH] Attempt to idiot-proof making and refreshing docs

Dan McGee dpmcgee at gmail.com
Tue Aug 5 22:14:28 EDT 2008


I mess this up more often than not, and maybe this will do the trick. Remove
the --enable-asciidoc option as it has been superseded by the --disable-doc
option in usefulness. If you want to skip building docs, you skip building
all docs which is much easier when it comes to ensuring the make 'dist' and
'distcheck' targets will always build the manpages and always build the most
up to date manpages.

Developers shouldn't be affected in their normal builds, nor should end
users of the source tarball.

Signed-off-by: Dan McGee <dan at archlinux.org>
---
 Makefile.am     |    3 +++
 configure.ac    |   23 -----------------------
 doc/Makefile.am |   22 ++++++++++++----------
 3 files changed, 15 insertions(+), 33 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index ea3b0e0..ed9a34d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3,6 +3,9 @@ if WANT_DOC
 SUBDIRS += doc
 endif
 
+# Make sure we test and build manpages when doing distcheck
+DISTCHECK_CONFIGURE_FLAGS = --enable-doc --disable-git-version
+
 # Some files automatically included, so they aren't specified below:
 #   AUTHORS, COPYING, NEWS, README
 EXTRA_DIST = HACKING
diff --git a/configure.ac b/configure.ac
index 9f4209b..9c5ed23 100644
--- a/configure.ac
+++ b/configure.ac
@@ -103,11 +103,6 @@ AC_ARG_ENABLE(doxygen,
 	AS_HELP_STRING([--enable-doxygen], [build your own API docs via Doxygen]),
 	[wantdoxygen=$enableval], [wantdoxygen=no])
 
-# Help line for asciidoc
-AC_ARG_ENABLE(asciidoc,
-	AS_HELP_STRING([--enable-asciidoc], [build your own manpages with Asciidoc]),
-	[wantasciidoc=$enableval], [wantasciidoc=no])
-
 # Help line for debug
 AC_ARG_ENABLE(debug,
 	AS_HELP_STRING([--enable-debug], [enable debugging support]),
@@ -267,23 +262,6 @@ else
 fi
 AM_CONDITIONAL(USE_DOXYGEN, test "x$usedoxygen" = "xyes")
 
-# Check for asciidoc support and status
-AC_CHECK_PROGS([ASCIIDOC], [asciidoc])
-AC_MSG_CHECKING([for asciidoc])
-if test "x$wantasciidoc" = "xyes" ; then
-	if test $ASCIIDOC ; then
-		AC_MSG_RESULT([yes])
-		useasciidoc=yes
-	else
-		AC_MSG_RESULT([no, asciidoc missing])
-		useasciidoc=no
-	fi
-else
-	AC_MSG_RESULT([no, disabled by configure])
-	useasciidoc=no
-fi
-AM_CONDITIONAL(USE_ASCIIDOC, test "x$useasciidoc" = "xyes")
-
 # Enable or disable debug code
 AC_MSG_CHECKING(for debug mode request)
 if test "x$debug" = "xyes" ; then
@@ -381,7 +359,6 @@ ${PACKAGE_NAME}:
     Run make in doc/ dir   : ${wantdoc}
     Use download library   : ${internaldownload}
     Doxygen support        : ${usedoxygen}
-    Asciidoc support       : ${useasciidoc}
     debug support          : ${debug}
 "
 
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 476a21c..cce0a71 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -15,6 +15,7 @@ ASCIIDOC_MANS = \
 DOXYGEN_MANS = $(wildcard man3/*.3)
 
 EXTRA_DIST = \
+	asciidoc.conf \
 	pacman.8.txt \
 	makepkg.8.txt \
 	repo-add.8.txt \
@@ -29,8 +30,12 @@ EXTRA_DIST = \
 	$(DOXYGEN_MANS)
 
 # Files that should be removed, but which Automake does not know.
-MOSTLYCLEANFILES = *.xml
-MAINTAINERCLEANFILES = $(ASCIIDOC_MANS)
+MOSTLYCLEANFILES = *.xml $(ASCIIDOC_MANS)
+
+# Ensure manpages are fresh when building a dist tarball
+dist-hook:
+	$(MAKE) $(AM_MAKEFLAGS) clean
+	$(MAKE) $(AM_MAKEFLAGS) all
 
 if USE_GIT_VERSION
 GIT_VERSION := $(shell sh -c 'git describe --abbrev=4 | sed s/^v//')-dirty
@@ -39,20 +44,18 @@ else
 REAL_PACKAGE_VERSION = $(PACKAGE_VERSION)
 endif
 
-
 man_MANS =
 dist_man_MANS = $(ASCIIDOC_MANS) repo-remove.8
 
 if USE_DOXYGEN
 man_MANS += $(DOXYGEN_MANS)
 
-all: doxygen.in
+all-local: doxygen.in
 
 doxygen.in:
 	$(DOXYGEN) $(srcdir)/Doxyfile
 endif
 
-if USE_ASCIIDOC
 ASCIIDOC_OPTS = \
 	-f asciidoc.conf \
 	-a pacman_version="$(REAL_PACKAGE_VERSION)" \
@@ -64,11 +67,10 @@ A2X_OPTS = \
 	--xsltproc-opts='-param man.endnotes.list.enabled 0' \
 	--xsltproc-opts='-param man.endnotes.are.numbered 0'
 
-$(ASCIIDOC_MANS):
-	a2x $(A2X_OPTS) --asciidoc-opts="$(ASCIIDOC_OPTS)" $@.txt
-
 # These rules are due to the includes and files of the asciidoc text
 $(ASCIIDOC_MANS): asciidoc.conf footer.txt
+	a2x $(A2X_OPTS) --asciidoc-opts="$(ASCIIDOC_OPTS)" $@.txt
+
 pacman.8: pacman.8.txt
 makepkg.8: makepkg.8.txt
 repo-add.8: repo-add.8.txt
@@ -78,7 +80,7 @@ pacman.conf.5: pacman.conf.5.txt
 libalpm.3: libalpm.3.txt
 # this one is just a symlink
 repo-remove.8: repo-add.8
-	ln -s repo-add.8 repo-remove.8
-endif
+	rm -f repo-remove.8
+	$(LN_S) repo-add.8 repo-remove.8
 
 # vim:set ts=2 sw=2 noet:
-- 
1.5.6.4




More information about the pacman-dev mailing list