[lxc-devel] [PATCH] $(localstatedir) != $(prefix)/var

Guido Trotter ultrotter at google.com
Fri Mar 27 20:37:37 UTC 2009


The current code assumes that localstatedir is equal to $(prefix)/var,
thus failing for example on debian, where prefix is /usr and
localstatedir is /var. This patch fixes this, and also sets the
permission of $(localstatedir)/lxc to be 2777 rather than just 777 thus
making it slightly better for concurrent usage by all users.

Also, we need to take into account DESTDIR, when installing, to avoid
altering the machine if we were supposed to install in a separate area,
for example for packaging.

Signed-off-by: Guido Trotter <ultrotter at quaqua.net>
---
 src/lxc/Makefile.am |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/lxc/Makefile.am b/src/lxc/Makefile.am
index 1c13c85..93b568a 100644
--- a/src/lxc/Makefile.am
+++ b/src/lxc/Makefile.am
@@ -130,5 +130,6 @@ lxc_version_SOURCES = lxc_version.c
 lxc_version_LDADD = liblxc.la
 
 install-exec-local:
-	@mkdir -p $(localstatedir) && mkdir -p $(prefix)/var/lxc && \
-	chmod ugo+rw $(prefix)/var/lxc
+	@mkdir -p $(DESTDIR)$(localstatedir) && \
+	mkdir -p $(DESTDIR)$(localstatedir)/lxc && \
+	chmod 2777 $(DESTDIR)$(localstatedir)/lxc
-- 
1.5.6.5





More information about the lxc-devel mailing list