Skip to content

Commit

Permalink
Move manual page generation to maintainer mode
Browse files Browse the repository at this point in the history
The page will be being shipped pre-built in official tars.

Also provides an option to disable manpage generation/installation, as
requested for the main firehol package, to allow users to build the program
with minimal extra infrastructure.
  • Loading branch information
philwhineray committed Dec 28, 2015
1 parent 4ee6cd9 commit ab6eb9e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
7 changes: 6 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ iprange_DESCRIPTION = "manage IP ranges"

bin_PROGRAMS = iprange
dist_noinst_DATA = iprange.spec

if ENABLE_MAN
man_MANS = iprange.1
endif

iprange_SOURCES = iprange.c

Expand All @@ -33,9 +36,10 @@ EXTRA_DIST = \
README.md \
iprange-9999.ebuild \
autogen.sh \
iprange.1 \
$(man_MANS) \
$(NULL)

if MAINTAINER_MODE
%.1: %
$(HELP2MAN) \
-s 1 \
Expand All @@ -44,3 +48,4 @@ EXTRA_DIST = \
-n $(if $($(subst -,_,$*)_DESCRIPTION), $($(subst -,_,$*)_DESCRIPTION), "manual page for $*") \
-o $@ \
$(top_builddir)/$<
endif
15 changes: 14 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,24 @@ PACKAGE_RPM_RELEASE="0.0.$(echo VERSION_SUFFIX | sed s/^_//)"

AC_INIT([iprange], VERSION_NUMBER[]VERSION_SUFFIX)

AC_ARG_ENABLE([man],
[AS_HELP_STRING([--disable-man], [disable manpage installation @<:@enabled@:>@])],
,
[enable_man="yes"])
AM_CONDITIONAL([ENABLE_MAN], [test "${enable_man}" = "yes"])

AM_MAINTAINER_MODE([disable])
if test x"$USE_MAINTAINER_MODE" = xyes; then
AC_MSG_NOTICE(***************** MAINTAINER MODE *****************)
PACKAGE_BUILT_DATE=$(date '+%d %b %Y')

AX_NEED_PROG([HELP2MAN],[help2man],[])
else
if test ! -f iprange.1; then
if test x"$enable_man" = xyes; then
AC_MSG_ERROR([docs not built, use '--disable-man' or --enable-maintainer-mode])
fi
fi
fi

PACKAGE_RPM_VERSION="VERSION_NUMBER"
Expand All @@ -32,7 +46,6 @@ AM_INIT_AUTOMAKE
AC_CANONICAL_HOST
AC_PROG_CC
AC_PROG_INSTALL
AX_NEED_PROG([HELP2MAN],[help2man],[])
AC_ARG_ENABLE(
[pedantic],
[AS_HELP_STRING([--enable-pedantic], [enable pedantic compiler warnings])],
Expand Down

0 comments on commit ab6eb9e

Please sign in to comment.