[CentOS] Building packages using RPMBUILD

Thu Dec 16 16:51:22 UTC 2010
Robert Heller <heller at deepsoft.com>

At Thu, 16 Dec 2010 17:00:23 +0100 CentOS mailing list <centos at centos.org> wrote:

> 
> Hello Keith,
> 
> On Thu, 2010-12-16 at 15:08 +0000, Keith Roberts wrote:
> > [rpmbuilder at karsites sox]$ rpm -iv ./sox-12.18.1-1.src.rpm
> > error: cannot write to %sourcedir /usr/src/redhat/SOURCES
> 
> /usr/src/redhat and sub dirs are owned root.root. If you want to build
> as a normal user (and you should!) you should fix the ownership of those
> directories.

Even better would be to create the directories under your home dir and
then include a line like:

%_topdir /home/rpmbuilder/src

in ~/.rpmmacros

> 
> > Is there a package I need to install and run to set 
> > things up corectly?
> 
> redhat-rpm-config sets certain build macros. Although not strictly
> required you should probably always install this packages. One thing I
> stumbled on is that a new type of check summing is used nowadays for the
> content of the rpms. If the correct macro isn't set you might run into
> installation conflicts, f.e. for multilib doc files.
> 
> > I have created a user called 'rpmbuilder' under my home dir, 
> > and created the rpmbuild dirs under that.
> 
> If you make a different user to do builds you should rather give it its
> own home dir. But you can just as well build using your default account.
> 
> > So what build dir shall I go for?
> 
> Whatever you prefer. Just using /usr/src/redhat is probably the easiest.
> If you want to use a different path scheme you can override the default
> settings in ~/.rpmmacros to suit your needs.
> %_sourcedir     %{_topdir}/%{name}-%{version}
> %_binary_filedigest_algorithm 8
> Regards,
> Leonard.
> 

-- 
Robert Heller             -- 978-544-6933 / heller at deepsoft.com
Deepwoods Software        -- http://www.deepsoft.com/
()  ascii ribbon campaign -- against html e-mail
/\  www.asciiribbon.org   -- against proprietary attachments