Subject: Re: How to quarterly releases?
To: Ryan Cresawn <email@example.com>
From: None <firstname.lastname@example.org>
Date: 11/08/2005 10:43:09
On Mon, 7 Nov 2005 23:17:10 -0500
Ryan Cresawn <email@example.com> wrote:
> I've been struggling with this problem for a while and I decided that
> I should ask the list because someone here has surely solved this
> before. The trouble is that I haven't found an intelligent way to
> update from one quarterly release to the next on a production server.
> A mail delivery host that I administer is running Solaris 8 with
> pkgsrc-2005Q1. Obviously, I would like to update this to the latest
> release. What is a good way to do this with minimal downtime?
This is how I do this:
I setup pkgsrc to use different directories
The first directory contains packages compiled with gcc, the second with Sun compilers. This is because there is a lot of software which breaks when built with Sun compilers, so it helps to test packages in parallel with both compilers. You could do something similar:
then have /opt/pkg symlink that points to your stable package directory.
Assuming you have installed packages in /opt/pkg-2005Q1 and now you want to build a new release, these new packages will go into /opt/pkg-2005Q3
You'll end up with 3 directories:
/opt/pkg-2005Q3 - this is where your packages will be installed
/opt/pkg-2005Q3.obj - this is the work directory, that will contain object files
/opt/pkg-2005Q3.packages - this is where binary packages will be archived, so you can reinstall them later
Assume your pkgsrc is mounted read-only via NFS under /opt/pkgsrc. Make sure that a working gcc/cc compiler is in your PATH
./bootstrap --workdir /opt/pkg-2005Q3.obj --prefix /opt/pkg-2005Q3 \
Note above that package database directory does not go into /var, instead we keep it where the packages get installed. This way you can avoid conflicts when you setup multiple package directories.
I would advice to bootstrap with gcc. When I used Sun Studio 10 compiler to bootstrap pkgsrc, 'tar' command would segfault. I posted about the problem on tech-pkg but recieved no replies :-/
After bootstrapping, 'bmake' and other utilities will be setup to use /opt/pkg-2005Q3 directory automatically.
If you're using Sun compilers, you simply create /opt/pkg-2005Q3/etc/mk.conf file, adjust your PATH environment variable and start building packages. If you want to use gcc, you'd have to build and install gcc into /opt/pkg-2005Q3 since some packages will be linked to gcc's libraries
Now set up your PATH and MANPATH:
export PATH MANPATH
and create /opt/pkg-2005Q3/etc/mk.conf file:
# -- Begin misc pkgsrc settings --
# Default to using everything from pkgsrc.
# -- End misc pkgsrc settings --
# -- Begin pkgsrc directory settings --
# -- End pkgsrc directory settings --
# -- Begin compiler and optimisation flags --
# Set these when building packages with gcc
PKGSRC_CFLAGS=-O2 -mcpu=ultrasparc -mvis -mv8plus -pipe
PKGSRC_CXXFLAGS=-O2 -mcpu=ultrasparc -mvis -mv8plus -pipe
# Set these when building packages with sunpro
#PKGSRC_CXXFLAGS=-xO3 -xtarget=native -features=%all,no%tmplife
# Set optimisation flags
# -- End compiler and optimisation flags --
# -- Begin specific package settings --
# Which compilers to build for lang/gcc4
# On Solaris chat/gaim needs gnutls, since devel/nss is broken
# Options for Postfix and OpenLDAP
PKG_OPTIONS.postfix+=bdb ldap sasl tls
# -- End specific package settings --
# The fist sourceforge site in MASTER_SITE_SOURCEFORGE is usually down or
# overloaded, select a different one to speed up downloads