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

Re: How to build optional package if certain requirement is satisfied?



On 2003-08-27(Wed) 01:38:03 -0500, Liguo Song wrote:
> Dear RPM Users,
> 
> I have a problem with packaging RPMs. The source tar ball is configured in
> such a way that some optional components will be build if a certain
> requirement is met. I want to package these optional components into a
> separate package, which depends on the requirement.

Would something like this work for you?


%define have_optional_component %(if some_command_succeded; then echo 1; else echo 0; fi)

%if %have_optional_component
%package optional_components
.......
%endif

Abel


> I know of the conditional build ability, with which you can define certain
> macros in the command line of rpm to control the build behavior. But, I
> prefer the minimal input from my src rpm user. So, I want to automate this
> procedure with something like this (pseudo codes of spec files. :)
> 
> %if required-package
> %package optional-components
> Summary: some optional stuff
> BuildRequires: required-package
> Requires: other-requirements
> 
> %files
> %{_bindir}/optional-bins
> 
> Is this possible right now with rpm-4.1?
> 
> Thanks for your comments.
> 
> 
> Liguo Song (Leo)
> 
> 
> 
> _______________________________________________
> Rpm-list mailing list
> Rpm-list@redhat.com
> https://www.redhat.com/mailman/listinfo/rpm-list

-- 
Abel Cheung
Linux counter #256983   | http://counter.li.org
GPG Key: (0xC67186FF)   | http://deaddog.org/gpg.asc
Key fingerprint: 671C C7AE EFB5 110C D6D1  41EE 4152 E1F1 C671 86FF

Attachment: pgp00012.pgp
Description: PGP signature


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