PACKAGE_NAME?= librdkafka VERSION?= $(shell ../get_version.py ../../src/rdkafka.h) # Jenkins CI integration BUILD_NUMBER?= 1 MOCK_CONFIG?=default RESULT_DIR?=pkgs-$(VERSION)-$(BUILD_NUMBER)-$(MOCK_CONFIG) all: rpm SOURCES: mkdir -p SOURCES archive: SOURCES cd ../../ && \ git archive --prefix=$(PACKAGE_NAME)-$(VERSION)/ \ -o packaging/rpm/SOURCES/$(PACKAGE_NAME)-$(VERSION).tar.gz HEAD build_prepare: archive mkdir -p $(RESULT_DIR) rm -f $(RESULT_DIR)/$(PACKAGE_NAME)*.rpm srpm: build_prepare /usr/bin/mock \ -r $(MOCK_CONFIG) \ --define "__version $(VERSION)" \ --define "__release $(BUILD_NUMBER)" \ --resultdir=$(RESULT_DIR) \ --buildsrpm \ --spec=librdkafka.spec \ --sources=SOURCES @echo "======= Source RPM now available in $(RESULT_DIR) =======" rpm: srpm /usr/bin/mock \ -r $(MOCK_CONFIG) \ --define "__version $(VERSION)"\ --define "__release $(BUILD_NUMBER)"\ --resultdir=$(RESULT_DIR) \ --rebuild $(RESULT_DIR)/$(PACKAGE_NAME)*.src.rpm @echo "======= Binary RPMs now available in $(RESULT_DIR) =======" clean: rm -rf SOURCES distclean: clean rm -f build.log root.log state.log available_pkgs installed_pkgs \ *.rpm *.tar.gz