On 27/05/2015 17:25, Ramon Medeiros wrote:
Commit 04d29530 was incomplete by not using DESTDIR on installation.
This can cause trouble when creating the rpm. Also, make install now is
installing correctly service and firewall configuration files.
---
Makefile.am | 54 +++++++++++++++++++++++++++++++------------
contrib/kimchi.spec.fedora.in | 3 ---
2 files changed, 39 insertions(+), 18 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 91a0fa2..46e0e0e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -116,26 +116,50 @@ ChangeLog:
install-data-local:
@if test -d /usr/lib/systemd/system/ ; then \
- $(INSTALL_DATA) contrib/kimchid.service.fedora
/usr/lib/systemd/system/kimchid.service; \
- systemctl daemon-reload; \
+ mkdir -p $(DESTDIR)/usr/lib/systemd/system/; \
+ $(INSTALL_DATA) contrib/kimchid.service.fedora
$(DESTDIR)/usr/lib/systemd/system/kimchid.service; \
elif test -d /etc/systemd/system; then \
- $(INSTALL_DATA) contrib/kimchid.service.fedora /etc/systemd/system/kimchid.service; \
- systemctl daemon-reload; \
- else \
- $(INSTALL_DATA) contrib/kimchid.sysvinit /etc/init.d/kimchid; \
- chmod +x /etc/init.d/kimchid; \
- fi
+ mkdir -p $(DESTDIR)/etc/systemd/system/; \
+ $(INSTALL_DATA) contrib/kimchid.service.fedora
$(DESTDIR)/etc/systemd/system/kimchid.service; \
+ else \
+ mkdir -p $(DESTDIR)/etc/init.d/ \
+ $(INSTALL_DATA) contrib/kimchid.sysvinit $(DESTDIR)/etc/init.d/kimchid; \
+ chmod +x $(DESTDIR)/etc/init.d/kimchid; \
+ if test -f /etc/fedora-release || test -f /etc/redhat-release; then \
+ $(INSTALL_DATA) contrib/kimchid-upstart.conf.fedora $(DESTDIR)/etc/init/kimchi.conf;
\
+ elif test -f /etc/debian_version; then \
+ $(INSTALL_DATA) contrib/kimchid-upstart.conf.debian $(DESTDIR)/etc/init/kimchi.conf;
\
+ fi; \
Why will we install the sysvinit script in a machine which uses upstart
script?
+ fi; \
+ if test -d /usr/lib/firewalld/services/; then \
+ mkdir -p $(DESTDIR)/usr/lib/firewalld/services/; \
+ $(INSTALL_DATA) src/firewalld.xml $(DESTDIR)/usr/lib/firewalld/services/kimchid.xml;
\
+ fi; \
Seems there is a problem in the indentation above.
+ mkdir -p
$(DESTDIR)/var/lib/kimchi/{debugreports,screenshots,vnc-tokens,isos}
+ touch $(DESTDIR)/var/lib/kimchi/objectstore
+ mkdir -p $(DESTDIR)/var/log/kimchi/
+ touch $(DESTDIR)/var/log/kimchi/kimchi-access.log
+ touch $(DESTDIR)/var/log/kimchi/kimchi-error.log
+ mkdir -p $(DESTDIR)/etc/kimchi/
+ touch $(DESTDIR)/etc/nginx/conf.d/kimchi.conf
I don't think we need it as those files will be created on demand on
Kimchi startup
uninstall-local:
@if test -f /usr/lib/systemd/system/kimchid.service; then \
- $(RM) /usr/lib/systemd/system/kimchid.service; \
- systemctl daemon-reload; \
- elif test -f /etc/systemd/system/kimchid.service; then \
- $(RM) /etc/systemd/system/kimchid.service; \
+ $(RM) $(DESTDIR)/usr/lib/systemd/system/kimchid.service; \
+ elif test -f $(DESTDIR)/etc/systemd/system/kimchid.service; then \
+ $(RM) $(DESTDIR)/etc/systemd/system/kimchid.service; \
elif test -f /etc/init.d/kimchid; then \
- $(RM) /etc/init.d/kimchid; \
- fi
-
+ $(RM) $(DESTDIR)/etc/init.d/kimchid; \
+ $(RM) $(DESTDIR)/etc/init/kimchi.conf; \
+ fi; \
+ if test -d /usr/lib/firewalld/services/; then \
+ $(RM) $(DESTDIR)/usr/lib/firewalld/services/kimchid.xml; \
+ fi; \
+ $(RM) -rf $(DESTDIR)/var/lib/kimchi
+ $(RM) -rf $(DESTDIR)/var/log/kimchi
+ $(RM) -rf $(DESTDIR)/etc/kimchi
+ $(RM) $(DESTDIR)/etc/nginx/conf.d/kimchi.conf
+
VERSION:
@if test -d .git; then \
git describe --abbrev=0 > $@; \
diff --git a/contrib/kimchi.spec.fedora.in b/contrib/kimchi.spec.fedora.in
index 30f8417..4e12327 100644
--- a/contrib/kimchi.spec.fedora.in
+++ b/contrib/kimchi.spec.fedora.in
@@ -98,9 +98,6 @@ touch %{buildroot}/%{_localstatedir}/log/kimchi/kimchi-error.log
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
You need to do the same for the SUSE spec, right?
%if 0%{?rhel} == 6