summaryrefslogtreecommitdiff
path: root/cpp/Makefile.am
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/Makefile.am')
-rw-r--r--cpp/Makefile.am38
1 files changed, 30 insertions, 8 deletions
diff --git a/cpp/Makefile.am b/cpp/Makefile.am
index 1d6c142109..dcdcb7cea0 100644
--- a/cpp/Makefile.am
+++ b/cpp/Makefile.am
@@ -1,13 +1,15 @@
AUTOMAKE_OPTIONS = 1.9.2 foreign
ACLOCAL_AMFLAGS = -I m4
+SPEC=$(PACKAGE).spec
+
EXTRA_DIST = \
LICENSE NOTICE README \
etc/qpidd \
- $(PACKAGE).spec \
- $(PACKAGE).spec.in
+ $(SPEC) $(SPEC).in \
+ rpm/README.qpidd-devel
-SUBDIRS = src docs/api docs/man rpm
+SUBDIRS = src docs/api docs/man
# Update libtool, if needed.
libtool: $(LIBTOOL_DEPS)
@@ -16,11 +18,31 @@ libtool: $(LIBTOOL_DEPS)
# This cannot be done by AC_CONFIG_FILES, because automake's
# make distcheck target does not like auto-generated files
# being included in the distributed archive.
-$(PACKAGE).spec: %: %.in
+$(SPEC): %: %.in Makefile
sed 's/@''PACKAGE@/@PACKAGE@/;s/@''VERSION@/@VERSION@/' $< > $@-tmp
mv $@-tmp $@
-MAINTAINERCLEANFILES = $(PACKAGE).spec
+MAINTAINERCLEANFILES = $(SPEC)
+
+#
+# Build RPMs from the distribution tarball.
+#
+RPMDIRS=rpm/BUILD rpm/RPMS rpm/SPECS rpm/SRPMS
+RPMMACROS=--define "_topdir @abs_builddir@/rpm" --define "_sourcedir @abs_builddir@"
+# Override this variable e.g. with -bs to produce srpm only
+RPMOPTS=-ba
+
+clean-local:
+ -rm -rf $(RPMDIRS)
+
+.PHONY: rpmbuild
+
+rpmbuild: $(SPEC) dist-gzip
+ mkdir -p $(RPMDIRS)
+ rpmbuild $(RPMMACROS) $(RPMOPTS) $(SPEC)
+if HAS_RPMLINT
+ rpmlint `find rpm -name '*.rpm'`
+else
+ @echo "WARNING: rpmlint not found, could not validate RPMs."
+endif
+
-.PHONY: rpm srpm
-rpm srpm: dist
- cd rpm && $(MAKE) $(MAKEFLAGS_AM) $@