Hi,
I'm doing cross-platform development and I want to build a nice, self-contained (!) package for Linux. I know that that's not the way it's usually done, but the application requires all data in one place, so I'm installing it into /opt, like many other proprietary software packages do. I will eventually provide deb and rpm packages, but it will only be .tar.gz for now. The user should extract it somewhere and it should work. I'd rather not have an installer.
First my questions, then the details:
- How do other people package proprietary software for Linux?
- Are there tools for packaging software including shared libraries?
Now for some details: This is my project's (I call it foo for this purpose) layout:
- foo (binary)
- config.ini
- data
Now in the package, there will be two additional elements:
- libs
- foo.sh
libs will contain all the shared libraries the project requires, and foo.sh is a script that sets LD_LIBRARY_PATH to include libs. Therefore, the user will execute foo.sh and the program should start.
I have a shell script that packages the software in the following steps:
- Create empty directory and copy foo.sh to it
- Invoke the build process and make install into the new directory
- Copy shared libs from the filesystem
- Package everything as .tar.gz
What do you think of this? There are some problems with this approach:
- I have to hard code all dependencies twice (once in CMake, once in the packaging script)
- I have to define the version number twice (once in the source code, once in the packaging script)
How do you do it?
Edit: Another question that just came up: How do you determine on which libraries your software depends? I did an ldd foo, but there's an awfull lot. I looked at how WorldOfGoo packages look, and they ship only very few libraries. How can I make assumptions about which library will be present on a user's system and which won't? Just install all targeted distributions into a virtual matine and see what's required?