[Kimchi-devel] [PATCH] Fix issue #738 - Use *lib/kimchi instead of *lib/wok/plugins/kimchi

Lucio Correia luciojhc at linux.vnet.ibm.com
Tue Oct 13 18:00:46 UTC 2015


Part 1: Move back kimchi files to kimchi tree. Object store is a
special case that will be handled in a future patch.

Signed-off-by: Lucio Correia <luciojhc at linux.vnet.ibm.com>
---
 src/wok/config.py.in                                 |  2 +-
 src/wok/plugins/kimchi/Makefile.am                   | 20 +++++++++++---------
 src/wok/plugins/kimchi/contrib/kimchi.spec.fedora.in | 12 ++++++------
 src/wok/plugins/kimchi/contrib/kimchi.spec.suse.in   | 12 ++++++------
 src/wok/plugins/kimchi/vnc.py                        |  4 ++--
 5 files changed, 26 insertions(+), 24 deletions(-)

diff --git a/src/wok/config.py.in b/src/wok/config.py.in
index b33fb6b..e98d1de 100644
--- a/src/wok/config.py.in
+++ b/src/wok/config.py.in
@@ -116,7 +116,7 @@ class PluginPaths(Paths):
 
         if self.installed:
             self.plugin_dir = os.path.join('plugins', name)
-            self.state_dir = os.path.join(paths.state_dir, self.plugin_dir)
+            self.state_dir = os.path.join('@localstatedir@/lib', name)
             self.conf_dir = '@sysconfdir@/wok/plugins.d'
             self.src_dir = os.path.join('@wokdir@', self.plugin_dir)
             self.mo_dir = '@prefix@/share/locale'
diff --git a/src/wok/plugins/kimchi/Makefile.am b/src/wok/plugins/kimchi/Makefile.am
index 34ddef4..1080005 100644
--- a/src/wok/plugins/kimchi/Makefile.am
+++ b/src/wok/plugins/kimchi/Makefile.am
@@ -98,12 +98,12 @@ config.py: config.py.in Makefile
 
 install-deb: install
 	cp -R $(top_srcdir)/contrib/DEBIAN $(DESTDIR)/
-	mkdir -p $(DESTDIR)/$(localstatedir)/lib/wok/
+	mkdir -p $(DESTDIR)/$(localstatedir)/lib/kimchi
 	touch $(DESTDIR)/$(localstatedir)/lib/wok/objectstore
-	mkdir -p $(DESTDIR)/$(localstatedir)/lib/wok/plugins/kimchi/vnc-tokens
-	mkdir -p $(DESTDIR)/$(localstatedir)/lib/wok/plugins/kimchi/debugreports
-	mkdir -p $(DESTDIR)/$(localstatedir)/lib/wok/plugins/kimchi/screenshots
-	mkdir -p $(DESTDIR)/$(localstatedir)/lib/wok/plugins/kimchi/isos
+	mkdir -p $(DESTDIR)/$(localstatedir)/lib/kimchi/vnc-tokens
+	mkdir -p $(DESTDIR)/$(localstatedir)/lib/kimchi/debugreports
+	mkdir -p $(DESTDIR)/$(localstatedir)/lib/kimchi/screenshots
+	mkdir -p $(DESTDIR)/$(localstatedir)/lib/kimchi/isos
 
 
 deb: contrib/make-deb.sh
@@ -139,16 +139,18 @@ ChangeLog:
 	fi
 
 install-data-local:
-	$(MKDIR_P) $(DESTDIR)/$(localstatedir)/lib/wok/
+	$(MKDIR_P) $(DESTDIR)/$(localstatedir)/lib/kimchi/
 	touch $(DESTDIR)/$(localstatedir)/lib/wok/objectstore
 	$(MKDIR_P) $(DESTDIR)$(kimchidir)
 	$(INSTALL_DATA) API.json $(DESTDIR)$(kimchidir)/API.json
-	mkdir -p $(DESTDIR)/$(localstatedir)/lib/wok/plugins/kimchi/vnc-tokens
-	mkdir -p $(DESTDIR)/$(localstatedir)/lib/wok/plugins/kimchi/{debugreports,isos,screenshots}
+	mkdir -p $(DESTDIR)/$(localstatedir)/lib/kimchi/vnc-tokens
+	mkdir -p $(DESTDIR)/$(localstatedir)/lib/kimchi/debugreports
+	mkdir -p $(DESTDIR)/$(localstatedir)/lib/kimchi/screenshots
+	mkdir -p $(DESTDIR)/$(localstatedir)/lib/kimchi/isos
 
 uninstall-local:
 	$(RM) $(DESTDIR)$(kimchidir)/API.json
