PkgSrc Info

Info about GSOC pkgsrc port and progress: PkgSrc, PkgSrc Upstreaming and Application Porting

Public documentation on how to use it (mostly about installing from source) under Minix: TestingPkgsrc

ftp.minix3.org points to ftp.cs.vu.nl. It avoids having to hardcode that near-arbitrary name.

Organisation of Binary Packages For Minix

There are several ways that PkgSrc retrieves binary packages. One basic way is the 'bin-install' target in the package directory (e.g. /usr/pkgsrc/misc/figlet). It looks at the BINPKG_SITES make variable, defined in /usr/pkgsrc/mk/install/bin-install.mk, currently set to

BINPKG_SITES?= ftp://ftp.minix3.org/pub/minix/packages/$${rel}/$${arch}

This corresponds to NFS dir: /usr/local/ftp/pub/minix/packages/...

For convenience, this is symlinked from our website dir: pkgsrc/packages -> /usr/local/ftp/pub/minix/packages, so you can go to pkgsrc/packages/ in the site to maintain packages. The URL scheme indicates the hierarchy.

Building Binary Packages And Maintaining the Minix Package Hierarchy

Building

Important note on environment: packages have to be built in a 'clean room,' i.e. it mustn't be allowed to use stuff that isn't part of a registered dependency, such as stuff in /usr/local or /usr/gnu. We need this for bootstrapping, but soon everything will have to build from scratch on a clean install, without /usr/gnu and /usr/local, using just pkgsrc packages to bootstrap the tools needed for building.

To build a binary package, type 'make package' in the pkgsrc dir. The documentation suggests doing

# make DEPENDS_TARGET=package package

will also make binary packages of the dependencies, which is very important of course. It'll then create the hierarchy of packages in /usr/pkgsrc/packages/<category>/<packagename>.tgz.

This hierarchy has to go under packages/$${rel}/$${arch}, i.e., there has to be both:

ftp://ftp.minix3.org/pub/minix/packages/$${rel}/$${arch}/All/<packagename>.tgz
ftp://ftp.minix3.org/pub/minix/packages/$${rel}/$${arch}/<category>/<packagename>.tgz -> ../All/<packagename>.tgz

like 'make package' creates.

Uploading

The mpkg command is a script that Ben was working on and hasn't be committed.

Before making a new package, make sure all binary packages you have installed under pkgsrc/packages/ are up-to-date, so you don't overwrite the server ones with old ones! You currently have to do a full fetch from the server in order to get a full up-to-date set of .index files too, which you need to make an up-to-date index file for pkgin. These instructions assume you have a /usr/pkgsrc hierarchy.

First update them:

# mpkg fetch

This synchronizes the hierarchy under /pub/minix/packages/$${rel}/$${arch}/ to /usr/pkgsrc/packages with rsync.

Then, build the packages you wish to build, e.g. pkgin:

# cd /usr/pkgsrc/pkgtools/pkgin
# make DEPENDS_TARGET=package package

This synchronizes your /usr/pkgsrc/packages back to the server.

It should have created a package in /usr/pkgsrc/packages/All/. To upload it:

# mpkg upload

The script will make sure all the binaries are group-writable. It also produces *.index files for each package, which are the output of 'pkg_info -X'. the cat of all these files together, bzip2ed, is what pkgin uses as an index. the script automatically maintains these files and this .bz2 index when uploading.

Unfortunately the protocol isn't bulletproof, as people can overwrite each others' changes this way. Maybe all the binary packages should just be built from a single coordinated build machine/farm. OTOH the only reason we need everything is the pkgsrc index file, which could be updated on the server side, even from the minix machine with ssh.

Maintaining

As everyone has to be able to maintain binary packages, make sure all files and directories are owned by the minix group and are group-writable. There is a fixperms.sh script in the pkgsrc/ dir on the server side to do this. It'll show you what it's doing:

15:06 pts/4 kits:minix3/pkgsrc% sh fixperms.sh
+ cd /usr/local/www/docs/minix3/pkgsrc
+ chgrp -R minix .
+ chmod -R g+w .

When using mpkg from minix, this is done automatically.

MinixWiki: PkgSrcSetup (last edited 2011-10-25 16:45:16 by AntoineLeca)