[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Help needed for packaging a library



On Fri, 2008-03-28 at 21:06 -0300, Felipe Sateler wrote:
> Helmut Grohne wrote:
> >> Why is my library architecture-dependent? How can I make it
> >> architecture-independent, assuming the source code doesn't care about the
> >> architecture (I don't think a printf should be a problem)?

Take a look at /usr/share/pkgconfig/ - the pc files in there are icon
themes, mime data, doc preparation - those are the only things that
should have .pc files in /usr/share, basically build tools and system
data, not compiled libraries.

The packaged library (libfoo.so) must be architecture-dependent and
therefore the .pc file needs to be in /usr/lib/ with all the other
library .pc files.

If this is unclear, maybe you should not be packaging a library in the
first place as shared library packages are always more complex than a
typical application package.

> I'd say that in pretty much all non-trivial libraries the pc file is
> system-dependant, so I would go with /usr/lib by default even if in your case
> the pkgconfig file is trivial.

Most .pc files are trivial - they must be complete, that's the main
point. 

prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
...

That may look like a template but there are various modes that will need
each and all of those to be specified in full. One or two packages seem
to think that these are expendable - they are *not*. The shortest a .pc
file can get would be:

prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: foo
Description: foo Library.
Version: 0.7.5
Requires: glib-2.0
Requires.private: bar
Libs: -L${libdir} -lfoo
Libs.private: -lm
Cflags: -I${includedir}/foo

Requires.private and Libs.private should be used wherever possible.

-- 


Neil Williams
=============
http://www.data-freedom.org/
http://www.nosoftwarepatents.com/
http://www.linux.codehelp.co.uk/


Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: