[Mageia-dev] get-skype package for submission

Anssi Hannula anssi.hannula at iki.fi
Sat Jun 11 10:14:34 CEST 2011


On 11.06.2011 03:05, Barry Jackson wrote:
> On 10/06/11 18:06, Anssi Hannula wrote:

>> 3. You cp files to %_datadir using a wildcard (*), but these
>>     files may not be removed on uninstallation as you only have filename
>>     lists for avatars/sounds/langs. While it may work now (I didn't
>>     test, I hope you did), this will cause unnoticed problems when the
>>     skype tarball contents change.
> 
> The wildcard is used to move the remaining files which are all
> individually handled by touch and the dir is removed by a %ghost.
> I was just saving spec lines.
> 
> Yes it does work fine and all files/dirs are removed on uninstall.
> 
> The tarball contents can't change or the md5sum would fail :\

I meant that when updating the package to a new version it is easy to
not notice some added files in the tarball, leaving the wildcard in
place but not add respective %ghosted files.

>> 4. Provide the script/commandline used to create the filelist files.
> 
> Do you mean the avatars.txt etc.
> It was all done semi-manually, but I will write a script if necessary.
> It did cross my mind, but it was quicker to just copy/paste into txt files.
> I was assuming I could maintain it manually.

Maintaining manually is fine, just add a comment beside the SourceXX
lines to tell what to do.

>> 5. Versionize the filelist files to make sure they are renegerated
>>     when the package is updated to a new version (avatars-%version.txt)
> 
> OK - again I was expecting to maintain it manually.

Yes, but this makes sure they are not forgotten (i.e. the pkg build
fails completely if you forget to update them, instead of creating a
broken package).

>> 6. Your usage of /tmp seems unsafe security-wise. What if some user
>>     has created something under /tmp/skype-%version already?
> 
> Hmm.. point taken
> 
>>     Instead use mktemp to create a temporary directory.
> 
> OK ... but:
> I can't figure out how to get a temp filename into a %define
> If I use
> %define mytmp $(mktemp -d -q)
> then every reference to the %define generates a new tmp file.
> How can I assign the output of a command expansion to a %define so it's
> evaluated only once on assignment?

%global mytmp %(mktemp -d -q)

However, that doesn't do what you want. That creates a temporary
directory in the system where package build is not done, while you want
to create a temporary directory in the user system. See below.

> I can use a variable in %pre but that is invisible in %post as it's in
> another shell so I'm sorta stuck on that for now :(

Probably the easiest way is to use a fixed location under
%{_localstatedir}/lib/%{name} for the tarball instead. Then you can use
mktemp locally in %post.

Also, is there a need to use -q for mktemp?


-- 
Anssi Hannula


More information about the Mageia-dev mailing list