How-To create a RPM -- page 2 -- the .spec file
2. Creating the package
2.1. Getting the sources
In the first place, we need to get the software source available on our system. As said earlier, the directory to host the sources is: SOURCES ;), therefore we are going to cd to this directory and download the source there.
$ cd ~/packages/SOURCES/
$ wget http://kitone.free.fr/subtitleeditor/files/subtitleeditor-0.20.0alpha4.tar.gz
Only .tar.gz, .tar, .tgz and .tar.Z can be used with RPM.
Now, we have our source, let's go and create our spec file.
2.2. The .spec file
The .spec is the file holding the information on how-to build the package. This file will contain section for unpacking the sources, building them, installing, removing the files. It will also contains meta-information on the software such as the version, the dependencies ....
Let's go to the SPECS directory and create our .spec file:
$ cd ~/packages/SPECS
$ vi subtitleeditor.spec
Summary: Subtitle editor
Name: subtitleeditor
Version: 0.20.0alpha4
Release: 1.rb7
License: GPL
Group: Applications/Multimedia
URL: http://kitone.free.fr/subtitleeditor/
Source: http://kitone.free.fr/subtitleeditor/files/subtitleeditor-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
Patch: gtk_update_icon_cache.patch
BuildRequires: gstreamer-plugins-base-devel, gtk2-devel, gtkmm24-devel, libglademm24-devel
BuildRequires: gstreamer-devel, pcre-devel, libxml++-devel, enchant-devel, iso-codes-devel
Packager: chantra
%description
Subtitle Editor is a GTK+2 tool to edit subtitles for GNU/*.
It can be used for new subtitles or as a tool to transform, edit,
correct and refine existing subtitle. This program also shows sound
waves, which makes it easier to synchronise subtitles to voices.
Subtitle Editor is free software released under the GNU General Public License (GPL).
%prep
%setup -q
%patch -p1 -b .buildroot
%build
%configure --disable-debug
%{__make}
%install
%{__rm} -rf %{buildroot}
%makeinstall
%find_lang %{name}
%clean
%{__rm} -rf %{buildroot}
%files -f %{name}.lang
%defattr(-, root, root, 0755)
%doc AUTHORS ChangeLog INSTALL NEWS TODO README COPYING
%{_bindir}/subtitleeditor
%{_datadir}/subtitleeditor/
%{_datadir}/icons/hicolor/*
%exclude %{_datadir}/icons/hicolor/icon-theme.cache
%{_datadir}/applications/subtitleeditor.desktop
%changelog
* Fri Aug 3 2007 - chantra AatT rpm-based DdOoTt org 0.20.alpha4-1.rb
- Initial release.
This is it, this .spec file contains all the information required to create an RPM from the sources. Let go through this file to get a better understanding of what's happening.
- Login or register to post comments
- Download PDF












