From 25491f062ae2104663c19e9ad843c99e1e81f00f Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Thu, 21 Oct 2021 19:34:08 -0400 Subject: [PATCH] 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. --- .travis.yml | 2 +- bindings/Makefile.am | 2 +- bindings/Makefile.in | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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 -- 2.47.2