Re: %if

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

 



Frank Cusack schrieb:
On December 16, 2006 10:04:01 PM +0100 "Marcus Habermehl (BMH1980)" <bmh1980de@xxxxxxxx> wrote:

%ifdef %{prefix}
    %_prefix            %{prefix}
%else
    %_prefix            /usr
%endif

This is only for testing purpose. If this is working, I want to add
macros for sysconfdir and localstatedir depending on the prefix/_prefix
macro.

I have searched in the whole max-rpm book and I have readed some spec
files from SuSE. As I'm understandig it, my code is right.

But it isn't working. So I'm thinking it isn't right. Can you help me?

Please quote any URL, page#, or spec file where you see '%ifdef' used or
documented.  You're probably trying to use a SuSE-specific macro on a
non-SuSE system.
I have see it in /usr/lib/rpm/macros, starting on line 101 (rpm 4.4.6).

[...]
# Handle conditional builds. %bcond_with is for case when feature is
# default off and needs to be activated with --with ... command line
# switch. %bcond_without is for the dual case.
#
# %bcond_with foo defines symbol with_foo if --with foo was specified on
# command line.
# %bcond_without foo defines symbol with_foo if --without foo was *not*
# specified on command line.
#
# For example (spec file):
#
# (at the beginning)
# %bcond_with extra_fonts
# %bcond_without static
# (and later)
# %if %{with extra_fonts}
# ...
# %else
# ...
# %endif
# %if ! %{with static}
# ...
# %endif
# %ifdef %{with static}
# ...
# %endif
# %{?with_static: ... }
# %{!?with_static: ... }
# %{?with_extra_fonts: ... }
# %{!?with_extra_fonts: ... }

#
# The bottom line: never use without_foo, _with_foo nor _without_foo, only
# with_foo. This way changing default set of bconds for given spec is just
# a matter of changing single line in it and syntax is more readable.
%bcond_with()        %{expand:%%{?_with_%{1}:%%global with_%{1} 1}}
%bcond_without()    %{expand:%%{!?_without_%{1}:%%global with_%{1} 1}}
[...]

But I have used '%if %{prefix} != ""' and '%if ! %{prefix}'. Nothing is working. :(

Best regards
Marcus

		
___________________________________________________________ Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de

_______________________________________________
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