[Rpm-maint] bug in /usr/lib/rpm/redhat/macros file?

Ritesh Sood baralachala at gmail.com
Sat Mar 14 04:54:36 UTC 2009


Please take a look at the following snippet from RHEL5's
/usr/lib/rpm/redhat/macros file:
#=
=
=
=
=
=
========================================================================
# ---- configure macros.  note that most of these are inherited
#      from the defaults.
#
%_prefix		/usr
%_sysconfdir		/etc
%_localstatedir		/var
%_infodir		/usr/share/info
%_mandir		/usr/share/man
%_initrddir		%{_sysconfdir}/rc.d/init.d

%_defaultdocdir		%{_usr}/share/doc

%_enable_debug_packages 1

#=
=
=
=
=
=
========================================================================

Even with my three days of experience in making RPM packages, I can tell
that the hardcoded %_infodir and %_mandir  paths would cause trouble  
and the correct way
of specifying these paths is:
#= 
= 
= 
= 
= 
= 
========================================================================
# ---- configure macros.  note that most of these are inherited
#      from the defaults.
#
%_prefix		/usr
%_sysconfdir		/etc
%_localstatedir		/var
%_datadir		%{_prefix}/share
%_infodir		%{_datadir}/info
%_mandir		%{_datadir}/man
%_initrddir		%{_sysconfdir}/rc.d/init.d

%_defaultdocdir		%{_datadir}/doc

%_enable_debug_packages 1

#= 
= 
= 
= 
= 
= 
========================================================================

while the two blocks achieve the same thing if one wants to install to
/usr, I was in for trouble since I wanted to install under /usr/local.
Here's  my spec file below:
#= 
= 
= 
= 
= 
= 
========================================================================
%define name 		pcre-ece
%define orig_name	pcre
%define version 	7.8
%define release 	1

%define _prefix 	/usr/local
%define _docdir 	%{_datadir}/doc/%{orig_name}
#= 
= 
= 
= 
= 
= 
========================================================================
If RedHat's macros file were not overriding the ones in /usr/lib/rpm/ 
macros,
everything would go under /usr/local as I want, including the man and  
info pages.

I have overridden these paths for the time being, but i'm certainly  
annoyed at
the time wasted in chasing down this rather obvious error.

Ritesh Sood




More information about the Rpm-maint mailing list