[Kimchi-devel] [PATCH 12/38] Update kimchi plugin build scripts

Lucio Correia luciojhc at linux.vnet.ibm.com
Thu May 21 21:33:25 UTC 2015


---
 plugins/kimchi/contrib/DEBIAN/control.in     |    5 +-
 plugins/kimchi/contrib/kimchi.spec.fedora.in |  103 ++++----------------------
 plugins/kimchi/contrib/kimchi.spec.suse.in   |   54 ++++----------
 3 files changed, 33 insertions(+), 129 deletions(-)

diff --git a/plugins/kimchi/contrib/DEBIAN/control.in b/plugins/kimchi/contrib/DEBIAN/control.in
index 0747d0f..ed8c2e1 100644
--- a/plugins/kimchi/contrib/DEBIAN/control.in
+++ b/plugins/kimchi/contrib/DEBIAN/control.in
@@ -3,7 +3,8 @@ Version: @PACKAGE_VERSION@
 Section: base
 Priority: optional
 Architecture: all
-Depends: python-cherrypy3 (>= 3.2.0),
+Depends: wok
+         python-cherrypy3 (>= 3.2.0),
          python-cheetah,
          python-imaging,
          python-configobj,
@@ -32,4 +33,4 @@ Depends: python-cherrypy3 (>= 3.2.0),
 Build-Depends: libxslt,
                python-lxml
 Maintainer: Aline Manera <alinefm at br.ibm.com>
-Description: Kimchi web server
+Description: Kimchi web application
diff --git a/plugins/kimchi/contrib/kimchi.spec.fedora.in b/plugins/kimchi/contrib/kimchi.spec.fedora.in
index 30f8417..2ab0ae7 100644
--- a/plugins/kimchi/contrib/kimchi.spec.fedora.in
+++ b/plugins/kimchi/contrib/kimchi.spec.fedora.in
@@ -7,6 +7,7 @@ BuildArch:	noarch
 Group:		System Environment/Base
 License:	LGPL/ASL2
 Source0:	%{name}-%{version}.tar.gz
+Requires:	wok
 Requires:	qemu-kvm
 Requires:	gettext-devel
 Requires:	libvirt
@@ -50,20 +51,8 @@ Requires:	python-imaging
 BuildRequires:    python-unittest2
 %endif
 
-%if 0%{?with_systemd}
-Requires:	systemd
-Requires:	firewalld
-Requires(post): systemd
-Requires(preun): systemd
-Requires(postun): systemd
-%endif
-
-%if 0%{?with_systemd}
-BuildRequires: systemd-units
-%endif
-
 %description
-Web server application to manage KVM/Qemu virtual machines
+Web application to manage KVM/Qemu virtual machines
 
 
 %prep
@@ -83,85 +72,31 @@ make
 rm -rf %{buildroot}
 make DESTDIR=%{buildroot} install
 
-%if 0%{?with_systemd}
-
 # create /var/lib/kimchi structure
-mkdir -p %{buildroot}/%{_sharedstatedir}/kimchi/{debugreports,screenshots,vnc-tokens,isos}
+mkdir -p %{buildroot}/%{_sharedstatedir}/kimchi/{debugreports,screenshots,isos}
 touch %{buildroot}/%{_sharedstatedir}/kimchi/objectstore
 
-# create /var/log/kimchi structure
-mkdir -p %{buildroot}/%{_localstatedir}/log/kimchi/
-touch %{buildroot}/%{_localstatedir}/log/kimchi/kimchi-access.log
-touch %{buildroot}/%{_localstatedir}/log/kimchi/kimchi-error.log
-
-# create /etc/kimchi structure
-mkdir -p %{buildroot}/%{_sysconfdir}/kimchi/
-touch %{buildroot}/%{_sysconfdir}/nginx/conf.d/kimchi.conf
-
-# Install the systemd scripts
-install -Dm 0644 contrib/kimchid.service.fedora %{buildroot}%{_unitdir}/kimchid.service
-install -Dm 0640 src/firewalld.xml %{buildroot}%{_prefix}/lib/firewalld/services/kimchid.xml
-%endif
-
-%if 0%{?rhel} == 6
-# Install the upstart script
-install -Dm 0755 contrib/kimchid-upstart.conf.fedora %{buildroot}/etc/init/kimchid.conf
-%endif
-%if 0%{?rhel} == 5
-# Install the SysV init scripts
-install -Dm 0755 contrib/kimchid.sysvinit %{buildroot}%{_initrddir}/kimchid
-%endif
-
-%post
-if [ $1 -eq 1 ] ; then
-    /bin/systemctl enable kimchid.service >/dev/null 2>&1 || :
-    # Initial installation
-    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
-fi
-
-
-%preun
-
-if [ $1 -eq 0 ] ; then
-    # Package removal, not upgrade
-    /bin/systemctl --no-reload disable kimchid.service > /dev/null 2>&1 || :
-    /bin/systemctl stop kimchid.service > /dev/null 2>&1 || :
-fi
-
-exit 0
-
-
-%postun
-if [ "$1" -ge 1 ] ; then
-    /bin/systemctl try-restart kimchid.service >/dev/null 2>&1 || :
-fi
-exit 0
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %files
 %attr(-,root,root)
