Bug 111193 - Macro %configure in file /usr/lib/rpm/macros is misbehaving
Macro %configure in file /usr/lib/rpm/macros is misbehaving
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
1
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
Mike McLean
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-11-29 11:35 EST by Marcelo Roberto Jimenez
Modified: 2007-11-30 17:10 EST (History)
1 user (show)

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


Attachments (Terms of Use)

  None (edit)
Description Marcelo Roberto Jimenez 2003-11-29 11:35:07 EST
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} \\\
        --infodir=%{?buildroot:%{buildroot}}%{_infodir}
Comment 1 Jeff Johnson 2003-11-30 09:42:41 EST
%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 07:51:38 EST
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.