__ in rpm macros
Tomasz Kłoczko
kloczek at rudy.mif.pg.gda.pl
Wed May 22 19:44:32 CEST 2002
On Wed, 22 May 2002, Michal Moskal wrote:
> Hmm.. I wonder why do we use __ in front of %{__make} and especially
> %{__autoconf} and %{__automake}. In C prefixing __ to name means: "don't
> touch, internal stuff". While in case of make it makes some sense (it
> expands to /usr/bin/make itself and nothing more, in default setup at
> least), but %{__automake} has several options.
>
> I guess it would be better to use %automake and %autoconf (and maybe
> %make).
Not so neccessary. We do not write C code ;) ... but seems you are right :)
Comment from /usr/lib/rpm/macros:
#==============================================================================
# Macro naming conventions (preliminary):
#
# Macros that begin with an underscore are "local" in the sense that
# they (if used) will not be exported in rpm headers. Some macros
# that don't start with an underscore (but look like they should)
# are compatible with macros generated by rpm-2.5.x and will be made
# more consistent in a future release.
#
So probaly will be good add:
%_use_smp_mflags 0
%make %{__make} %{?_use_smp:%{_smp_mflags}}
%autoconf %{__autoconf} %{?debug:-Wall}
%automake %{__automake} -a -c -f --foreing
%libtoollize %{__libtoolize} --copy --force
%gettextize %{__gettextize} --copy --force
Also must be repalced all direct using make and replaced by using %make in
rest platform.in. For PLD in platform.in can be removed %makeinstall or
better redefine this to "%{make} install DESTDIR=%{rpmbuildroot}".
Also IMHO will be good drop (but rather on begining work on PLD 1.2)
using %{rpmcflags} macro and redefine in platform.in:
%optflags @RPMRC_OPTFLAGS@
to:
%optflags %{!?debug:@RPMRC_OPTFLAGS@}%{?debug:-O -g}
And back to using %optflags instead current %rpmcflags (?).
Or better also local template and define:
%__optflags @RPMRC_OPTFLAGS@
and %optflags as:
%optflags %{!?debug:%{__optflags} %{_cflags}}%{?debug:-O -g}
and also add empty %{_cflags} %{_cxxflags} %{_fflags} %{_ldflags} macros
(for make this much more closer to template names from autoconf name
space).
For fixing in platform.in is also IMHO:
%_initrddir %{_sysconfdir}/rc.d/init.d
it must be:
%_initrddir /etc/rc.d/init.d
for not depending local redefine %{_sysconfdir} in spec preamble.
Coments or any other planed changes ?
Some time ago I'm also thinking about add profiling infrastructure similar
to current %{debug} support.
kloczek
--
-----------------------------------------------------------
*Ludzie nie mają problemów, tylko sobie sami je stwarzają*
-----------------------------------------------------------
Tomasz Kłoczko, sys adm @zie.pg.gda.pl|*e-mail: kloczek at rudy.mif.pg.gda.pl*
More information about the pld-devel-en
mailing list