POSSE 2009 Tuesday

From Teaching Open Source

Jump to: navigation, search

Tuesday session for POSSE. Theme for the day: Source

Contents

[edit] Status Check

  • Brief quiz/review of previous day.
  • Discussion of Overnight Deliverables -- status, problem encountered, concepts learned.
  • Rose/Thorn/Bud update from each participant
    • Rose: something learned
    • Thorn: problem encountered
    • Bud: something anticipated in the future
  • Physical wiki update.
  • Open source news -- current developments.


[edit] Virtual Machine Assignment

NameUserIDVM
Cameron Seaycseayposse1.fedoraproject.org
Kent Palmerkentposse2.fedoraproject.org
Matt Jadudjadudmposse3.fedoraproject.org
Christian Jacobsencljposse4.fedoraproject.org
Fardad Soleimanloofardadposse5.fedoraproject.org
Ian Wellerianwellerposse6.fedoraproject.org
Mel Chuamchuaposse7.fedoraproject.org

[edit] Getting and building source

Morning A Session

  • Build Environments
    • Finding and Installing build dependencies
    • Operating systems, cross-platform builds
    • Machine requirements
      • Fast I/O, lots of RAM (for linking)
    • Tools
    • Libraries
    • Settings
      • Environment variables, PATHs
  • Build Tools
    • autoconf
    • make
    • meta-make tools
    • Common open source approaches to automation (Python, Bash)
  • End to end Example Walkthrough
    • Get code for XXX (something open source and smallish)
    • Look at what we got
    • Configure (maybe explore a couple of options we can pass to configure)
    • Make XXX
    • Look at end result of what we built

Morning B Session

Lab: Working with Build Systems

In this lab participants have the opportunity to work with a number of build systems, including:

  • A small one they create from scratch
  • Mozilla's Firefox build system

In the first part of the lab, the participants are presented with a small source project and asked to work together to create a Makefile in order that the build process can be fully automated. Once again, students are encouraged to use online communication tools in order to collaborate. Participants are also encouraged to consult online materials, examples in other open source projects (e.g., using Google Code Search), etc. One of the outcomes of this lab is that participants learn to leverage existing code, a key element of open source.

Next, having created a simple Makefile and learned the basic workings of make, participants are led through an examination of various parts of the Mozilla build system, including:

  • Compiling Firefox on Fedora
  • Understanding phases of the build, and what is happening as the build messages scroll by
  • Looking at a number of interesting aspects, and how they are implemented in Makefiles, configure scripts
  • Future directions (pymake)

[edit] RPM Packaging Basics

Afternoon Session

  • Why package?
    • Maintainability
    • Easy updating
    • Authentication of origin
    • Dependency management
  • What is an RPM?
    • One file containing:
      • Software
      • Documentation
      • Configuration files
      • Sample data
      • Metadata
      • Dependency and capability data
      • Installation and removal scripts
  • Using RPMs
    • Querying the RPM database (coderpm -q/code)
    • Installing, updating, removing
    • Using YUM
  • RPM Build Process
    • Components:
      1. Pristine sources
      2. Patches
      3. Spec file
    • Process:
      1. Obtain sources and patches
      2. Test and document build process
      3. Create spec file
      4. Build RPM
      5. Test
  • Looking at existing source RPMs
    • Getting SRPMs (yumdownloader --source packagename)
    • Installing (rpm -i package.src.rpm)
    • Rebuilding (rpmbuild --rebuild package.src.rpm)
  • Creating a spec file
    • Sections of a spec file
    • Creating the file (rpmdev-newspec package)
  • Building an RPM
    • rpmbuild -ba package.spec
  • Testing an RPM
    •  %test section
    • Trial installation (yum localinstall package.rpm)
    • rpmlint - run on the .spec, .src.rpm, and .rpm files
    • mock (mock -r fedora-11-i386 --rebuild package.src.rpm)
    • koji test builds (more on Wednesday)
  • Package review process - Overview
    • Bugzilla (more on Wednesday)
    • Koji (overview)
    • Bodhi (overview)
  • Creating a repository
    • codecreaterepo/code
    • Repo configuration files

Exercise

  • Create a very basic package (GNU hello)

[edit] Overnight deliverable

Packaging Sprint

  • Create a package for Fedora. We'll start them in the review process on Wednesday.
    • Check to ensure that the package does not already exist in Fedora (yum search name) and that it's not in review (Google for "fedora review request package")
    • Choose a package that you think would really be useful in Fedora. It can be your own code. Alternately, consider packaging some useful non-software such as fonts.
    • There are Fedora packaging guidelines for various types of packages. Ensure that your package meets the guidelines for the applicable package type.
    • Don't overload yourself:
      • Choose a package that builds simply for your first package. Something that comes in a tarball or zip file (and unpacks into a directory with the same name as the package, e.g., foo-2.5.tgz -> foo-2.5/), builds with "./configure" (optional), "make", and "make install" would be ideal.

Resources: