RPM101: A gentle intro to creating your own packages Richard Keech Red Hat Asia-Pacific.

Slides:



Advertisements
Similar presentations
© Novell, Inc. XBS Build Buddy: The Ximian Build System Dan Mills.
Advertisements

Biopackages.net Operating System Packages for Bioinformatics Allen Day
2 Copyright © 2009, Oracle. All rights reserved. Installing your Oracle Software.
Linux+ Guide to Linux Certification Chapter 12 Compression, System Backup, and Software Installation.
Overview Basic functions Features Installation: Windows host and Linux host.
Linux+ Guide to Linux Certification, Third Edition Chapter 11 Compression, System Backup, and Software Installation.
Deploying and Managing Software by Using Group Policy.
Chapter 11 Compression, System Backup, and Software Installation.
Downloading & Installing Software Chapter 13. Maintaining the System Yum Pirut BitTiorrent Rpm Keeping Software Up To Date Up2date Red Hat Network Wget.
Migration XenDesktop 7. © 2013 Citrix | Confidential – Do Not Distribute Migration prerequisites Set up a XenDesktop 7 Site, including the site database.
Linux Operations and Administration
Linux+ Guide to Linux Certification
Dustin Harman VM Workshop 2015 RPM Basics. What is RPM? Red Hat Package Manager Native package manager on RHEL, Fedora, SUSE, some Mandriva RPM/SRPM files.
70-294: MCSE Guide to Microsoft Windows Server 2003 Active Directory Chapter 12: Deploying and Managing Software with Group Policy.
SUSE Linux Enterprise Server Administration (Course 3037) Chapter 4 Manage Software for SUSE Linux Enterprise Server.
Package Management How to use rpms. Topics The Problem of Software Installation Package Management Systems Using RPM Finding RPMs Building RPMs.
Install Software. UNIX Shell The UNIX/LINUX shell is a program important part of a Unix system. interface between the user & UNIX kernel starts running.
A Practical Guide to Fedora and Red Hat Enterprise Linux Unit 8: Installing Software in Linux Chapter 13: Downloading and Installing Software By Fred R.
CVS – concurrent versions system Network Management Workshop intERlab at AIT Thailand March 11-15, 2008.
Guide to Linux Installation and Administration1 Chapter 4 Running a Linux System.
Ant & Jar Ant – Java-based build tool Jar – pkzip archive, that contains metadata (a manifest file) that the JRE understands.
Module 6: Deploying and Managing Software by Using Group Policy.
What is a port The Ports Collection is essentially a set of Makefiles, patches, and description files placed in /usr/ports. The port includes instructions.
Deploying Software with Group Policy Chapter Twelve.
GLite build and integration system Building and Packaging Robert HARAKALY
Installation of packages Objectives –Using software packaging tools Contents –Application delivered as –Where to get commonly used rpm’s –Autofs on! –Getting.
Tanner Lovelace – Slide 1 RPM Packaging 101 Tanner Lovelace Triangle Linux Users Group 11/Jan/2003.
Software in the Data Protector Architecture
RedHat Package Management RPM and YUM in RedHat Enterprise, Fedora, Suse and Centos.
Debian Package Management
Installation. All Rights Reserved © Alcatel-Lucent | Installation Module Objectives  Installation  Startup and process monitoring  Uninstallation.
CACI Proprietary Information | Date 1 Upgrading to webMethods Product Suite Name: Semarria Rosemond Title: Systems Analyst, Lead Date: December 8,
Operated by Los Alamos National Security, LLC for NNSA U N C L A S S I F I E D Slide 1 Institutional Install of Red Hat Enterprise Linux From One CD In.
Tito Miroslav Suchý Red Hat
Ellucian Solution Manager at UNM
System Administration Application Management. ● A common task for a system administrator is the installation, updating and removal of software. Several.
Getting Started in RPM Packaging Izhar Firdaus / KageSenshi Contributor Fedora Project
Into Fedora RPM packages Lubomir Rintel Presented by Fedora Package Maintainer Creative Commons Attribution-ShareAlike license applies. Packaging Gems.
Perl in RPM-Land Dave Cross Magnum Solutions Ltd YAPC::Europe 15 th August 2008.
Sitecore upgrades The Past, The Present, The Future.
1 April 2, Software Packaging and Releasing Best Practices William Cohen NCSU CSC 591W April 2, 2008.
Packaging Software for Debian Roberto C. Sánchez Ohio Linuxfest Saturday, September 29, 2007.
Building Good RPM Packages
Chapter 9 Managing Software
Chuan-kai Lin Drake Diedrich Google Inc.
Installation of the ALICE Software
Hadoop Architecture Mr. Sriram
How to make good RPM Packages
RPM Packaging for Sysadmins
Build Automation with Gradle
Connect:Direct for UNIX v4.2.x Silent Installation
CCNA Routing and Switching Routing and Switching Essentials v6.0
CVS – concurrent versions system
Provisioning with custom builds and Kickstart
Packaging Example All Hands Meeting, Padova,
Upgrade SFX V3 to V4 Lieve Rottiers.
Managing Software.
Chapter 10: Device Discovery, Management, and Maintenance
CCNA Routing and Switching Routing and Switching Essentials v6.0
Get Oracle 8i Running on Your Linux Server Straight Away!
RedHat Package Management
Chapter 10: Device Discovery, Management, and Maintenance
University of Texas Rio Grande Valley Systems Administration CSCI 6175
Tanner Lovelace Triangle Linux Users Group 11/Jan/2003
Microsoft Virtual Academy
Your code is not just…your code
Microsoft Office Not in Textbook.
Periodic Processes Chapter 9.
Perl in RPM-Land Dave Cross Magnum Solutions Ltd YAPC::Europe
Your code is not just…your code
Presentation transcript:

