diff options
-rw-r--r-- | .version | 1 | ||||
-rw-r--r-- | Makefile | 52 | ||||
-rw-r--r-- | libaio.spec | 2 |
3 files changed, 40 insertions, 15 deletions
diff --git a/.version b/.version new file mode 100644 index 0000000..7b32a6e --- /dev/null +++ b/.version @@ -0,0 +1 @@ +0.3.109 @@ -9,6 +9,14 @@ prefix=/usr includedir=$(prefix)/include libdir=$(prefix)/lib +pkgname := libaio +ver := $(shell cat .version) + +version_dirty := $(strip $(shell git diff | lsdiff | grep ".version")) +dirty := $(strip $(shell git whatchanged ${pkgname}-${ver}... 2>/dev/null)) +new_changes := $(strip $(shell git diff 2>/dev/null)) +tag_valid := $(strip $(shell git tag -l ${pkgname}-${ver})) + default: all all: @@ -27,21 +35,37 @@ clean: @$(MAKE) -C src clean @$(MAKE) -C harness clean -tag-archive: - @cvs -Q tag -F $(CVSTAG) +tag: tag-checks + git tag ${pkgname}-${ver} -create-archive: tag-archive - @rm -rf /tmp/$(NAME) - @cd /tmp; cvs -Q -d $(CVSROOT) export -r$(CVSTAG) $(NAME) || echo GRRRrrrrr -- ignore [export aborted] - @mv /tmp/$(NAME) /tmp/$(NAME)-$(VERSION) - @cd /tmp; tar czSpf $(NAME)-$(VERSION).tar.gz $(NAME)-$(VERSION) - @rm -rf /tmp/$(NAME)-$(VERSION) - @cp /tmp/$(NAME)-$(VERSION).tar.gz . - @rm -f /tmp/$(NAME)-$(VERSION).tar.gz - @echo " " - @echo "The final archive is ./$(NAME)-$(VERSION).tar.gz." +archive: uptodate + @echo "Creating archive from version ${pkgname}-${ver}:" + git archive --format=tar --prefix=${pkgname}-${ver}/ \ + ${pkgname}-${ver} | gzip > ${pkgname}-${ver}.tar.gz +tag-checks: +ifneq (${version_dirty},) + @echo "Error: .version is not committed to the repository." + @exit 1 +endif +ifneq (${new_changes},) + @echo "Error: there are changes in this checkout that have not been" + @echo "committed to the repository." + @exit 1 +endif -archive: clean tag-archive create-archive +uptodate: tag-checks +ifneq (${dirty},) + @echo -n "Error: this branch contains changes that are not part of tag " + @echo "${pkgname}-${ver}." + @echo -n "Try running git-whatchanged ${pkgname}-${ver}... to see " + @echo "the changes." + @exit 1 +endif +ifeq (${tag_valid},) + @echo "Error: tag ${pkgname}-${ver} does not exist. Run 'make tag'" + @echo "and try again." + @exit 1 +endif -srpm: create-archive +srpm: archive $(RPMBUILD) --define "_sourcedir `pwd`" --define "_srcrpmdir `pwd`" --nodeps -bs $(SPECFILE) diff --git a/libaio.spec b/libaio.spec index f1840a7..32b0d42 100644 --- a/libaio.spec +++ b/libaio.spec @@ -1,5 +1,5 @@ Name: libaio -Version: 0.3.108 +Version: 0.3.109 Release: 1 Summary: Linux-native asynchronous I/O access library License: LGPL |