This document provides an introduction to creating RPM packages on Fedora. It covers the basic concepts of RPM packaging including the toolset, SPEC files, and building packages. The presentation outlines the steps for getting started with RPM packaging, including writing a SPEC file, building a package, and submitting it for review. Useful resources for RPM packaging are also provided.
2. Florian Tani
Presented by
Licensed under a Creative Commons Attribution-ShareAlike (BY-SA) 3.0 license. http://creativecommons.org/by-sa/3.0/
Introduction in creating
RPM packages
3. Stuff covered
Basic concept of RPM packaging
How to write a simple SPEC for a simple package
Stuff not covered
Stuff from Fedora Packaging Guidelines
Advanced tricks around RPM packaging
Whatever off-topic
Matter of day
4. Outline
Getting Started
Quick into to RPM
How RPMs are packaged
RPM Packaging Basics
The toolset
The SPEC file
Writing a SPEC file
Building your package
5. Getting Started
Creating a RPM package is easy
Equivalent to writing a script for automatically
compile and install a particular source code package
With some extra rules to follow
Straightforward, write a SPEC, put the source
tarball and the SPEC in the correct place, run
rpmbuild, wait, fun, profit!.
6. The Toolset
RPMBuild
Obviously, used for building RPM
yum install rpmdevtools fedora-packager
This is the primary tool needed for building RPM.
rpmbuild -ba mypackage.spec
rpmbuild --rebuild mypackage.src.rpm
rpmbuild -ta mypackage.tar.bz2
Exist an Eclipse plug-in called :
Fedora Packager
yum install eclipse-fedorapackager
7. The SPEC file
Look at it as the specification
config for a RPM package
Generally consist of several parts
Headers
Source preparation script (%prep)
Build script (%build)
Install script (%install)
Post-installation cleanup script (%clean)
Installed files listing (%files)
SPEC changelog (%changelog)
8. Writing a SPEC file
General steps
Define the package information
Figure out the dependencies required for
building the package and define in the spec
Write the prepare script
Write the build script
Write the install script
Define files included in the package
9. Building RPM packages
To create a RPM build tree skeleton
rpmdev-setuptree
This will create a tree in ~/rpmbuild
containing:
BUILD – folder for temporary build files
BUILDROOT – folder for temporary install files
RPMS – generated RPMs are saved here
SOURCES – where you should put your
source tarballs
SPECS – where you should pun your specfile
10. Building RPM packages
Save the specfile in the SPEC folder
Copy the source tarballs to the SOURCES
folder
Chdir to the SPEC folder, and build!!!
rpmbuild -ba yourspecfile.spec
The build process will run,Source RPM will
be saved in SRPMS folder, and binary RPM
will be saved in RPMS folder.
11. Make the step
Grab some softwares which are not
packaged in Fedora Repository, package
them, and submit for review on Bugzilla
Start writing your RPM package!
Be A Fedora Packager
http://join.fedoraproject.org
http://fedoraproject.org/wiki/Join_the_packag
e_collection_maintainers
12. Useful Links
Fedora Packaging Guidelines:
https://fedoraproject.org/wiki/Packaging:Guidelines
https://fedoraproject.org/wiki/Packaging:ReviewGuidelines
Maximum RPM:
http://www.rpm.org/max-rpm-snapshot/
Fedora GIT Tree (contains lots of example specs)
http://pkgs.fedoraproject.org/gitweb/ (be patient with it)
Fedora packaging mailing list
https://admin.fedoraproject.org/mailman/listinfo/packaging
Rpmlint website:
http://rpmlint.zarb.org/cgi-bin/trac.cgi
13. Any questions?
Any volunteers?
Licensed under a Creative Commons Attribution-ShareAlike (BY-SA) 3.0 license. http://creativecommons.org/by-sa/3.0/
linux@openlabs.cc
floriantani@gmail.com
Contact: