Score:0

Including shared libraries in a .deb package

nz flag

I have a binary file that is dependent on a few shared libraries, I am trying to package this binary with the required libraries and install them alongside my app.

The libraries were built by myself, and are not available in any apt repository. Is it possible to bundle my shared libraries with my binary?

Essentially I want to run dpkg -i my-app.deb and it installs my-app binary in /usr/local/bin and my libraries in /usr/local/lib

The current directory setup fails when running:

dpkg-deb --build debian/

My directory structure looks like this:

my-app-1603/
├── debian
│   ├── changelog
│   ├── control
│   ├── copyright
│   ├── install
│   ├── rules
│   ├── source
│   │   └── format
│   └── my-app-docs.docs
└── my-app_1603
    ├── libbitcoin-client.so.0.0.0
    ├── libbitcoin-explorer.so.0.0.0
    ├── libbitcoin-network.so.0.0.0
    ├── libbitcoin-protocol.so.0.0.0
    ├── libbitcoin-system.so.0.0.0
    ├── libsecp256k1.so.0.0.0
    └── my-app

note: I am providing prebuilt software, and did not include the source code (though this can be done if required, building just takes quite a bit of time)

thanks in advance if you are able to help

pl flag
Yes, this is possible. It's outside the guidelines for some Linux distributions, but if you're making a standalone deb for people to download, install, and run, then it's fine.
Melon avatar
nz flag
Thanks for the reply, this is intended only for internal use and won't be published anywhere. With that being said, what would be the correct way to do this with libraries that arent included in default repositories? Creating my own PPA and publishing these libraries are a dependency? Thanks
pl flag
Launchpad PPAs are designed for open source software. You'd need to publish source packages and have launchpad build them. In that case it's cleaner to do a package for each library, and one for the application, and have the application depend on the libraries. If you publish in your own (non-PPA) repo, you can largely do whatever you like, bundling wise.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.