From e86fb529efdb225fc533c724d297feedef630257 Mon Sep 17 00:00:00 2001 From: Frank Zago Date: Mon, 6 Apr 2015 17:59:57 -0500 Subject: [PATCH] LU-6437 doc: enable lustre to be built without manpages Add configure option --disable-manpages, to prevent the building and packaging of the manpages. This can be used for an embedded environment, or when manpages can't be build because python-docutils (rst2man) isn't available. Do not distribute (with make dist) manpages generated from ReST, but distribute the ReST sources. Signed-off-by: frank zago Change-Id: I47405d466ac35eb9d295c5a6dc0bdeb0d4d75b9e Reviewed-on: http://review.whamcloud.com/14382 Reviewed-by: Dmitry Eremin Tested-by: Jenkins Reviewed-by: Patrick Farrell Reviewed-by: Bob Glossman Tested-by: Maloo Reviewed-by: Oleg Drokin --- config/lustre-build.m4 | 33 +++++++++++++++++++++++++++------ lustre.spec.in | 9 ++++++++- lustre/doc/Makefile.am | 16 ++++++++++++---- 3 files changed, 47 insertions(+), 11 deletions(-) diff --git a/config/lustre-build.m4 b/config/lustre-build.m4 index 89d4685..a0bd33b 100644 --- a/config/lustre-build.m4 +++ b/config/lustre-build.m4 @@ -309,6 +309,27 @@ AC_SUBST(ENABLE_DOC) ]) # LB_CONFIG_DOCS # +# LB_CONFIG_MANPAGES +# +# Build manpages? +# +AC_DEFUN([LB_CONFIG_MANPAGES], [ +AC_MSG_CHECKING([whether to build Lustre manpages]) +AC_ARG_ENABLE([manpages], + AC_HELP_STRING([--disable-manpages], + [skip creation and inclusion of man pages (default is enable)]), + [], [enable_manpages="yes"]) +AC_MSG_RESULT([$enable_manpages]) +AS_IF([test "x$enable_manpages" = xyes], [ +AC_CHECK_PROGS(RST2MAN, [rst2man rst2man.py], []) + if test "x$RST2MAN" = "x"; then + AC_MSG_ERROR( + [rst2man is needed to build the man pages. Install python-docutils.]) +fi +]) +]) # LB_CONFIG_MANPAGES + +# # LB_CONFIG_HEADERS # # add -include config.h @@ -401,6 +422,7 @@ AM_CONDITIONAL([MODULES], [test x$enable_modules = xyes]) AM_CONDITIONAL([UTILS], [test x$enable_utils = xyes]) AM_CONDITIONAL([TESTS], [test x$enable_tests = xyes]) AM_CONDITIONAL([DOC], [test x$ENABLE_DOC = x1]) +AM_CONDITIONAL([MANPAGES], [test x$enable_manpages = xyes]) AM_CONDITIONAL([LINUX], [test x$lb_target_os = xlinux]) AM_CONDITIONAL([USES_DPKG], [test x$uses_dpkg = xyes]) AM_CONDITIONAL([USE_QUILT], [test x$use_quilt = xyes]) @@ -525,6 +547,7 @@ for arg; do --enable-utils | --disable-utils ) ;; --enable-iokit | --disable-iokit ) ;; --enable-dlc | --disable-dlc ) ;; + --enable-manpages | --disable-manpages ) ;; * ) CONFIGURE_ARGS="$CONFIGURE_ARGS '$arg'" ;; esac done @@ -585,6 +608,9 @@ fi if test x$USE_DLC = xyes ; then RPMBINARGS="$RPMBINARGS --with lnet_dlc" fi +if test x$enable_manpages != xyes ; then + RPMBINARGS="$RPMBINARGS --without manpages" +fi RPMBUILD_BINARY_ARGS=$RPMBINARGS RPMBUILD_SOURCE_ARGS=$RPMSRCARGS @@ -620,18 +646,13 @@ LB_PROG_CC LC_OSD_ADDON LB_CONFIG_DOCS +LB_CONFIG_MANPAGES LB_CONFIG_UTILS LB_CONFIG_TESTS LC_CONFIG_CLIENT LB_CONFIG_MPITESTS LB_CONFIG_SERVERS -AC_CHECK_PROGS(RST2MAN, [rst2man rst2man.py], []) -if test "x$RST2MAN" = "x"; then - AC_MSG_ERROR( - [rst2man is needed to build the man pages. Install python-docutils.]) -fi - # Tests depends from utils (multiop from liblustreapi) AS_IF([test "x$enable_utils" = xno], [enable_tests="no"]) diff --git a/lustre.spec.in b/lustre.spec.in index 7d87b77..4f6f6ca 100644 --- a/lustre.spec.in +++ b/lustre.spec.in @@ -9,6 +9,7 @@ %bcond_without lustre_iokit %bcond_without lustre_modules %bcond_with lnet_dlc +%bcond_without manpages %if %{without servers} # --without servers overrides --with {ldiskfs|zfs} @@ -106,7 +107,10 @@ BuildRoot: %{_tmppath}/lustre-%{version}-root Obsoletes: lustre-lite, lustre-lite-utils, lustre-ldap nfs-utils-lustre Provides: lustre-lite = %{version}, lustre-lite-utils = %{version} Requires: %{name}-modules = %{version} -BuildRequires: libtool python-docutils +BuildRequires: libtool +%if %{with manpages} +BuildRequires: python-docutils +%endif %if %{with servers} Requires: lustre-osd Requires: lustre-osd-mount @@ -337,6 +341,7 @@ fi %{!?with_servers:--disable-server} \ %{!?with_zfs:--without-zfs} \ %{!?with_lnet_dlc:--disable-dlc} \ + %{!?with_manpages:--disable-manpages} \ --with-release=%{release} \ --with-linux=%{kdir} \ --with-linux-obj=%{kobjdir} \ @@ -463,7 +468,9 @@ find $RPM_BUILD_ROOT%{?rootdir}/lib/modules/%{kversion}/%{kmoddir} \ %{_libdir}/libcfsutil.a %{_libdir}/liblustreapi.a %{_libdir}/liblustreapi.so +%if %{with manpages} %{_mandir}/man?/* +%endif %{_includedir}/lustre %{_includedir}/libcfs %endif diff --git a/lustre/doc/Makefile.am b/lustre/doc/Makefile.am index 1a62342..4925ceb 100644 --- a/lustre/doc/Makefile.am +++ b/lustre/doc/Makefile.am @@ -40,7 +40,7 @@ MANFILES = lustre.7 lfs.1 mount.lustre.8 lctl.8 lnetctl.8 \ llverdev.8 llbackup.8 llapi_quotactl.3 llobdstat.8 llstat.8 \ plot-llstat.8 l_getgroups.8 lst.8 routerstat.8 \ ll_recover_lost_found_objs.8 llog_reader.8 llapi_file_open.3 \ - llapi_file_create.3 llapi_file_get_stripe.3 lustreapi.7 \ + llapi_file_create.3 llapi_file_get_stripe.3 \ lustre_rsync.8 lfs_migrate.1 lhbadm.8 ldev.8 ldev.conf.5 nids.5 \ lfs-hsm.1 llapi_hsm_state_get.3 llapi_hsm_state_set.3 \ lustre_routes_config.8 lustre_routes_conversion.8 \ @@ -64,15 +64,23 @@ else DISTONLY_MANFILES = $(SERVER_MANFILES) endif +# Generated manpages with their sources in ReST. Generated files are +# not part of the dist target; they may or may not have been +# generated (see --disable-manpages option). +RST_MANFILES = lustreapi.rst +GEN_MANFILES = lustreapi.7 + if UTILS -man_MANS = $(MANFILES) +if MANPAGES +man_MANS = $(MANFILES) $(GEN_MANFILES) +endif endif .rst.3 .rst.7: @RST2MAN@ $? $@ -CLEANFILES = *.aux *.tex *.log *.pdf +CLEANFILES = *.aux *.tex *.log *.pdf $(GEN_MANFILES) -EXTRA_DIST = $(MANFILES) *.rst $(DISTONLY_MANFILES) +EXTRA_DIST = $(MANFILES) $(RST_MANFILES) $(DISTONLY_MANFILES) all: -- 1.8.3.1