1. Use the system package manager.
2. See rule #1.
In all seriousness, there needs to be a good way to [spray your stuff](http://dilbert.com/strip/2013-06-09) all over a system with the rest of the system knowing about it. FPM does a decent job of this.
There is some research out there on common things that this kind of code gets wrong: https://www.cs.arizona.edu/stork/packagemanagersecurity/
Anyone know the name of this tool? It was unmaintained for a long time already when I stopped using Linux, and that was 10 years ago.
%prep
%setup -q
%build
%configure
make %{?_smp_mflags}
%install
make install DESTDIR=%{buildroot}
%files
/usr/*
Boom, there you go, build it with rpmbuild or mock and you're done. Debian control files are just Makefiles with a bunch of magic targets that get called, and debhelper 99% of the time will automatically figure out what you are trying to package (autotools, python, ruby, java, node, etc) and build/install/package it correctly for you so that most debian/control files are one or two lines.When system package managers get properly documented maybe ... when instead of having 1 package manager per system , we have a single package manager for every system ... otherwise no, use the package manager that comes with the language if there is one.
Invalid complaint. The major package managers are extremely well documented. Even some of the minor ones, like archlinux.
Until then, I surely will not waste my time generating one package per OS/distribution flavor.
This could be 1000 x as much work for not much gain.
Then you have a bunch of developers all taking the easy way. And now all the system administrators running systems with those projects can't trust their packaging tools anymore, and have to do a lot more work in their daily workflow.
Oh, and as a bonus, none of these systems have a secure update mechanism, so you've bypassed the inherent code whitelisting that comes with a system package manager with a centralised repository and a requirement for strong package signatures. At best, they do like PyPi and optionally allow a developer to specify a GPG key. So you have to do "pip install <bla>" and pray to the computer god that the developer of <bla> and all the developers of all its dependencies cared about code integrity and set up GPG keys. From experience, the chances of that are approximately 0%, because it's not a requirement.
No you are not. At this point, you have catered for developers in the language. You have not yet catered for final users.
Really, the Linux landscape is not that scattered. Package for Debian and Redhat and you have done the Pareto effort.
This doesn't work so well for micro-dependencies, though. The TeTeX distrib. in Fedora is bad enough, I'd hate to see the same done with node packages.
A much better solution would involve making languages like Python accept the Python version as a dependency while making building the PYTHONPATH more flexible with common tooling. Making PYTHONPATH building better would enable installation with namespace+version, such that we could have:
/usr/lib/pymodules/requests/1.0.0/...
/usr/lib/pymodules/requests/1.2.1/...
/usr/lib/pymodules/python/2.7.10/...
/usr/lib/pymodules/python/3.5.0/...
Python in particular is still a bit challenging in that the compiler assumes it can spit out byte-compiled code all over the place (.pyc), but if someone was going through the tooling effort, they'd presumably find a way (or get something merged if it doesn't exist), to add a shadow directory of .pyc files that could be keyed by version and cached somewhere user-writeable (~/.pymodules for example).Addendum: I'd might as well mention that PEP 3147 is implemented from Python 3.2 onwards, so for Python 3, some of the problem is solved.
You still have the issue of being able to install different version of the same library.
This is certainly better than it was (.pyc files just didn't co-exist sanely across python versions), but it doesn't provide a method for running multiple versions of libraries between different apps.
Far from it. It's up to the system package manager to generate the .pyc files for the globally installed version of the libraries. __pycache__ directories allow this to be done cleanly for any installed interpreter that supports them. It has all the information it needs, and users need not get involved.
Unless the user is running a copy of Python that wasn't installed by the package manager, there should be no need for them to cause the .pyc files to be generated. Besides, .pyc files are an optimisation so that parsing and bytecode compilation doesn't have to repeatedly happen, and aren't even strictly required: the result is slower startup, but it couldn't prevent the code from being run.
> it doesn't provide a method for running multiple versions of libraries between different apps
Indeed, and I pointed that out in my comment in the addendum. Virtual environments are still pretty much the state of the art in that regard, unfortunately. It's possible that some PYTHONPATH magic might help with that to some degree, but that would be messy.
May sound weird, but take a look:
https://www.gnu.org/software/guix/
The main distribution will only ever have free/open source software in it but it is trivial to make your own packages/package repositories and share them since it is just a guile code file.
nix/guix is a sort of reasonable answer to this issue, I guess, but then you have to develop on nix/guix and hope that apt/rpm/pacman can handle your dependencies.
[1] http://www.gnu.org/software/guix/manual/html_node/Features.h...
[2] http://www.gnu.org/software/guix/manual/html_node/Invoking-g...
Then again, I've had good mileage out of making .debs that plonk dev work and deps into /opt locally. YMMV.
You should be so lucky as to have a program package manner be at all compatible with apt or yum.