On 02/22/2012 08:32 AM, Mr Dash Four wrote:
> 
>> _libexecdir *is* defined by RPM.
>>   
> What I meant was, is it defined by RPM *without* using your macros (i.e. 
> in the "vanilla" RPM distribution)?
> 
>> It is already defined within RPM. As I noted, however, the default
>> setting is distribution- and release-dependent so I override the default
>> in $HOME/.rpmmacros.
>>   
> One thing I still cannot understand - if it is defined within RPM (and I 
> mean the *vanilla* RPM, without having your macros installed - I am dead 
> against this, but that is another topic for discussion altogether) why 
> not stick with that definition, why do you have to redefine it?
> 
>> When running rpmbuild, %shorewall_initdir is the only way to specify the
>> directory containing the init scripts. Here is the text that invokes the
>> installer:
>>
>>      DESTDIR=$RPM_BUILD_ROOT \
>>      OWNER=`id -n -u` \
>>      GROUP=`id -n -g` \
>>      LIBEXEC=%{_libexecdir} \
>>      PERLLIB=%{perl_sitelib} \
>>      INITDIR=%{shorewall_initdir} \
>>      TARGET=%{shorewall_target} \
>>      ./install.sh
>>
>> Here's the %attr specification for the init script:
>>
>>      %attr(0544,root,root) %{shorewall_initdir}/shorewall
>>   
> I disagree on a number of points.
> 
> Assuming %{_libexecdir} and %{perl_sitelib} are defined by the *vanilla* 
> RPM, then I don't see why do I have to install a separate macros in 
> $HOME (and "pollute" my build environment unnecessarily) just to make 
> use of two variables which are used just *once* - you may as well place 
> whatever the value of these are in the .spec file.
> 
> Besides, "shorewall_initdir" could very-well be substituted with its 
> vanilla-rpm-defined counterpart, which for my distribution - Fedora - is 
> %{_initddir}.
> 
> Also, the above is missing the "BUILD" setting, which I am also pretty 
> confident could be substituted by Fedora automatically. "TARGET" should 
> also be "HOST". Oh, and $RPM_BUILD_ROOT is %{buildroot} and has been 
> like that for a long time.
> 
> Lastly, I don't see the meaning of OWNER and GROUP either - if you are 
> going to execute "id -n -X", then you may as well do it from within 
> install.sh - no need to specify it as a separate environment variable 
> cluttering this spec file even further.

Okay -- I've come to this point:

%install
DESTDIR=%{buildroot} \
LIBEXEC=%{_libexecdir} \
PERLLIB=%{perl_sitelib} \
INITDIR=%{_initddir} \
HOST=%{_vendor} \
 ./install.sh%install

Note that I'm not setting BUILD. The reason is as follows:

teastep@gateway:~$ fgrep vendor /home/teastep/shorewall/redhat-macros
#       Configurable vendor information, same as Vendor: in a specfile.
#%vendor
%_vendor                redhat
%_target_platform       %{_target_cpu}-%{_vendor}-%{_target_os}%{?_gnu}
%_build_vendor          %{_host_vendor}
%_host_vendor           pc
%_target_vendor         %{_host_vendor}
%perl_vendorarch %(eval "`%{__perl} -V:installvendorarch`"; echo
$installvendorarch)
%perl_vendorlib  %(eval "`%{__perl} -V:installvendorlib`"; echo
$installvendorlib)
teastep@gateway:~$


As you can see, both %_build_vendor and %_host_vendor are set to 'pc'
rather than 'redhat' on a Fedora. Note that on Centos and Foobar, the
value is 'unknown' rather than 'pc'.

Contrast that with OpenSuSE:

teastep@gateway:~$ fgrep vendor /home/teastep/shorewall/suse-macros
#       Configurable vendor information, same as Vendor: in a specfile.
#%vendor
%_vendor                suse
%_target_platform       %{_target_cpu}-%{_vendor}-%{_target_os}%{?_gnu}
%_build_vendor          %{_host_vendor}
%_host_vendor           suse
%_target_vendor         %{_host_vendor}
%perl_vendorarch %(eval "`%{__perl} -V:installvendorarch`"; echo
$installvendorarch)
%perl_vendorlib  %(eval "`%{__perl} -V:installvendorlib`"; echo
$installvendorlib)
teastep@gateway:~$

Here, both _build_vendor and _host_vendor are set to 'suse'.

The alternative is this:

%install
DESTDIR=%{buildroot} \
BUILD=%{_build_vendor} \
LIBEXEC=%{_libexecdir} \
PERLLIB=%{perl_sitelib} \
INITDIR=%{_initddir} \
HOST=%{_host_vendor} \
 ./install.sh

On Redhat system, this would then be needed in $HOME/.rpmmacros:

%_host_vendor           redhat

No special entries would be needed for SuSE-based systems. I tend to
favor this second approach but I'm open to comments.

Either way, I've had to change the distro names in the .install.sh files
to lower case.

-Tom
-- 
Tom Eastep        \ When I die, I want to go like my Grandfather who
Shoreline,         \ died peacefully in his sleep. Not screaming like
Washington, USA     \ all of the passengers in his car
http://shorewall.net \________________________________________________

Attachment: signature.asc
Description: OpenPGP digital signature

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Shorewall-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/shorewall-devel

Reply via email to