Perl in RPM-Land Dave Cross Magnum Solutions Ltd YAPC::Europe

Slides:



Advertisements
Similar presentations
Low level CASE: Source Code Management. Source Code Management  Also known as Configuration Management  Source Code Managers are tools that: –Archive.
Advertisements

Source Code Management Or Configuration Management: How I learned to Stop Worrying and Hate My Co-workers Less.
Installing Linux softwares Sirak Kaewjamnong. 2 Software packets  When Linux developers create their software they typically bundle all the executable.
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.
Linux Operations and Administration
Erlware For Managing Distribution and Build Erlang User Conference 2007.
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.
SUSE Linux Enterprise Server Administration (Course 3037) Chapter 4 Manage Software for SUSE Linux Enterprise Server.
LPIC-1 TRAINING COURSE Topic 102: Linux Installation and package management.
Package Management How to use rpms. Topics The Problem of Software Installation Package Management Systems Using RPM Finding RPMs Building RPMs.
COSC 4750 Customizing and maintenance. Installing software Redhat/Fedora (and linux in general) has a package installer, called rpm Many programs will.
Integrating with UCSF’s Shibboleth system
October, Scientific Linux INFN/Trieste B.Gobbo – Compass R.Gomezel - T.Macorini - L.Strizzolo INFN - Trieste.
Review Security Hardening IPTables SELinux. Today Installations and updates – Rpm command and packages Apache “Issue Ownership”
DB server + PHPMyAdmin ดรัสวิน วงศ์ปรเมษฐ์ สาขาวิชาเทคโนโลยีสารสนเทศ คณะ วิทยาศาสตร์ มรภ. บร. 19/10/56.
CIT 470: Advanced Network and System AdministrationSlide #1 CIT 470: Advanced Network and System Administration Package Management.
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.
SUSE Linux Enterprise Desktop Administration Chapter 6 Manage Software.
March 11, 2008 USCMS Tier-2 Workshop Oh Dear God Alain made a PowerPoint presentation 1.
 Linux Mint is a computer operating system designed to work on most modern systems, including typical x86 and x64 PC’s. Linux Mint can be thought of.
