Yamaban <foerster@lisas.de> Wed, 27 May 2015 00:08:37 +0300:
On Tue, 26 May 2015 22:50, Dmitriy Perlow wrote:
Yamaban on Tue, 26 May 2015 22:23:03 +0300:
Hi to all. I maintain monster-rpg-2 package at games repo. The game provided some > files at /usr/share/%name but now it should provide the single zip file > there. So I just updated the spec, rebuild packages and installed them. > For some reason /usr/share/%name' files weren't
On Tue, 26 May 2015 21:10, Dmitriy Perlow wrote: purged! So game tries to > load both files and zip file and fails.
Any tips please? Hi, Dmitriy If you are sure that ALL files in /usr/share/%name are replaced, I'd use a %preinstall scriptlet to remove the whole dir, just to be sure.
I am.
Necessary for this: your package "owns" (brings) the /usr/share/%name directory, and all the files in it.
Of course.
Thinking more on it, maybe the following as %preinstall scriptlet would be better / cleaner: [code] # !/usr/bin/sh # Cleanup in /usr/share/%name BEFORE install / update # due to change from discrete files to zipped archive PATH=/usr/bin/:$PATH # no dir, nothing to do test -d /usr/share/%name || exit files=`rpm -ql %name|grep /usr/share/%name|tr ' ' '?'|sed 's,/usr/share/%name/,./,'` # no files, nothing to do test -z $files && exit # change into dir, just to make sure cd /usr/share/%name test -n $files && rm $files #EOF [/code]
- Yamaban
Seems to be nice but where may it be placed into the spec file?
Huh? Normally, I put it after the %install and before the %files section of the spec file.
Types: %pre = before install / update %preun = before uninstall (e.g. use for remove info-docs handling)
These are new for me, thank you!
%post = after install / update %postun = after uninstall
Already known :)
usage here, simplified : [code] %install [...] %pre # Cleanup in /usr/share/%name BEFORE install / update # due to change from discrete files to zipped archive # no dir, nothing to do test -d %_datadir/%name || exit 0 rm %_datadir/%name/* %_datadir/%name/.??* exit 0
%files [...] [/code]
References: [0] https://en.opensuse.org/openSUSE:Packaging_scriptlet_snippets [1] http://rpm5.org/docs/rpm-guide.html#id3103565 [2] http://www.rpm.org/max-rpm-snapshot/
- Yamaban.
-- Best regards, Dmitriy DA(P).DarkneSS Perlow @ Linux x64 -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org