Today's lesson is: use mock if you can. Mach doesn't really seem to work and is a hell to configure, mock is a re-write and I actually managed to get it to work after I updated sqlite. This is how you create an rpm to the environment you desire:
- Install mock if you don't have it already.
- Add root to the mock group.
- Run mock -r
rebuild whereis one of the files in /etc/mock (like fedore-devel-i386) and package is the srpm you want rebuilt.
The downside is mock only supports epel and fedora, not Red Hat, centOS, SuSE, Yellow Dog etc. like mach. Hopefully either mock people add support or at least it's easy to add it yourself. (should be if adding a config file is adequate, they seem simple enough). At least it looks like adding Red Hat to the list is simple enough.
There are still a number of issues that should be checked:
- How easy would it be to use LVM snapshots with these chroots?
- If I have a deb package and run alien to convert it to rpm and then rebuild it to a different target, is it really a functional package (i.e. dependencies are correct)? The other alternative is to build the rpm directly from source which requires a spec file (alien doesn't).
Long time ago I came across one project that the guy was making a builder to make both DEB and RPM as well and PKG files. Unfortunately, I cannot find it anymore. It might be that it was long time agon (like this article http://handhelds.freshmeat.net/articles/the-universal-source-package)...but hack, it is worth investigating...
ReplyDeleteSounds like fpm maybe:
Deletehttps://github.com/jordansissel/fpm