RPM101: A gentle intro to creating your own packages Richard Keech Red Hat Asia-Pacific

Agenda Issues What's in an RPM SPEC files Rolling your own package

The RPM way For both core OS and add-ons Installation is not interactive ● Installation separated from configuration No such thing as a patch A file can only belong to one package Pristine source plus patches

RPM packaging Installed state becomes: ● Visible ● Verifiable ● Upgradable

RPM packaging Packages contain ● Files (obviously!) ● Scripts (install & uninstall) ● Metadata

Creating your own RPMs Benefits: ● Modular installation, removal and upgrading ● Rapid deployment ● Controlled configuration ● Integrates with OS dependencies Benefits – developers ● Repeatable builds ● Dependency handling ● Configuration control

Creating your own RPMs General approach: ● Create tar archive of manual install ● Create / adapt a SPEC file Outcome: ● End-usable package file ● 'Source' package file

Build tree /usr/src/redhat/ BUILD/ RPMS/ i386 noarch SOURCES/ SPECS/ SRPMS/

RPM Macros Variables and functions Defaults in /usr/lib/rpm/macros Overrides in /etc/rpm/macros.* and ~/.rpmmacros Users should set %{_topdir} macro, otherwise build will be in /usr/src/redhat

SPEC file: preamble Name: hello Version: 1.0 Release: 1 Summary: Hello, world! Group: Applications/Productivity License: Distributable Source0: hello-1.0.tar.gz Source1: hello.sh Source2: hello.csh BuildArch: i686 BuildRoot: /var/tmp/hello-root %description An enthusiastic greeting to the world of RPM building.

SPEC file: %prep %prep prepares sources ● Unpacks pristine sources into BUILD ● Applies any necessary patches Useful macros ● %setup ● %patch

SPEC file: %build %build compiles and prepares the software Runs as a shell script %configure macro make

SPEC file: %install %install prepares files for packaging Chroot tree - BuildRoot $RPM_BUILD_ROOT set %makeinstall

SPEC file: %clean %clean removes temporary files after the build Typically remove BuildRoot tree %clean rpm -rf $RPM_BUILD_ROOT

SPEC file: Scripts Should never be interactive %pre -- prior to file installation ● Adding users and groups %post -- after file installation ● chkconfig –add ● service re-start %preun – before file removal ● chkconfig --del %postun – after file removal rpm -q --scripts pkgname

SPEC file: %files %files lists all the files Sufficient to specify the base directory if all files are included %dir to specify empty directories %defattr(mode,user,group) filename %config %doc

SPEC file: %changelog %changelog records package history Date format: +”%a %b %d %Y” Show using rpm -q --changelog pkg

rpmbuild rpmbuild -bp specfile prep only rpmbuild -bc specfile prep and compile rpmbuild -bb specfile prep and compile and install rpmbuild -bs specfile build source pkg only rpmbuild -ba specfile all, ie binary and source pkg

Signing RPM packages GPG key required Signing is generally encouraged Signing is mandatory for many repos rpmbuild --sign rpmbuild --resign Macros: %_signature gpg %gpg_name My Name Make public key available

References Red Hat RPM Guide

Demo (time permitting)

Example: RPMs of Oracle DB Roll your own: encapsulation / backup of the Oracle install you'd do by hand find a spec file that does something similar Example: Red Hat product “Satellite” embeds Oracle Server Example: Oracle Express available as RPM

RPMs of Oracle DB oracle-server i386.rpm 162MB oracle-server-prod rhgps.x86_64.rpm 1017MB

Recommendations / Observations Sysadmin and DBA collaborate to prepare RPM of your way of doing Oracle DBA can prepare and maintain their own scripts / utilities RPM package. Sysadmin can prepare and maintain their own custom Red Hat CD Easy to leverage one project for the next Red Hat & TPS can meld for highly repeatable, productized deliverables

Thank you Any questions?