6 ms·
If you're a developer, try to package your own things for the distros you care about. And accept patches that fix packaging issues. Think about how much easier
by zdw 13y ago
If you're a developer, try to package your own things for the distros you care about. And accept patches that fix packaging issues. Think about how much easier your ops friends, and the continuous integration systems and similar will have it if all they have to do is run an "apt get" or "port install" to get a fully built version of your code.
Things that help:
http://fedoraproject.org/wiki/How_to_create_an_RPM_package http://fedoraproject.org/wiki/How_to_create_an_RPM_package
https://wiki.debian.org/IntroDebianPackaging https://wiki.debian.org/IntroDebianPackaging
http://guide.macports.org/chunked/development.creating-portfile.html http://guide.macports.org/chunked/development.creating-portf...
http://www.openbsd.org/faq/ports/guide.html http://www.openbsd.org/faq/ports/guide.html
http://www.netbsd.org/docs/pkgsrc/creating.html http://www.netbsd.org/docs/pkgsrc/creating.html
- massysett 13y agoShouldn't packaging be left to each distributor's experts? As a developer of software you're an expert in whatever your software does--web server, calculator, compiler, whatever. There is no way you can be an expert in your software's functionality and in packaging, especially for more than one distribution. I'm always wary of installing packages not provided by my distribution, just because I have more faith that my distribution's packagers know how to package and they are more likely to use QA processes that will catch packaging bugs. I'd rather compile from source than install third-party packages; I can make my own rudimentary package that would be woefully inadequate for general use but that is perfectly sufficient for my needs.
- blueblob 13y agoI think that depends. ArchLinux packages are almost just bash scripts. People can request fixes. I am sure when you first started programming you weren't an expert and that same logic applies to making packages. Multiple distributions you may be right. I suppose it is fair enough that you would want to install third party packages from source but with most package managers I would guess you could download the package and look at how it is built or at least what files it contains. Using packages can make cleaning up a bad package easier.
- dfc 13y agoIf there is not a proper Debian package you can use checkinstall or GNU stow. This lets you install from a source tarball and be able to cleanly remove the installation if something happens, good or bad. (proper debian package / botched compile/install)
- zdw 13y ago> Shouldn't packaging be left to each distributor's experts? My take is that any package is better than no package. At least then there's something for a sysadmin, distributor, or other ops person to work with, and it shows that you actively want your software to be packaged. You're the expert on your program and what it needs to work, knowing what the dependencies are, etc - inject that knowledge into the spec/port file and then whatever upstream packager will have even more to work from. > I can make my own rudimentary package that would be woefully inadequate for general use but that is perfectly sufficient for my needs. Why not make that and share it? Having the rudiments around as a starting point to fix and improve is almost always better than having nothing. Think of making packages as a collaboration, rather than something that someone else has to do for you.
- nailer 13y ago> Shouldn't packaging be left to each distributor's experts? I get where you're coming from - there's some apps that want to redefine how packaging or your OS works - but I think it's easier for software devs to learn things like the FHS and packaging than it is for distro maintainers to judge whether an arbitrary piece of software works on not. +1 making your own packages though. More people should do that - if you're smart enough to compile from source, you can easily make an RPM or Dpkg.
- forgottenpass 13y agoThere is no way you can be an expert in your software's functionality and in packaging, especially for more than one distribution. The goal of packaging your own software shouldn't be to spin up a public repository of your own, but to get it into distribution repositories. You don't need to be an expert to make decent packages, nor do you have to toil on your own for perfection. Just have something to show for yourself when you get the package reviewed by the distribution maintainers.
- bostik 13y agoDebian packaging has a long history of being insanely hard to get right. That was certainly true in debhelper v5 and v6 times - if you wanted to package ANY software, you needed to copy-paste from an existing debian/rules and then tweak all the dh_* calls until you got a working build. It was possible to get the packaging into a "working condition" by sheer stubbornness. (Trying to learn Debian packaging from scratch was like trying to learn auto* from scratch.) With debhelper v9, and it's lovely sequencer things are a lot easier. The once-so-arcane debian/rules is now only a few lines, and as long as you set DH_VERBOSE=1, you can see exactly which internal helper gets called at any point of the packaging run. If you need to override a step, simply define "override_dh_auto_FOO" target and that's it. There's less boilerplate, and thus the packaging will be quite a bit easier to adapt to official Debian standards. So it will be (hopefully) less work for an official NM/DD to adapt your simple rules and get the package into a shape where it could be uploaded to experimental or unstable. Back in my previous life I actually wrote two or three instruction sets for random developers on how to get their software into a working debian package. And then, when the customer project manager wanted to try his hand at coding too, I came up with a bunch of reductionist scripts and templates that allowed to automatically generate a sensible debian/* hierarchy. (That effort was later taken over by developers more capable than me - and made into a proper QtCreator plugin. That thing has supported "easy debian package" system for a couple of years now...) I still can't produce packages that would pass the extremely high bar Debian sets for their packaging standards, but I sure can put together a packaging that works and is relatively easy to polish.
- xioxox 13y agoYes, I maintain Fedora and Debian packages for my upstream project (I'm not a Debian developer - I pass my package to a sponsor). Debian is much harder to get right, though I do have more experience maintaining Fedora systems. The Debian packaging process seems an order of magnitude more difficult to get right, mainly because of the magic documented in various scattered documents and the many different build systems. I've yet to find a good document explaining how all this stuff interacts with each other. rpmbuild is much more conceptually easy to understand for me. You also have more boilerplate documents (e.g. copyright), that Fedora doesn't care about. Fedora also has a nice system where you can get builds done on a server with various architectures and for different releases.
- peterwwillis 13y agoIn an ideal world, software developers should merely prepare their software to make it easier for packagers to whip up a package based on a template. As a packager I know the pain of having to discover the magical way a piece of code is intended to be built, tracking down its dependencies, and stringing together the means of packaging the finished product based on how the developer assembled it. Some of the problems you'll face when packaging random code: * non-standard version numbers * non-standard file paths * non-standard configure/make/install routines (or none at all) * custom or non-standard build/install tools * lack of build/configure/install documentation * lack of dependency documentation (including what versions of what dependencies might conflict) * code that isn't portable past the desktop the developer wrote it on * lack of best practices in setting up multi-user permissions * lack of pre/post install scripts * lack of simple init scripts * lack of minimal configuration files * lack of pidfile, log rotation, crontab, environment, and other necessary ops functions * patching code just to get them to build and install on your distro * bundled, highly patched, third-party software (!!!) Learning to make packages is easy, but what's even easier is leaving your source in a state that's convenient for packagers of all distros to put it together with little or no effort. Here's some suggestions on how to do this: 1. Make sure your code is portable. Please, try not to hardcode things; use a 'configure'-type process to allow someone to override things like file paths, usernames, and other variable data. Test it on multiple architectures or distributions to see what kind of dependencies you might need to document. 2. PLEASE use a standard configure/make/make install method for your language, and don't write one yourself or depend on some backwards antiquated build tool that nobody uses. Interpreted languages often have their own standard, and compiled languages often use autoconf/automake. Learn them and use them, or at the very least, make an incredibly basic Makefile. And please document the expected permissions and users (chowns/chgrps/chmods). 3. Make sure that you can run one command for each of the configure/make/make install steps. Make sure it can be passed options or environment variables to change the root directory to install into. Make sure your install procedure puts them all in Filesystem Hierarchy Standard paths. Make sure it works as a non-root user; the packager will add the permissions and ownership as metadata to the package. 4. Provide working samples of all the things your app will need. Crontabs, log rotation, pid file tracking for daemons, configuration files, documentation, init scripts, preinstall/postinstall/uninstall scripts. 5. For the love of god, use standard version numbers. Either X.XXXX, X.XX.XX, or X.X.X.X. Pick one and stick with it. Otherwise different distros might actually use different version schemes for their packages which confuses everyone. Please don't include any non-numeric characters (fuck you, openssl! hex doesn't belong in versions!!!) 6. Fully document your ChangeLogs. A packager needs to know that your new release now requires a newer dependency or breaks ABI compatibility, because now they have to modify the metadata of the package to specify what deps will or won't work. Remember that users often install and uninstall different versions of different software.
- grosskur 13y agoThis is exactly why I created Package Lab---to make Linux packaging easier for developers and ops folks. Currently in private beta and would love feedback. Please get in touch with me if you're interested (email in profile). https://packagelab.com/ https://packagelab.com/
- lwhalen 13y agoaaaand invite request sent. I'm a big believer in packaging, and $current_job is of the opinion that packages "aren't Cloudy/DevOps/new enough" to be worth investing in. If I could show them a RESTful API, that might just be what it takes for them to move beyond the pain of 'git pull' deploys!
- twic 13y ago> $current_job is of the opinion that packages "aren't Cloudy/DevOps/new enough" to be worth investing in I don't know about clouds, but packages are fully DevOps. You can tell them i said that.
- deleted 13y ago[deleted]
- grosskur 13y agoGreat! My experience has been that packages simplify automation and play nicely with DevOps tools like Puppet and Chef. It's dead simple to write a recipe to install a package, whereas things get complicated quickly when you try to write a recipe to orchestrate a build process, e.g., git pull, install compilers, ruby-build, install gems, compile assets, etc. To help convince folks on the value of packages, you could try pointing them toward Michael Stahnke's presentation "The Balance of Packaging vs. Puppet Manifests": http://www.youtube.com/watch?v=NydVbJ4xP84 http://www.youtube.com/watch?v=NydVbJ4xP84
- Mikeb85 13y agoTo add to this, OpenSUSE build service is invaluable, and not just for SUSE distros. https://build.opensuse.org/ https://build.opensuse.org/
- znowi 13y agoI'd like to have a honorable mention of Archlinux here. Arguably, it has the easiest package management out there. To create a package you write a single PKGBUILD file with a few required fields (like pkgname, pkgver, etc) and a bash build script - that's it. Then you run "makepkg" and it's done. Take a look for yourself. This is a build script for tmux: https://projects.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/tmux https://projects.archlinux.org/svntogit/community.git/tree/t... If you know of an app which isn't available for Arch yet, I welcome you to give it a try and build a package. It's really easy. And for completeness - the package guidelines for Archlinux: https://wiki.archlinux.org/index.php/Arch_Packaging_Standards https://wiki.archlinux.org/index.php/Arch_Packaging_Standard...
- stefantalpalaru 13y agoGentoo's build script for tmux has more tricks up its sleeve: http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/app-misc/tmux/tmux-1.8.ebuild?view=markup http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/app-...