-	$(RM) -rf $(DESTDIR)/$(localstatedir)/lib/wok/plugins/kimchi
+	$(RM) -rf $(DESTDIR)/$(localstatedir)/lib/kimchi
 
 VERSION:
 	@if test -d .git; then                                \
diff --git a/src/wok/plugins/kimchi/contrib/kimchi.spec.fedora.in b/src/wok/plugins/kimchi/contrib/kimchi.spec.fedora.in
index f56d235..e4b7b6d 100644
--- a/src/wok/plugins/kimchi/contrib/kimchi.spec.fedora.in
+++ b/src/wok/plugins/kimchi/contrib/kimchi.spec.fedora.in
@@ -98,16 +98,16 @@ rm -rf $RPM_BUILD_ROOT
 %{_sysconfdir}/kimchi/distros.d/ubuntu.json
 %{_sysconfdir}/kimchi/distros.d/gentoo.json
 %{_sysconfdir}/kimchi/
-%{_sharedstatedir}/wok/plugins/kimchi/debugreports/
-%{_sharedstatedir}/wok/plugins/kimchi/isos/
-%{_sharedstatedir}/wok/plugins/kimchi/screenshots/
-%{_sharedstatedir}/wok/plugins/kimchi/vnc-tokens/
-%{_sharedstatedir}/wok/plugins/kimchi/
+%{_sharedstatedir}/kimchi/debugreports/
+%{_sharedstatedir}/kimchi/isos/
+%{_sharedstatedir}/kimchi/screenshots/
+%{_sharedstatedir}/kimchi/vnc-tokens/
+%{_sharedstatedir}/kimchi/
 %{_sharedstatedir}/wok/objectstore
 
 
 %changelog
-* Thu Jun 18 2015 Lucio Correia <luciojhc at linux.vnet.ibm.com> 1.6
+* Thu Jun 18 2015 Lucio Correia <luciojhc at linux.vnet.ibm.com> 2.0
 - Run kimchi as a plugin
 
 * Thu Feb 26 2015 Frédéric Bonnard <frediz at linux.vnet.ibm.com> 1.4.0
diff --git a/src/wok/plugins/kimchi/contrib/kimchi.spec.suse.in b/src/wok/plugins/kimchi/contrib/kimchi.spec.suse.in
index 64b9025..03dfa7b 100644
--- a/src/wok/plugins/kimchi/contrib/kimchi.spec.suse.in
+++ b/src/wok/plugins/kimchi/contrib/kimchi.spec.suse.in
@@ -85,16 +85,16 @@ rm -rf $RPM_BUILD_ROOT
 %{_sysconfdir}/kimchi/distros.d/ubuntu.json
 %{_sysconfdir}/kimchi/distros.d/gentoo.json
 %{_sysconfdir}/kimchi/
-%{_var}/lib/wok/plugins/kimchi/debugreports/
-%{_var}/lib/wok/plugins/kimchi/isos/
-%{_var}/lib/wok/plugins/kimchi/screenshots/
-%{_var}/lib/wok/plugins/kimchi/vnc-tokens/
-%{_var}/lib/wok/plugins/kimchi/
+%{_var}/lib/kimchi/debugreports/
+%{_var}/lib/kimchi/isos/
+%{_var}/lib/kimchi/screenshots/
+%{_var}/lib/kimchi/vnc-tokens/
+%{_var}/lib/kimchi/
 %{_var}/lib/wok/objectstore
 
 
 %changelog
-* Thu Jun 18 2015 Lucio Correia <luciojhc at linux.vnet.ibm.com> 1.6
+* Thu Jun 18 2015 Lucio Correia <luciojhc at linux.vnet.ibm.com> 2.0
 - Run kimchi as a plugin
 
 * Thu Feb 26 2015 Frédéric Bonnard <frediz at linux.vnet.ibm.com> 1.4.0
diff --git a/src/wok/plugins/kimchi/vnc.py b/src/wok/plugins/kimchi/vnc.py
index 2532449..1a2e59d 100644
--- a/src/wok/plugins/kimchi/vnc.py
+++ b/src/wok/plugins/kimchi/vnc.py
@@ -24,10 +24,10 @@ import os
 from multiprocessing import Process
 from websockify import WebSocketProxy
 
-from wok.config import config, paths
+from wok.config import config, paths, PluginPaths
 
 
-WS_TOKENS_DIR = '/var/lib/wok/vnc-tokens'
+WS_TOKENS_DIR = os.path.join(PluginPaths('kimchi').state_dir, 'vnc-tokens')
 
 
 def new_ws_proxy():
-- 
1.9.1




More information about the Kimchi-devel mailing list