Getting Started in RPM Packaging Izhar Firdaus / KageSenshi Contributor Fedora Project

Slides:



Advertisements
Similar presentations
Install Software in Ubuntu. Do you have Internet? Everything is on the Internet and Free!
Advertisements

IERG4180 Tutorial 4 Jim.
Reproducible Environment for Scientific Applications (Lab session) Tak-Lon (Stephen) Wu.
Installing Linux softwares Sirak Kaewjamnong. 2 Software packets  When Linux developers create their software they typically bundle all the executable.
Solaris Software Packaging and Installation Paul Foster 14/11/2000.
1 Introduction to Tool chains. 2 Tool chain for the Sitara Family (but it is true for other ARM based devices as well) A tool chain is a collection of.
Downloading & Installing Software Chapter 13. Maintaining the System Yum Pirut BitTiorrent Rpm Keeping Software Up To Date Up2date Red Hat Network Wget.
Module 10 – Linux Installations. Wikipedia: Red Hat Package Manager or RPM Package Manager (RPM) is a package management system. The name RPM variously.
Installing and Configuring Tomcat A quick guide to getting things set up on Windows.
Linux Operations and Administration
SCRAM Software Configuration, Release And Management Background SCRAM has been developed to enable large, geographically dispersed and autonomous groups.
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.
CCA Port, Component & Application Build Skeleton Templates “A new script toolkit for generating CCA build skeletons” Torsten Wilde and James Kohl Oak Ridge.
CENT 305 Information Systems Security Linux Introduction.
Package Management How to use rpms. Topics The Problem of Software Installation Package Management Systems Using RPM Finding RPMs Building RPMs.
SUSE Linux Enterprise Desktop Administration Chapter 6 Manage Software.
Michael Still Google Inc. October, Managing Unix servers the slack way Tools and techniques for managing large numbers of Unix machines Michael.
9/2/ CS171 -Math & Computer Science Department at Emory University.
Introduction Advantages/ disadvantages Code examples Speed Summary Running on the AOD Analysis Platforms 1/11/2007 Andrew Mehta.
March 11, 2008 USCMS Tier-2 Workshop Oh Dear God Alain made a PowerPoint presentation 1.
Installation of packages Objectives –Using software packaging tools Contents –Application delivered as –Where to get commonly used rpm’s –Autofs on! –Getting.
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.
Installation of packages Objectives –Using software packaging tools Contents –Application delivered as –Where to get commonly used rpm’s –Autofs on! –Getting.
HTML Basics. HTML Coding HTML Hypertext markup language The code used to create web pages.
2136 Gallows Road, Suite F, Dunn Loring, VA Phone: Fax: Business Analyst Training 1 Module 5.2 Rational ClearCase.
More Unix Naomi Altman. Directories Directory = folder mkdir - makes a new directory rmdir - removes an empty directory cd mydirectory - moves you into.
Yannick Patois - Datagrid Software Repository Presentation - March, n° 1 Datagrid Software Repository Presentation CVS, packages and automatic.
Tanner Lovelace – Slide 1 RPM Packaging 101 Tanner Lovelace Triangle Linux Users Group 11/Jan/2003.
Andrew McNab - Globus Distribution for Testbed 1 Globus Distribution for Testbed 1 Andrew McNab, University of Manchester
Installing Applications in FreeBSD lctseng. Computer Center, CS, NCTU 2 Before we start  Permission issue root: the super user Like administrator in.
Build Tools 1. Building a program for a large project is usually managed by a build tool that controls the various steps involved. These steps may include:
Tito Miroslav Suchý Red Hat
System Administration Application Management. ● A common task for a system administrator is the installation, updating and removal of software. Several.
Linux Basics Part 2. VIM Editor vi improved Installed on most Linux machines Can be a bit confusing at first... o Cheat sheets FTW Other popular editors:
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.
How to participate Introduction in creating RPM packages.
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.
RPM101: A gentle intro to creating your own packages Richard Keech Red Hat Asia-Pacific.
Building Good RPM Packages
New Tools Used by the Scientific Linux Team
Installing Applications in FreeBSD
Outline Installing Gem5 SPEC2006 for Gem5 Configuring Gem5.
Cross-Distribution Packaging Made Easy OSDC 2011, Canberra
Open-O Integration Project Introduction
Development Environment
Installation of the ALICE Software
Installation of MySQL Objectives Contents Practical Summary
Build process of ovirt-node and the plugins
application into a Flatpak
How to make good RPM Packages
RPM Packaging for Sysadmins
Packaging a Structural Biology Application – imod / 3dmod
Topics Introduction Hardware and Software How Computers Store Data
Packaging Example All Hands Meeting, Padova,
Introduction to .NET Core
COMP Introduction to Operating Systems Project 1 – Installing CentOS
Workshop: Building Good Fedora Packages
Build and Package CSE 403 section, 2011 Feb 3, Hao Lu.
June 2011 David Front Weizmann Institute
Let's Learn Python and Pygame
University of Texas Rio Grande Valley Systems Administration CSCI 6175
Tanner Lovelace Triangle Linux Users Group 11/Jan/2003
How to Run a Java Program
Topics Introduction Hardware and Software How Computers Store Data
BSc in Digital Media, PSUIC
Perl in RPM-Land Dave Cross Magnum Solutions Ltd YAPC::Europe
Advanced Programming TA Session 3
Outline Announcements: Version control with CVS HW II due today!
Presentation transcript:

