Re: unwanted directory removal during rpm build

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

 



mån 2009-08-31 klockan 23:07 -0700 skrev Scott Frankel:
> Hello,
> 
> 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- 
> around.
> 
> Thanks in advance!
> Scott

> 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.
> 
> [ ... ]
> 	%build
> 	rm -rf $RPM_BUILD_ROOT
> 	mkdir $RPM_BUILD_ROOT
> 	mkdir $RPM_BUILD_ROOT/opt
> 	mkdir $RPM_BUILD_ROOT/opt/foo
> 
> 
> 	%install
> 	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.

%build

%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

	Mattias

Attachment: smime.p7s
Description: S/MIME cryptographic signature

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

[Index of Archives]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite Forum]     [KDE Users]

  Powered by Linux