# -*- makefile -*-

FEVER =		~/.fedora/fever-check.py
VERSION_INFO =	verinfo

verinfo:
		$(FEVER) < $(VERSION_INFO)

checkver:	lastver
ifneq ($(SUMMARY),)
		$(FEVER) < $(VERSION_INFO) | diff $< -
else
		cur=$$($(FEVER) < $(VERSION_INFO)); old=$$(cat $<); \
		test x"$$cur" = x"$$old" && \
		printf "OK:       %20s/%-10s\t'%s'\n" '${NAME}' '${BRANCH}' "$$cur" || \
		printf "OUTDATED: %20s/%-10s\t'%s' -> '%s'\n" '${NAME}' '${BRANCH}' "$$old" "$$cur"
endif

new-sources:	update-lastver

update-lastver:	.lastver.tmp
		@rm -f lastver
		@mv -f $< lastver

.lastver.tmp:
		$(FEVER) < $(VERSION_INFO) > $@

.PHONY::		verinfo checkver .lastver.tmp update-lastver
