From fee9bbd85afeac3593abd791de2d002bed300c8e Mon Sep 17 00:00:00 2001 From: Petr Spacek Date: Mon, 7 Nov 2016 16:46:37 +0100 Subject: Build: add make rpms target and convenience script makerpms.sh make rpms and ./makerpms.sh will produce the same RPM packages. The advantage of makerpms.sh is that it will take care of initial autoreconf & configure phases as needed. rpm-build-4.13.0-1.fc24.x86_64 broke parallel build of RPMs. If you get error INTERNAL: Exiting with 1 jobserver tokens available; should be 8! undefine the MAKEFLAGS variable and do not specify neither -j nor -l. https://fedorahosted.org/freeipa/ticket/6418 Reviewed-By: Martin Basti Reviewed-By: Christian Heimes --- Makefile.am | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'Makefile.am') diff --git a/Makefile.am b/Makefile.am index 79d607d88..eed7d9ffd 100644 --- a/Makefile.am +++ b/Makefile.am @@ -24,3 +24,23 @@ EXTRA_DIST = .mailmap \ doc \ pylintrc \ pytest.ini + +# convenience targets for RPM build +RPMBUILD ?= $(abs_builddir)/rpmbuild +TARBALL = $(PACKAGE)-$(VERSION).tar.gz +rpmroot: + mkdir -p $(RPMBUILD)/BUILD + mkdir -p $(RPMBUILD)/RPMS + mkdir -p $(RPMBUILD)/SOURCES + mkdir -p $(RPMBUILD)/SPECS + mkdir -p $(RPMBUILD)/SRPMS + +rpmdistdir: + mkdir -p $(top_builddir)/dist/rpms + mkdir -p $(top_builddir)/dist/srpms + +rpms: dist-gzip rpmroot rpmdistdir + cp $(top_builddir)/$(TARBALL) $(RPMBUILD)/SOURCES/ + rpmbuild --define "_topdir $(RPMBUILD)" -ba $(top_builddir)/$(PACKAGE).spec + cp $(RPMBUILD)/RPMS/*/*.rpm $(top_builddir)/dist/rpms/ + cp $(RPMBUILD)/SRPMS/*.src.rpm $(top_builddir)/dist/srpms/ -- cgit