rpmdist.mk: Add target rpm-next-build

- Add target rpm-next-build
  - Overall beautification, untested
This commit is contained in:
Jan Lindemann 2007-08-28 01:22:05 +00:00 committed by Jan Lindemann
commit f113cd95d6

View file

@ -18,8 +18,11 @@ FTP_HOST ?= ftp.jannet.de
FTP_HOST_LOGIN ?= root FTP_HOST_LOGIN ?= root
RPM_PROJECT ?= $(PROJECT) RPM_PROJECT ?= $(PROJECT)
RPM_VERSION ?= $(DIST_VERSION) RPM_VERSION ?= $(DIST_VERSION)
LAST_RPM_VERSION ?= $(shell sed 's/-dev$$//' $(TOPDIR)/LAST_RPM_VERSION 2>/dev/null)
RPM_ARCH ?= i586 RPM_ARCH ?= i586
RPMBUILD ?= rpmbuild RPMBUILD ?= rpmbuild
CHECK_CVS_SYNC_BEFORE_RPM_RELEASE ?= true
HASH = $(shell $(cvs_files) | grep -v "CHANGES\|VERSION\|HASH\|MD5SUMS" | xargs md5sum | md5sum | sed 's/ .*//')
include $(MODDIR)/make/tag-defs.mk include $(MODDIR)/make/tag-defs.mk
@ -44,6 +47,8 @@ DIST_DIRS = $(DIST_SRC_DIR) $(DIST_PCKG_DIR)
DIST_PCKG_RPM = $(DIST_PCKG_DIR)/$(PCKG_RPM_RUN_I386) $(DIST_PCKG_DIR)/$(PCKG_RPM_DEVEL_I386) DIST_PCKG_RPM = $(DIST_PCKG_DIR)/$(PCKG_RPM_RUN_I386) $(DIST_PCKG_DIR)/$(PCKG_RPM_DEVEL_I386)
RPM_REQUIRES_DEVEL += $(RPM_PROJECT)-run = $(RPM_VERSION) RPM_REQUIRES_DEVEL += $(RPM_PROJECT)-run = $(RPM_VERSION)
unexport RPM_VERSION VERSION DIST_SRC_DIR unexport RPM_VERSION VERSION DIST_SRC_DIR
include $(MODDIR)/make/tag-rules.mk include $(MODDIR)/make/tag-rules.mk
@ -131,8 +136,6 @@ update-repo.dist: upload.dist
# ------ hash stuff # ------ hash stuff
CHECK_CVS_SYNC_BEFORE_RPM_RELEASE ?= true
define check_cvs_sync define check_cvs_sync
echo + checking cvs ;\ echo + checking cvs ;\
cvs status > cvs_status.tmp 2>&1;\ cvs status > cvs_status.tmp 2>&1;\
@ -155,20 +158,23 @@ define increase_build_number
if [ "$(CHECK_CVS_SYNC_BEFORE_RPM_RELEASE)" = true ]; then \ if [ "$(CHECK_CVS_SYNC_BEFORE_RPM_RELEASE)" = true ]; then \
$(check_cvs_sync) ;\ $(check_cvs_sync) ;\
fi ;\ fi ;\
if [ "$(LAST_RPM_VERSION)" != $(RPM_VERSION) ]; then \
exit 0 ;\
fi ;\
echo $(MAJOR_MINOR_RELEASE)-$(shell expr $(BUILD_NUMBER) + 1)-dev | tee VERSION ;\ echo $(MAJOR_MINOR_RELEASE)-$(shell expr $(BUILD_NUMBER) + 1)-dev | tee VERSION ;\
echo $(HASH) > HASH ;\ echo $(HASH) > HASH ;\
if ! grep -q HASH CVS/Entries; then \ if ! grep -q HASH CVS/Entries; then \
cvs add HASH ;\ cvs add HASH ;\
fi ;\ fi ;\
cvs commit -m "o $(VERSION)" HASH VERSION cvs commit -m "o $(RPM_VERSION)" HASH VERSION
endef endef
HASH = $(shell $(cvs_files) | grep -v "CHANGES\|VERSION\|HASH\|MD5SUMS" | xargs md5sum | md5sum | sed 's/ .*//')
LAST_RPM_VERSION = $(shell cat $(TOPDIR)/LAST_RPM_VERSION 2>/dev/null)
md5: md5:
echo $(HASH) > HASH echo $(HASH) > HASH
rpm-next-build:
@$(increase_build_number)
rpm-update-release: rpm-update-release:
@if [ "`cat HASH`" != "$(HASH)" ]; then \ @if [ "`cat HASH`" != "$(HASH)" ]; then \
echo + source was modified ;\ echo + source was modified ;\
@ -185,16 +191,16 @@ rpm-check-release:
fi fi
rpm-release: rpm-update-release rpm-release: rpm-update-release
@if [ "$(VERSION)" != "$(LAST_RPM_VERSION)" ]; then \ @if [ "$(LAST_RPM_VERSION)" != "$(RPM_VERSION)" ]; then \
$(check_cvs_sync) ;\ $(check_cvs_sync) ;\
echo "+ version $(VERSION) doesn't match latest released rpm version "\ echo "+ version $(RPM_VERSION) doesn't match latest released rpm version "\
"$(LAST_RPM_VERSION), building a new release" ;\ "$(LAST_RPM_VERSION), building a new release" ;\
make rpm-clean update-repo.dist || exit 1;\ make rpm-clean update-repo.dist || exit 1;\
cp VERSION LAST_RPM_VERSION ;\ cp VERSION LAST_RPM_VERSION ;\
if ! grep -q LAST_RPM_VERSION CVS/Entries; then \ if ! grep -q LAST_RPM_VERSION CVS/Entries; then \
cvs add LAST_RPM_VERSION ;\ cvs add LAST_RPM_VERSION ;\
fi ;\ fi ;\
cvs commit -m "o $(VERSION)" LAST_RPM_VERSION ;\ cvs commit -m "o $(RPM_VERSION)" LAST_RPM_VERSION ;\
else \ else \
echo "+ version matches latest released rpm version" ;\ echo "+ version matches latest released rpm version" ;\
fi fi