Re: Strange mock behaviour - buildrequires in the host?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Martin Langhoff wrote:
Hi,

while building some packages for the OLPC XS I am seeing some odd
behaviour from Mock. I am not certain whether this is expected...

1 - The F9 host had httpd installed (unbeknownst to me)
2 - The install script in the package was (wrongly) trying to do
install -o apache /file - which errored out "no such user"
3 - Adding a BuildRequires to the spec file fixed the problem - mock
installed httpd in the chroot - however, install would still fail as
it was not running as root.
4 - I spotted httpd on the host and removed it. I can no longer build
the package - "httpd is needed by ds-backup-x-y-z..."

There are 2 weird things in here for me:

- In step 4 - the host environment not having httpd should not affect
the build chroot.

- In step 3, I was expecting the rpmbuild running the "install" target
inside mock to be using fakeroot or something similar.

The fix for this is to remove (patch out) the "-o httpd" option from the install section of the Makefile (the chown won't work as a non-root user, and RPMs should always be built as non-root users), and instead use %attr in the spec file's %files section to indicate that the installed file should be owned by the "httpd" user. Check out the specs for most web apps in Fedora for examples.

This method will mean that you don't need to buildrequire httpd too (though you will still need to require it as a runtime dependency so ensure that the httpd account exists on the target system).

Paul.

--
fedora-devel-list mailing list
fedora-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-devel-list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux