Home
|
UNIX
|
Oracle
|
Code
|
Practical
|
Private
Pkgsrc configuration (cross UNICES)
Introduction
pkgsrc is NetBSD's package system. It may nevertheless be used on other operating systems.
Note. some pkgsrc managers :
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"
Usage
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
To build a package, either fetch the weekly tarball or get the tree by CVS (see below),
ftp -a ftp://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc.tar.gz
tar xzf pkgsrc.tar.gz -C /usr
cd /usr/pkgsrc/sysutils
make install
#make package
Note. some trick to show package dependencies quite quickly,
make clean-depends
CVS usage
To get it from CVS,
export CVSROOT=anoncvs@anoncvs.fr.netbsd.org:/cvsroot
export CVS_RSH=ssh
cd /usr
cvs -q co pkgsrc
and then,
cd /usr/pkgsrc
cvs -q update -dP
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
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 :
References