Results 1 to 6 of 6

Thread: Question about %if

  1. #1

    Question Question about %if

    Hey guys,

    I'm building a package for OpenSUSE and Fedora, the problem is that the requirements to build "BuildRequires line" is different for both:

    For example the OpenSUSE requirement looks like this:
    requirement-devel

    While fedora looks like this:
    requirement

    I tried adding:

    Code:
    %if {fedora_version} > 17
    BuildRequires: requirement
    %endif
    But it says there is an error there.

    Can somebody tell me what the problem is? i know this works if it says {suse_version} but it doesn't like it for fedora.

    Thanks

  2. #2
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    32,352
    Blog Entries
    15

    Default Re: Question about %if

    On Sun 29 Dec 2013 05:26:01 PM CST, jurgen73 wrote:


    Hey guys,

    I'm building a package for OpenSUSE and Fedora, the problem is that the
    requirements to build "BuildRequires line" is different for both:

    For example the OpenSUSE requirement looks like this:
    requirement-devel

    While fedora looks like this:
    requirement

    I tried adding:


    Code:
    --------------------
    %if {fedora_version} > 17
    BuildRequires: requirement
    %endif
    --------------------


    But it says there is an error there.

    Can somebody tell me what the problem is? i know this works if it says
    {suse_version} but it doesn't like it for fedora.

    Thanks


    Hi
    It should be;
    Code:
    %if 0%{?fedora} > 17
    See here;
    http://en.opensuse.org/openSUSE:Buil...ribution_howto

    --
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SLED 11 SP3 (x86_64) GNOME 2.28.0 Kernel 3.0.101-0.8-default
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!


  3. #3

    Thumbs up Re: Question about %if

    Thanks a million, why isn't this documentation in one big PDF file, it would be easier to find.

    Quote Originally Posted by malcolmlewis View Post
    Hi
    It should be;
    Code:
    %if 0%{?fedora} > 17
    See here;
    openSUSE:Build Service cross distribution howto - openSUSE

    --
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SLED 11 SP3 (x86_64) GNOME 2.28.0 Kernel 3.0.101-0.8-default
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  4. #4
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    32,352
    Blog Entries
    15

    Default Re: Question about %if

    On Sun 29 Dec 2013 10:56:03 PM CST, jurgen73 wrote:


    Thanks a million, why isn't this documentation in one big PDF file, it
    would be easier to find.

    malcolmlewis;2612296 Wrote:
    > Hi
    > It should be;
    > >

    Code:
    --------------------
    > >

    > %if 0%{?fedora} > 17
    >

    --------------------
    > >

    > See here;
    > 'openSUSE:Build Service cross distribution howto - openSUSE'
    > (http://tinyurl.com/2b44jhd)
    >

    Hi
    Your welcome It is, sort of, just not a pdf.... Start here;
    http://en.opensuse.org/Portalackaging

    --
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SLED 11 SP3 (x86_64) GNOME 2.28.0 Kernel 3.0.101-0.8-default
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!


  5. #5

    Smile Re: Question about %if

    Thanks everybody,

    0%{?fedora} worked like a charm, but I'm having another problem, I'm trying to build a library and when OBS gets to this part of the spec file:

    Code:
    %install
    %{__make} install
    It says it cannot copy regylar file /usr/lib/library-version.so: access denied.

    I thought OBS did all the process using root privileges and if root cannot copy a file to that folder what can be causing that?

    Thanks,

  6. #6
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    32,352
    Blog Entries
    15

    Default Re: Question about %if

    On Fri 10 Jan 2014 12:56:01 AM CST, jurgen73 wrote:


    Thanks everybody,

    0%{?fedora} worked like a charm, but I'm having another problem, I'm
    trying to build a library and when OBS gets to this part of the spec
    file:


    Code:
    --------------------
    %install
    %{__make} install
    --------------------


    It says it cannot copy regylar file /usr/lib/library-version.so: access
    denied.

    I thought OBS did all the process using root privileges and if root
    cannot copy a file to that folder what can be causing that?

    Thanks,


    Hi
    Because your not trying to install in the buildroot, you need to check
    the Makefile to see if it respects DESTDIR.
    Code:
    make DESTDIR=%{buildroot} install
    --
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    openSUSE 13.1 (Bottle) (x86_64) GNOME 3.10.2 Kernel 3.11.6-4-desktop
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •