Ask Your Question
1

Build platform specific RPM

asked 2017-11-02 19:56:35 -0600

MKD gravatar image

I am automating the process of uploading SRPM. I want to build my packages for Fedora and CentOS. I will be generating SRPMs individually for Fedora and centOS to match up the RHEL platform. Is there a command line tool to switch off building for CentOS when Fedora SRPM is uploaded to COPR and vice versa?

When done manually, I'll be clearing the CentOS checkbox and select Fedora platform for Fedora generated SRPMs. Likewise for the other-way round.

edit retag flag offensive close merge delete

Comments

I think, not sure as have not done it, you could add and if condition on the spec file that include the excludearch depending if Centos or Fedora

aeperezt gravatar imageaeperezt ( 2017-11-02 20:42:16 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-11-03 18:08:00 -0600

davidva gravatar image

I will be generating SRPMs individually for Fedora and centOS

Why? you only need write what is for fedora or centOS... and it is easy with conditionals in DistTag...

example...

%if 0%{?fedora}
Requires:  foo
%else
Requires: foo
%endif

Is there a command line tool to switch off building for CentOS when Fedora SRPM is uploaded to COPR and vice versa?"

yes with copr-cli...

Example:

copr-cli build -r fedora-27-x86_64 -r fedora-27-i386 "youruser/yourproject" foo.src.rpm
edit flag offensive delete link more

Comments

"you only need write what is for fedora or centOS" - I was mentioning the generation of SRPM for the same package in CentOS and Fedora platforms. Will SRPM generated in Fedora work for CentOS as well in COPR? (I was thinking a package built on CentOS will closely resemble RHEL built)

MKD gravatar imageMKD ( 2017-11-10 10:33:17 -0600 )edit

Generally, what is copr? a internet GUI/graphic web of "mock". Mock works in Fedora, Centos, RedHat, Mageia, the unique difference are the repositories and names in the dependencies... then if you make correctly the src.rpm works fine in Centos, Fedora, mageia.....

davidva gravatar imagedavidva ( 2017-11-10 16:37:07 -0600 )edit

Question Tools

Stats

Asked: 2017-11-02 19:56:35 -0600

Seen: 100 times

Last updated: Nov 03 '17