Differences between Fakeroot and Mock & Suggested method

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Fri Oct 11 21:20:04 UTC 2013


Hi Matt,

I believe this is the easiest way to setup your build host:
sudo yum group install "Fedora Packager"
sudo yum install fedora-review

I personally use rpmbuild and then mock before submitting the packages.

Best Regards,
Dridi

On Thu, Oct 10, 2013 at 4:31 PM, Richard W.M. Jones <rjones at redhat.com> wrote:
> On Wed, Oct 09, 2013 at 12:32:08PM -0700, Matt Eskes wrote:
>>       It's taking a bit of time, but I plan to start packaging a couple of
>> packages that are not currently available for either Red Hat nor Fedora.
>> The main reason for it taking a bit longer really has to do with
>> personal infrastructure and setting up my build host, etc.
>>
>>       However, that doesn't really pertain to the question at hand. I come
>> from a Debian centric environment, and have "come back" to Red Hat and
>> Fedora after more than a decade. As such, I have quite a bit more
>> experience building my packages with fakeroot, than I do with mock, and
>> I'm wondering what the differences between the two packages/processes are.
>>
>>       Will using mock in this environment be more beneficial to using
>> fakeroot? Will it be "harder" for lack of a better word, to build from
>> within the build system using fakeroot , once I get to that point or, is
>> Koji flexible enough so that it really wouldn't matter from an
>> infrastructure point of view as to whether or not I use one or the other?
>>
>>       As I am more familiar with fakeroot, I'd like to keep using that, but
>> at the same time, I'd like to do it the "Red Hat way" to ensure that the
>> package conforms to both Red Hat and Fedora packaging standards.
>
> [Incidentally to this, I was the co-maintainer of fakeroot &
> fakechroot in some branches of Fedora (not any longer).]
>
> I would highly recommend *not* trying to use fakeroot.  It's not
> necessary to build RPMs either as root or emulating root (as is done
> in Debian).  There should be no step that requires root.
>
> The two common things you would think might require root would be:
>
> (1) 'make install'
>
> (2) Setting setuid bits on binaries.
>
> (1) -- make install -- does not need to be run as root by rpmbuild
> because we use a DESTDIR to put the files into a buildroot under your
> $HOME, ie:
>
>   make install DESTDIR=%{buildroot}
>
> RPM does the magic of turning the buildroot into the package.
>
> (2) -- setuid -- does not need to be done because you can set
> attributes on files in the %files section.  RPM turns these into
> setuid bits at package install time (which does happen as root).
>
> So, forget about fakeroot.  Not needed.  Don't run rpmbuild as real
> root either.
>
> You don't really need to use mock either.  Just use 'rpmbuild -ba'
> directly or 'fedpkg local' which is a wrapper.
>
> Rich.
>
> --
> Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
> Fedora Windows cross-compiler. Compile Windows programs, test, and
> build Windows installers. Over 100 libraries supported.
> http://fedoraproject.org/wiki/MinGW
> --
> devel mailing list
> devel at lists.fedoraproject.org
> https://admin.fedoraproject.org/mailman/listinfo/devel
> Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct


More information about the devel mailing list