RPM packaging @OSCAL2014
-
Upload
floriantani -
Category
Technology
-
view
173 -
download
0
description
Transcript of RPM packaging @OSCAL2014
[email protected] - 21 Mai 2008
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
Stuff coveredBasic concept of RPM packaging
How to write a simple SPEC for a simple package
Stuff not coveredStuff from Fedora Packaging Guidelines
Advanced tricks around RPM packaging
Whatever off-topic
Matter of day
OutlineGetting Started
Quick into to RPM
How RPMs are packaged
RPM Packaging BasicsThe toolset
The SPEC file
Writing a SPEC file
Building your package
Getting Started
Creating a RPM package is easyEquivalent 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!.
The ToolsetRPMBuild
Obviously, used for building RPMyum 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
The SPEC fileLook at it as the specification config for a RPM package
Generally consist of several partsHeaders
Source preparation script (%prep)
Build script (%build)
Install script (%install)
Post-installation cleanup script (%clean)
Installed files listing (%files)
SPEC changelog (%changelog)
Writing a SPEC fileGeneral 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
Building RPM packagesTo 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
Building RPM packagesSave 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.
Make the stepGrab some softwares which are not packaged in Fedora Repository, package them, and submit for review on BugzillaStart writing your RPM package!
Be A Fedora Packagerhttp://join.fedoraproject.org
http://fedoraproject.org/wiki/Join_the_package_collection_maintainers
Useful LinksFedora Packaging Guidelines:https://fedoraproject.org/wiki/Packaging:Guidelineshttps://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 listhttps://admin.fedoraproject.org/mailman/listinfo/packaging
Rpmlint website:http://rpmlint.zarb.org/cgi-bin/trac.cgi
Any questions?Any volunteers?
Licensed under a Creative Commons Attribution-ShareAlike (BY-SA) 3.0 license. http://creativecommons.org/by-sa/3.0/
[email protected]@gmail.com
Contact: