[Kimchi-devel] [PATCH 2/3] Don't let empty directories left on suse

Ramon Medeiros ramonn at linux.vnet.ibm.com
Mon Dec 15 13:09:08 UTC 2014


On 12/15/2014 10:14 AM, Aline Manera wrote:
>
> On 12/12/2014 11:52 AM, Ramon Medeiros wrote:
>> 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 at 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 be75590..b1679a8 100644
>> --- a/contrib/kimchi.spec.suse.in
>> +++ b/contrib/kimchi.spec.suse.in
>> @@ -52,10 +52,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
>> +
>
> Use the macros here too.
>
>>   # Install the SysV init scripts
>>   install -Dm 0755 contrib/kimchid.sysvinit 
>> %{buildroot}%{_initrddir}/kimchid
>>   -
>>   %post
>>   chkconfig kimchid on
>>   @@ -75,6 +83,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
>> @@ -83,6 +92,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
>> @@ -91,6 +101,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/
>
> Couldn't you use %{_sharedstatedir} here too? As you use for fedora spec.
I can't use the %{_sharedstatedir}  because this macro points to 
/usr/share in suse. I search for a equivalent macro on suse, but did not 
found.
>> +%{_localstatedir}/log/kimchi/*
>> +%{_localstatedir}/log/kimchi/
>>     %changelog
>>   * Tue Feb 11 2014 Crístian Viana <vianac at linux.vnet.ibm.com> 1.1.0
>


-- 
Ramon Nunes Medeiros
RHEV-H Blue for Troy, Sparta, zBX, zHelix and zGryphon  Focal Point
Software Engineer - Linux Technology Center Brazil
IBM Systems & Technology Group
Phone : +55 19 2132 7878
ramonn at br.ibm.com




More information about the Kimchi-devel mailing list