[Fedora-packaging] unwanted directory removal during rpm build
mattias.ellert at fysast.uu.se
Tue Sep 1 07:20:42 UTC 2009
mån 2009-08-31 klockan 23:07 -0700 skrev Scott Frankel:
> I'm new to rpm package development and just joined this list. I'm
> trying to create an rpm, but working subdirs of BUILDROOT are getting
> deleted between %build and %install. This causes subsequent copy
> operations to fail and rpmbuild to error out with a bad exit status.
> The `rm -rf` that removes the working dir is not coming from any
> explicit statement in my spec file.
> I'm copying pertinent lines from shell output, the spec file, and
> system configuration below. I'm hopeful someone can suggest a work-
> Thanks in advance!
> The spec file has this %build section (in its entirety), followed by
> the first of the failed copies. Note that these are contiguous lines
> of specfile code between %build and %install.
> [ ... ]
> rm -rf $RPM_BUILD_ROOT
> mkdir $RPM_BUILD_ROOT
> mkdir $RPM_BUILD_ROOT/opt
> mkdir $RPM_BUILD_ROOT/opt/foo
> cp -r schema $RPM_BUILD_ROOT/opt/foo
> [ ... ]
The %build section must not create files or directories in the
$RPM_BUILD_ROOT. That must only be done in the %install section.
The Fedora packaging guidelines says that the first command in the
%install section must be "rm -rf $RPM_BUILD_ROOT". If you are using a
recent RPM version this will be enforced automatically, which is what
happens in this case.
rm -rf $RPM_BUILD_ROOT
cp -r schema $RPM_BUILD_ROOT/opt/foo
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 2272 bytes
Desc: not available
More information about the Fedora-packaging