UserPreferences

RPMHowto


1. RPM Howto

This is a page to list our some hints on making RPMs for RPM-based systems (like Fedora).

First, you need a .spec file.

%define _prefix /usr/local

Summary: A Simple Program
Name: simple
Version: 1.0
Release: 1
License: GPL
Group: Application
URL: http://dangermouse.brynmawr.edu/
Source0: %{name}-%{version}.tgz
Prefix: /usr/local

%description
This is a simple test to see how this works.

%prep
%setup -q
%configure

%build
g++ simple.c -o simple

%install
rm -rf $RPM_BUILD_ROOT
install simple %{_bindir}

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%{_bindir}/simple

Then you need the source file. Put it in /usr/src/redhat/SOURCES

This assumes that the tar file is NAME-VERSION-RELEASE.tgz

If the name of the directory that you would cd into is not NAME-VERSION-RELEASE, then put the directory name here:

%setup -q -n NAME

The top line is to give a default for the initial build.

/!\ If the prefix is given in the configure step, then it is not relocateble! Remove the "Prefix:" line.