Gmane
Picon
From: Taj Morton <tajmorton@...>
Subject: Re: a few more skeletons: speex, lua, libmikmod, and physfs
Newsgroups: gmane.comp.autopackage.devel
Date: 2006-02-27 23:22:52 GMT (2 years, 20 weeks, 1 day, 23 hours and 38 minutes ago)
On 2/25/06, Karl Pietrzak <kap4020@...> wrote:
> Attached are a few skeletons I had to write.  Any feedback would be
> appreciated, so in the future I can write better skeletons.  Thanks! :)
Hi Karl,
I took a look at the skeletons, overall looks pretty good, but just a few notes:
1. All skeletons *must* set INTERFACE_VERSIONS.

2. Use DisplayName for a short name/description, e.g., "zlib
compression library", "mikmod sound library", "speex audio codec",
etc. DisplayName is what is shown in the "checking" window of the
interface.

3: speex skeleton: You set INTERFACE_VERSIONS with testForLib -v.
testForLib -v returns the version of the installed library, instead of
the the IV. For example:
/usr/lib/libspeex.so.1.2.1

testForLib -i libspeex.so
1.2

testForLib -v libspeex.so
1.2.1

Although apparently libspeex.so doesn't include the software version,
so don't worry about it. Just set INTERFACE_VERSIONS to testForLib -i
libspeex.so. See the API docs for more info on testForLib:
http://autopackage.sunsite.dk/api/system-checking-and-dependency-handling.html#func-testForLib

4. physfs: physfs doesn't use libtool versioning. This means that
testForLib can't be used to detect it automatically. In fact, its
versioning scheme is a little questionable, and *very* hard to parse
automagically. physfs creates libs like this:
libphysfs-<version>.so.0.0.0
So, you would need to manually get the list of paths to look in for
libs (/etc/ld.so.conf and $LD_LIBRARY_PATH) and do something like this
inside each dir:

libs=$(ls libphysfs-[1234567890].[1234567890].so*)
for f in $libs; do
  if [ -f $f ]; then
    echo $f | awk -F'-' ' {print $2 }' | head -c3
    echo " "
  fi
done

That echos something that could be stuck into INTERFACE_VERSIONS. But
there's still a problem:
libphysfs installs a symlink called libphysfs.so that links to
libphysfs-<version>.so. This is a problem for 2 reasons:
First, someone might link against libphysfs-<version>.so instead of
libphysfs.so. This basically makes <version> of libphysfs a hard
requirement, because the ELF loader looks for a library with a SONAME
of libphys-<VERSION>. (Well, I think that is how it works, but I don't
know too much about ELF, so I could be wrong).

The other problem with this is that a version of libphysfs could be
released with a different API that breaks backwards compatibility, and
libphysfs.so would be pointing to the latest version of libphysfs
(which has no SONAME versioning information). However, when an app
that uses the older libphysfs starts, it fails to start because it
tries to use the new version of libphysfs, when it was designed to use
the old one.

Basically, libphysfs is a mess when it comes to versioning. :(
Statically linking it is really the only way to go.

5. lua: Can you get the version of lua by running it (lua -v or
something?) You could use locateCommand and countDownVersions:
SOFTWARE_VERSIONS=$(locateCommand -o lua -v)
INTERFACE_VERSIONS=`countDownVersions $SOFTWARE_VERSIONS`

Of course, this assumes that lua -v returns the version and nothing
else. Of course, if it returns the copyright notice or something, you
can always use head and awk to get just the version. This method seems
more reliable to me for some reason...

6. libmiknod: Use INTERFACE_VERSIONS=`testForLib -i libmikmod.so` In
the [Notes] you say that SOFTWARE_VERSIONS follows INTERFACE_VERSIONS,
but I have version 3.1.10 installed but libraries with a SONAME of
libmikmod.so.2.0.4. No big, just don't bother to set
SOFTWARE_VERSIONS.

Wow, this email is far too long. :)

Cheers,
--
Taj
http://www.wildgardenseed.com/Taj/blog

Need a GMail invite? Email me.
Peace cannot be kept by force; it
can only be achieved by understanding.
                -- A. Einstein

---------------------------------------------------------------------
To unsubscribe, e-mail: autopackage-dev-unsubscribe@...
For additional commands, e-mail: autopackage-dev-help@...