update Makefile and setup.py

This commit is contained in:
2013-09-01 23:09:50 +02:00
parent d3ee2acaab
commit f379a0fc0a
2 changed files with 51 additions and 41 deletions

View File

@ -15,8 +15,7 @@ ifneq ($(DESTDIR),)
PYTHON_OPTS += --root $(DESTDIR)
endif
LAST_TAG := $(shell git describe --tags --abbrev=0)
VERSION := $(shell echo $(LAST_TAG) | awk -F'/' '{print $$2}' || true)
VERSION := 1.0rc
VERSION_FILE := version.in
# Build translation files
@ -39,11 +38,12 @@ define install_translation
fi
endef
all:
all: build-lang
clean:
$(RM) -r build
$(RM) -r tiramisu.egg-info/
$(RM) -r $(PACKAGE).egg-info/
$(RM) -r $(VERSION_FILE)
$(RM) -r $(TRADUC_DIR)/*/*.mo
#test: clean
@ -51,12 +51,12 @@ clean:
# Build or update Portable Object Base Translation for gettext
build-pot:
pygettext.py -p translations/ -o tiramisu.pot `find tiramisu/ -name "*.py"`
pygettext.py -p translations/ -o $(PACKAGE).pot `find $(PACKAGE)/ -name "*.py"`
build-lang:
$(call build_translation, $(TRADUC_DIR))
install-lang: build-lang
install-lang:
$(INSTALL_DIR) $(TRADUC_DEST)
$(call install_translation, $(TRADUC_DIR))
@ -65,16 +65,9 @@ install: version.in install-lang
# List in .PHONY to force generation at each call
version.in:
@if test -n $(VERSION) ; then \
echo -n $(VERSION) > $(VERSION_FILE) ; \
fi
@if test ! -s $(VERSION_FILE); then \
echo -n '0.0-dev' > $(VERSION_FILE); \
fi
echo -n $(VERSION) > $(VERSION_FILE)
dist: version.in
git archive --format=tar --prefix $(PACKAGE)-$(VERSION)/ -o $(PACKAGE)-$(VERSION).tar $(LAST_TAG) \
&& tar --xform "s,\(.*\),$(PACKAGE)-$(VERSION)/\1," -f $(PACKAGE)-$(VERSION).tar -r version.in \
&& gzip -9 $(PACKAGE)-$(VERSION).tar
dist:
git archive --format=tar --prefix $(PACKAGE)-$(VERSION)/ HEAD | gzip -9 > $(PACKAGE)-$(VERSION).tar.gz
.PHONY: all clean test install version.in dist build-pot
.PHONY: all clean build-pot build-lang install-lang install version.in dist