From c30fa6bc6469cd0f2c3d3921fc4f99e7d82930c7 Mon Sep 17 00:00:00 2001 From: James Duley Date: Sat, 1 Aug 2015 14:35:22 +0100 Subject: [PATCH] LP-80 extend linux packaging: add package_src for rpm Change-Id: Iaf0e8d134a5396917c3d71edb47e822c9dd5d129 --- package/linux/rpm.mk | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/package/linux/rpm.mk b/package/linux/rpm.mk index 789c1ce30..7814f547f 100644 --- a/package/linux/rpm.mk +++ b/package/linux/rpm.mk @@ -4,6 +4,7 @@ RPM_REL := 1 RPM_ARCH := $(shell rpm --eval '%{_arch}') RPM_PACKAGE_NAME := $(RPM_NAME)-$(UPSTREAM_VER)-$(RPM_REL)$(shell rpm --eval '%{?dist}').$(RPM_ARCH).rpm RPM_PACKAGE_FILE := $(PACKAGE_DIR)/RPMS/$(RPM_ARCH)/$(RPM_PACKAGE_NAME) +RPM_PACKAGE_SRC := $(PACKAGE_DIR)/SRPMS/$(RPM_PACKAGE_NAME).src.rpm SED_SCRIPT := sed -i -e ' \ s//$(UPSTREAM_VER)/g; \ @@ -29,9 +30,14 @@ $(SPEC_FILE): $(SPEC_FILE_IN) | $(RPM_DIRS) .PHONY: package package: $(RPM_PACKAGE_FILE) +$(RPM_PACKAGE_FILE): RPMBUILD_OPTS := -bb -$(RPM_PACKAGE_FILE): $(SPEC_FILE) $(DIST_TAR_GZ) | $(RPM_DIRS) - @$(ECHO) "Building $(RPM_PACKAGE_NAME), please wait..." +.PHONY: package_src +package_src: $(RPM_PACKAGE_SRC) +$(RPM_PACKAGE_SRC): RPMBUILD_OPTS := -bs + +$(RPM_PACKAGE_FILE) $(RPM_PACKAGE_SRC): $(SPEC_FILE) $(DIST_TAR_GZ) | $(RPM_DIRS) + @$(ECHO) "Building $(call toprel,$@), please wait..." $(V1) ln -sf $(DIST_TAR_GZ) $(PACKAGE_DIR)/SOURCES - $(V1) rpmbuild -bb --define "_topdir $(PACKAGE_DIR)" $(SPEC_FILE) + $(V1) rpmbuild $(RPMBUILD_OPTS) --define "_topdir $(PACKAGE_DIR)" $(SPEC_FILE)