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:

%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

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;


%if 0%{?fedora} > 17

See here;
http://en.opensuse.org/openSUSE:Build_Service_cross_distribution_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!

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

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 :slight_smile: It is, sort of, just not a pdf… Start here;
http://en.opensuse.org/Portal:Packaging


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!

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:

%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,

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.


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!