aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorThomas F Herbert <therbert@redhat.com>2016-10-13 18:36:50 -0400
committerDamjan Marion <dmarion.lists@gmail.com>2016-11-04 22:22:53 +0000
commit20a29c7b4d1b5b68112498bee21ee7f3fe123b13 (patch)
tree364bb9682084282b94102f6a433111dea3851c24 /Makefile
parentdea606321942132521effe5a3a1bfdaa77d41ebf (diff)
VPP-498: Prepare vpp RPM packaging for use by downstream distros.
Change spec to add new macros to get rid of relative dir reference and use vpp version. Store version string in .version to store metadata in dist archive. New script to create dist archive. Add dist and wipedist targets to Makefile for builds of source RPMs. Change-Id: I7cf0164f0cb094ec70f3dc323ed7fa2ee82bd902 Signed-off-by: Thomas F Herbert <therbert@redhat.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile21
1 files changed, 19 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 3a6c7834c1e..987008645de 100644
--- a/Makefile
+++ b/Makefile
@@ -167,10 +167,27 @@ define make
@make -C $(BR) PLATFORM=$(PLATFORM) TAG=$(1) $(2)
endef
+$(BR)/scripts/.version:
+ifneq ("$(wildcard /etc/redhat-release)","")
+ $(shell $(BR)/scripts/version rpm-string > $(BR)/scripts/.version)
+else
+ $(shell $(BR)/scripts/version > $(BR)/scripts/.version)
+endif
+
+dist: $(BR)/scripts/.version
+ $(MAKE) verstring=$(PLATFORM)-$(shell cat $(BR)/scripts/.version) prefix=$(PLATFORM) distversion
+
+distversion: $(BR)/scripts/.version
+ $(BR)/scripts/verdist ${BR} ${prefix}-$(shell $(BR)/scripts/version rpm-version) ${verstring}
+ mv $(verstring).tar.gz $(BR)/rpm
+
build: $(BR)/.bootstrap.ok
$(call make,$(PLATFORM)_debug,vpp-install)
-wipe: $(BR)/.bootstrap.ok
+wipedist:
+ $(RM) $(BR)/scripts/.version $(BR)/rpm/*.tar.gz
+
+wipe: wipedist $(BR)/.bootstrap.ok
$(call make,$(PLATFORM)_debug,vpp-wipe)
rebuild: wipe build
@@ -271,7 +288,7 @@ run-vat:
pkg-deb:
$(call make,$(PLATFORM),install-deb)
-pkg-rpm:
+pkg-rpm: dist
$(call make,$(PLATFORM),install-rpm)
ctags: ctags.files