rpm packaging @oscal2014

14
[email protected] - 21 Mai 2008

Upload: floriantani

Post on 04-Jun-2015

173 views

Category:

Technology


0 download

DESCRIPTION

Presentation about a RPM packaging at Open Source Conference Albania (OSCAL) 2014

TRANSCRIPT

Page 1: RPM packaging @OSCAL2014

[email protected] - 21 Mai 2008

Page 2: RPM packaging @OSCAL2014

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

Page 3: RPM packaging @OSCAL2014

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

Page 4: RPM packaging @OSCAL2014

OutlineGetting Started

Quick into to RPM

How RPMs are packaged

RPM Packaging BasicsThe toolset

The SPEC file

Writing a SPEC file

Building your package

Page 5: RPM packaging @OSCAL2014

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!.

Page 6: RPM packaging @OSCAL2014

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

Page 7: RPM packaging @OSCAL2014

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)

Page 8: RPM packaging @OSCAL2014

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

Page 9: RPM packaging @OSCAL2014

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

Page 10: RPM packaging @OSCAL2014

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.

Page 11: RPM packaging @OSCAL2014

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

Page 12: RPM packaging @OSCAL2014

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

Page 13: RPM packaging @OSCAL2014

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:

Page 14: RPM packaging @OSCAL2014

[email protected] - 21 Mai 2008

We can't wait to impress you,

The team