The pkgsrc-wip project

What is pkgsrc-wip?

pkgsrc-wip (work in progress) is a project to get more people actively involved with creating packages for pkgsrc, a portable packaging system coming from NetBSD. It is the default packaging system for NetBSD, SmartOS, and MINIX 3 and has also been ported to many additional operating systems, including Linux, Darwin, FreeBSD, OpenBSD, Illumos, and others.

What's in it?

You can get an overview of the packages currently in pkgsrc-wip on the cvsweb page for pkgsrc-wip, or a nicer-looking page at pkgsrc.se.

Getting started

This project already assumes you know what pkgsrc is and how to use it, so if you don't, please read the reference and use it. We'll also assume a basic knowledge of CVS.

You should subscribe to the tech-pkg mailing lists. You can ask for questions about packaging here, or for comments and import to pkgsrc, if you think a package is finished.

Additionally, there is the pkgsrc-wip-cvs mailing list. Its subscribers receive a mail message for every commit to the pkgsrc-wip repository. This is for addicts only. ;)

If you're interested in committing packages (and not only testing), send mail to Thomas Klausner with your SourceForge user name and perhaps ideas for your first packages.

Getting the "source"

Downloading a snapshot

The easiest way probably is to download a snapshot. Just select the newest one from the snapshot directory and extract it in /usr/pkgsrc:

cd /usr/pkgsrc
tar xvzf /path/to/pkgsrc-wip-DATEHERE-snapshot.tar.gz

Getting via CVS -- without a SourceForge account

Assuming you have a pkgsrc checkout in /usr/pkgsrc and you're currently in your home directory, do the following:

cvs -d:pserver:anonymous@pkgsrc-wip.cvs.sourceforge.net:/cvsroot/pkgsrc-wip login

Just press ENTER when prompted for password.

cvs -z3 -d:pserver:anonymous@pkgsrc-wip.cvs.sourceforge.net:/cvsroot/pkgsrc-wip checkout -P wip
mv wip /usr/pkgsrc/

There is a anoncvs mirror using ssh (CVS_RSH=ssh; but its the default nowadays) at:

CVSROOT=anoncvs@anoncvs.netbsd.se:/cvsroot

Its fingerprint is:

SSH RSAv2 fingerprint: b6:6b:fc:a6:24:a0:2a:32:d0:d3:25:83:ca:33:64:08

Getting via CVS -- with a SourceForge account

You'll have to re-check out pkgsrc if you previously had an anonymous checkout. Otherwise you'll run into commit problems later on.

You'll also have to set up your sourceforge ssh keys per the instructions from sourceforge.

Assuming you have a pkgsrc checkout in /usr/pkgsrc, you're currently in your home directory, and you have commit rights to pkgsrc-wip (see "Getting started" above for details), do the following:

export CVS_RSH=ssh

or, if you are using a csh like shell:

setenv CVS_RSH ssh

If you have successfully set your remote shell to ssh, just do:

cvs -d :ext:username@pkgsrc-wip.cvs.sourceforge.net:/cvsroot/pkgsrc-wip checkout -P wip
mv wip /usr/pkgsrc/

username is of course your username on sourceforge. That's all.

Getting via CVSUP

You can also use cvsup for getting pkgsrc-wip and keeping it up-to-date. Use the following supfile:

*default tag=.
*default release=cvs
*default delete use-rel-suffix
*default umask=002
*default host=cvsup.netbsd.se
*default base=/usr/pkgsrc
*default prefix=/usr/pkgsrc
*default compress

netbsd-pkgsrc-wip

You can use the supfile with cvsup or csup (csup is recommended).

Examples:

cvsup -L2 -g supfile
csup supfile

Web-based CVS browsing

Of course, you can also browse the CVS repository on the pkgsrc-wip cvsweb or its pkgsrc.se mirror.

Keeping up-to-date

Upgrading with CVS

Just invoke the following:

cd /usr/pkgsrc/wip
cvs update -dP

Upgrading with CVSUP

Create a supfile with the following content, if you don't have one already:

*default tag=.
*default release=cvs
*default delete use-rel-suffix
*default umask=002
*default host=cvsup.netbsd.se
*default base=/usr/pkgsrc
*default prefix=/usr/pkgsrc
*default compress

netbsd-pkgsrc-wip

You can use the supfile with cvsup or csup (csup is recommended).

Examples:

cvsup -L2 -g supfile
csup supfile

In case you downloaded a snapshot, you'll probably have to do:

cvs -d:pserver:anonymous@pkgsrc-wip.cvs.sourceforge.net:/cvsroot/pkgsrc-wip login

Just press ENTER when prompted for password.

Note: You only have to do this once (not once per update, just once).

Trying packages

Change to the package's directory:

cd /usr/pkgsrc/wip/<packagename>

Take a look at the TODO file there. If the package seems finished enough, install, and try it out:

make install

Report your experiences to the tech-pkg mailing list.

Creating packages

Creating and testing

If you haven't read it yet, take a look at the pkgsrc Guide (also in /usr/pkgsrc/doc/pkgsrc.txt).

Create a package.

Test it with pkglint -- not all reported warnings and errors need to be fixed, but you should try to at least understand the reported ones. In case of trouble, ask on the tech-pkg mailing list.

Importing the package

The recommended way to import packages is to use the import script, located in wip/import-package.sh:

cd wip/newpkg
pkglint		# optional, but recommended
../import-package.sh

The import script will present an editor session where you will be given the opportunity to describe the new package (for mailing list readers). After saving and reviewing the final settings, hit 'y', enter to proceed.

If you know your way around CVS or prefer to import packages manually, follow the instructions below instead.

Importing the package manually

Add the files to wip/<packagename>. If the complete package is in wip/newpkg then you would do the following:

export CVS_RSH=ssh
cd /usr/pkgsrc/wip
cvs add newpkg
cd newpkg

if not run previously:

pkglint

if all went well, you can safely add the files now:

cvs add DESCR Makefile PLIST distinfo

if you have patches, also add them:

cvs add patches
cvs add patches/p*

similarly for files or buildlink3.mk:

cvs add files
cvs add files/[ABD-z]*
cvs add buildlink3.mk

Then commit the files:

cvs commit

As message, use the DESCR, or at least the COMMENT -- something to give a commit message reader a good impression what the package does. Afterwards check the import:

cvs update

Nothing should be reported -- if you overlooked files, you can add them as described previously.

Finally add the directory to the list of all subdirectories:

vi Makefile

add "SUBDIR+= newpkg"

cvs commit Makefile

Note: be sure to replace "newpkg" references (as shown above) with your package's real name.

If you get a permission error while committing the Makefile, make sure you checked out the repository with your developer permissions and are not trying to commit to anoncvs.

Further changes

Include a TODO file detailing what you think is missing or needs more work, or just noting that it's finished.

For any further changes to the package, go the the newpkg directory, edit, cvs add any new files and cvs remove any no-longer-needed ones, and then do cvs commit to submit your changes to the public repository. cvs import is only for the first import of a package.

If you have questions, or want review for a finished package, ask on the tech-pkg mailing list. If other people with enough knowledge judge your package ready, it'll probably get committed to the main pkgsrc repository soon afterwards -- enjoy your fame in that case!

You will find pkgsrc.se very useful while working on packages.

Also try the tools that come with meta-pkgs/pkg_developer.

Statistics

There's a page for pkgsrc-wip at the CIA Open Source Notification System.

Similar projects

pkgsrc-wip-jp Japanese pkgsrc-wip

pkgsrc-wip kr Korean pkgsrc-wip

OpenBSD Ports WIP Similar project for OpenBSD ports (was here before)

Project contact

Thomas Klausner