NetBSD: how to get pkgsrc and keep it up-to-date


Reference: http://www.netbsd.org/docs/pkgsrc/getting.html

First time I installed “pkgsrc” after install NetBSD from boot-only disc I grab “pkgsrc” with:

ftp ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc.tar.gz

Just decompress it and you can start to use it.

By default “pkgsrc”, as “ports” in FreeBSD, will store sources in /usr/pkgsrc/distfiles. In my case I prefer use another place, out of “pkgsrc”. To achieve this, do:

  • make a directory in /usr, for example “mkdir /usr/pkgsrc_distfiles”
  • inform to pkgsrc about it in “mk.conf”:

        DISTDIR=/usr/pkgsrc_distfiles

More things can be configured are:

  • the CFLAGS variable, to compilation fits to your processor
  • resume transfers
  • fetch from different locations
  • acceptable licenses for some packages

My “mk.conf” now appears like:


########################################
#Distfiles location
DISTDIR=/usr/pkgsrc_distfiles
########################################
########################################
USE_CPUFLAGS=yes
#amd64
#CFLAGS+= -mfpmath=sse -msse3 -march=nocona
#i386
CFLAGS+= -mfpmath=sse -msse3 -march=prescott
########################################

########################################
#Resume transfers
PKG_RESUME_TRANSFERS=YES
FETCH_CMD=wget
FETCH_BEFORE_ARGS= –passive-ftp
FETCH_RESUME_ARGS=-c
FETCH_OUTPUT_ARGS=-O
########################################

########################################

#Fetch distfiles from multiple locations


#Note: dfdisk must be installed from pkgsrc


.if exists(/usr/pkg/bin/dfdisk)


FETCH_CMD= /usr/pkg/bin/dfdisk fetch


.endif


########################################



########################################
#X11_TYPE=modular
########################################

########################################
#Licenses
ACCEPTABLE_LICENSES+= flash-license
ACCEPTABLE_LICENSES+= opera-850-license
ACCEPTABLE_LICENSES+= sun-jre6-license
ACCEPTABLE_LICENSES+= vim-license
ACCEPTABLE_LICENSES+= lame-license
ACCEPTABLE_LICENSES+= openmotif-license
ACCEPTABLE_LICENSES+= rar-license
ACCEPTABLE_LICENSES+= unrar-license

About jjjesss

I'm a guy interested in technology, bsd fan and concerned about the world around.
This entry was posted in BSD, NetBSD, Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s