commit b86c20a16c940cbba9cd41fb3baaa58b6df53a7e Author: Ximin Luo infinity0@gmx.com Date: Fri Nov 8 17:44:02 2013 +0000
read version automatically from the ChangeLog --- Makefile | 2 +- Makefile.client | 2 +- setup-common.py | 5 ++++- version.sh | 3 +++ 4 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile index 5623c4f..207115c 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ # then running `make PYTHON_W32="wine python" dist-exe`.
PACKAGE = flashproxy-client -VERSION = 1.4 +VERSION = $(shell sh version.sh) DISTNAME = $(PACKAGE)-$(VERSION)
THISFILE = $(lastword $(MAKEFILE_LIST)) diff --git a/Makefile.client b/Makefile.client index 9ebc576..3c02712 100644 --- a/Makefile.client +++ b/Makefile.client @@ -4,7 +4,7 @@ # dependencies to function; it is given as a reference for distro packagers.
PACKAGE = flashproxy-client -VERSION = 1.4 +VERSION = $(shell sh version.sh) DESTDIR =
THISFILE = $(lastword $(MAKEFILE_LIST)) diff --git a/setup-common.py b/setup-common.py index 97d2099..440085f 100755 --- a/setup-common.py +++ b/setup-common.py @@ -20,10 +20,13 @@ To build/install a self-contained binary distribution of flashproxy-client # # See discussion on #6810 for more details.
+import subprocess import sys
from setuptools import setup, find_packages
+version = subprocess.check_output(["sh", "version.sh"]).strip() + setup( name = "flashproxy-common", author = "dcf", @@ -35,7 +38,7 @@ setup( packages = find_packages(exclude=['*.test']), test_suite='flashproxy.test',
- version = "1.4", + version = version,
install_requires = [ 'setuptools', diff --git a/version.sh b/version.sh new file mode 100755 index 0000000..87cf555 --- /dev/null +++ b/version.sh @@ -0,0 +1,3 @@ +#!/bin/sh +# Read version from the ChangeLog to avoid repeating in multiple build scripts +sed -nre 's/^Changes .* version (.+)$/\1/g;tx;b;:x p;q' ChangeLog