-%{_bindir}/kimchid
-%{python_sitelib}/kimchi/*.py*
-%{python_sitelib}/kimchi/control/*.py*
-%{python_sitelib}/kimchi/control/vm/*.py*
-%{python_sitelib}/kimchi/model/*.py*
-%{python_sitelib}/kimchi/xmlutils/*.py*
-%{python_sitelib}/kimchi/API.json
-%{python_sitelib}/kimchi/plugins/*.py*
-%{python_sitelib}/kimchi/
+%{python_sitelib}/wok/plugins/kimchi/*.py*
+%{python_sitelib}/wok/plugins/kimchi/control/*.py*
+%{python_sitelib}/wok/plugins/kimchi/control/vm/*.py*
+%{python_sitelib}/wok/plugins/kimchi/model/*.py*
+%{python_sitelib}/wok/plugins/kimchi/API.json
+%{python_sitelib}/wok/plugins/kimchi/
 %{_datadir}/kimchi/doc/API.md
 %{_datadir}/kimchi/doc/README.md
 %{_datadir}/kimchi/doc/README-federation.md
 %{_datadir}/kimchi/doc/kimchi-guest.png
 %{_datadir}/kimchi/doc/kimchi-templates.png
 %{_prefix}/share/locale/*/LC_MESSAGES/kimchi.mo
-%{_datadir}/kimchi/config/ui/*.xml
-%{_datadir}/kimchi/ui/
-%{_datadir}/kimchi
-%{_sysconfdir}/nginx/conf.d/kimchi.conf.in
-%{_sysconfdir}/nginx/conf.d/kimchi.conf
+%{_datadir}/wok/plugins/kimchi/ui/config/*.xml
+%{_datadir}/wok/plugins/kimchi/ui/
+%{_datadir}/wok/plugins/kimchi
 %{_sysconfdir}/kimchi/kimchi.conf
 %{_sysconfdir}/kimchi/template.conf
 %{_sysconfdir}/kimchi/distros.d/debian.json
@@ -172,25 +107,17 @@ rm -rf $RPM_BUILD_ROOT
 %{_sysconfdir}/kimchi/
 %{_sharedstatedir}/kimchi/debugreports/
 %{_sharedstatedir}/kimchi/screenshots/
-%{_sharedstatedir}/kimchi/vnc-tokens/
 %{_sharedstatedir}/kimchi/isos/
 %{_sharedstatedir}/kimchi/
 %{_localstatedir}/log/kimchi/*
 %{_localstatedir}/log/kimchi/
 %{_mandir}/man8/kimchid.8.gz
 
-%if 0%{?with_systemd}
-%{_unitdir}/kimchid.service
-%{_prefix}/lib/firewalld/services/kimchid.xml
-%endif
-%if 0%{?rhel} == 6
-/etc/init/kimchid.conf
-%endif
-%if 0%{?rhel} == 5
-%{_initrddir}/kimchid
-%endif
 
 %changelog
+* Mon May 18 2015 Lucio Correia <luciojhc at linux.vnet.ibm.com> 1.x
+- Run kimchi as a plugin
+
 * Thu Feb 26 2015 Frédéric Bonnard <frediz at linux.vnet.ibm.com> 1.4.0
 - Add man page for kimchid
 
diff --git a/plugins/kimchi/contrib/kimchi.spec.suse.in b/plugins/kimchi/contrib/kimchi.spec.suse.in
index bf85661..3074a2e 100644
--- a/plugins/kimchi/contrib/kimchi.spec.suse.in
+++ b/plugins/kimchi/contrib/kimchi.spec.suse.in
@@ -7,6 +7,7 @@ BuildArch:	noarch
 Group:		System Environment/Base
 License:	LGPL/ASL2
 Source0:	%{name}-%{version}.tar.gz
+Requires:	wok
 Requires:	kvm
 Requires:	gettext-tools
 Requires:	libvirt
@@ -41,7 +42,7 @@ Requires:       python-ordereddict
 %endif
 
 %description
-Web server application to manage KVM/Qemu virtual machines
+Web application to manage KVM/Qemu virtual machines
 
 %prep
 %setup
@@ -55,54 +56,29 @@ rm -rf %{buildroot}
 make DESTDIR=%{buildroot} install
 
 # create /var/lib/kimchi structure
-mkdir -p %{buildroot}/%{_var}/lib/kimchi/{debugreports,screenshots,vnc-tokens,isos}
+mkdir -p %{buildroot}/%{_var}/lib/kimchi/{debugreports,screenshots,isos}
 touch %{buildroot}/%{_var}/lib/kimchi/objectstore
 
-# create /var/log/kimchi structure
-mkdir -p %{buildroot}/%{_localstatedir}/log/kimchi/
-touch %{buildroot}/%{_localstatedir}/log/kimchi/kimchi-access.log
-touch %{buildroot}/%{_localstatedir}/log/kimchi/kimchi-error.log
-
-# create /etc/kimchi structure
-mkdir -p %{buildroot}/%{_sysconfdir}/kimchi/
-
-# create nginx configuration
-touch %{buildroot}/%{_sysconfdir}/nginx/conf.d/kimchi.conf
-
-# Install the SysV init scripts
-install -Dm 0755 contrib/kimchid.sysvinit %{buildroot}%{_initrddir}/kimchid
-
-%post
-chkconfig kimchid on
-
-%preun
-service kimchid stop
-
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %files
 %attr(-,root,root)
-%{_bindir}/kimchid
-%{python_sitelib}/kimchi/*.py*
-%{python_sitelib}/kimchi/control/*.py*
-%{python_sitelib}/kimchi/control/vm/*.py*
-%{python_sitelib}/kimchi/model/*.py*
-%{python_sitelib}/kimchi/xmlutils/*.py*
-%{python_sitelib}/kimchi/API.json
-%{python_sitelib}/kimchi/plugins/*.py*
-%{python_sitelib}/kimchi/
+%{python_sitelib}/wok/plugins/kimchi/*.py*
+%{python_sitelib}/wok/plugins/kimchi/control/*.py*
+%{python_sitelib}/wok/plugins/kimchi/control/vm/*.py*
+%{python_sitelib}/wok/plugins/kimchi/model/*.py*
+%{python_sitelib}/wok/plugins/kimchi/API.json
+%{python_sitelib}/wok/plugins/kimchi/
 %{_datadir}/kimchi/doc/API.md
 %{_datadir}/kimchi/doc/README.md
 %{_datadir}/kimchi/doc/README-federation.md
 %{_datadir}/kimchi/doc/kimchi-guest.png
 %{_datadir}/kimchi/doc/kimchi-templates.png
 %{_prefix}/share/locale/*/LC_MESSAGES/kimchi.mo
