this is obsolete doc -- see http://doc.nethence.com/ instead

Pkgsrc configuration (cross UNICES) 

 

http://pbraun.nethence.com/doc/sysutils_bsd/pkgsrc.html 

http://pbraun.nethence.com/doc/sysutils_linux/slackware_pkgsrc.html 

 

http://pbraun.nethence.com/doc/sysutils_bsd/netbsd.html 

http://pbraun.nethence.com/doc/sysutils_bsd/pkgsrc.html 

 

 

Introduction 

pkgsrc is NetBSD's package system. It may nevertheless be used on other operating systems. 

 

Note. some pkgsrc managers : 

- pkgmanager (http://www.scode.org/pkgmanager/) 

- pkgin, a tool to manage pkgsrc binary packages (http://imil.net/pkgin/) 

 

 

Usage -- binaries 

To install a binary package from the official NetBSD repository, 

export PKG_PATH=ftp: //ftp.fr.netbsd.org/pub/pkgsrc/packages/NetBSD/amd64/5.0/All
export PASSIVE_FTP=yes
pkg_add -v pwgen

 

 

Fetch the pkgsrc tree by FTP 

Get pkgsrc by FTP, 

ftp -a ftp: //ftp.netbsd.org/pub/pkgsrc/current/pkgsrc.tar.gz
tar xzf pkgsrc.tar.gz -C /usr

 

 

Fetch the pkgsrc tree by CVS 

Or to get it from CVS, 

export CVSROOT=anoncvs@anoncvs.fr.netbsd.org:/cvsroot
export CVS_RSH=ssh
cd /usr
cvs -q co -P pkgsrc

and then, 

cd /usr/pkgsrc
cvs -q up -dP

 

 

Pkgsrc configuration 

Configure pkgsrc, 

cd /etc
ln -s /usr/pkg/etc/pkg_install.conf
vi mk.conf  #new file

add/adapt those variables accordinly, 

MASTER_SITE_SOURCEFORGE=freefr.dl.sourceforge.net \
        ovh.dl.sourceforge.net/sourceforge \
        heanet.dl.sourceforge.net/sourceforge/ \
        belnet.dl.sourceforge.net/sourceforge/
USA_RESIDENT=NO
PASSIVE_FETCH=YES

PKG_RCD_SCRIPTS=YES 

#ALLOW_VULNERABLE_PACKAGES=YES
#ACCEPTABLE_LICENSES+=pine-license
#ACCEPTABLE_LICENSES+=lame-license
#ACCEPTABLE_LICENSES+=majordomo-license
#X11BASE=/usr/pkg/X11R6

Note. I heard a more recent way to deal with master sites is to use those, 

#MASTER_SORT=
#MASTER_SORT_RANDOM=NO

 

Define your prefered mirror for daily vulnerability list download, 

vi /usr/pkg/etc/audit-packages.conf  #new file

like, 

VUL_SOURCE="ftp: //ftp.fr.NetBSD.org/pub/NetBSD/packages/distfiles/pkg-vulnerabilities"

 

 

Building binaries 

Build a package binary 

cd /usr/pkgsrc/sysutils/pwgen
make package
ls -l /usr/pkgsrc/packages

Note. it's possible to build quite a repository like this without even messing with the bulk script 

Note you can now make it available through FTP and use that binary from another slackware 

 

To build the whole tree, edit bulk.conf and execute bulk.sh. Here's a little wrapper, 

#!/bin/ksh
PATH=/usr/pkg/bin:/usr/pkg/sbin:$PATH
export PATH
cd /usr/pkgsrc/mk/bulk
sh build --config /usr/pkgsrc/mk/bulk/build.conf -r

 

 

Misc 

Note. some trick to show package dependencies quite quickly, 

make clean-depends

 

Firefox 

Native NetBSD Firefox package works (linux emul doesn't as of today : segfault), use Flash via "nspluginwrapper". Works even on NetBSD/amd64. 

 

 

Additional mk.conf examples 

Some more options (most of them are probably outdated), 

#MOZILLA_USE_LINUX=YES
#PKGSRCDIR=/usr/pkgsrc
#PACKAGES=/alternatepath/packages
#DISTDIR=/alternatepath/distfiles
#PACKAGES=/home/pkgout/packages
#DISTDIR=/home/pkgout/distfiles
#PKG_RCD_SCRIPTS=YES
#RCD_SCRIPTS_DIR=/etc/rc.d

 

#X11_TYPE=xorg
#USE_X11BASE=YES
#X11BASE=/usr/X11R6

 

#USE_OPENLDAP=NO
#USE_SASL=NO
#USE_SASL2=NO

 

#PINE_USE_LDAP=YES
#IRSSI_USE_PERL=YES
#PKG_OPTIONS.irssi=irssi-perl

 

 

CPU flags 

Note. you may play with CPU optimizations too. Those are just examples, it might break things, 

#CFLAGS+=-O2 -march=i686 -mcpu=i386
#CXXFLAGS=-O2 -march=i686 -mcpu=i386
#COPTS+=-O2 -mcpu=i686 -fexpensive-optimizations -ffast-math -msoft-float \
# -fmemoize-lookups -fthread-jumps -m486 -fomit-frame-pointer \
# -finline-functions

but it's preferable to use the relevant cpuflags package but I'm hearing it doesn't work for the latest CPUs, 

devel/cpuflags
sysutils/cpuid

note. gentoo's optimization pages may be worth visiting too : 

- Gentoo Compilation Optimization Guide : http://www.gentoo.org/doc/en/gcc-optimization.xml 

- Gentoo CFLAGS : http://en.gentoo-wiki.com/wiki/CFLAGS 

 

 

References 

Pkgsrc's Home Page : http://www.netbsd.org/docs/software/packages.html 

Pkgsrc's CVS frontend : http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/ 

Pkgsrc guide : http://www.netbsd.org/docs/pkgsrc/using.html 

Some great web pkgsrc browser : http://pkgsrc.se 

pkgmanager : http://www.scode.org/pkgmanager/ 

pkgin, a tool to manage pkgsrc binary packages : http://imil.net/pkgin/