Search Contact information
University of Cambridge Home Department of Engineering
University of Cambridge >  Engineering Department >  computing help

Writing Programs for local system installation (DRAFT)

Locally we use RPM (the RPM Package Manager) to store, query, verify, install, upgrade and remove packages.

  rpm -qa

will list our RPMs. Doing

  rpm -qa | grep cued

will list the locally produced ones. If you want to know which package a particular installed file comes from, you can use something like the following

  rpm  -q --whatprovides /usr/local/bin/xcc

Locally produced programs are stored as RPMs (preferably source RPMs - SRPMs) according to the naming scheme below. If you can't produce such files, mail teaching-support. checkinstall could be handy for making packages from ordinary Make-built software.

Naming Scheme

All locally generated teaching system RPMs should feature 'cued' somewhere in the name of the RPM. Having it only as part of the version string causes problems when updates come along.

Where the local version replaces a standard RPM then the RPM should provide the original RPM name plus any other provisions it inherits. e.g. cups-cued provides cups. This will satisfy other RPMs which depend on cups.

Where a RPM is completely bespoke, the name should start with cued. e.g. cued-dpo-tools. (some existing ones don't follow this rule, because they predate it).

All spec files ought to specify a buildroot in their header, then install files relative to $RPM_BUILD_ROOT. This keeps the install process from interfering with the underlying OS and possibly files from that being accidentally packaged without being installed.

Directory layout

Assume a GNU-like layout. Binaries to be executed by non-root users should live in /usr/local/bin. /usr/local/lib, /usr/local/share, etc should be used appropriately.


All distribution RPMs should be in /usr/src/packages on glamring. This area is backed up. At the very minimum the .src.rpm must be preserved in which the source and spec file to generate the binary RPM ought to reside.

/usr/src/packages/tarballs is one location for the source of locally generated .tar.gz files to live, but is not mandatory. That the .tar.gz files used for generating our RPMs to be in the .src.rpm is mandatory.

RPM spec file headers

Here's sample spec file
Summary: C++ graphics library
Name: cued-glue
Packager: tl136
Version: 1
Release: 1
Copyright: GPL
Group: CUED
Source0: cued-glue-1.tar.gz 

This library is used in 1A C++ teaching.
%setup -q
g++ -I/usr/include/GL -fPIC -c
g++ -shared -Wl,-soname, -o glue.o

install -s -m 755 -o 0 -g 0 /usr/local/lib
install -m 644 -o 0 -g 0 glue.h /usr/local/include
install -m 644 -o 0 -g 0 glue.1 /usr/man/man1

%doc README 

See also

© Cambridge University Engineering Dept
Information provided by Tim Love (tpl)
Last updated: June 2008