Don't rely on being able to run all of the matahari executables on
whatever is doing the builds. Build them locally when a tarball is
being built and include them in the tarball.
Related: rhbz#737088
Signed-off-by: Russell Bryant <rbryant(a)redhat.com>
---
GNUmakefile | 14 +++++++++-----
mkrelease.sh | 3 +--
src/cmake/modules/MatahariMacros.cmake | 8 +++++++-
3 files changed, 17 insertions(+), 8 deletions(-)
diff --git a/GNUmakefile b/GNUmakefile
index 5fcaf9b..d96ce85 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -20,8 +20,8 @@
PACKAGE ?= matahari
VERSION ?= $(shell cat .version)
-TARPREFIX = $(PACKAGE)-$(PACKAGE)-$(TAG)
-TARFILE = $(TARPREFIX).tgz
+TARPREFIX ?= $(PACKAGE)-$(PACKAGE)-$(TAG)
+TARFILE ?= $(TARPREFIX).tgz
HTML_ROOT = coverity@www.clusterlabs.org:/var/www/html
RPM_ROOT ?= $(shell pwd)
@@ -43,7 +43,7 @@ DOT:=$(shell which dot 2>/dev/null)
linux.build:
@echo "=::=::=::= Setting up for Linux =::=::=::= "
mkdir -p $@
- cd $@ && eval "`rpm --eval "%{cmake}" | grep -v -e
"^%"`" -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
+ cd $@ && eval "`rpm --eval "%{cmake}" | grep -v -e
"^%"`" -DCMAKE_BUILD_TYPE=RelWithDebInfo
-DREQUIRE_HELP2MAN=$(REQUIRE_HELP2MAN) ..
@$(MAKE) --no-print-dir -C $@
tests: linux.build
@@ -76,7 +76,12 @@ check-mock:
export:
rm -f $(TARFILE).tgz
- git archive --prefix=$(TARPREFIX)/ $(TAG) | gzip > $(TARFILE)
+ git archive --prefix=$(TARPREFIX)/ $(TAG) | tar x
+ cd $(TARPREFIX) && \
+ $(MAKE) linux.build REQUIRE_HELP2MAN=1 && \
+ for n in `find linux.build/ -iname '*.8.gz'` ; do cp $$n $${n:12}; done
&& \
+ cd .. && rm -rf linux.build
+ tar czvf $(TARFILE) $(TARPREFIX)
echo `date`: Rebuilt $(TARFILE) from $(TAG)
$(VARIANT)$(PACKAGE).spec: $(VARIANT)$(PACKAGE).spec.in
@@ -93,7 +98,6 @@ $(VARIANT)$(PACKAGE).spec: $(VARIANT)$(PACKAGE).spec.in
srpm: export $(VARIANT)$(PACKAGE).spec
rm -f *.src.rpm
-
rpmbuild -bs $(RPM_OPTS) $(VARIANT)$(PACKAGE).spec
# eg. WITH="--with cman" make rpm
diff --git a/mkrelease.sh b/mkrelease.sh
index db650c4..7c5219e 100755
--- a/mkrelease.sh
+++ b/mkrelease.sh
@@ -18,5 +18,4 @@ if [ "$(cat .version)" != "${TAG:1}" ] ; then
git commit -s -m "build: update .version to ${TAG:1}"
fi
git tag -a -m "Tagged release $TAG" $TAG $BRANCH
-git archive --prefix=matahari-${TAG:1}/ $TAG | tar x
-tar czvf matahari-${TAG:1}.tar.gz matahari-${TAG:1}/
+make export TAG=${TAG} TARPREFIX=matahari-${TAG:1} TARFILE=matahari-${TAG:1}.tar.gz
diff --git a/src/cmake/modules/MatahariMacros.cmake
b/src/cmake/modules/MatahariMacros.cmake
index e051b2b..7cdb7e1 100644
--- a/src/cmake/modules/MatahariMacros.cmake
+++ b/src/cmake/modules/MatahariMacros.cmake
@@ -109,8 +109,14 @@ macro(create_manpage BINARY SECTION DESC)
COMMENT "Generating ${BINARY} man page"
VERBATIM
)
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${BINARY}.${SECTION}.gz DESTINATION
share/man/man${SECTION})
+ else(HELP2MAN)
+ if(REQUIRE_HELP2MAN)
+ message(FATAL_ERROR "help2man is required.")
+ endif(REQUIRE_HELP2MAN)
endif(HELP2MAN)
+ if(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/${BINARY}.${SECTION}.gz)
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${BINARY}.${SECTION}.gz DESTINATION
share/man/man${SECTION})
+ endif(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/${BINARY}.${SECTION}.gz)
endmacro(create_manpage)
macro(create_service_scripts BASE)
--
1.7.6.2
Show replies by date