2015-07-31 20:17:31 +02:00
|
|
|
RPM_NAME := $(PACKAGE_NAME)
|
|
|
|
UPSTREAM_VER := $(subst -,~,$(subst RELEASE-,,$(DIST_LBL)))
|
|
|
|
RPM_REL := 1
|
|
|
|
RPM_ARCH := $(shell rpm --eval '%{_arch}')
|
2015-11-08 21:14:38 +01:00
|
|
|
RPM_PACKAGE_NAME := $(RPM_NAME)-$(UPSTREAM_VER)-$(RPM_REL)
|
|
|
|
RPM_PACKAGE_FILE := $(PACKAGE_DIR)/RPMS/$(RPM_ARCH)/$(RPM_PACKAGE_NAME)$(shell rpm --eval '%{?dist}').$(RPM_ARCH).rpm
|
2015-08-01 15:35:22 +02:00
|
|
|
RPM_PACKAGE_SRC := $(PACKAGE_DIR)/SRPMS/$(RPM_PACKAGE_NAME).src.rpm
|
2015-07-31 20:17:31 +02:00
|
|
|
|
2015-10-08 23:33:16 +02:00
|
|
|
SED_SCRIPT := $(SED_SCRIPT)' \
|
2015-07-31 20:17:31 +02:00
|
|
|
s/<VERSION>/$(UPSTREAM_VER)/g; \
|
|
|
|
s/<NAME>/$(RPM_NAME)/g; \
|
|
|
|
s/<RELEASE>/$(RPM_REL)/g; \
|
2015-08-26 19:38:44 +02:00
|
|
|
s/<SOURCE0>/$(notdir $(DIST_TAR_GZ))/g; \
|
|
|
|
s/<SOURCE1>/$(notdir $(FW_DIST_TAR_GZ))/g; \
|
2015-10-08 23:33:16 +02:00
|
|
|
s/<SUMMARY>/$(DESCRIPTION_SHORT)/g; \
|
2016-04-01 23:23:21 +02:00
|
|
|
s/<DESCRIPTION>/$(subst ','"'"',$(subst $(NEWLINE),\n,$(DESCRIPTION_LONG)))/g; \
|
2015-07-31 20:17:31 +02:00
|
|
|
'
|
|
|
|
|
|
|
|
RPM_DIRS := $(addprefix $(PACKAGE_DIR)/,BUILD RPMS SOURCES SPECS SRPMS)
|
|
|
|
DIRS += $(RPM_DIRS)
|
|
|
|
|
|
|
|
SPEC_FILE := $(PACKAGE_DIR)/SPECS/$(RPM_NAME).spec
|
|
|
|
SPEC_FILE_IN := $(ROOT_DIR)/package/linux/rpmspec.in
|
|
|
|
|
|
|
|
.PHONY: rpmspec
|
|
|
|
rpmspec: $(SPEC_FILE)
|
|
|
|
|
2016-05-14 19:44:23 +02:00
|
|
|
$(SPEC_FILE): $(SPEC_FILE_IN) $(DIST_VER_INFO) | $(RPM_DIRS)
|
2015-07-31 20:17:31 +02:00
|
|
|
$(V1) cp -f $(SPEC_FILE_IN) $(SPEC_FILE)
|
|
|
|
$(V1) $(SED_SCRIPT) $(SPEC_FILE)
|
|
|
|
|
|
|
|
|
|
|
|
.PHONY: package
|
|
|
|
package: $(RPM_PACKAGE_FILE)
|
2015-08-01 15:35:22 +02:00
|
|
|
$(RPM_PACKAGE_FILE): RPMBUILD_OPTS := -bb
|
2015-07-31 20:17:31 +02:00
|
|
|
|
2015-08-01 15:35:22 +02:00
|
|
|
.PHONY: package_src
|
|
|
|
package_src: $(RPM_PACKAGE_SRC)
|
|
|
|
$(RPM_PACKAGE_SRC): RPMBUILD_OPTS := -bs
|
|
|
|
|
2015-08-26 19:38:44 +02:00
|
|
|
$(RPM_PACKAGE_FILE) $(RPM_PACKAGE_SRC): $(SPEC_FILE) $(DIST_TAR_GZ) $(FW_DIST_TAR_GZ) | $(RPM_DIRS)
|
2015-08-01 15:35:22 +02:00
|
|
|
@$(ECHO) "Building $(call toprel,$@), please wait..."
|
2015-07-31 20:17:31 +02:00
|
|
|
$(V1) ln -sf $(DIST_TAR_GZ) $(PACKAGE_DIR)/SOURCES
|
2015-08-26 19:38:44 +02:00
|
|
|
$(V1) ln -sf $(FW_DIST_TAR_GZ) $(PACKAGE_DIR)/SOURCES
|
2015-08-01 15:35:22 +02:00
|
|
|
$(V1) rpmbuild $(RPMBUILD_OPTS) --define "_topdir $(PACKAGE_DIR)" $(SPEC_FILE)
|