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, DragonFly BSD, and MINIX 3 and was also ported to many additional operating systems, including Solaris, Linux, Darwin, FreeBSD, OpenBSD, and others.
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.
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 consider subscribing to the mailing lists.
There are three of them:
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.
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
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
You'll have to re-check out pkgsrc if you previously had an anonymous checkout. Otherwise you'll run into commit problems later on.
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.
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
Of course, you can also browse the CVS repository on the pkgsrc-wip cvsweb or its pkgsrc.se mirror.
Just invoke the following:
cd /usr/pkgsrc/wip cvs update -dP
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).
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 package discussion mailing list.
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 package discussion mailing list.
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.
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.
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, ask on the package discussion mailing list; or in case it's already finished, ask for reviews on the review 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.
There's a page for pkgsrc-wip at the CIA Open Source Notification System.
pkgsrc-wip-jp Japanese pkgsrc-wip
pkgsrc-wip kr Korean pkgsrc-wip
OpenBSD Ports WIP Similar project for OpenBSD ports (was here before)