PDA

View Full Version : Shared library spec file


schander
1st March 2012, 01:37 PM
Hi,
Can anyone help me write a spec file for installing shared libraries?
What I'm not sure about is what to include in the %files section, as it will need the headers aswell as the shared libs etc
I have created a package for debian and the structure is:
/usr/lib/libusb_pico-1.0.la
/usr/lib/libps6000.la
/usr/lib/libps6000.so.1.0.0
/usr/lib/libusb_pico-1.0.so.1.0.0
/usr/lib/libusb_pico-1.0.a
/usr/lib/pkgconfig/libusb_pico-1.0.pc
/usr/share/doc/ps6000linux/changelog.Debian.gz
/usr/share/doc/ps6000linux/copyright
/usr/share/doc/ps6000linux/README.Debian
/usr/include/libusb_pico-1.0/libusb.h
/usr/include/libps6000-1.3/PicoStatus.h
/usr/include/libps6000-1.3/ps6000Api.h
/DEBIAN/control
/DEBIAN/postrm
/DEBIAN/shlibs
/DEBIAN/md5sums
/DEBIAN/postinst

How do I replicate this? Should I just put the everything listed above under /usr in the %files section (excluding the debian specific stuff)?

Thanks
Satpal

vallimar
1st March 2012, 06:06 PM
Easiest to just look at a package that already does what you want as an example.
In your case, something similar might be libusb1. Just install the srpm and look over
the spec file.

schander
2nd March 2012, 10:07 AM

Easiest to just look at a package that already does what you want as an example.
In your case, something similar might be libusb1. Just install the srpm and look over
the spec file.

D'oh. What a simple solution. :D

Thanks
Satpal

schander
5th March 2012, 08:50 AM
Hi folks,
I looked at the libusb1 spec file. I tried to build the libusb package, however because I don't know the mappings that are used by the build system I have to build it as root, which on all accounts is a big no no, from what I've read.
So my question is does anyone know what the standard mappings are for building these rpm's, e.g. what should %{_lib} be mapped to?
The libusb src rpm i'm trying to build is from here (http://rpmfind.net/linux/rpm2html/search.php?query=libusb1)

Thanks
Satpal

leigh123linux
5th March 2012, 08:53 AM
http://fedoraproject.org/wiki/Packaging:RPMMacros#Build_flags_macros