From Teaching Open Source
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
| Name | UserID | VM |
|---|---|---|
| Cameron Seay | cseay | posse1.fedoraproject.org |
| Kent Palmer | kent | posse2.fedoraproject.org |
| Matt Jadud | jadudm | posse3.fedoraproject.org |
| Christian Jacobsen | clj | posse4.fedoraproject.org |
| Fardad Soleimanloo | fardad | posse5.fedoraproject.org |
| Ian Weller | ianweller | posse6.fedoraproject.org |
| Mel Chua | mchua | posse7.fedoraproject.org |
[edit] Getting and building source
Morning A Session
- Obtaining Source
- Tarballs
- Revision control
- Legacy central-server model - CVS
- Modern approaches: Mercurial (hg) and Git
- Patches
- Build Environments
- Finding and Installing build dependencies
- Example: Mozilla Build for Windows
- Using yum, MacPorts, etc.
- Operating systems, cross-platform builds
- Virtualization - Virtual Box
- Machine requirements
- Fast I/O, lots of RAM (for linking)
- Tools
- Libraries
- Settings
- Environment variables, PATHs
- Finding and Installing build dependencies
- Build Tools
- Introduction to Makefiles
- Basic structure
- How to write them
- How to read them
- Example Makefile - PuTTY on Windows
- Example Makefile - wget
- 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
- One file containing:
- Using RPMs
- Querying the RPM database (coderpm -q/code)
- Installing, updating, removing
- Using YUM
- RPM Build Process
- Components:
- Pristine sources
- Patches
- Spec file
- Process:
- Obtain sources and patches
- Test and document build process
- Create spec file
- Build RPM
- Test
- Components:
- 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: