Re: Creating subpackages dynamically

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Valery Reznic wrote:
> --- Erez Zilber <erezz@xxxxxxxxxxxx> wrote:
>
>   
>> Hi,
>>
>> I'm building rpms for 2 different distributions
>> (SuSE & RedHat) using a
>> single spec file. In order to do that, I'm using
>> "%package". The 2
>> packages contain more or less the same files, but
>> the package name is
>> different.
>>     
>
> You can make use %if and/or %? construction to make
> you package name, rpm filename, filelist depend on
> distribution. No need for subpackages.
>
> Valery
>
>   
Using something like:

%if "%{_vendor}" == "suse"
%if %sles_version == 10
%define _build_name_fmt %_arch/sles-name-%{version}.%{release}.%_arch.rpm
%endif
%else
%if %_vendor == "redhat"
%define _build_name_fmt %_arch/redhat-name-%{version}.%{release}.%_arch.rpm
%endif
%endif

was problematic and results in behavior like having 2 debuginfo rpms in
RedHat instead of 1 normal rpm and 1 rpm with debuginfo.

Why don't you recommend using "%package"?

Thanks,
Erez
>   
>> The problem that I'm trying to solve is that when I
>> build the binary rpm
>> from the src rpm, I want to create only the package
>> for the distribution
>> that I run on: if I build it on a SuSE machine, I
>> want to create only
>> the binary rpm for SuSE and not the binary rpm for
>> RedHat.
>>
>> I know that if I don't have "%files <package name>"
>> in the spec file,
>> the rpm for that package will not be created. Can I
>> do that dynamically?
>> Is there another solution for this problem?
>>
>> Thanks,
>> -- 
>>
>>
>>     
> ____________________________________________________________
>   
>> Erez Zilber | 972-9-971-7689
>>
>> Software Engineer, Storage Team
>>
>> Voltaire – _The Grid Backbone_
>>
>> __
>>
>> www.voltaire.com <http://www.voltaire.com/>
>>
>>
>>
>> _______________________________________________
>> Rpm-list mailing list
>> Rpm-list@xxxxxxxxxx
>> https://www.redhat.com/mailman/listinfo/rpm-list
>>
>>     
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
>
> _______________________________________________
> Rpm-list mailing list
> Rpm-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/rpm-list
>   

_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/rpm-list

[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux