Packaging for gNewSense
Introduction
This page describes how to start working on gNewSense packages. That means either modifying Debian packages or creating new packages. The most common reasons for working on packages are
- a package is partially non-free and those parts need to be cut out or replaced,
- the system should look like gNewSense, not Debian,
- we want to include software that is not (yet) in Debian, but which is very useful to free software users.
However, the difference with Debian should be kept minimal, because every change we do we have to maintain ourselves. That includes
- tracking upstream (security) updates and importing them quickly,
- keeping our changes compatible with imports from upstream,
- checking our changes for security problems,
- not breaking integration with the rest of the system,
- not making other packages unbuildable.
Requirements
- You're comfortable with using the command line.
- You know how to use a text editor.
- You have used apt-get or aptitude and dpkg a few times.
Environment setup
Set some environment variables that are used by the development tools by adding the following lines to your ~/.bashrc:
export DEBEMAIL="address@hidden" export DEBFULLNAME="Joe Black" export EDITOR=emacs
You should fill in your own email address, name and editor of choice. Then run
$ . ~/.bashrc
for these to take effect (or start a new terminal). Then install the necessary packages:
$ sudo aptitude install devscripts quilt
Add the upstream distribution to your package sources by creating /etc/apt/sources.list.d/debian.list with these lines (please replace the URLs with a mirror close to you:
deb http://http.us.debian.org/debian/ squeeze main deb-src http://http.us.debian.org/debian/ squeeze main deb http://security.debian.org/ squeeze/updates main deb-src http://security.debian.org/ squeeze/updates main
To prevent any Debian packages being installed you must configure pinning in /etc/apt/preferences:
Package: * Pin: release n=squeeze Pin-Priority: -1
Now update your package indexes:
sudo aptitude update
Next, set the tags lintian should ignore for modified packages. Put the following in $HOME/.lintiantags.
# Lintian tags to be ignored for gNewSense packages that are derived from # Debian packages. changelog-should-mention-nmu source-nmu-has-incorrect-version-number # original-maintainer unknown-field-in-dsc # bzr:// vcs-field-uses-unknown-uri-format
Make a quilt helper script runnable:
sudo cp /usr/share/doc/quilt/examples/dpatch2quilt.sh /usr/local/bin sudo chmod a+x /usr/local/bin/dpatch2quilt.sh
Lastly, set the default options for quilt in the ~/.quiltrc file:
QUILT_PATCH_OPTS="--unified-reject-files" QUILT_PATCHES=debian/patches QUILT_REFRESH_ARGS="-p ab --no-timestamps --no-index"
Packaging types
New package
If you want to package software that is not yet available in Debian, then follow the guide to build a new package.
Changing a package
If you want to modify an existing package, you first have to know why you want to change it. If the package contains non-free code that needs to be removed, then you have to modify the original source.
On the other hand, if all the sources in the orig archive fall under a free license, but need to be changed anyway, then you follow the package patching tutorial.