[lxc-devel] [PATCH v2] make install should create $LXCPATH, cache directories

Dwight Engen dwight.engen at oracle.com
Fri Nov 30 14:44:18 UTC 2012


The $LXCPATH (default /var/lib/lxc) directory was not being created by
make install, so unless it gets created by some other means
(packaging tools), commands such as lxc-create will fail. Also ensure
the cache directory (default /var/cache/lxc, used by some templates)
gets created.
---
 Makefile.am | 4 ++++
 lxc.spec.in | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/Makefile.am b/Makefile.am
index f99ad1c..7b32326 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -9,6 +9,10 @@ EXTRA_DIST = autogen.sh lxc.spec CONTRIBUTING MAINTAINERS ChangeLog
 pcdatadir = $(libdir)/pkgconfig
 pcdata_DATA = lxc.pc
 
+install-data-local:
+	$(MKDIR_P) $(DESTDIR)$(LXCPATH)
+	$(MKDIR_P) $(DESTDIR)$(localstatedir)/cache/lxc
+
 ChangeLog::
 	@touch ChangeLog
 
diff --git a/lxc.spec.in b/lxc.spec.in
index 3f4d5b6..094c34d 100644
--- a/lxc.spec.in
+++ b/lxc.spec.in
@@ -97,6 +97,8 @@ rm -rf %{buildroot}
 %defattr(-,root,root)
 %{_libdir}/*.so.*
 %{_libdir}/%{name}
+ at LXCPATH@
+%{_localstatedir}/cache/lxc
 %attr(4555,root,root) %{_libexecdir}/%{name}/lxc-init
 
 %files devel
-- 
1.7.11.7





More information about the lxc-devel mailing list