6

My application uses some shared libraries, which i need to package with the binary, and as per Debian Policy Rules

It is recommended that supporting files and run-time support programs that do not need to be invoked manually by users, but are nevertheless required for the package to function, be placed (if they are binary) in a subdirectory of /usr/lib, preferably under /usr/lib/package-name.

So, I put my shared library e.g. libabc.so in /usr/lib/myapp/ directory. After creating the debian package the binary fails to load as /usr/lib/myapp/ is not searched by the loader to load the directory. They don't recommend using RPATH in the binary.

So what changes should i make in the Debian package, in the postinst file or anything else to make it work.

2
  • What's the nature of the binary that fails to load your shared library? Where is it installed? Is it using the system's dynamic linker, or dlopen? Jan 23, 2013 at 15:47
  • @RobieBasak It is a Qt application, which uses libmetalink.so library. The binary is installed in /usr/bin/ . And i don't know what dlopen or dynamic linker is. Jan 23, 2013 at 15:59

1 Answer 1

0

No, your shared library should be installed:

  • to /usr/lib directly
  • or to /usr/lib/<package-name> with a shortcut in /usr/lib

The manual means:

  • by supporting files like plugins and modules (in binary form) that your program would scan them by itself. They could be shared libs .so or any other format, even custom formats.
  • by run-time support programs the executable programs that are used by your program, but are not useful for the user to run them directly, so that note suggests to avoid installing them to /usr/bin

The support files in text format (not generated-binary at least) are more convenient to be installed in /usr/share/<package-name>

I would recommend to you, making quick look on examples from other packages.

tree /usr/lib/libreoffice/
tree /usr/lib/gimp/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .