示例来源于rpmbuild官网:https://rpmbuildtut.wordpress.com/development-packages/
vpython 的一个依赖包,gtkglarea,的spec文件(粗体部分为构建Development包时的内容):
Name: gtkglarea
Version: 1.2.3
Release: 1%{?dist}
Summary: Gtkglarea is an opengl wigdet for the gtk+ gui toolkit
Group: Development/Libraries
License: GPLv2+
URL: http://www.bradlongo.wordpress.com
Source0: gtkglarea-1.2.3.tar.gz
Patch0:gtkglarea.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: gtk±devel >= 1.2
Requires: gtk+ >= 1.2
%description
Gtkglarea is an opengl widget similar to the GtkDrawingArea.
%package devel
Group: Development/Libraries
Summary: Development files for gtkglarea
Requires: gtkglarea == 1.2.3
%description devel
Development files for gtkglarea.
%post -p /sbin/ldconfig
%prep
%setup -q
%patch0 -p1
%build
%configure
make %{?_smp_mflags}
%install
rm -rf
R
P
M
B
U
I
L
D
R
O
O
T
m
a
k
e
i
n
s
t
a
l
l
D
E
S
T
D
I
R
=
RPM_BUILD_ROOT make install DESTDIR=
RPMBUILDROOTmakeinstallDESTDIR=RPM_BUILD_ROOT
rm -f %{_libdir}/libgtkgl.la
rm -f $RPM_BUILD_ROOT/%{_libdir}/libgtkgl.la
%postun -p /sbin/ldconfig
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc COPYING
%doc README
%doc INSTALL
%doc AUTHORS
%{_libdir}/libgtkgl.so.5
%{_libdir}/libgtkgl.so.5.0.0
%{_datadir}/aclocal/gtkgl.m4
%files devel
%defattr(-,root,root,-)
%doc COPYING
%doc README
%doc INSTALL
%doc AUTHORS
%{_includedir}/gtkgl/gdkgl.h
%{_includedir}/gtkgl/gtkglarea.h
%{_libdir}/libgtkgl.so
%{_libdir}/libgtkgl.a
%changelog
*Sun Jul 13 2008 Brad Longo bjlongo@ncsu.edu 1.2.3-1
–Fixed files section
–Deleted zero length file.
–Created patch to get rid of rpmlint errors.
*Thu Jun 26 2008 Brad Longo bjlongo@ncsu.edu 1.2.3-1
–Initial Build.