From: Dmitry Kalinkin Date: Thu, 21 Oct 2021 23:34:08 +0000 (-0400) Subject: Fix python bindings installation in case of empty DESTDIR X-Git-Tag: v1.8.0~16^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1138%2Fhead;p=thirdparty%2Frrdtool-1.x.git Fix python bindings installation in case of empty DESTDIR The current behaviour is to install the extension to ./usr/local (if prefix is /usr/local), so it ends up in the temporary build directory instead of the intended absolute prefix. The slash after $(DESTDIR) is needed to make empty DESTDIR mean installation to / instead of making the prefix to mean a relative path. We make it triple slash as POSIX reserves double slashes to possibly have a special treatment by the OS. The change for travis is needed as "make install" is run as root, and once the python extension is actually installed, it leaves a root-owned .egg-info file. --- diff --git a/.travis.yml b/.travis.yml index f5f0f314..0e4ddfa8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,7 +32,7 @@ script: - podchecker doc/*.pod - sudo make install - cd bindings/perl-shared && make test - - cd ../python && python setup.py test + - cd ../python && sudo chown -R travis rrdtool.egg-info && python setup.py test - /opt/rrdtool-master/bin/rrdtool - /opt/rrdtool-master/share/rrdtool/examples/4charts.pl - cd ../.. diff --git a/bindings/Makefile.am b/bindings/Makefile.am index 1c32a4ae..d32a0305 100644 --- a/bindings/Makefile.am +++ b/bindings/Makefile.am @@ -42,7 +42,7 @@ install-data-local: && ( cd ${builddir}/python \ && env BUILDLIBDIR=${abs_top_builddir}/src/.libs \ $(PYTHON) ${abs_srcdir}/python/setup.py install \ - --skip-build --root=$(DESTDIR) --prefix=$(prefix) \ + --skip-build --root=$(DESTDIR)/// --prefix=$(prefix) \ --exec-prefix=$(exec_prefix)) \ || true diff --git a/bindings/Makefile.in b/bindings/Makefile.in index 729b5795..13aabcb0 100644 --- a/bindings/Makefile.in +++ b/bindings/Makefile.in @@ -738,7 +738,7 @@ install-data-local: && ( cd ${builddir}/python \ && env BUILDLIBDIR=${abs_top_builddir}/src/.libs \ $(PYTHON) ${abs_srcdir}/python/setup.py install \ - --skip-build --root=$(DESTDIR) --prefix=$(prefix) \ + --skip-build --root=$(DESTDIR)/// --prefix=$(prefix) \ --exec-prefix=$(exec_prefix)) \ || true