-%{_datadir}/kimchi/config/ui/*.xml
-%{_datadir}/kimchi/ui/
-%{_datadir}/kimchi
-%{_sysconfdir}/nginx/conf.d/kimchi.conf.in
-%{_sysconfdir}/nginx/conf.d/kimchi.conf
+%{_datadir}/wok/plugins/kimchi/ui/config/*.xml
+%{_datadir}/wok/plugins/kimchi/ui/
+%{_datadir}/wok/plugins/kimchi
 %{_sysconfdir}/kimchi/kimchi.conf
 %{_sysconfdir}/kimchi/template.conf
 %{_sysconfdir}/kimchi/distros.d/debian.json
@@ -110,12 +86,9 @@ rm -rf $RPM_BUILD_ROOT
 %{_sysconfdir}/kimchi/distros.d/opensuse.json
 %{_sysconfdir}/kimchi/distros.d/ubuntu.json
 %{_sysconfdir}/kimchi/distros.d/gentoo.json
-%{_sysconfdir}/kimchi
-%{_initrddir}/kimchid
 %{_sysconfdir}/kimchi/
 %{_var}/lib/kimchi/debugreports/
 %{_var}/lib/kimchi/screenshots/
-%{_var}/lib/kimchi/vnc-tokens/
 %{_var}/lib/kimchi/isos/
 %{_var}/lib/kimchi/
 %{_localstatedir}/log/kimchi/*
@@ -123,6 +96,9 @@ rm -rf $RPM_BUILD_ROOT
 %{_mandir}/man8/kimchid.8.gz
 
 %changelog
+* Mon May 18 2015 Lucio Correia <luciojhc at linux.vnet.ibm.com> 1.x
+- Run kimchi as a plugin
+
 * Thu Feb 26 2015 Frédéric Bonnard <frediz at linux.vnet.ibm.com> 1.4.0
 - Add man page for kimchid
 
-- 
1.7.1




More information about the Kimchi-devel mailing list