Secondary Architectures

Building your application for architectures like s390(x), PowerPC, ARMv8

Secondary Architectures

In Fedora, we call s390(x), PowerPC and ARMv8 architectures as Secondary Architectures. These are either not easily accessible or newly introduced as compared to Primary Acrhitectures

Benefits

Developers generally have an Intel (i686/x86_64) based machine, so they can build and test their applications for that. A successful build and run of an application on one architecture (e.g. x86_64) doesn’t ensure that it will compile and run successfully on other architectures (e.g. PowerPC) too. This is because behaviours like endianness, instruction set etc may vary by architectures. A developer can use Fedora Secondary architectures infrastructure to ensure that her application builds successfully on machines like PowerPC. This helps to make your application available to even larger audience.

Pre-requisites

In Fedora, every application is shipped in rpm format, which is also required to build an application using Fedora infrastructure. Most applications which meet Fedora packaging licensing will be already available in Fedora.

Make sure you first follow below checklist before you start building your application using Fedora infrastructure:

Example

The following example (iprutils package) will demonstrate how to get an rpm package available in Fedora repository:

# Clone existing package available in Fedora repository e.g. iprutils
$ fedpkg clone -a iprutils && cd iprutils && ls
   0001-Service-start-is-controled-by-udev-rule.patch  iprdbg.8.gz  iprutils.spec  sources

# Fetch latest source available in Fedora repo for application iprutils
$ fedpkg sources && ls
   0001-Service-start-is-controled-by-udev-rule.patch  iprdbg.8.gz  iprutils  iprutils-2.4.11.1.tar.gz  sources

# Generates source rpm (*.src.rpm) for iprutils which we will use in ppc-koji to build
$ fedpkg srpm
  0001-Service-start-is-controled-by-udev-rule.patch  iprdbg.8.gz  iprutils-2.4.11.1-1.fc25.src.rpm  iprutils-2.4.11.1.tar.gz  iprutils.spec  sources

Further, to modify source or spec file follow below steps:

# Create required directory structure in ~/rpmbuild/
$ rpmbuild-setuptree

# Copy original or modified spec file in ~/rpmbuild/SPECS/ directory
$ cp 0001-Service-start-is-controled-by-udev-rule.patch ~/rpmbuild/SOURCES/
$ cp iprdbg.8.gz ~/rpmbuild/SOURCES
$ cp *.tar.gz ~/rpmbuild/SOURCES
$ cp iprutils.spec ~/rpmbuild/SOURCES/

# Create srpm file
$ rpmbuild -bs ~/rpmbuild/SOURCES/iprutils.spec

Generated srpm will be available in ~/rpmbuild/SRPMS/ directory

Note: iprutils package which is used as an example may get updated later on and hence content may change.