[Kimchi-devel] [PATCH 3/5] [WOK] Update build and config files to new plugins path.
pvital at linux.vnet.ibm.com
pvital at linux.vnet.ibm.com
Tue Sep 29 13:08:15 UTC 2015
From: Paulo Vital <pvital at linux.vnet.ibm.com>
Updated build (configure.ac and Makefile.am) files to reflect the new paths of
plugins after move to src/wok structure.
Moved the creation of objectstore file from the Wok's Makefile.am to the Kimchi
one and changed the hard-coded '$(DESTDIR)/var' to '$(DESTDIR)/$(localstatedir)'
path.
Also, updated src/wok/config.py.in file with new plugins path and correct paths
of symbolic links and POTFILES.
Signed-off-by: Paulo Vital <pvital at linux.vnet.ibm.com>
---
Makefile.am | 20 ++++++++++----------
configure.ac | 16 ++++++++--------
src/wok/Makefile.am | 2 +-
src/wok/config.py.in | 7 ++++---
src/wok/plugins/kimchi/Makefile.am | 18 +++++++++++-------
src/wok/plugins/kimchi/contrib/kimchi.spec.fedora.in | 11 ++++++-----
src/wok/plugins/kimchi/contrib/kimchi.spec.suse.in | 11 ++++++-----
src/wok/plugins/sample/config.status | 2 +-
src/wok/plugins/sample/po/POTFILES.in | 2 +-
9 files changed, 48 insertions(+), 41 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index c7914d0..337aa24 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -16,7 +16,8 @@
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-SUBDIRS = src ui docs contrib po plugins
+
+SUBDIRS = src ui docs contrib po
man_MANS = docs/wokd.8
@@ -35,11 +36,11 @@ EXTRA_DIST = \
$(NULL)
-PEP8_BLACKLIST = *src/wok/config.py,*src/wok/i18n.py,*plugins/kimchi
+PEP8_BLACKLIST = *src/wok/config.py,*src/wok/i18n.py,*src/wok/plugins/kimchi
SKIP_PYFLAKES_ERR = "\./src/wok/websocket\.py"
-I18N_FILES = plugins/*/i18n.py \
+I18N_FILES = src/wok/plugins/*/i18n.py \
src/wok/i18n.py \
$(NULL)
@@ -69,7 +70,6 @@ all-local:
install-deb: install
cp -R $(top_srcdir)/contrib/DEBIAN $(DESTDIR)/
- touch $(DESTDIR)/var/lib/wok/objectstore
$(MKDIR_P) $(DESTDIR)/etc/init
$(MKDIR_P) $(DESTDIR)/usr/lib/firewalld/services
cp -R $(top_srcdir)/contrib/wokd-upstart.conf.debian \
@@ -123,10 +123,10 @@ install-data-local:
mkdir -p $(DESTDIR)/usr/lib/firewalld/services/; \
$(INSTALL_DATA) src/firewalld.xml $(DESTDIR)/usr/lib/firewalld/services/wokd.xml; \
fi; \
- touch $(DESTDIR)/var/lib/wok/objectstore
- mkdir -p $(DESTDIR)/var/log/wok/
- touch $(DESTDIR)/var/log/wok/wok-access.log
- touch $(DESTDIR)/var/log/wok/wok-error.log
+ mkdir -p $(DESTDIR)/$(localstatedir)/lib/wok/
+ mkdir -p $(DESTDIR)/$(localstatedir)/log/wok/
+ touch $(DESTDIR)/$(localstatedir)/log/wok/wok-access.log
+ touch $(DESTDIR)/$(localstatedir)/log/wok/wok-error.log
mkdir -p $(DESTDIR)/etc/wok/
$(INSTALL_DATA) src/dhparams.pem $(DESTDIR)/etc/wok/dhparams.pem
touch $(DESTDIR)/etc/nginx/conf.d/wok.conf
@@ -141,8 +141,8 @@ uninstall-local:
if test -d /usr/lib/firewalld/services/; then \
$(RM) $(DESTDIR)/usr/lib/firewalld/services/wokd.xml; \
fi; \
- $(RM) -rf $(DESTDIR)/var/lib/wok
- $(RM) -rf $(DESTDIR)/var/log/wok
+ $(RM) -rf $(DESTDIR)/$(localstatedir)/lib/wok
+ $(RM) -rf $(DESTDIR)/$(localstatedir)/log/wok
$(RM) -rf $(DESTDIR)/etc/wok
$(RM) $(DESTDIR)/etc/nginx/conf.d/wok.conf
diff --git a/configure.ac b/configure.ac
index e11a17d..6d4119b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -94,14 +94,14 @@ AC_CONFIG_FILES([
src/wok/control/Makefile
src/wok/model/Makefile
src/wok/xmlutils/Makefile
- plugins/Makefile
- plugins/sample/Makefile
- plugins/sample/po/Makefile.in
- plugins/sample/sample.conf
- plugins/sample/ui/Makefile
- plugins/sample/ui/config/Makefile
- plugins/sample/ui/js/Makefile
- plugins/sample/ui/pages/Makefile
+ src/wok/plugins/Makefile
+ src/wok/plugins/sample/Makefile
+ src/wok/plugins/sample/po/Makefile.in
+ src/wok/plugins/sample/sample.conf
+ src/wok/plugins/sample/ui/Makefile
+ src/wok/plugins/sample/ui/config/Makefile
+ src/wok/plugins/sample/ui/js/Makefile
+ src/wok/plugins/sample/ui/pages/Makefile
ui/Makefile
ui/css/Makefile
ui/css/fontawesome/Makefile
diff --git a/src/wok/Makefile.am b/src/wok/Makefile.am
index 6e00907..47aefd5 100644
--- a/src/wok/Makefile.am
+++ b/src/wok/Makefile.am
@@ -17,7 +17,7 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-SUBDIRS = control model xmlutils
+SUBDIRS = control model xmlutils plugins
wok_PYTHON = $(filter-out config.py, $(wildcard *.py))
diff --git a/src/wok/config.py.in b/src/wok/config.py.in
index 616c013..219eee2 100644
--- a/src/wok/config.py.in
+++ b/src/wok/config.py.in
@@ -80,7 +80,7 @@ class Paths(object):
self.log_dir = self.add_prefix('log')
self.conf_dir = self.add_prefix('src')
self.src_dir = self.add_prefix('src/wok')
- self.plugins_dir = self.add_prefix('plugins')
+ self.plugins_dir = self.add_prefix('src/wok/plugins')
self.mo_dir = self.add_prefix('mo')
def get_prefix(self):
@@ -108,14 +108,15 @@ class PluginPaths(Paths):
def __init__(self, name):
super(PluginPaths, self).__init__()
- self.plugin_dir = os.path.join('plugins', name)
if self.installed:
- self.state_dir = '@localstatedir@/lib/%s' % name
+ self.plugin_dir = os.path.join('plugins', name)
+ self.state_dir = os.path.join(paths.state_dir, self.plugin_dir)
self.conf_dir = '@sysconfdir@/wok/plugins.d'
self.src_dir = os.path.join('@wokdir@', self.plugin_dir)
self.mo_dir = '@prefix@/share/locale'
else:
+ self.plugin_dir = os.path.join(paths.plugins_dir, name)
self.state_dir = self.add_prefix(os.path.join(self.plugin_dir,
'data'))
self.conf_dir = self.add_prefix(self.plugin_dir)
diff --git a/src/wok/plugins/kimchi/Makefile.am b/src/wok/plugins/kimchi/Makefile.am
index 49c835e..34ddef4 100644
--- a/src/wok/plugins/kimchi/Makefile.am
+++ b/src/wok/plugins/kimchi/Makefile.am
@@ -98,10 +98,12 @@ config.py: config.py.in Makefile
install-deb: install
cp -R $(top_srcdir)/contrib/DEBIAN $(DESTDIR)/
- mkdir -p $(DESTDIR)/var/lib/kimchi/vnc-tokens
- mkdir -p $(DESTDIR)/var/lib/kimchi/debugreports
- mkdir -p $(DESTDIR)/var/lib/kimchi/screenshots
- mkdir -p $(DESTDIR)/var/lib/kimchi/isos
+ mkdir -p $(DESTDIR)/$(localstatedir)/lib/wok/
+ 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
deb: contrib/make-deb.sh
@@ -137,14 +139,16 @@ ChangeLog:
fi
install-data-local:
+ $(MKDIR_P) $(DESTDIR)/$(localstatedir)/lib/wok/
+ touch $(DESTDIR)/$(localstatedir)/lib/wok/objectstore
$(MKDIR_P) $(DESTDIR)$(kimchidir)
$(INSTALL_DATA) API.json $(DESTDIR)$(kimchidir)/API.json
- mkdir -p $(DESTDIR)/var/lib/kimchi/vnc-tokens
- mkdir -p $(DESTDIR)/var/lib/kimchi/{debugreports,isos,screenshots}
+ mkdir -p $(DESTDIR)/$(localstatedir)/lib/wok/plugins/kimchi/vnc-tokens
+ mkdir -p $(DESTDIR)/$(localstatedir)/lib/wok/plugins/kimchi/{debugreports,isos,screenshots}
uninstall-local:
$(RM) $(DESTDIR)$(kimchidir)/API.json
- $(RM) -rf $(DESTDIR)/var/lib/kimchi
+ $(RM) -rf $(DESTDIR)/$(localstatedir)/lib/wok/plugins/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 0db3d7e..9097043 100644
--- a/src/wok/plugins/kimchi/contrib/kimchi.spec.fedora.in
+++ b/src/wok/plugins/kimchi/contrib/kimchi.spec.fedora.in
@@ -95,11 +95,12 @@ rm -rf $RPM_BUILD_ROOT
%{_sysconfdir}/kimchi/distros.d/ubuntu.json
%{_sysconfdir}/kimchi/distros.d/gentoo.json
%{_sysconfdir}/kimchi/
-%{_sharedstatedir}/kimchi/debugreports/
-%{_sharedstatedir}/kimchi/isos/
-%{_sharedstatedir}/kimchi/screenshots/
-%{_sharedstatedir}/kimchi/vnc-tokens/
-%{_sharedstatedir}/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}/wok/objectstore
%changelog
diff --git a/src/wok/plugins/kimchi/contrib/kimchi.spec.suse.in b/src/wok/plugins/kimchi/contrib/kimchi.spec.suse.in
index e466961..2fbdaf7 100644
--- a/src/wok/plugins/kimchi/contrib/kimchi.spec.suse.in
+++ b/src/wok/plugins/kimchi/contrib/kimchi.spec.suse.in
@@ -82,11 +82,12 @@ rm -rf $RPM_BUILD_ROOT
%{_sysconfdir}/kimchi/distros.d/ubuntu.json
%{_sysconfdir}/kimchi/distros.d/gentoo.json
%{_sysconfdir}/kimchi/
-%{_var}/lib/kimchi/debugreports/
-%{_var}/lib/kimchi/isos/
-%{_var}/lib/kimchi/screenshots/
-%{_var}/lib/kimchi/vnc-tokens/
-%{_var}/lib/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/wok/objectstore
%changelog
diff --git a/src/wok/plugins/sample/config.status b/src/wok/plugins/sample/config.status
index 6cd6b4f..7297963 120000
--- a/src/wok/plugins/sample/config.status
+++ b/src/wok/plugins/sample/config.status
@@ -1 +1 @@
-../../config.status
\ No newline at end of file
+../../../../config.status
\ No newline at end of file
diff --git a/src/wok/plugins/sample/po/POTFILES.in b/src/wok/plugins/sample/po/POTFILES.in
index 7dbfb6c..0aaf102 100644
--- a/src/wok/plugins/sample/po/POTFILES.in
+++ b/src/wok/plugins/sample/po/POTFILES.in
@@ -1,2 +1,2 @@
# List of source files which contain translatable strings.
-plugins/sample/ui/pages/*.tmpl
+src/wok/plugins/sample/ui/pages/*.tmpl
--
2.4.3
More information about the Kimchi-devel
mailing list