diff options
author | John Wiegley <johnw@newartisans.com> | 2009-01-26 17:16:59 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-01-26 17:16:59 -0400 |
commit | 2541c4cd26dc06ac3af0c40cadffb487ab034805 (patch) | |
tree | cfb8b33eddc1ecac7676d888786f5dcb3a87bb01 | |
parent | 082614a0869cde22d94fce525c5639f5e2f49700 (diff) | |
download | fork-ledger-2541c4cd26dc06ac3af0c40cadffb487ab034805.tar.gz fork-ledger-2541c4cd26dc06ac3af0c40cadffb487ab034805.tar.bz2 fork-ledger-2541c4cd26dc06ac3af0c40cadffb487ab034805.zip |
Handle the VERSION more gracefully, and uninstall the Python Egg file.
-rw-r--r-- | Makefile.am | 65 | ||||
-rwxr-xr-x | python/setup.py | 2 |
2 files changed, 46 insertions, 21 deletions
diff --git a/Makefile.am b/Makefile.am index 842261f7..182652e9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,3 +1,5 @@ +VERSION = 3.0 + if HAVE_GDTOA SUBDIRS = lib/gdtoa endif @@ -33,7 +35,7 @@ libledger_util_la_SOURCES = \ lib/sha1.cpp libledger_util_la_CPPFLAGS = $(lib_cppflags) -libledger_util_la_LDFLAGS = -release 3.0.0 +libledger_util_la_LDFLAGS = -release $(VERSION).0 libledger_math_la_SOURCES = \ src/amount.cc \ @@ -43,7 +45,7 @@ libledger_math_la_SOURCES = \ src/value.cc libledger_math_la_CPPFLAGS = $(lib_cppflags) -libledger_math_la_LDFLAGS = -release 3.0.0 +libledger_math_la_LDFLAGS = -release $(VERSION).0 libledger_expr_la_SOURCES = \ src/token.cc \ @@ -55,7 +57,7 @@ libledger_expr_la_SOURCES = \ src/option.cc libledger_expr_la_CPPFLAGS = $(lib_cppflags) -libledger_expr_la_LDFLAGS = -release 3.0.0 +libledger_expr_la_LDFLAGS = -release $(VERSION).0 libledger_data_la_SOURCES = \ src/item.cc \ @@ -67,7 +69,7 @@ libledger_data_la_SOURCES = \ src/compare.cc libledger_data_la_CPPFLAGS = $(lib_cppflags) -libledger_data_la_LDFLAGS = -release 3.0.0 +libledger_data_la_LDFLAGS = -release $(VERSION).0 libledger_parse_la_SOURCES = \ src/textual.cc \ @@ -83,7 +85,7 @@ libledger_parse_la_SOURCES += src/ofx.cc endif libledger_parse_la_CPPFLAGS = $(lib_cppflags) -libledger_parse_la_LDFLAGS = -release 3.0.0 +libledger_parse_la_LDFLAGS = -release $(VERSION).0 libledger_report_la_SOURCES = \ src/session.cc \ @@ -93,7 +95,7 @@ libledger_report_la_SOURCES = \ src/help.cc libledger_report_la_CPPFLAGS = $(lib_cppflags) -libledger_report_la_LDFLAGS = -release 3.0.0 +libledger_report_la_LDFLAGS = -release $(VERSION).0 libledger_extra_la_SOURCES = \ src/derive.cc \ @@ -101,7 +103,7 @@ libledger_extra_la_SOURCES = \ src/quotes.cc libledger_extra_la_CPPFLAGS = $(lib_cppflags) -libledger_extra_la_LDFLAGS = -release 3.0.0 +libledger_extra_la_LDFLAGS = -release $(VERSION).0 pkginclude_HEADERS = \ acconf.h \ @@ -258,18 +260,39 @@ pyexec_PROGRAMS = ledger.so clean-local: rm -fr build +uninstall-hook: + rm -f $(DESTDIR)$(libdir)/Ledger-$(VERSION)-py$(PYTHON_VERSION).egg-info + if HAVE_GDTOA install-exec-hook: - CFLAGS="$(CPPFLAGS)" ARCHFLAGS="$(ARCHFLAGS)" PYLIBS="$(PYLIBS)" \ - LDFLAGS="$(LDFLAGS) -L. -L.libs -Llib/gdtoa -Llib/gdtoa/.libs" \ - SRCDIR="$(srcdir)" $(PYTHON) $(srcdir)/python/setup.py install \ - --prefix=$(prefix) --root=$(DESTDIR)/ + BUILD_DIR=`cd $(top_builddir); pwd`; \ + SRC_DIR=`cd $(srcdir); pwd`; \ + (cd $(srcdir); \ + CFLAGS="$(CPPFLAGS) -I$(srcdir) -I$$BUILD_DIR -I$$BUILD_DIR/lib/gdtoa $(libledger_python_la_CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)" \ + LDFLAGS="$(LDFLAGS) -L$$BUILD_DIR -L$$BUILD_DIR/.libs -L$$BUILD_DIR/lib/gdtoa -L$$BUILD_DIR/lib/gdtoa/.libs" \ + ARCHFLAGS="$(ARCHFLAGS)" PYLIBS="$(PYLIBS)" VERSION="$(VERSION)" \ + SRCDIR="$$SRC_DIR" $(PYTHON) python/setup.py install \ + --skip-build \ + --root=$(DESTDIR)/ \ + --prefix=$(prefix) \ + --install-lib=$(libdir) \ + --install-headers=$(pkgincludedir) \ + --install-data=$(datadir)) else install-exec-hook: - CFLAGS="$(CPPFLAGS)" ARCHFLAGS="$(ARCHFLAGS)" PYLIBS="$(PYLIBS)" \ - LDFLAGS="$(LDFLAGS) -L. -L.libs" \ - SRCDIR="$(srcdir)" $(PYTHON) $(srcdir)/python/setup.py install \ - --prefix=$(prefix) --root=$(DESTDIR)/ + BUILD_DIR=`cd $(top_builddir); pwd`; \ + SRC_DIR=`cd $(srcdir); pwd`; \ + (cd $(srcdir); \ + CFLAGS="$(CPPFLAGS) -I$(srcdir) -I$$BUILD_DIR $(libledger_python_la_CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)" \ + LDFLAGS="$(LDFLAGS) -L$$BUILD_DIR -L$$BUILD_DIR/.libs" \ + ARCHFLAGS="$(ARCHFLAGS)" PYLIBS="$(PYLIBS)" VERSION="$(VERSION)" \ + SRCDIR="$$SRC_DIR" $(PYTHON) python/setup.py install \ + --skip-build \ + --root=$(DESTDIR)/ \ + --prefix=$(prefix) \ + --install-lib=$(libdir) \ + --install-headers=$(pkgincludedir) \ + --install-data=$(datadir)) endif ledger_so_SOURCES = $(all_sources) @@ -296,20 +319,22 @@ endif if HAVE_GDTOA ledger.so: $(ledger_so_SOURCES) $(ledger_so_DEPENDENCIES) BUILD_DIR=`cd $(top_builddir); pwd`; \ + SRC_DIR=`cd $(srcdir); pwd`; \ (cd $(srcdir); \ CFLAGS="$(CPPFLAGS) -I$(srcdir) -I$$BUILD_DIR -I$$BUILD_DIR/lib/gdtoa $(libledger_python_la_CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)" \ LDFLAGS="$(LDFLAGS) -L$$BUILD_DIR -L$$BUILD_DIR/.libs -L$$BUILD_DIR/lib/gdtoa -L$$BUILD_DIR/lib/gdtoa/.libs" \ - ARCHFLAGS="$(ARCHFLAGS)" PYLIBS="$(PYLIBS)" \ - SRCDIR="$(srcdir)" $(PYTHON) $(srcdir)/python/setup.py build \ + ARCHFLAGS="$(ARCHFLAGS)" PYLIBS="$(PYLIBS)" VERSION="$(VERSION)" \ + SRCDIR="$$SRC_DIR" $(PYTHON) python/setup.py build \ --build-lib=$$BUILD_DIR/ --build-temp=$$BUILD_DIR/build -f) else ledger.so: $(ledger_so_SOURCES) $(ledger_so_DEPENDENCIES) BUILD_DIR=`cd $(top_builddir); pwd`; \ + SRC_DIR=`cd $(srcdir); pwd`; \ (cd $(srcdir); \ - CFLAGS="$(CPPFLAGS) -I$(srcdir) -I$$BUILD_DIR -I$$BUILD_DIR/lib/gdtoa $(libledger_python_la_CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)" \ + CFLAGS="$(CPPFLAGS) -I$(srcdir) -I$$BUILD_DIR $(libledger_python_la_CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)" \ LDFLAGS="$(LDFLAGS) -L$$BUILD_DIR -L$$BUILD_DIR/.libs" \ - ARCHFLAGS="$(ARCHFLAGS)" PYLIBS="$(PYLIBS)" \ - SRCDIR="$(srcdir)" $(PYTHON) $(srcdir)/python/setup.py build \ + ARCHFLAGS="$(ARCHFLAGS)" PYLIBS="$(PYLIBS)" VERSION="$(VERSION)" \ + SRCDIR="$$SRC_DIR" $(PYTHON) python/setup.py build \ --build-lib=$$BUILD_DIR/ --build-temp=$$BUILD_DIR/build -f) endif diff --git a/python/setup.py b/python/setup.py index e040f51d..1e67fb00 100755 --- a/python/setup.py +++ b/python/setup.py @@ -8,7 +8,7 @@ defines = [('PYTHON_MODULE', 1)] libs = os.environ["PYLIBS"].split() setup(name = "Ledger", - version = "2.7", + version = os.environ["VERSION"], description = "Ledger Accounting Library", author = "John Wiegley", author_email = "johnw@newartisans.com", |