Bug 111193 - Macro %configure in file /usr/lib/rpm/macros is misbehaving
Summary: Macro %configure in file /usr/lib/rpm/macros is misbehaving
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm   
(Show other bugs)
Version: 1
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Jeff Johnson
QA Contact: Mike McLean
Depends On:
TreeView+ depends on / blocked
Reported: 2003-11-29 16:35 UTC by Marcelo Roberto Jimenez
Modified: 2007-11-30 22:10 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2003-11-30 14:42:41 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Marcelo Roberto Jimenez 2003-11-29 16:35:07 UTC
Description of problem:The macro %configure in file /usr/lib/rpm/macros
should have some of its parameters prefixed with %{?buildroot:%{buildroot}},
just like the macro %makeinstall. The way it is now, normal users cannot
create rpms, because it creates Makefiles with bindir=/usr/bin. The fix I used was:
%configure \
  CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \
  CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \
  FFLAGS="${FFLAGS:-%optflags}" ; export FFLAGS ; \
  ./configure --host=%{_host} --build=%{_build} \\\
        --target=%{_target_platform} \\\
        --program-prefix=%{?_program_prefix} \\\
        --prefix=%{?buildroot:%{buildroot}}%{_prefix} \\\
        --exec-prefix=%{?buildroot:%{buildroot}}%{_exec_prefix} \\\
        --bindir=%{?buildroot:%{buildroot}}%{_bindir} \\\
        --sbindir=%{?buildroot:%{buildroot}}%{_sbindir} \\\
        --sysconfdir=%{?buildroot:%{buildroot}}%{_sysconfdir} \\\
        --datadir=%{?buildroot:%{buildroot}}%{_datadir} \\\
        --includedir=%{?buildroot:%{buildroot}}%{_includedir} \\\
        --libdir=%{?buildroot:%{buildroot}}%{_libdir} \\\
        --libexecdir=%{?buildroot:%{buildroot}}%{_libexecdir} \\\
        --localstatedir=%{?buildroot:%{buildroot}}%{_localstatedir} \\\
        --sharedstatedir=%{?buildroot:%{buildroot}}%{_sharedstatedir} \\\
        --mandir=%{?buildroot:%{buildroot}}%{_mandir} \\\

Comment 1 Jeff Johnson 2003-11-30 14:42:41 UTC
%configure can be changed, or even not used, if it does not
work for your specific package.

Comment 2 Marcelo Roberto Jimenez 2003-12-01 12:51:38 UTC
Ok, I agree, I don't have to use it. But then, the comments in the 
file /usr/lib/rpm/macros that precede the macro %makeinstall should 
be altered. There we can read:

# The make install analogue of %configure:
%makeinstall \

This is clearly false for a normal user creating a rpm with another 
buildroot. I wonder what is the problem with prefixing some entries 
with %{?buildroot:%{buildroot}} just like it has been done with %
makeinstall. Well, maybe I'm just using it the wrong way.

These two macros are great to quickly create rpms from well written 
gnu packages, that's why I always use them.

Note You need to log in before you can comment on or make changes to this bug.