~canonical-ca-hackers/libdep-service-python/trunk

« back to all changes in this revision

Viewing changes to Makefile

  • Committer: James Westby
  • Date: 2012-10-19 20:27:42 UTC
  • mto: This revision was merged to the branch mainline in revision 16.
  • Revision ID: james.westby@canonical.com-20121019202742-yu1i5ricnj4ec8jd
Read the version from the $(VERSION_FILE) rather than requiring it to be specified.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
VERSION_FILE=libdep_service_client/__init__.py
22
22
NEWS_FILE=NEWS
23
23
LP_PROJECT=libdep-service-python
 
24
VERSION=$(shell grep "^__version__ " "$(VERSION_FILE)" | sed -e "s/.*=\s*'\([^']\+\)'.*/\1/")
24
25
 
25
26
release:
26
 
        @[ -n "$(VERSION)" ] || (echo "You must specify Specify VERSION=<version>" && exit 1)
27
 
        @grep -q "^$(VERSION) " "$(NEWS_FILE)" || (echo "You must update $(NEWS_FILE)" && exit 1)
28
 
        @grep -q "^__version__ = '$(VERSION)'" "$(VERSION_FILE)" || (echo "You must update VERSION_FILE" && exit 1)
 
27
        @echo Releasing version $(VERSION)
 
28
        @(bzr tags | grep -vq "^$(VERSION)\s") || (echo "Tag already exists for $(VERSION), remove it and run again" && exit 1)
 
29
        @grep -q "^$(VERSION)\s" "$(NEWS_FILE)" || (echo "No entry for $(VERSION) in NEWS" && exit 1)
29
30
        python setup.py sdist upload --sign
30
31
        bzr tag "$(VERSION)"
31
32
        bzr push lp:$(LP_PROJECT)