Tux
Communication
Mailing lists
Documentation
User Manual
Target board info.
Target chip info.
Support
Linux support
Bugzilla
Downloads
STLinux
Updates
Search
Google


The web
stlinux.com
Getting Started
Building SRPMs
ST Logo
Previous   Contents   Next

Sometimes you may want to rebuild one of the supplied SRPMs. This is very simple to do, but relies on a couple of features of RPM which may not be familiar to users who have only ever used it for installing binary RPMs.

All the macros needed to do the build are specified in the stm-host-rpmconfig RPM. This is supplied with the distribution, but not installed by default. So first this needs to be installed (as root) by:

rpm -ihv stm-host-rpmconfig-1.0-2.noarch.rpm

From now on you do not need to be root, and the process does not modify the RPM database.

Assuming you do not want to build in the normal RPM build area (which you can do without any problems, just remove the _topdir macro from localmacros), first cd into the directory where you want to do the build, and create the build hierarchy:

mkdir -p SOURCES SPECS BUILD SRPMS RPMS/{noarch,i386,sh4}

Next there are a couple of options which we need to give RPM, and which can only be specified in configuration files. These control the root of the RPM build tree, and where to search for macro definitions. Note that the localrc file just contains one long line, it is shown here broken into a number of lines for clarity:

echo "%_topdir	`pwd`" > localmacros
echo "macrofiles: /usr/lib/rpm/macros:
	/opt/STM/ST40Linux-1.0/config/rpm/hosts/i686-pc-linux-gnu:
	/opt/STM/ST40Linux-1.0/config/rpm/targets/sh4-linux:
	/opt/STM/ST40Linux-1.0/config/rpm/common:
	`pwd`/localmacros" > localrc

Next install the SRPM into this structure:

rpm --rcfile localrc -Uhv stm-target-util-linux-2.11n-1.src.rpm 

substituting the name of the required SRPM.

Finally build the package:

rpm --rcfile localrc -ba -v --target=sh4-linux SPECS/stm-target-util-linux.spec 

If the package is for the host instead of the target, just remove the --target option.

Previous   Contents   Next
Valid HTML 4.01! Last updated: 2002/10/31 15:45:05
© Copyright STMicroelectronics Limited, 2005
Printer