[PATCH 0/2] Issue #670: openSUSE: problem while building Kimchi

Ramon Medeiros (2): Issue #670: openSUSE: problem while building Kimchi Issue #670: openSUSE: problem while building Kimchi Makefile.am | 4 ++-- contrib/kimchi.spec.suse.in | 40 ++++++++++++++++++++++++++++++++++++---- 2 files changed, 38 insertions(+), 6 deletions(-) -- 2.1.0

openSuSE spec was not considering systemctl systems. So, a condition argument add systemd files if present. Also, change os version detection to the correct macros. Signed-off-by: Ramon Medeiros <ramonn@linux.vnet.ibm.com> --- contrib/kimchi.spec.suse.in | 40 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/contrib/kimchi.spec.suse.in b/contrib/kimchi.spec.suse.in index fa55cc5..f42d386 100644 --- a/contrib/kimchi.spec.suse.in +++ b/contrib/kimchi.spec.suse.in @@ -37,10 +37,16 @@ BuildRequires: libxslt-tools BuildRequires: openssl BuildRequires: python-lxml -%if 0%{?sles_version} == 11 +%if 0%{?suse_version} == 1100 Requires: python-ordereddict %endif +%if 0%{?suse_version} > 1140 +%global with_systemd 1 +BuildRequires: systemd-rpm-macros +%{?systemd_requires} +%endif + %description Web server application to manage KVM/Qemu virtual machines @@ -56,10 +62,30 @@ rm -rf %{buildroot} make DESTDIR=%{buildroot} install %post -chkconfig kimchid on +%if 0%{?with_systemd} + %service_add_post kimchid.service + /bin/systemctl daemon-reload >/dev/null 2>&1 || : +%else + chkconfig kimchid on +%endif +exit 0 + %preun -service kimchid stop +%if 0%{?with_systemd} + %service_del_preun kimchid.service +%else + service kimchid stop +%endif +exit 0 + + +%postun +%if 0%{?with_systemd} + %service_del_postun kimchid.service +%endif +exit 0 + %clean rm -rf $RPM_BUILD_ROOT @@ -94,7 +120,6 @@ rm -rf $RPM_BUILD_ROOT %{_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/ @@ -105,6 +130,13 @@ rm -rf $RPM_BUILD_ROOT %{_localstatedir}/log/kimchi/ %{_mandir}/man8/kimchid.8.gz +%if 0%{?with_systemd} +%{_unitdir}/kimchid.service +%else +%{_initrddir}/kimchid +%endif + + %changelog * Thu Feb 26 2015 Frédéric Bonnard <frediz@linux.vnet.ibm.com> 1.4.0 - Add man page for kimchid -- 2.1.0

Fix directory checking on Makefile. Signed-off-by: Ramon Medeiros <ramonn@linux.vnet.ibm.com> --- Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index 1a0c8e7..0b46086 100644 --- a/Makefile.am +++ b/Makefile.am @@ -115,11 +115,11 @@ ChangeLog: fi install-data-local: - @if test -d $(systemdsystemunitdir) ; then \ + @if test "$(systemdsystemunitdir)" != "" && test -d $(systemdsystemunitdir) ; then \ mkdir -p $(DESTDIR)/$(systemdsystemunitdir); \ $(INSTALL_DATA) contrib/kimchid.service.fedora $(DESTDIR)/$(systemdsystemunitdir)/kimchid.service; \ else \ - mkdir -p $(DESTDIR)/etc/init.d/ \ + mkdir -p $(DESTDIR)/etc/init.d/; \ $(INSTALL_DATA) contrib/kimchid.sysvinit $(DESTDIR)/etc/init.d/kimchid; \ chmod +x $(DESTDIR)/etc/init.d/kimchid; \ fi; \ -- 2.1.0

'make install' on openSUSE 13.1 is still failing with the following error: /usr/bin/install -c -m 644 src/dhparams.pem /root/kimchi/tmp//etc/kimchi/dhparams.pem touch /root/kimchi/tmp//etc/nginx/conf.d/kimchi.conf touch: cannot touch ‘/root/kimchi/tmp//etc/nginx/conf.d/kimchi.conf’: No such file or directory Makefile:975: recipe for target 'install-data-local' failed make[2]: *** [install-data-local] Error 1 make[2]: Leaving directory '/root/kimchi' Makefile:789: recipe for target 'install-am' failed make[1]: *** [install-am] Error 2 make[1]: Leaving directory '/root/kimchi' Makefile:494: recipe for target 'install-recursive' failed I will apply those 2 patches that fix the rpm generation but the bug will keep open until the above problem get solved. On 26/06/2015 13:25, Ramon Medeiros wrote:
Ramon Medeiros (2): Issue #670: openSUSE: problem while building Kimchi Issue #670: openSUSE: problem while building Kimchi
Makefile.am | 4 ++-- contrib/kimchi.spec.suse.in | 40 ++++++++++++++++++++++++++++++++++++---- 2 files changed, 38 insertions(+), 6 deletions(-)
participants (2)
-
Aline Manera
-
Ramon Medeiros