2

I've recently switched to Fedora.

I'm looking for an equivalent of the procedure described here but in yum, so I can take advantage both of compiler optimization in heavily used software that prebuild binaries can't offer and the virtues of having a package manager manage your installed packages.

The word "source" is not even mentioned in the yum man page. Maybe rpm offers a way to do this?

Thank you for your time!

1
  • 1
    Precompiled binaries are carefully optimized. In any case, given that today's CPUs are memory-bound, any minor time gained by shorter/less instructions executed will most probably be swamped by the time loading into memory, cache effects, ... Yes, everybody knows Gentoo runs twice as fast once everything is self-compiled. But that is just a "I worked so hard, it is just impossible I have nothing to show for it" effect.
    – vonbrand
    May 8, 2014 at 0:42

1 Answer 1

3

You can download the SRPM (source RPM) packages and compile it yourself.

To download SRPM:

yumdownloader --source SOME_PACKAGE_NAME

If the yumdownloader app is not installed, install the yum-utils package.

To install necessary dependencies for compilation:

yum-builddep SOME_PACKAGE_NAME

To "install" SRPM package (actually unpacking the source and spec files):

rpm -iv somepackage-x.y.z-v.dist.src.rpm (replace with the SRPM path)

Now you have the source files populating your ~/rpmbuild/ directory. You can make the necessary hacks and recompile (packages rpm-build, rpmdevtools and optionally rpm-sign are needed to rebuild from the spec file, see their man pages). RPM packaging is rather a rich topic and the margins here are too small ... ;)

Fedora-specific notes

You may be interested in mock, the packaging and testing suite recommended by Fedora.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .