Building Debian Packages Debian packaging tutorial Amaya Rodrigo, Soissons Feb 2007.

Slides:



Advertisements
Similar presentations
Configuration management
Advertisements

Software installation Chapter 7. Software installation Numerous software options Usually free Open source Several sources Installation CD Websites sourceforge.net.
Hands-On Microsoft Windows Server 2003 Chapter 2 Installing Windows Server 2003, Standard Edition.
Linux+ Guide to Linux Certification, Third Edition Chapter 11 Compression, System Backup, and Software Installation.
G51FSE Version Control Naisan Benatar. Lecture 5 - Version Control 2 On today’s menu... The problems with lots of code and lots of people Version control.
Package Managers What are they and why we use them.
11 MAINTAINING THE OPERATING SYSTEM Chapter 5. Chapter 5: MAINTAINING THE OPERATING SYSTEM2 CHAPTER OVERVIEW  Understand the difference between service.
1 SEEM3460 Tutorial Unix Introduction. 2 Introduction What is Unix? An operation system (OS), similar to Windows, MacOS X Why learn Unix? Greatest Software.
Chapter 11 Compression, System Backup, and Software Installation.
This presentation will guide you though the initial stages of installation, through to producing your first report Click your mouse to advance the presentation.
Software Configuration Management (SCM)
Debian package manager Presenter: Lilian Wang. Install Software  先別管 package 了, 你有聽過重灌嗎 ?  Chrome/Firefox, Office, pietty, Notepad++, PCMan, LOL, …
Linux Operations and Administration
Linux+ Guide to Linux Certification
1 RH033 Welcome to RedHat Linux. 2 Hardware Requirements ♦ Pentium Pro or better with 256 MB RAM ♦ Or ♦ 64-bit Intel/AMD with 512 MB RAM ♦ 2-6 GB disk.
V Avon High School Tech Crew Agenda Old Business –Delete Files New Business –Week 9 Topics: Coming up: –Yearbook Picture: Feb 7 12:20PM.
Guide to Linux Installation and Administration, 2e1 Chapter 3 Installing Linux.
Tutorial 11 Installing, Updating, and Configuring Software
Lesson 14: Installing and Uninstalling Programs how to install a new program what to do if the new program doesn’t work how to uninstall a program © CCI.
10/1/2015 Chapter 2 Installing Windows XP Professional.
Isecur1ty training center Presented by : Eng. Mohammad Khreesha.
Installation Overview Lab#2 1Hanin Abdulrahman. Installing Ubuntu Linux is the process of copying operating system files from a CD, DVD, or USB flash.
1 What is a Kernel The kernel of any operating system is the core of all the system’s software. The only thing more fundamental than the kernel is the.
Software Installation Using Disk Images By: Irena Lanc and Peter Sempolinski.
How to configure, build and install Trilinos November 2, :30-9:30 a.m. Jim Willenbring Mike Phenow.
Unix and Samba By: IC Labs (Raj Kidambi). What is Unix?  Unix stands for UNiplexed Information and Computing System. (It was originally spelled "Unics.")
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
 Programming - the process of creating computer programs.
Yannick Patois - Datagrid Software Repository Presentation - March, n° 1 Datagrid Software Repository Presentation CVS, packages and automatic.
Linux development Lection What we gonna do today Root privileges Software packages Managing software packages Build procedures Build components.
Installing Applications in FreeBSD lctseng. Computer Center, CS, NCTU 2 Before we start  Permission issue root: the super user Like administrator in.
Chapter Linux Basics. Acknowledgements This presentation was prepared by – Banyat Settapanich – Bahran Madaen This presentation will be updated later.
How to configure, build and install Trilinos November 2, :30-9:30 a.m. Jim Willenbring.
Upgrade on Windows 7. DownloadSoftware Download Software from link provided in Webliography: e/
Chapter 25 – Configuration Management 1Chapter 25 Configuration management.
1 February 6, Patches William Cohen NCSU CSC 591W February 6, 2008.
Building programs LinuxChix-KE. What happens in your CPU? ● It executes a small set of instructions called "machine code" ● Each instruction is just a.
1 April 14, Starting New Open Source Software Projects William Cohen NCSU CSC 591W April 14, 2008.
Use Cases, Issues, Proposed Solutions: Software and Environment Non Privileged User Package Management Francois-Denis Gonthier Kryptiva inc.
Fixing bugs in Ubuntu. Analysing the problem bzr branch lp:ubuntu/octave-multicore Branched 4 revision(s). cd.
1 April 2, Software Packaging and Releasing Best Practices William Cohen NCSU CSC 591W April 2, 2008.
1 /15 Design and Implementation of the Custom Debian Distributions Toolkit (CDDT) 17 February 2006 Sergio Talens-Oliag II Open Source World.
Packaging Software for Debian Roberto C. Sánchez Ohio Linuxfest Saturday, September 29, 2007.
FreeBSD ports & packages. FreeBSD ports & packages - overview Different UNIX distributions use differents package systems for distributing software Debian.
RPM101: A gentle intro to creating your own packages Richard Keech Red Hat Asia-Pacific.
Free as in Freedom, or Free as in Beer? Steve McIntyre Debian Project Leader 4th December 2009, Aberystwyth.
Installing Windows 7 Lesson 2.
Installing Applications in FreeBSD
Development Environment
Installation of the ALICE Software
Guide to Linux Installation and Administration, 2e
Upgrading from r4.1.4 to r7: Making a Smooth Transition
Install external command line softwares
or Call Toll-Free for help.
Chapter 7 Installing Program &Backup Tool
The Linux Operating System
Debian Past, Present and Future
Giving Back Contributing to Debian and the New Maintainer Process
Open Source Software Licenses
University of Texas Rio Grande Valley Systems Administration CSCI 6175
IS3440 Linux Security Unit 4 Securing the Linux Filesystem
Chapter 2: The Linux System Part 1
IS3440 Linux Security Unit 7 Securing the Linux Kernel
OPS235 PACKAGE MANAGEMENT
Overview Unit testing Building Version control.
FreeBSD ports & packages
Carthage ios 8 onwards Dependency manager that streamlines the process of integrating the libraries into the project.
Presentation transcript:

Building Debian Packages Debian packaging tutorial Amaya Rodrigo, Soissons Feb 2007

What is Distribution? ● Kernel ● Installer ● Package manager Why is Debian different? ● Free ● Volunteer, not comercial ● High quality standards

Packaging for Debian ● You don't need to be a Developer ● You don't need a Debian Tattoo ● You don't need to include your packages in Debian... But if you do... ● Think of packaging as a journey ● Learn as you go ● Don't be afraid to ask

Debian Policy ● Documents the quality standards ● Describes packaging procedures to obtain this quality ● Works best with the Developer's Reference ● Is the reason why Debian works so well ● Comes from common usage and consensus ● If there is disagreement, there is a Technical Committee to help decide

FHS: Filesystem Hierarchy Standard ● Describes directories in the system ● Describe where files should live ● Helps vendors ensure their (propietary) solutions will work in any Distribution ● Helps System Administrators find their way around any system ● Packagers must know and follow these guidelines

Linux Standard Base ● Interoperability between applications and the Linux operating system. ● Includes the FHS, but goes further ● Tests are provided ● Certification for distributions ● Debian complies with the LSB

Why packages? ● Make it easy to install software ● Precompiled, configured, free license ● Dependencies, upgrades, security ● Make it easy to uninstall software ● Know which packages own each file ● All software works together

Choosing your package ● The license is free according to DFSG – GPL – BSD – Artistic... ● You use it, know it and like it ● You know “a bit” the programming language ● You intend to work with upstream

Overview ● ITP: Announce your Intent To Package ● Check "WNPP" for existing ITPs ● Fetch and unpack ● Check license ● Add Debian specific changes ● Build Debian source package ● Build Debian binary package(s) ● Test and fix and repeat until done – Install & Remove – Upgrade

Helpful Tools ● devscripts – Scripts to make the life of a Debian Package easier ● fakeroot – Gives a fake root environnment ● dpkg-dev – Package building tools for Debian ● dh-make – tool that converts source archives into Debian package source

Our environment /home/user/.bash_profile /home/user/.bashrc ="Debian User " DEBFULLNAME="The Happy Debian user" DEBSIGN_KEYID="3FCC2A90"

Download the tarball $ hello hello world!

Rename the tarball $ mv hello-1.0.tar.gz hello_1.0.orig.tar.gz Make the basic structure: $ tar -zxvf hello_1.0.orig.tar.gz $ cd hello-1.0/ $ dh_make Answer the questions

dh_make Maintainer name : Debian User -Address : Date : Fri, 22 Apr :55: Package Name : hello Version : 1.0 License : blank Type of Package : Single Hit to confirm:

dh_make environment Values for «Maintainer name» and « -Address» are taken from environment variables: – DEBFULLNAME – DEB

dh_make options ● dh_make options ✔ -n, --native ✔ -c, --copyright : gpl, lgpl, artistic or bsd ✔ -e, -- ✔ -l, --library ✔ -s, --single ✔ -m, --multi ✔ -k, --kmod

The result Debian packaging files in debian/ – changelog – control – copyright – rules – Sometimes more files as well Sometimes also changes to upstream source – Bug fixes, configuration, etc

Celaning the structure ● Before editing the package key files, we clean to see better what we are doing ● The created structure has plenty of example files with the extension.ex or.EX ● We don't need them all, so let's clean it up!

debian/control Source: hello Section: unknown Priority: optional Maintainer: Debian User Build-Depends: debhelper (>= 5.0.0) Standards-Version: Package: hello Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description:

debian/changelog hello (1.0-1) unstable; urgency=low * Initial Release (Closes: #1234). -- Debian User Fri, 22 Apr :18:

debchange ● To make our life easier, we can use dch (Debian Changelog) : – --increment, -i – --append, -a

debian/compat 5 ● Only contains one single character ● Describing the compatibility mode for the debhelper tools we are using

debian/copyright ● Legal stuff regarding our package This package was debianized by Debian User on Fri, 22 Apr :03: It was downloaded from Copyright Holder: This software is copyleft (C) 2005 Alexis Sukrieh. License: This program is released under the terms of the GPL licence. On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL.

debian/dirs Using the debhelper script dh_installdirs, we create the directories needed to install our software. It can be removed. $ rm -f debian/dirs

debian/docs We can list all the documentation files we want to include in our package.

debian/rules This is the file that really builds the package ● Makefile format ● Describes targets (stages of the package creation)

debian/rules ● build: compile the program ● binary: create binary package – Install program under debian/tmp – Install packaging meta data into ● debian/tmp/DEBIAN ● clean: clean up afterwards

debian/rules #!/usr/bin/make ­f build: $(MAKE) CFLAGS=­O2 LDFLAGS=­s clean: $(MAKE) clean rm -rf debian/files debian/substvars debian/tmp binary: binary­arch binary­indep binary­indep:

debian/rules install: build dh_testdir dh_testroot dh_clean -k dh_installdirs # Add here commands to install the package $(MAKE) install DESTDIR=$(CURDIR)/debian/hello

Building ● Run debian/rules by hand until all is correct ● dpkg­buildpackage ­us ­uc ­rfakeroot – Does a full "real" package build (without signing) – Also builds source package ● sudo pbuilder build foo_1.0­1.dsc – Does full real build in "chroot" to check for build dependencies; still unsigned (advanced stuff)

Build results hello_1.0.orig.tar.gz Manually renamed from original, not really built foo_1.0­1.diff.gz foo_1.0­1.dsc foo_1.0­1_i386.changes foo_1.0­1_i386.deb

Test the package Automatic checks for some common problems ● lintian *.changes ● linda *.changes Installation tests: ● Install on fresh system, remove ● Upgrade from earlier version – piuparts does this (advanced) Use the package yourself

You are not alone ● Debian-Edu French Mailing List: – – Coordination ● French Developer Mailing List: – – Packaging questions ● irc.debian.org: #skolelinux.fr

Suggested Reading ● Debian Packaging School packaging-tutorial.pdfhttp://liw.iki.fi/liw/talks/debian- packaging-tutorial.pdf ● Debian New Maintainer's Guide ● Debian Developer's Reference ● Debian Policy Manual policy/ policy/