Generating a pkg config file with distutils

Tycho Andersen tycho at tycho.ws
Tue Mar 27 22:01:32 EDT 2012


Hi all,

I'm distributing a package which for various legacy reasons needs to
generate a pkgconfig file from a template (adding version numbers,
prefixes, etc.) and install the file in the right place
($PREFIX/lib/pkgconfig/foo.pc in most cases).

Currently, I have a rather nasty hack to implement all this, but
presumably there's a better way to do it. If I could even get the
installation part (e.g. using the right MANIFEST.in incantations),
that would be wonderful. Reading the MANIFEST.in docs [1], it's not
obvious that you can control the install locations of these files
(i.e., .pc files must be installed to the above location to be
correctly detected by other packages).

Is what I want to do possible, or should I continue using my nasty
hack?

TIA!

Tycho

[1]: http://docs.python.org/distutils/sourcedist.html#commands



More information about the Python-list mailing list