2 ms·
This guide looks quite nice; there are certainly tools I've not used before. One thing that's good about Debian packages (and I'm sure many other formats): it'
by chriswarbo 12y ago
This guide looks quite nice; there are certainly tools I've not used before.
One thing that's good about Debian packages (and I'm sure many other formats): it's really easy to get something that works; everything else is optional extras. For example (if I remember correctly; I've not used Debian for a while):
# Set up directory structure:
mkdir -p my_package/DEBIAN
mkdir -p my_package/usr/bin
# Copy in the files you want the package to contain
cp my_binary my_package/usr/bin/
# Add metadata
echo "2" > my_package/DEBIAN/version
# Write skeletal my_package/DEBIAN/control here
# Build, install and use
dpkg -b my_package
dpkg -i my_package*.deb
my_binary
Of course, such a package is never going to be accepted into Debian's repos, but that's not the point: it makes it less likely to say "screw it, I'll dump stuff into /opt manually".
There's also the excellent "checkinstall" program, which does a pretty good job of turning autoconf-style source repos into decent packages.
With any of these approaches, the package manager keeps track of the files so they can all be removed in the future (just don't write crazy destructive pre/post scripts!).