Getting Started in RPM Packaging Izhar Firdaus / KageSenshi Contributor Fedora Project

WARNING Geek Stuff Alert!!

Whats covered, and whats not 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

Presentation 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 Moving Forward Best Practises Contributing to Fedora Packaging Project

9/29/20165 Getting Started : A quick intro to RPM RPM Package Manager Used widely in Fedora and Fedora based distros. Also used in OpenSuSE Mandriva, and other distros with lineage from RHL YUM Update Manager Dependency resolution tool which manage RPM packages. YUM != RPM

9/29/20166 Getting Started : How RPMs are packaged 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!.

9/29/20167 RPM Packaging Basics : The Toolset RPMBuild Obviously, used for building RPM yum install rpmdevtools This is the primary tool needed for building RPM. rpmbuild -ba mypackage.spec rpmbuild --rebuild mypackage.src.rpm rpmbuild -ta mypackage.tar.bz2

9/29/20168 RPM Packaging Basics : The Toolset GCC and friends Without these you can't build anything In Fedora, best to have "Development Tools" group installed yum groupinstall "Development Tools" Others nice-to-have python-devel – if ure doing python packages openjdk-devel – if ure trying to package a Java stuff etc

9/29/20169 RPM Packaging Basics : 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)

9/29/ RPM Packaging Basics : The SPEC file Case Study : Nitrogen Nitrogen is a tool for setting up different background on different screens on a multi-monitor machine running GNOME Straightforward package Should cover the basics of RPM packaging

9/29/ RPM Packaging Basics : The SPEC file Headers Metadata configuration about the package Define the name, description, version, build dependencies, etc.

9/29/ RPM Packaging Basics : The SPEC file Name: nitrogen Version: 1.4 Release: 1%{?dist} Summary: Background browser and setter for X windows. Group: User Interface/Desktop License: GPLv2+ URL: Source0: BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: gtkmm24-devel gtk2-devel glib-devel glib2-devel xorg-x11-proto-devel BuildRequires: intltool gettext %description Nitrogen is a background browser and setter for X windows. It is written in C++ using the gtkmm toolkit. It can be used in two modes: browser and recall. Nitrogen has been in development for over 2 years, due to real life and laziness. For more info, check out

9/29/ RPM Packaging Basics : The SPEC file Package information Name: nitrogen Version: 1.4 Release: 1%{?dist} Summary: Background browser and setter for X windows. Group: User Interface/Desktop License: GPLv2+ URL:

9/29/ RPM Packaging Basics : The SPEC file Source information Define the location and filename of the source tarball, patches, etc. Build dependencies Define the packages that required to be installed first before compiling. Source0: BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: gtkmm24-devel gtk2-devel BuildRequires: glib-devel glib2-devel xorg-x11-proto-devel BuildRequires: intltool gettext

9/29/ RPM Packaging Basics : The SPEC file %prep section Section for script to prepare the package source code before compiling Usually where scripts to extract the tarball, apply patches, copy/move files are defined. The script style is similar to a sh script, with some additional RPM helper macros to aid on stuff. Common simplest example: %prep %setup -q ** %setup macro will extract the source0 tarball and chdir into it.

9/29/ RPM Packaging Basics : The SPEC file %build section Section for scripts which configure and compile the source code../configure && make - kind of scripts Commonly used macro for configure - %configure Set the proper autoconf values for RPM building Eg: %build %configure make %{?_smp_mflags}

9/29/ RPM Packaging Basics : The SPEC file %install section Where the script to install the files into the RPM system root make install Can also use the cp command to install or other way to install files Eg: %install rm -rf $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT

9/29/ RPM Packaging Basics : The SPEC file %clean section Clean everything, usually, just rm -rf the extracted source. %clean rm -rf $RPM_BUILD_ROOT

9/29/ RPM Packaging Basics : The SPEC file %files section Listing of files installed by the package %files %defattr(-,root,root,-) %doc README COPYING INSTALL AUTHORS %{_bindir}/nitrogen %{_datadir}/icons/hicolor/*/apps/nitrogen.png %{_datadir}/icons/hicolor/*/actions/wallpaper-tiled.png %{_datadir}/icons/hicolor/*/actions/wallpaper-centered.png %{_datadir}/icons/hicolor/*/actions/wallpaper-scaled.png %{_datadir}/icons/hicolor/*/actions/wallpaper-zoomed.png %{_datadir}/icons/hicolor/*/devices/video-display.png %{_datadir}/icons/hicolor/*/mimetypes/image-x-generic.png %{_mandir}/man1/nitrogen.1.gz

9/29/ RPM Packaging Basics : 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/29/ RPM Packaging Basics : Building the RPM package After writing the specfile, the tarball, and related files need to be put in correct rpmbuild location. 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

9/29/ RPM Packaging Basics : Building the RPM package 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, if theres no problem with your spec, after successful build, Source RPM will be saved in SRPMS folder, and binary RPM will be saved in RPMS folder. Test install, debug if have problem, then, Profit!!!

9/29/ Moving Forward : Best Practices Try to use built in helper macro if possible Keep It Simple S***** Dependencies should not be bundled together Spec should be reproduceable repetitively across different system

9/29/ Moving Forward : Contributing to Fedora Packaging Project Start writing your own RPM package!! Contribute to Fedora Project, Grab some softwares which are not packaged in Fedora Repository, package them, and submit for review Be A Fedora Packager !!