Presentation is loading. Please wait.

Presentation is loading. Please wait.

Tanner Lovelace – Slide 1 RPM Packaging 101 Tanner Lovelace Triangle Linux Users Group 11/Jan/2003.

Similar presentations


Presentation on theme: "Tanner Lovelace – Slide 1 RPM Packaging 101 Tanner Lovelace Triangle Linux Users Group 11/Jan/2003."— Presentation transcript:

1 Tanner Lovelace – Slide 1 RPM Packaging 101 Tanner Lovelace Triangle Linux Users Group 11/Jan/2003

2 Tanner Lovelace – Slide 2 Outline Package Management BasicsPackage Management Basics RPM Package Management BasicsRPM Package Management Basics Creating Your Own RPM PackagesCreating Your Own RPM Packages Creating RPM Packages of Downloaded ProgramsCreating RPM Packages of Downloaded Programs Advanced RPM PackagingAdvanced RPM Packaging

3 Tanner Lovelace – Slide 3 Package Management Basics Why use package management?Why use package management? –OpenBSD base doesn’t –Most Linux systems do Keeps track of system packagesKeeps track of system packages –Files –Descriptions –Checksums –Other… Allows easy upgrades and uninstallsAllows easy upgrades and uninstalls

4 Tanner Lovelace – Slide 4 RPM Package Management Basics Developed by RedhatDeveloped by Redhat –Dominant distribution at the time was Slackware »Slackware has packages, but not really a package management system »RPM was a big advance over Slackware –Current stable version is 4.1 –Most commonly used version today is 4.0.x »We will be covering 4.0.x

5 Tanner Lovelace – Slide 5 RPM Package Concepts Pristine SourcesPristine Sources –Most Linux software downloaded from the Internet –Any distribution specific customizations should be kept separately in patches »Makes it easier to handle new versions Reproducible BuildsReproducible Builds –Building and packaging should be easy and reproducible –Shell script automation

6 Tanner Lovelace – Slide 6 Common RPM Installation Commands InstallationInstallation –rpm –ihv –rpm –ihv UpgradeUpgrade –rpm –Uhv –rpm –Uhv FreshenFreshen –rpm –Fhv –rpm –Fhv EraseErase –rpm –e –rpm –e

7 Tanner Lovelace – Slide 7 Other Common RPM Commands QueryQuery –rpm –q[option] –rpm –q[option] »-qi = Query Package Information »-ql = List Package Files »-qf = Query which package a file belongs to. »--queryformat – Construct Special Query »--querytags – List available tags »-p – Specify non-installed rpm package »-a – Query all installed files

8 Tanner Lovelace – Slide 8 Other Common RPM Commands VerifyVerify –rpm –V[option] –rpm –V[option] »Compare information about installed package files with information stored in rpm database and note any discrepencies. »Compares size, MD5 sum, permissions, type, owner, and group of each package file Signature checkingSignature checking –rpm {-K|--checksig} –rpm {-K|--checksig} »Checks package gpg/pgp signature Conversion to cpioConversion to cpio –rpm2cpio cpio converts rpm files to cpio streams

9 Tanner Lovelace – Slide 9 Setting up the RPM Build Environment NEVER BUILD RPMs AS ROOT!!!NEVER BUILD RPMs AS ROOT!!! ~/.rpmmacros~/.rpmmacros –%_topdir /path/to/rpm/build/env »I typically use ~/RPM –Optional temp directory »%_tmppath /path/to/tmp Create directoriesCreate directories –~/RPM/BUILD –~/RPM/RPMS/ –~/RPM/RPMS/ –~/RPM/RPMS/noarch –~/RPM/SOURCES –~/RPM/SPECS –~/RPM/SRPMS

10 Tanner Lovelace – Slide 10 Creating Your Own RPMs rpmbuild commandrpmbuild command –rpmbuild –ba – build binary and source rpms –rpmbuild –bb – build binary rpm –rpmbuild –bs – build source rpm Before version 4, the rpm command was used instead of rpmbuild.Before version 4, the rpm command was used instead of rpmbuild. –Compatibility aliases in 4.0 –Aliases removed in 4.1 (Redhat 8.0) Need source files, patches (if any) and a spec file.Need source files, patches (if any) and a spec file. –Source and patch files go in SOURCES/ –Spec file goes in SPECS/

11 Tanner Lovelace – Slide 11 RPM Spec Files Instructions for building and packaging an rpm.Instructions for building and packaging an rpm. –Building – set of shell scripts –Packaging – General info, lists of files, etc. Divided into sectionsDivided into sections –Headers (unlabeled section) –%description –%prep –%build –%install –%files –Others

12 Tanner Lovelace – Slide 12 Creating RPMs Examples See Pinky and the Brain Examples atSee Pinky and the Brain Examples at http://home.fnal.gov/~dawson/rpms/howto/index.html Sub package exampleSub package example Example of how to “rpm-ify” a package.Example of how to “rpm-ify” a package. PatchingPatching Conditional buildingConditional building

13 Tanner Lovelace – Slide 13 References References will go here when presentation goes online..References will go here when presentation goes online..


Download ppt "Tanner Lovelace – Slide 1 RPM Packaging 101 Tanner Lovelace Triangle Linux Users Group 11/Jan/2003."

Similar presentations


Ads by Google