]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
vici: Support out-of-tree build of Python Egg
authorTobias Brunner <tobias@strongswan.org>
Tue, 31 Mar 2015 13:40:30 +0000 (15:40 +0200)
committerTobias Brunner <tobias@strongswan.org>
Thu, 21 May 2015 15:19:09 +0000 (17:19 +0200)
We also don't require setup.py to exist during cleanup, as e.g. with
make distcheck the source directory is not writable when the build directory
is cleaned, so setup.py can't be created (to just get removed again anyway
if VICI and the Python Eggs haven't been enabled previously).

src/libcharon/plugins/vici/python/Makefile.am

index f5173787062263a57b2a8299dd437b1660b57ebd..163b23473e685b284ec95e42e74f084d3a2ef60c 100644 (file)
@@ -8,21 +8,21 @@ EXTRA_DIST = LICENSE MANIFEST.in \
        vici/protocol.py \
        vici/session.py
 
-setup.py: $(srcdir)/setup.py.in
+$(srcdir)/setup.py: $(srcdir)/setup.py.in
        $(AM_V_GEN) sed \
        -e "s:@EGG_VERSION@:$(PACKAGE_VERSION):" \
        $(srcdir)/setup.py.in > $@
 
 all-local: dist/vici-$(PACKAGE_VERSION)-py$(PYTHON_VERSION).egg
 
-dist/vici-$(PACKAGE_VERSION)-py$(PYTHON_VERSION).egg: $(EXTRA_DIST) setup.py
+dist/vici-$(PACKAGE_VERSION)-py$(PYTHON_VERSION).egg: $(EXTRA_DIST) $(srcdir)/setup.py
        (cd $(srcdir); $(PYTHON) setup.py bdist_egg \
                -b $(shell readlink -f $(builddir))/build \
                -d $(shell readlink -f $(builddir))/dist)
 
-clean-local: setup.py
-       $(PYTHON) setup.py clean -a
-       rm -rf vici.egg-info dist setup.py
+clean-local:
+       (cd $(srcdir); [ ! -f setup.py ] || $(PYTHON) setup.py clean -a)
+       rm -rf $(srcdir)/setup.py $(srcdir)/vici.egg-info $(builddir)/dist
 
 install-exec-local: dist/vici-$(PACKAGE_VERSION)-py$(PYTHON_VERSION).egg
        $(EASY_INSTALL) $(PYTHONEGGINSTALLDIR) \