r/linux_programming • • May 12 '15
question How to distribute software in a compatible way with any distribution?
Hi there /r/linux_programming !
I've developed a little project in python, mysql and php mainly and I want to write some kind of installer to make easy for anybody to install it.
I'd need to check for dependencies and write in /etc a folder and a couple of config file.
I've digged about it but I don't get anything clear. I think a pkgbuild could be what I want but I'm not sure.
Any help here please :)
3
Upvotes
4
u/protestor May 13 '15
It's usual to make an installer that writes in
Even better than this is to make a .tar.gz with the directory structure of your program (a bin directory with binaries, an etc directory with config files, a share directory with images and other assets, etc). And make it work in any directory that the user extracts. That way, the user chooses whether it wants to extract to /opt (and be like 1), or to /usr/local (and be like 2), or to its own home directory (and be like 3).
Better than that: this approach makes it very easy for people to turn your .tar.gz into a distro package (such as Arch Linux, Debian, etc). Even if you don't provide a package yourself, perhaps someone will upload one to Arch Linux's AUR, etc.
PS: it's NOT okay to write files to /etc (or expect files there) if you're a third party package, not managed by the package manager!
2
u/syswizard May 12 '15
If it's a fairly simple installation just include a install.sh installation script inside of a tarball. Write the script to create all the files, databases, etc.
Otherwise, take a look at Autotools.
1
u/LHCGreg May 14 '15
fpm makes it easy to build .rpm and .deb packages. You can then either just distribute the .deb and .rpm files or host an APT repository for the .deb's with aptly and host a yum repository for the .rpm's with createrepo.
0
u/souenzzo Jul 05 '15
!/usr/bin/env python3
is a good way to start.