GLite build and integration system Building and Packaging Robert HARAKALY
12 CVS Mauro Jaskelioff (originally by Gail Hopkins)
Tanner Lovelace – Slide 1 RPM Packaging 101 Tanner Lovelace Triangle Linux Users Group 11/Jan/2003.
RedHat Package Management RPM and YUM in RedHat Enterprise, Fedora, Suse and Centos.
GLite build and integration system Building and Packaging Robert HARAKALY
SCD Monthly Projects Meeting 2014 Scientific Linux Update Rennie Scott January 14, 2014.
The Great Migration: From Pacman to RPMs Alain Roy OSG Software Coordinator.
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
Luke Macken [ bodhi ]. ● History of Fedora updates ● bodhi ● goals ● features ● architecture ● using ● testing/qa ● hacking ● future ideas [ overview.
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
The firmware-tools project Matt Domsch Michael Brown.
EPEL All Hands Meeting, Padova, Mattias Ellert Uppsala University.
Perl in RPM-Land Dave Cross Magnum Solutions Ltd YAPC::Europe 15 th August 2008.
DELL PUBLIC Matt Domsch Technology Strategist, Office of the CTO, Dell September 21, 2009 Dynamic Driver Injection.
Packaging Grid Software for Linux Distributions HEPiX spring meeting 2009 Umeå Mattias Ellert, Uppsala Universitet Steffen Möller, Universität zu Lübeck.
1 April 2, Software Packaging and Releasing Best Practices William Cohen NCSU CSC 591W April 2, 2008.
April 1st, 2009 Cobbler Provisioning Made Easy Jasper Capel.
Karsten Wade Sr. Developer Community Mgr, Red Hat.
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
Development Environment
Installation of MySQL Objectives Contents Practical Summary
CIT 470: Advanced Network and System Administration
How to make good RPM Packages
Update On Scientific Linux
The 500 builds of 300 applications in the HeLmod repository will at least get you started on a full suite of scientific applications Aaron Kitzmiller,
COP 4343 Unix System Administration
The Use of AMET and Automated Scripts for Model Evaluation
CompTIA Server+ Certification (Exam SK0-004)
Overview – SOE PatchTT December 2013.
Managing Software.
Supporting the gLite release process
Spacewalk and Koji at Fermilab
Lecture 13 RPM and its advantages.
More Scripting & Chapter 11
RedHat Package Management
Lab #1 Install Linux & How to Build Live CD
University of Texas Rio Grande Valley Systems Administration CSCI 6175
Tanner Lovelace Triangle Linux Users Group 11/Jan/2003
James N. Bellinger University of Wisconsin at Madison 3 November 2010
Figure 6-4: Installation and Patching
OPS235 PACKAGE MANAGEMENT
Setting up your dev environment
Carthage ios 8 onwards Dependency manager that streamlines the process of integrating the libraries into the project.
Presentation transcript:

http://mag-sol.com/ dave@mag-sol.com Perl in RPM-Land Dave Cross Magnum Solutions Ltd http://mag-sol.com/ dave@mag-sol.com YAPC::Europe 15th August 2008

What is RPM? RPM is the “RPM Package Manager” Previously “RedHat Package Manager” Package manager for Red Hat Linux Now used by many distributions RHEL and Centos Fedora SUSE Mandriva This talk will concentrate on Fedora and Centos Perl in RPM-Land Dave Cross

Distributing RPMs An RPM is distributed as a single file package_name-version.rpm Also a source RPM package_name-version.src.rpm Contains source and build instructions Install with command line program rpm -i package_name-version.rpm Or, more usually, rpm -Uvh package_name-version.rpm Perl in RPM-Land Dave Cross

Problems With rpm Dependency hell Each RPM contains a list of required RPMs Won't install if requirements are missing Warns of missing requirements But won't install them Better to use yum instead Perl in RPM-Land Dave Cross

yum YellowDog Updater Modified yum install package-name No need to specify version Installs latest version Traces dependency tree Downloads and installs all requirements A bit like apt-get Perl in RPM-Land Dave Cross

Advantages of RPMs Dependency resolution Easy distribution Standard installation method Uninstall simply (rpm -e)‏ Built-in versioning Command line tools Tools to query RPM database Perl in RPM-Land Dave Cross

What About the CPAN Shell? The CPAN shell can do most of this But it has some problems Sysadmins often prefer RPMs RPM can handle non-CPAN dependencies Other RPMs might depend on CPAN RPMs CPAN doesn't update the RPM database The siteperl / vendorperl incompatibility Perl in RPM-Land Dave Cross

The siteperl / vendorperl Incompatibility Standard CPAN installations put modules in the siteperl directory RPM standard is to put modules in the vendorperl directory vendorperl is before siteperl in @INC Therefore mixing RPM-installed modules and CPAN-installed modules is a bad idea e.g. Updating an RPM installed module using CPAN Perl in RPM-Land Dave Cross

Dave's Rule of Mixing RPMs with CPAN Modules Never mix CPAN-installed modules and RPM-installed modules in the same Perl installation I've been following this rule for about three years now and it has made my life much happier Perl in RPM-Land Dave Cross

Corollary If you want to have a Perl installation which uses CPAN-installed modules then have one which is completely separate The system Perl already comes with a lot of RPM-installed modules so you shouldn't use CPAN to install modules there Perl in RPM-Land Dave Cross

RPMs of CPAN Modules There are two ways to get hold of RPMs of CPAN modules Find a decent RPM repository Build your own We'll look at both of these Perl in RPM-Land Dave Cross

Finding RPMs RPMs are usually distributed from online repositories yum is configured to work with these repositories List available Perl RPMs yum list available 'perl-*' Install chosen RPM yum install perl-Calendar-Simple Perl in RPM-Land Dave Cross

Yum Repositories for Fedora Many Perl RPMs in the default Fedora repository Over 900 packages available More packages added all the time Fedora Perl developers mailing list https://www.redhat.com/mailman/listinfo/fedora-perl-devel-list Perl in RPM-Land Dave Cross

Other Fedora Repositories Livna - http://rpm.livna.org/ Concentrates on packages that can't be officially distributed by Fedora Only one Perl package (perl-MythTV)‏ ATrpms - http://www.atrpms.net/ Dag Wieers - http://dag.wieers.com/rpm/ Dries Verachtert - http://dries.ulyssis.org/rpm/ Perl in RPM-Land Dave Cross

Yum Repositories for Centos As with Fedora, many modules part of the default Centos repository Also uses Fedora packages But generally a few months behind Perl in RPM-Land Dave Cross

Other Centos Repositories EPEL - http://fedoraproject.org/wiki/EPEL Extra Packages for Enterprise Linux Repackaging of Fedora packages Hosted by Fedora project RPMForge - http://rpmforge.net/ Combined repository Dag, Dries and a couple of smaller repositories Perl in RPM-Land Dave Cross

Latest Repository News Dag, Dries and a couple of smaller repositories have joined forces to form RPMForge http://rpmforge.net/ Currently supports Centos but not Fedora RPM Repo - https://rpmrepo.org/ Will eventually will combine RPMs from ATrpms, Dag, Dries and others Perl in RPM-Land Dave Cross

Building RPMs from CPAN I put off doing this for a long time Thought it would be complicated Turned out to be easier than I imagined Good tools help Perl in RPM-Land Dave Cross

Building RPMs You'll need an RPM build environment yum install rpm-build Create ~/.rpmmacros %packager Dave Cross <dave@mag-sol.com> %vendor Magnum Solutions %_topdir /home/dave/rpm Create working directories mkdir -p ~/rpm/BUILD ~/rpm/RPMS \ ~/rpm/SOURCES ~/rpm/SPECS ~/rpm/SRPMS Perl in RPM-Land Dave Cross

Building an RPM An RPM file is built from a source distribution and a spec file Spec file controls how the RPM is built Pre- and post-build processing Calendar-Simple-1.20.tar.gz + perl-Calendar-Simple.spec = perl-Calendar-Simple-1.20.1.rpm Perl in RPM-Land Dave Cross

Spec Files Spec files are a bit of a dark art To me, at least Many options controlling the build In the general case, constructing a spec file is complex But CPAN modules use a standard build mechanism Usually So building a spec file can be automated Perl in RPM-Land Dave Cross

cpanspec cpanspec is the standard tool for creating RPM spec files from CPAN distributions In the Fedora/Centos world, at least yum install cpanspec cpanspec cpan-distribution-file cpanspec Calendar-Simple.1.20.tar.gz Many options Rarely used In my experience Perl in RPM-Land Dave Cross

Building Your RPM cpanspec will build the RPM for you cpanspec -b cpan-package-name But that gets messy if the spec file needs tweaking I use rpmbuild to build my RPMs rpmbuild -ba specfile rpmbuild -ba perl-Calendar-Simple.spec Creates RPM and source RPM Then just install using rpm Perl in RPM-Land Dave Cross

From CPAN to RPM cd ~/rpm wget http://search.cpan.org/CPAN/authors/id/D/DA/DAVECROSS/Calendar-Simple-1.20.tar.gz mv Calendar-Simple-1.20.tar.gz SOURCES cpanspec Calendar-Simple-1.20.tar.gz rpmbuild -ba perl-Calendar-Simple.spec rpm -Uvh /home/dave/rpm/RPMS/noarch/perl-Calendar-Simple-1.20-1.fc9.noarch.rpm Perl in RPM-Land Dave Cross

Common Errors All tests must pass Missing files Missing dependencies Submit any patches back to CPAN author Missing files cpanspec often misses installed programs Fix %files section in spec file Missing dependencies Generated from PREREQS in Makefile.PL Fix and report to author Perl in RPM-Land Dave Cross

Sharing Your Work If you build an RPM for a module please consider sharing it Put it on a web page http://rpm.mag-sol.com/ Create a real yum repository Submit it to the Fedora project Licensing issues http://fedoraproject.org/wiki/Packaging/Perl http://fedoraproject.org/wiki/SIGs/Perl Perl in RPM-Land Dave Cross

Something More Ambitious Many CPAN spec files can be generated automatically with cpanspec Many others can be generated, hand-tweaked and reused for subsequent releases The Fedora project currently packages ~10% of CPAN Can we help them improve that? Perl in RPM-Land Dave Cross

A Rough Plan http://rpm.cpan.org/ Monitor CPAN uploads Generate automatic specs for new modules If the build works distribute the RPM If not, sent it to a volunteer for investigation and fixing Have as many up to date CPAN RPMs available as possible For as many RPM-based Linuxes as possible Perl in RPM-Land Dave Cross

Questions Any questions? Any volunteers? Perl in RPM-Land Dave Cross