v2:
Fix suse based on fedora
v3:
Put ubuntu changes on Makefile
Use the variables instead path
Ramon Medeiros (3):
Remove empty directories after rpm -e kimchi on fedora
Don't let empty directories left on suse
Remove directories under /var/lib/kimchi if empty on ubuntu
Makefile.am | 5 +++++
contrib/kimchi.spec.fedora.in | 21 ++++++++++++++++++++-
contrib/kimchi.spec.suse.in | 20 +++++++++++++++++++-
3 files changed, 44 insertions(+), 2 deletions(-)
--
1.8.3.1
Show replies by date
Some directories were not removed on rpm -e due no declaration on %files
section. Also, the directory was being created in runtime. Now, it is
being created on rpm build.
Signed-off-by: Ramon Medeiros <ramonn(a)linux.vnet.ibm.com>
---
contrib/kimchi.spec.fedora.in | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/contrib/kimchi.spec.fedora.in b/contrib/kimchi.spec.fedora.in
index 8172897..e75018e 100644
--- a/contrib/kimchi.spec.fedora.in
+++ b/contrib/kimchi.spec.fedora.in
@@ -82,6 +82,16 @@ 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}
+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
+
# 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
@@ -147,7 +157,6 @@ exit 0
# Rollback SELinux rules
semanage permissive -d httpd_t
-
%clean
rm -rf $RPM_BUILD_ROOT
@@ -161,6 +170,7 @@ rm -rf $RPM_BUILD_ROOT
%{python_sitelib}/kimchi/xmlutils/*.py*
%{python_sitelib}/kimchi/API.json
%{python_sitelib}/kimchi/plugins/*.py*
+%{python_sitelib}/kimchi/
%{_datadir}/kimchi/doc/API.md
%{_datadir}/kimchi/doc/README.md
%{_datadir}/kimchi/doc/README-federation.md
@@ -169,6 +179,7 @@ rm -rf $RPM_BUILD_ROOT
%{_prefix}/share/locale/*/LC_MESSAGES/kimchi.mo
%{_datadir}/kimchi/config/ui/*.xml
%{_datadir}/kimchi/ui/
+%{_datadir}/kimchi
%{_sysconfdir}/kimchi/kimchi.conf
%{_sysconfdir}/kimchi/nginx.conf.in
%{_sysconfdir}/kimchi/distros.d/debian.json
@@ -176,6 +187,14 @@ 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/
+%{_sharedstatedir}/kimchi/debugreports/
+%{_sharedstatedir}/kimchi/screenshots/
+%{_sharedstatedir}/kimchi/vnc-tokens/
+%{_sharedstatedir}/kimchi/isos/
+%{_sharedstatedir}/kimchi/
+%{_localstatedir}/log/kimchi/*
+%{_localstatedir}/log/kimchi/
%if 0%{?with_systemd}
%{_unitdir}/kimchid.service
--
1.8.3.1
Some directories were not removed on rpm -e due no declaration on %files
section. Also, the directory was being created in runtime. Now, it is
being created on rpm build.
Signed-off-by: Ramon Medeiros <ramonn(a)linux.vnet.ibm.com>
---
contrib/kimchi.spec.suse.in | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/contrib/kimchi.spec.suse.in b/contrib/kimchi.spec.suse.in
index ad01ff6..0c51dfb 100644
--- a/contrib/kimchi.spec.suse.in
+++ b/contrib/kimchi.spec.suse.in
@@ -51,10 +51,18 @@ make
rm -rf %{buildroot}
make DESTDIR=%{buildroot} install
+# create /var/lib/kimchi structure
+mkdir -p %{buildroot}/var/lib/kimchi/{debugreports,screenshots,vnc-tokens,isos}
+touch %{buildroot}/var/lib/kimchi/objectstore
+
+# create /var/log/kimchi structure
+mkdir -p %{buildroot}/var/log/kimchi/
+touch %{buildroot}/var/log/kimchi/kimchi-access.log
+touch %{buildroot}/var/log/kimchi/kimchi-error.log
+
# Install the SysV init scripts
install -Dm 0755 contrib/kimchid.sysvinit %{buildroot}%{_initrddir}/kimchid
-
%post
chkconfig kimchid on
@@ -74,6 +82,7 @@ rm -rf $RPM_BUILD_ROOT
%{python_sitelib}/kimchi/xmlutils/*.py*
%{python_sitelib}/kimchi/API.json
%{python_sitelib}/kimchi/plugins/*.py*
+%{python_sitelib}/kimchi/
%{_datadir}/kimchi/doc/API.md
%{_datadir}/kimchi/doc/README.md
%{_datadir}/kimchi/doc/README-federation.md
@@ -82,6 +91,7 @@ rm -rf $RPM_BUILD_ROOT
%{_prefix}/share/locale/*/LC_MESSAGES/kimchi.mo
%{_datadir}/kimchi/config/ui/*.xml
%{_datadir}/kimchi/ui/
+%{_datadir}/kimchi
%{_sysconfdir}/kimchi/kimchi.conf
%{_sysconfdir}/kimchi/nginx.conf.in
%{_sysconfdir}/kimchi/distros.d/debian.json
@@ -90,6 +100,14 @@ rm -rf $RPM_BUILD_ROOT
%{_sysconfdir}/kimchi/distros.d/ubuntu.json
%{_sysconfdir}/kimchi/distros.d/gentoo.json
%{_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/*
+%{_localstatedir}/log/kimchi/
%changelog
* Tue Feb 11 2014 CrÃstian Viana <vianac(a)linux.vnet.ibm.com> 1.1.0
--
1.8.3.1
Add the directory structure in the buildroot. Dpkg automatically removes
empty directories.
Signed-off-by: Ramon Medeiros <ramonn(a)linux.vnet.ibm.com>
---
Makefile.am | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/Makefile.am b/Makefile.am
index 62b10fc..36e12d0 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -68,6 +68,11 @@ all-local:
install-deb: install
cp -R $(top_srcdir)/contrib/DEBIAN $(DESTDIR)/
+ mkdir -p $(DESTDIR)/var/lib/kimchi/debugreports
+ mkdir -p $(DESTDIR)/var/lib/kimchi/screenshots
+ mkdir -p $(DESTDIR)/var/lib/kimchi/vnc-tokens
+ mkdir -p $(DESTDIR)/var/lib/kimchi/isos
+ touch $(DESTDIR)/var/lib/kimchi/objectstore
$(MKDIR_P) $(DESTDIR)/etc/init
$(MKDIR_P) $(DESTDIR)/usr/lib/firewalld/services
cp -R $(top_srcdir)/contrib/kimchid-upstart.conf.debian \
--
1.8.3.1
Applied. Thanks.
Regards,
Aline Manera