On Mon, Oct 07, 2002, Martin Konold wrote:

> I am trying to learn how to write spec files for OpenPKG. I do have the
> impression that your modified rpm-4.x is rather powerful.
> I am therefore wondering if the following is possible.
>
>  {l_shtool} install -c -m 700 -e \
> 's;@@@kolab_prefix@@@;%{l_prefix};g;\
>  s;@@@fqdn@@@;`hostname --fqdn`;g;' kolab.conf
>
> Basically I would love to have @@@fqdn@@@ in the file kolab.conf replaced with
> the output of the shell command hostname --fqdn.
>
> With the above line though `hostname --fqdn` does not get evaluated during
> installation but is taken literally.
>
> Any ideas?

The correct way is:

 %{l_shtool} install -c -m 644 \
    -e 's;@@@kolab_prefix@@@;%{l_prefix};g' \
    -e "s;@@@fqdn@@@;`hostname --fqdn`;g" \
    kolab.conf

But keep in mind that hostname --fqdn ist not portable. So I recommend
you this enhanced version:

 %{l_shtool} install -c -m 644 \
    -e 's;@@@kolab_prefix@@@;%{l_prefix};g' \
    -e "s;@@@fqdn@@@;`%{l_shtool} echo -e %h%d`;g" \
    kolab.conf

> P.S.: is there documentation available about the install you are using?

Sorry, can you be more specific here? Are you talking about the
BuildRoot feature?
                                       Ralf S. Engelschall
                                       [EMAIL PROTECTED]
                                       www.engelschall.com
______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
Developer Communication List                   [EMAIL PROTECTED]

Reply via email to