Skip to content

Commit

Permalink
Build: extra Publican arrangement only for in-tree brand if usable
Browse files Browse the repository at this point in the history
In other words, if and only if:

  configured using "--with-brand=clusterlabs"
  AND NOT clusterlabs brand              -- installed in the system
  AND Publican recognizing "--brand_dir"  /

If the last sub-clause is not met (under short circuiting evaluation),
"common" is used as a fallback brand (no special treatment required).

Ability to explicitly prevent Publican generated documentation even
if it would otherwise be (using "--with-brand=" to ./configure)
is retained.
  • Loading branch information
jnpkrn committed Apr 15, 2016
1 parent 70394ab commit b4fa518
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 7 deletions.
23 changes: 19 additions & 4 deletions configure.ac
Expand Up @@ -606,16 +606,31 @@ fi
AM_CONDITIONAL(BUILD_STONITH_CONFIG, test $SUPPORT_STONITH_CONFIG = 1)
AC_DEFINE_UNQUOTED(SUPPORT_STONITH_CONFIG, $SUPPORT_STONITH_CONFIG, Support a stand-alone stonith config file in addition to the CIB)

AM_CONDITIONAL([BUILD_DOCBOOK],
[test x"${PUBLICAN_BRAND}" != x"" \
&& test x"${PUBLICAN}" != x"" \
&& test x"${INKSCAPE}" != x""])
publican_intree_brand=no
if test x"${PUBLICAN_BRAND}" != x"" \
&& test x"${PUBLICAN}" != x"" \
&& test x"${INKSCAPE}" != x""; then
dnl special handling for clusterlabs brand (possibly in-tree version used)
test "${PUBLICAN_BRAND}" != "clusterlabs" \
|| test -d /usr/share/publican/Common_Content/clusterlabs
if test $? -ne 0; then
dnl Unknown option: brand_dir vs. Option brand_dir requires an argument
if ${PUBLICAN} build --brand_dir 2>&1 | grep -Eq 'brand_dir$'; then
AC_MSG_WARN([Cannot use in-tree clusterlabs brand, resorting to common])
PUBLICAN_BRAND=common
else
publican_intree_brand=yes
fi
fi
AC_MSG_NOTICE([Enabling Publican-generated documentation using ${PUBLICAN_BRAND} brand])
PCMK_FEATURES="$PCMK_FEATURES publican-docs"
fi
AM_CONDITIONAL([BUILD_DOCBOOK],
[test x"${PUBLICAN_BRAND}" != x"" \
&& test x"${PUBLICAN}" != x"" \
&& test x"${INKSCAPE}" != x""])
AM_CONDITIONAL([PUBLICAN_INTREE_BRAND],
[test x"${publican_intree_brand}" = x"yes"])

dnl ========================================================================
dnl checks for library functions to replace them
Expand Down
32 changes: 29 additions & 3 deletions doc/Makefile.am
Expand Up @@ -108,15 +108,27 @@ CFS_XML=$(CFS_TXT:%.txt=%.xml)

$(CFS_XML): $(CFS_SHARED_XML)

PUBLICAN_INTREE_DEPS =
if PUBLICAN_INTREE_BRAND
PUBLICAN_INTREE_DEPS += publican-catalog
endif

# We have to hardcode the book name
# With '%' the test for 'newness' fails
Clusters_from_Scratch.build: $(PNGS) $(wildcard Clusters_from_Scratch/en-US/*.xml) $(CFS_XML) $(CFS_SHARED_XML) publican-catalog
Clusters_from_Scratch.build: $(PNGS) $(wildcard Clusters_from_Scratch/en-US/*.xml) $(CFS_XML) $(CFS_SHARED_XML) $(PUBLICAN_INTREE_DEPS)
$(PCMK_V) @echo Building $(@:%.build=%) because of $?
rm -rf $(@:%.build=%)/publish/*
if PUBLICAN_INTREE_BRAND
$(AM_V_PUB)cd $(@:%.build=%) \
&& RPM_BUILD_DIR="" XML_CATALOG_FILES="$(CURDIR)/publican-catalog" \
$(PUBLICAN) build --publish --langs=$(DOCBOOK_LANGS) --formats=$(DOCBOOK_FORMATS) --brand_dir=../publican-clusterlabs \
$(PCMK_quiet)
else
$(AM_V_PUB)cd $(@:%.build=%) \
&& RPM_BUILD_DIR="" \
$(PUBLICAN) build --publish --langs=$(DOCBOOK_LANGS) --formats=$(DOCBOOK_FORMATS) \
$(PCMK_quiet)
endif
rm -rf $(@:%.build=%)/tmp
touch $@

Expand All @@ -130,13 +142,20 @@ $(PE_XML): $(PE_SHARED_XML)

# We have to hardcode the book name
# With '%' the test for 'newness' fails
Pacemaker_Explained.build: $(PNGS) $(wildcard Pacemaker_Explained/en-US/*.xml) $(PE_XML) $(PE_SHARED_XML) publican-catalog
Pacemaker_Explained.build: $(PNGS) $(wildcard Pacemaker_Explained/en-US/*.xml) $(PE_XML) $(PE_SHARED_XML) $(PUBLICAN_INTREE_DEPS)
$(PCMK_V) @echo Building $(@:%.build=%) because of $?
rm -rf $(@:%.build=%)/publish/*
if PUBLICAN_INTREE_BRAND
$(AM_V_PUB)cd $(@:%.build=%) \
&& RPM_BUILD_DIR="" XML_CATALOG_FILES="$(CURDIR)/publican-catalog" \
$(PUBLICAN) build --publish --langs=$(DOCBOOK_LANGS) --formats=$(DOCBOOK_FORMATS) --brand_dir=../publican-clusterlabs \
$(PCMK_quiet)
else
$(AM_V_PUB)cd $(@:%.build=%) \
&& RPM_BUILD_DIR="" \
$(PUBLICAN) build --publish --langs=$(DOCBOOK_LANGS) --formats=$(DOCBOOK_FORMATS) \
$(PCMK_quiet)
endif
rm -rf $(@:%.build=%)/tmp
touch $@

Expand All @@ -146,13 +165,20 @@ PR_XML=$(PR_TXT:%.txt=%.xml)

# We have to hardcode the book name
# With '%' the test for 'newness' fails
Pacemaker_Remote.build: $(PNGS) $(wildcard Pacemaker_Remote/en-US/*.xml) $(PR_XML) publican-catalog
Pacemaker_Remote.build: $(PNGS) $(wildcard Pacemaker_Remote/en-US/*.xml) $(PR_XML) $(PUBLICAN_INTREE_DEPS)
$(PCMK_V) @echo Building $(@:%.build=%) because of $?
rm -rf $(@:%.build=%)/publish/*
if PUBLICAN_INTREE_BRAND
$(AM_V_PUB)cd $(@:%.build=%) \
&& RPM_BUILD_DIR="" XML_CATALOG_FILES="$(CURDIR)/publican-catalog" \
$(PUBLICAN) build --publish --langs=$(DOCBOOK_LANGS) --formats=$(DOCBOOK_FORMATS) --brand_dir=../publican-clusterlabs \
$(PCMK_quiet)
else
$(AM_V_PUB)cd $(@:%.build=%) \
&& RPM_BUILD_DIR="" \
$(PUBLICAN) build --publish --langs=$(DOCBOOK_LANGS) --formats=$(DOCBOOK_FORMATS) \
$(PCMK_quiet)
endif
rm -rf $(@:%.build=%)/tmp
touch $@

Expand Down

0 comments on commit b4fa518

Please sign in to comment.