Building both devel and normal version of a RPM package

ereOn picture ereOn · May 26, 2010 · Viewed 7.9k times · Source

I have a library from which I'd like to create two RPM packages.

While I found several links on how to create a basic RPM package, I can't find how to create a devel package (see this question if you wonder what a devel package is).

What do I have to do to generate both devel and non-devel versions of my RPM package ?

Thanks.

Answer

ereOn picture ereOn · May 27, 2010

I found an example of a .spec file which generates both devel and non-devel packages.

It seems you can create one (or several) sub-package(s) inside a package, appending devel (or whatever name you want to) after the %files directive.

Below is an extract from the example I posted:

Name:      kmymoney
Summary:   The Personal Finances Manager for KDE.
Version:   0.8
Release:   1.%{disttag}%{distver}
License:   GPL
Packager:  %packer
Group:     Productivity/Office/Finance
Source0:   %{name}2-%version.tar.bz2
BuildRoot: %{_tmppath}/%{name}2-%{version}-%{release}-build
BuildRequires: kdebase3-devel
Prereq: /sbin/ldconfig

%description
Description goes here...

%package devel
#Requires:
Summary: KMyMoney development files
Group: Productivity/Office/Finance
Provides: kmymoney-devel

%description devel
This package contains necessary header files for KMyMoney development.

... more to go here ...

%files
... some files ...

%files devel
... the devel files ...

Note the devel suffixes.