rpm: $(wildcard $(LOCAL_PATH)/rpm/*) $(BUILT_IMG)
@echo ----- Making an rpm ------
OUT=$(abspath $(PRODUCT_OUT)); mkdir -p $$OUT/rpm/BUILD; rm -rf $$OUT/rpm/RPMS/*; $(ACP) $< $$OUT; \
+ echo $(VER) | grep -vq rc; EPOCH=$$((-$$? + `echo $(VER) | cut -d. -f1`)); \
rpmbuild -bb --target=$(if $(filter x86,$(TARGET_ARCH)),i686,x86_64) -D"cmdline $(BOARD_KERNEL_CMDLINE)" \
- -D"_topdir $$OUT/rpm" -D"_sourcedir $$OUT" -D"systemimg $(notdir $(systemimg))" -D"ver $(VER)" \
+ -D"_topdir $$OUT/rpm" -D"_sourcedir $$OUT" -D"systemimg $(notdir $(systemimg))" -D"ver $(VER)" -D"epoch $$EPOCH" \
$(if $(BUILD_NAME_VARIANT),-D"name $(BUILD_NAME_VARIANT)") \
-D"install_prefix $(if $(INSTALL_PREFIX),$(INSTALL_PREFIX),android-$(VER))" $(filter %.spec,$^); \
mv $$OUT/rpm/RPMS/*/*.rpm $$OUT
Name: %{?name}%{!?name:android-x86}
Version: %(echo %{ver} | cut -d- -f1)
Release: %(echo %{ver} | cut -d- -f2)
+Epoch: %{epoch}
Source1: kernel
Source2: initrd.img
Source3: ramdisk.img