[opensuse-packaging] Don't overwrite highscore file on update
I have packaged Tower Toppler in home:RedDwarf. If a /var/games/toppler/toppler.hsc file exists the game uses it to store highscores for all users, if doesn't exists it uses ~/.toppler/toppler.hsc. I use %verify(not size md5 mtime) %attr(-, root, games) %{_localstatedir}/games/%{name}/%{name}.hsc so any user in games group can use it and rpm -V doesn't complains. But when I update the package a new empty file is created that deletes previous highscores! What's the best way to package this file so old highscores aren't lost? And since I'm with this... - The binary should go to /usr/bin or /usr/games? There is any openSUSE official policy? - What are the plans for %suse_update_desktop_file? Should not desktop-file-install from freedesktop.org be enough? I have never fully understood how X-SuSE-translate is used. When you want to support other distros isn't funny to %if every package with a .desktop file. Thanks. --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Christian Morales Vega wrote:
I have packaged Tower Toppler in home:RedDwarf. If a /var/games/toppler/toppler.hsc file exists the game uses it to store highscores for all users, if doesn't exists it uses ~/.toppler/toppler.hsc. I use %verify(not size md5 mtime) %attr(-, root, games) %{_localstatedir}/games/%{name}/%{name}.hsc so any user in games group can use it and rpm -V doesn't complains. But when I update the package a new empty file is created that deletes previous highscores! What's the best way to package this file so old highscores aren't lost?
You could try putting %config(noreplace) at the start of the line.
And since I'm with this... - The binary should go to /usr/bin or /usr/games? There is any openSUSE official policy?
Please use /usr/games - nearly all binaries in games repository do that. Once the package is working as you expect, please drop me a note and I will move it to games repository so you can maintain it there.
- What are the plans for %suse_update_desktop_file? Should not desktop-file-install from freedesktop.org be enough? I have never fully understood how X-SuSE-translate is used. When you want to support other distros isn't funny to %if every package with a .desktop file.
%suse_update_desktop_file also translates strings like Name or Comment - use that macro for SUSE. It also puts X-SuSE-translate identifier there so original .desktop file cannot contain it. -- Best Regards / S pozdravom, Pavol RUSNAK SUSE LINUX, s.r.o Package Maintainer Lihovarska 1060/12 PGP 0xA6917144 19000 Praha 9, CR prusnak[at]suse.cz http://www.suse.cz --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
2008/7/28 Pavol Rusnak <prusnak@suse.cz>:
Christian Morales Vega wrote:
I have packaged Tower Toppler in home:RedDwarf. If a /var/games/toppler/toppler.hsc file exists the game uses it to store highscores for all users, if doesn't exists it uses ~/.toppler/toppler.hsc. I use %verify(not size md5 mtime) %attr(-, root, games) %{_localstatedir}/games/%{name}/%{name}.hsc so any user in games group can use it and rpm -V doesn't complains. But when I update the package a new empty file is created that deletes previous highscores! What's the best way to package this file so old highscores aren't lost?
You could try putting %config(noreplace) at the start of the line. Works, thanks. I wasn't sure marking a highscore file like a configuration file was a good idea.
And since I'm with this... - The binary should go to /usr/bin or /usr/games? There is any openSUSE official policy?
Please use /usr/games - nearly all binaries in games repository do that. Once the package is working as you expect, please drop me a note and I will move it to games repository so you can maintain it there.
OK. But games repository only builds openSUSE/SLE packages. What people do to make the package build also for other distros? Should all the distro specific %ifs be removed from the packages hosted in games repository?
- What are the plans for %suse_update_desktop_file? Should not desktop-file-install from freedesktop.org be enough? I have never fully understood how X-SuSE-translate is used. When you want to support other distros isn't funny to %if every package with a .desktop file.
%suse_update_desktop_file also translates strings like Name or Comment - use that macro for SUSE. It also puts X-SuSE-translate identifier there so original .desktop file cannot contain it.
But this is something automatic, something that translators grep for or...? Some posibilities I have though about: - Translators regulary grep all spec files for X-SuSE-translate=true and manually edit the spec files. - A script automatically makes the translations using a "word translations database" (I would not expect too much quality) - Translation teams mantain a separate file and a script merges it to the .desktop file if X-SuSE-translate is true - ... And with any of them... is this something that only applies to official packages, or OBS packages are also translated? Perhaps is something different I have not thought about. But would not be easier, from a distro interoperativility POV, to just make whatever is done now *always* if no X-SuSE-translate=false is found? So if for whatever reason a packager doesn't wants translations (I suppose this will be only a few cases) he only needs to make a "cat X-SuSE-translate=false >> file.desktop". In all other cases he could use the freedesktop.org tool to check the file and openSUSE tools would make his translation work automatically. --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
participants (2)
-
Christian Morales Vega
-
Pavol Rusnak