Bug 11989

Summary: when building, fileutils tries to update running system
Product: [Retired] Red Hat Raw Hide Reporter: Michael Tokarev <mjt>
Component: findutilsAssignee: Preston Brown <pbrown>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 1.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-06-08 18:38:17 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Michael Tokarev 2000-06-08 17:33:09 UTC
$ rpm --rebuild findutils-4.1.4-1.src.rpm
....
%install stage
...
make[2]: Entering directory `/usr/mjt/rpm/build/findutils-4.1.4/locate'
/bin/sh ../mkinstalldirs /var/tmp/find-root/usr/bin
  /usr/bin/install -c  locate /var/tmp/find-root/usr/bin/locate
/bin/sh ../mkinstalldirs /usr/lib/findutils
mkdir /usr/lib/findutils
^^^^^^^^^^^^^^^^^^^^^^^^
mkdir: cannot make directory `/usr/lib/findutils': Permission denied
make[2]: *** [install-libexecPROGRAMS] Error 1

$_

This caused by buggy line in locate/Makefile, at the bottom of file,
that is a duplicate of install target (install: install-am):
---
install:
        $(top_srcdir)/mkinstalldirs $(localstatedir)
---

And also, relevant portion of .spec file:
===========
%define optflags $RPM_OPT_FLAGS -D_GNU_SOURCE
%configure \
 --exec-prefix=%{_prefix} \
 --libexecdir=$RPM_BUILD_ROOT/%{_prefix}/lib/findutils
%undefine optflags

make localstatedir=/var/lib

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p ${RPM_BUILD_ROOT}%{_prefix}/lib/findutils
make \
 prefix=${RPM_BUILD_ROOT}%{_prefix} \
 exec_prefix=${RPM_BUILD_ROOT}%{_prefix} \
 libexecdir=%{_prefix}/lib/findutils \
 localstatedir=/var/lib \
 install
===

This should be as follows:
===
%define optflags $RPM_OPT_FLAGS -D_GNU_SOURCE
%configure \
 --exec-prefix=%{_prefix} \
 --libexecdir='${exec_prefix}/lib/findutils' \
 --localstatedir=/var/lib
%undefine optflags

make

%install
rm -rf $RPM_BUILD_ROOT
#mkdir -p ${RPM_BUILD_ROOT}%{_prefix}/lib/findutils
make install DESTDIR="${RPM_BUILD_ROOT}"
======

Far more clean than original (RH) verion... ;)

==
Can anybody audit all packages to be buildable as non-root and
thus preventing that ugly bug(s)?!
I already posted tons of bugreports about similar problems
(missing `%defattr(-,root,root)', stupid `install -u0 -g0',
modification of system files when building etc etc...)

Comment 1 Michael Tokarev 2000-06-08 18:38:16 UTC
With changes in .spec (that I provided), bug will go away.


Comment 2 Preston Brown 2001-01-31 22:29:24 UTC
fixed since 7 was released.