vici: Support out-of-tree build of Python Egg
[strongswan.git] / src / libcharon / plugins / vici / python / Makefile.am
1 EXTRA_DIST = LICENSE MANIFEST.in \
2         setup.py.in \
3         vici/test/__init__.py \
4         vici/test/test_protocol.py \
5         vici/__init__.py \
6         vici/compat.py \
7         vici/exception.py \
8         vici/protocol.py \
9         vici/session.py
10
11 $(srcdir)/setup.py: $(srcdir)/setup.py.in
12         $(AM_V_GEN) sed \
13         -e "s:@EGG_VERSION@:$(PACKAGE_VERSION):" \
14         $(srcdir)/setup.py.in > $@
15
16 all-local: dist/vici-$(PACKAGE_VERSION)-py$(PYTHON_VERSION).egg
17
18 dist/vici-$(PACKAGE_VERSION)-py$(PYTHON_VERSION).egg: $(EXTRA_DIST) $(srcdir)/setup.py
19         (cd $(srcdir); $(PYTHON) setup.py bdist_egg \
20                 -b $(shell readlink -f $(builddir))/build \
21                 -d $(shell readlink -f $(builddir))/dist)
22
23 clean-local:
24         (cd $(srcdir); [ ! -f setup.py ] || $(PYTHON) setup.py clean -a)
25         rm -rf $(srcdir)/setup.py $(srcdir)/vici.egg-info $(builddir)/dist
26
27 install-exec-local: dist/vici-$(PACKAGE_VERSION)-py$(PYTHON_VERSION).egg
28         $(EASY_INSTALL) $(PYTHONEGGINSTALLDIR) \
29                 dist/vici-$(PACKAGE_VERSION)-py$(PYTHON_VERSION).egg
30
31 if USE_PY_TEST
32   TESTS = $(PY_TEST)
33 endif