- 论坛徽章:
- 0
|
http://pbraun.nethence.com/doc/sysutils_bsd/pkgsrc.html
Pkgsrc configuration (cross UNICES)
Pkgsrc configuration (cross UNICES) : pbraun.nethence.com/doc/sysutils_bsd/pkgsrc.html
Slackware Linux configuration : pbraun.nethence.com/doc/sysutils_linux/slackware.html
Slackware and pkgsrc : pbraun.nethence.com/doc/sysutils_linux/slackware-pkgsrc.html
Introduction
pkgsrcis NetBSD's package system for all plateforms. It may nevertheless beused on other operating systems, as it automates compilations fromsource. For the NetBSD system itself see pbraun.nethence.com/doc/sysutils/NetBSD.html
Usage for binaries
OnceNetBSD is installed, find your relevant binary repository depending onyour NetBSD version (release and architecture) and country (choose yourNetBSD mirror),
export PKG_PATH=ftp.fr.netbsd.org/pub/pkgsrc/packages/NetBSD/i386/4.0/All
pkg_add -v screen
Eventually do,
export PASSIVE_FTP=yes
to get through firewall, but ftp(1) should switch to that by default.
Once this is working add the PKG_PATH export line into root's ~/.profile.
Binaries are more convenient but you may also compile the packages using the pkgsrc tree.
Usage from source
Either get pkgsrc.tar.gz from your NetBSD FTP mirror and extract it,
cd /root
ftp -a ftp.fr.netbsd.org/pub/NetBSD/NetBSD-current/tar_files/pkgsrc.tar.gz
tar xzf pkgsrc.tar.gz -C /usr
Or get the tree from CVS,
export CVSROOT=anoncvs@anoncvs.fr.netbsd.org:/cvsroot
export CVS_RSH=ssh
cd /usr
cvs -q co pkgsrc
Note. you may specify a branche using "-r". See cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/ (at the bottom)
To update the tree,
cd /usr/pkgsrc
cvs -q update -dP
To compile & install pacakges using pkgsrc,
cd /usr/pkgsrc/misc/screen
make install
To do the same while keeping a copy of the binary package into /usr/pkgsrc/packages,
make package
Note you may create a small binary addon repository with that, without the use of bulk.sh.
To quickly show dependencies, besides looking at the Makefile,
make clean-depends
Note.use that +" cvs up -dP" on the relevant packages' directories beforeinstalling them, if you don't want to update the whole tree.
Eventually create /etc/mk.conf to define a few specifics,
vi /etc/mk.conf
MASTER_SITE_SOURCEFORGE=ovh.dl.sourceforge.net/sourceforge \
heanet.dl.sourceforge.net/sourceforge/ \
belnet.dl.sourceforge.net/sourceforge/
PASSIVE_FETCH=YES
PKG_RCD_SCRIPTS=YES
MASTER_SITE_SOURCEFORGE=ovh.dl.sourceforge.net/sourceforge \
heanet.dl.sourceforge.net/sourceforge/ \
belnet.dl.sourceforge.net/sourceforge/
PASSIVE_FETCH=YES
Note. a more recent way to deal with master sites is the use of those,
#MASTER_SORT=
#MASTER_SORT_RANDOM=NO
Some additionnal examples,
#ACCEPTABLE_LICENSES+=pine-license
#ACCEPTABLE_LICENSES+=lame-license
#ACCEPTABLE_LICENSES+=majordomo-license
#MOZILLA_USE_LINUX=YES
#IRSSI_USE_PERL=YES
#PINE_USE_LDAP=YES
#X11_TYPE=xorg
#USE_X11BASE=YES
#X11BASE=/usr/X11R6
#PKGSRCDIR=/usr/pkgsrc
#PACKAGES=/alternatepath/packages
#DISTDIR=/alternatepath/distfiles
#WITH_DVDCSS=YES
#USE_OPENLDAP=NO
#USE_SASL=NO
#USE_SASL2=NO
#ALLOW_VULNERABLE_PACKAGES=YES
#USA_RESIDENT=NO
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 : www.gentoo.org/doc/en/gcc-optimization.xml
- Gentoo CFLAGS : en.gentoo-wiki.com/wiki/CFLAGS
pkgsrc security
Install the audit-packages package to check for vulnerabilites,
cd /usr/pkgsrc/security/audit-packages
make install
vi /usr/pkg/etc/audit-packages.conf
VUL_SOURCE="ftp.fr.NetBSD.org/pub/NetBSD/packages/distfiles/pkg-vulnerabilities"
If there's definitely some vulnerable package you need to install, add this to /etc/mk.conf,
ALLOW_VULNERABLE_PACKAGES=YES
Making bulks
Edit bulk.conf and execute bulk.sh. Alternatively, use this little wrapper,
#!/bin/sh
PATH=/usr/pkg/bin:/usr/pkg/sbin PATH
export PATH=/usr/pkg/bin:/usr/pkg/sbin PATH
cd /usr/pkgsrc/mk/bulk
sh build --config /usr/pkgsrc/mk/bulk/build.conf -r
References
Pkgsrc's Home Page,
www.netbsd.org/docs/software/packages.html
Pkgsrc's CVS frontend,
cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/
Pkgsrc guide
www.netbsd.org/docs/pkgsrc/using.html
Some great web pkgsrc browser,
pkgsrc.se |
|