wiki:Developer/Projects/Obsolete/RPM_Packages

Version 17 (modified by JoelSherrill, on 03/10/06 at 08:00:36) (diff)

spam

Building Tool RPM Packages

Chris: This is the start of documenting building the tool RPM packages.

RTEMS provides binary tool packages in the RPM format. You need to build the packages from source so will need the RTEMS source tree, plus the source for GCC, binutils, newlib and GDB. The standard packages may require patches.

Build Machine

The current tool sets are build on Linux PC based machines. Joel uses a RedHat? 7.3 machine to give the resulting executables a wide range of machines to run on. Ralf and Chris use Fedora Core 4 machines. The page is written while building on a Fedora Core 4 machine.

The host machine needs to be a software development machine. You need to make sure you have a working GNU compile suite. If you intend to build all possible packages you will need a large amount of disk space. You need to install perl and help2man. On Fedora Core 4 you can find a help2man RPM package in the Extras RPM repository.

Source Code

To build the latest tool set you will need a current RTEMS snapshot. A CVS checkout may be suitable. You will also need to download these source code packages from the ftp://ftp.rtems.org/pub/rtems/SOURCES/ directory on the RTEMS ftp server:

Place these files in a SOURCES directory under the RPM build location you select.

RPM Base Directory

You need to selection a location on the host build machine where the RPMs are built and the resulting images left. An example is:

/opt/rtems/src

This means the source code should be placed in:

/opt/rtems/src/SOURCES

You also need to create few working directories. These are:

$ cd /opt/rtems/src $ mkdir SRPMS $ mkdir -p RPMS/noarch

RPM Macros File

Create a private RPM macros file in your home directory:

$ cat ~/.rpmmacros %_topdir /opt/rtems/src %_tmppath /tmp/rtems %_rpmdir %_topdir/%_target_os/RPMS %_srcrpmdir %_topdir/%_target_os/SRPMS %_signature gpg # %_gpg_path ~/.gnupg # %_gpg_name "RTEMS Packager" %_gpg_name rtems %vendor: OAR Corp %packager http://www.rtems.org/

The {{{%_topdir</code> field is set to your RPM Base directory.

Building

The building of the RPM packages requires a number of phases to be completed in order. Each phase requires the previous phase to be completed.

Configuring the Scripts

Enter the scripts directory of RTEMS and run configure providing a prefix address. The prefix is the . This assumes you have successfully completed a bootstrap:

$ cd /opt/rtems/src/cvs/scripts $ ./configure --prefix=/opt/rtems/current

The result are a number of specs files in each component directory. There is a spec file for each RTEMS target processor type.

Running rpmbuild

The first packages you need to build are the autotools packages. RTEMS uses autotool packages that are later releases than those found on most Linux operating sysems. To build enter the autotools directory and run rpmbuild:

$ cd autotools $ rpmbuild -ba rtems-4.7-autoconf-rtems.spec --target=i686-pc-linux-gnu

This builds autoconf for a Linux PC host.

Note: Different versions of RPM may behave differently. This may appear when building a different target. If this occurs try:

rpmbuild \

--define '_build i386-redhat-linux' \ --define '_host i686-pc-cygwin' \ --target=i686-pc-cygwin \ -ba <spec-files>