home | help
UNTITLED()			      LOCAL			      UNTITLED()

NAME
     portmanager -- FreeBSD port collection management.

SYNOPSIS
     portmanager

DESCRIPTION
      Update  mode Updates installed FreeBSD ports. Updates ports in the correct
     order based on their dependencies. If a port fails to "make" during  update
     it  is marked as ignored.	Portmanager will continue updating any ports not
     marked as "ignored" so long as they are not dependent on the ignored port.

      Status mode Provides the status of installed ports.

      Single port update Updates a single port and all of its dependencies.  Al-
     ways  put the switches after the port directory when using this option: ex-
     ample: portmanager x11/gnome2 -l -ui -f

      Fix mode Rebuilds all dependencies, even if they are up to date.

      Safe port removal See ports that are  not  dependencies  of  other  ports.
     These  ports  are safe to remove.	Note:  After purging unneeded ports with
     -slid option and for extra safety run portmanager -u again.

     portmanager commands: One of these must be first item on the command line

     *	 -s or --status
	  status of installed ports

     *	 -u or --upgrade
	  upgrade installed ports

     *	 -sl or --show-leaves
	  show ports that are not run dependencies of another port, AKA "leaves"

     *	 -slid or --show-leaves-interactive-delete
	  interactively and safely delete leaf ports

     *	 -v or --version
	  portmanager VERSION information

     *	 {port category directory}/{port name}

	 portmanager switches:	These must follow a command if used

     *	 -l or --log
	  enable limited logging, output goes to /var/log/portmanager.log

     *	 -f or --fix
	  force building of all dependencies, see examples

     *	 -bu or --back-up
	  Make packages for updated ports

     *	 -ip
	  ignore port example: portmanager -u -ip x11/kdelibs3

     *	 -ui or --upgrade-interactive
	  upgrade in interactive mode asks (y/n/a) before updating each port

     *	 -y or --yes
	  assume yes if a port conflict or removed port is found. If  set  port-
	 manager will automatically remove conflicting ports and ports that have
	 been  removed	from  the ports tree (see /usr/ports/MOVED for a list of
	 these)

     *	 -p or --pristine
	  Updates a port if any dependency in it's /var/db/pkg/{port name}/+CON-
	 TENTS does not match what is installed. The effect is when  a	port  is
	 updated,  any	port who uses the updated port in it's dependency chain,
	 no matter how deep, are rebuilt. Normally only ports one level  up  are
	 rebuilt.

     *	 --resume
	  bypass  installed port dependency data collection:  if you quit in the
	 middle of a forced update for example, you may be able  to  resume  in-
	 stead	of  starting from the beginning with this option. After you have
	 updated with portmanager -u, you may  want  to  run  portmanager  -slid
	 --resume as a time saver if you wish to removed unneeded ports.

      Web site

     http://portmanager.sunsite.dk/

FILES
     /usr/local/etc/portmanager/pm-020.conf
      portmanager configuration file. Use this file to set individual port
      compile options.

EXAMPLES
     to upgrade all installed ports with logging:

	  portmanager -u -l

     to upgrade all installed ports with logging in interactive (y/n/a) mode:

	  portmanager -u -l -ui

     to add or update a single port with logging:

	  portmanager x11/gnome2 -l

     to add or update a single port with logging in interactive (y/n/a) mode:

	  portmanager x11/gnome2 -l -ui

     to add/update/repair a single port with logging and forcing all of it's de-
     pendencies to be rebuilt

	  portmanager x11/gnome2 -l -f

     to  upgrade everything except nedit, open office and ports that depended on
     them

	  portmanager -u -ip editors/nedit editors/openoffice

     rebuild  all installed ports

	  portmanager -u -f

     resume after the above halted to make repairs for example, avoids	starting
     from scratch

	  portmanager -u -f --resume

     list all ports that are safe to remove (leafs)

	  portmanager -sl

     interactively (y/n) remove leafs

	  portmanager -slid

setting individual port configuration options
     Configuring individual port build options

     The preferred order for setting individual port options is first:

     If  the port defines OPTIONS in it's directory set them with "make config".
     To determine if options is defined in the port's directory  run  "grep  OP-
     TIONS Makefile".  examples:

      cd /usr/ports/ports-mgmt/portmanager

      grep OPTIONS Makefile

      result: OPTIONS=	      DEBUG "Enable debug support and warnings" off

      Ok to run make config because OPTIONS is set to something so:

     make config

     and  a  blue  screen  with  available options will appear.  Set the options
     here.

     Second preferred way is for when ports don't define options and is  located
     towards  the end of this manual in the HINTS AND TIPS section under the ti-
     tle "alternative configuration".

     Third way to configure individual port options is	to  place  an  entry  in
     portmanager's configuration file, or in pkgtools.conf if you also have por-
     tupgrade installed:

     textproc/libxml2|THREADS=off SCHEMA=on MEM_DEBUG=off THREAD_ALLOC=off|

     Effective version 0.3.9 the use of wild cards is OK:

     textproc/*|THREADS=off SCHEMA=on MEM_DEBUG=off THREAD_ALLOC=off|

     */libxm*|THREADS=off SCHEMA=on MEM_DEBUG=off THREAD_ALLOC=off|

     Setting  portmanager  to  ignore certain ports and the stopping/starting of
     applications, wild cards are ok here:

     IGNORE|editors/openoffice*|

     STOP|/mail/postfix /usr/local/sbin/postfix stop|

     START|/mail/postfix /usr/local/sbin/postfix start|

      #
      # port manager example configuration file   ver 0.2.0
      #
      # effective 0.3.9 if portupgrade is installed, portmanager
      # merges settings in /usr/local/etc/pkgtools.conf with those
      # in this file each time it is run.  If you have pkgtools.conf
      # setup just the way you like, there should is no reason
      # to change this file.
      #

      CATEGORY/PORT|OPTION=|	   # do not delete this line!

      #
      # port   | options |
      #

      #textproc/docproj|JADETEX=no|
      #java/jdk14|-DMINIMAL|
      #textproc/libxml2|THREADS=off SCHEMA=on MEM_DEBUG=off XMLLINT_HIST=off|
      #
      # Effective 0.3.9 use of wild cards is ok
      #
      #textproc/*|THREADS=off SCHEMA=on MEM_DEBUG=off THREAD_ALLOC=off|
      #*/libxm*|THREADS=off SCHEMA=on MEM_DEBUG=off THREAD_ALLOC=off|

      #
      # do not let portmanager update the following ports
      #

      #IGNORE|editors/openoffice*|
      #IGNORE|java/jdk14|

      #
      # STOP/START these programs if they are updated
      #
      # Stop command will be run after program is built, before
      # old installed version is removed
      #
      # Start command will be run after rebuilt program is
      # installed and successfully registerd
      #
      # note:
      #   must have leading "/" in /{category}/{port dir}
      #   anything after  /{category}/{port dir} is run as
      #   a sh shell command
      #
      #STOP|/mail/postfix /usr/local/sbin/postfix stop|
      #START|/mail/postfix /usr/local/sbin/postfix start|

KNOBS
     Portmanager may be built  in  various  configurations  by	setting  certain
     "knobs" on or off.

     WITH_DEBUG

      a)   set	with either make config from ports-mgmt/portmanager or by adding
     ports-mgmt/portmanager|WITH_DEBUG=1| to pm-020.conf

      b)  effects: when portmanager is built all warnings  are	enabled  and  is
     built with -ggdb option so symbols may be seen with gdb debugger.

     WITH_BUILD_DEPENDS_ARE_LEAVES

      a)  portmanager normally tries to keep ports that are only build dependen-
     cies for other ports installed and current, some people  have  expressed  a
     dislike   of   tracking   build   dependencies   this   close.  By  setting
     WITH_BUILD_DEPENDS_ARE_LEAVES=1 in  pm-020.conf  or  through  make  config,
     build  dependencies  that	are  missing won't be tracked and -sl -slid will
     list these type of ports as leaves.

      b) ports/java, ports in this category are allowed to build even  if  build
     dependencies  are	missing  in normal mode, all though in normal mode build
     dependencies will still get identified as missing.

DIAGNOSTICS
     Detail of how portmanager upgrade cycle works:

     Determines ports that are out of date by comparing them to Makefiles  down-
     loaded  through cvsup into the ports tree, and checking wether RUN_DEPENDS,
     LIB_DEPENDS or DEPENDS ports they were built with are out of date.   Either
     condition will result in a port being added to the out of date list.  Note:
     An  out  of date BUILD_DEPENDS, EXTRACT_DEPENDS, PATCH_DEPENDS or FETCH_DE-
     PENDS will NOT cause a port to be considered OLD.

     Once a port is determined to be out of date it is added to a list of  ports
     to be updated.

     After  every  out of date port is in the list portmanager starts at the top
     of the list and checks for every possible excuse not to update that partic-
     ular port yet, here are some excuses:

     1. The out of date port has a RUN_DEPENDS, LIB_DEPENDS, DEPENDS,  BUILD_DE-
     PENDS,  EXTRACT_DEPENDS, PATCH_DEPENDS or FETCH_DEPENDS that is also in the
     out of date list.	Exception: ports/java ports do	not  take  into  account
     BUILD_DEPENDS, EXTRACT_DEPENDS, PATCH_DEPENDS or FETCH_DEPENDS prior to be-
     ing built.

     2.  The  out  of date port has a RUN_DEPENDS, LIB_DEPENDS or DEPENDS depen-
     dency that was built with an out of date port.

     3. The port is marked as ignore.

     4. The port is dependent on a port marked as ignore.

     The first port in the out of date list that has no excuse to be skipped, is
     built, then the cycle restarts from the beginning untill all  out	of  date
     ports are eventually updated.

     The  end  result after a ports collection has been updated with portmanager
     is a collection where every port has been built and installed with only the
     most current available sources.

     portmanager is non intrusive, it does not modify any file on  any	part  of
     the  FreeBSD  ports  system. Portmanager does not use /usr/ports/INDEX, IN-
     DEX-5, INDEX-6 etc.

     ( prior to version 0.3.1 ) portmanager made its decisions based  on  values
     stored in /var/db/pkg/{packagename}/+CONTENTS

     (	version 0.3.1 and beyond ) portmanager creates its own equivalent of the
     INDEX file with these notable differences:  all local options  are  consid-
     ered  when  determining dependencies and port names and only the portion of
     INDEX relevant to installed ports is gathered.  If  dependencies  or  port-
     names  change when a port "blue screens" during build, portmanager recalcu-
     lates and new dependencies/portname changes "on the fly".

     At any time it is perfectly safe to abort out of portmanager with the  fol-
     lowing advisory:

     With  the	normal	"make  install	clean" method of adding ports there is a
     critical step, after a port is made, the old port must be de-installed then
     the new port installed in its place.  If for some reason the new port fails
     to install you are left with neither your old port, nor the new one.  It is
     for this reason portmanager makes a package from your old port  before  re-
     moving  it, and if the new port fails to install correctly portmanager will
     reinstall your old port from that package.

     Even if you <control> <c> out of portmanager at the crucial moment  between
     removal  of  the  old port and installation of the new port portmanager may
     still install the original from the backup package, this is not  guaranteed
     though,  so  only	at this step it is recommended not to terminate portman-
     ager.

HINTS AND TIPS
     local ports, ie. ports not in the FreeBSD ports tree:

     Here is how to handle locally installed ports if you plan to take advantage
     of some of FreeBSD's port system features:

      ########################################################################
      # Makefile from /usr/ports/local/ports-mgmt/somelocalportname/Makefile
      ########################################################################
      PORTNAME= 	  somelocalportname
      PORTVERSION=	  0.1.0
      CATEGORIES=	  local/ports-mgmt
      VALID_CATEGORIES+=  ${CATEGORIES}       # for FreeBSD to accept our
					      # local category

     Simply add a "local" directory to /usr/ports and install your  local  ports
     under  that  directory.  Where  a	normal	FreeBSD  port  may be in "ports-
     mgmt/{portname} the example above would reside in	"local/ports-mgmt/{port-
     name}".

     cvsup hints

     here is a sample cvsup file to keep the ports tree up to date

      default host=cvsup4.FreeBSD.org
      *default base=/usr/local/etc/cvsup
      *default prefix=/usr
      *default release=cvs
      *default tag=.
      *default delete
      *default compress
      #########
      #if you want to set installed ports to a prior date
      ##*default date=2005.10.07.00.00.00
      ######
      ports-all

     in /etc/make.conf make a line that points to the above file, EXAMPLE:

     PORTSSUPFILE= /usr/local/etc/cvsup/ports-supfile

     Install sysutils/fastest_cvsup then add this to /etc/make.conf as well:

     SUPHOST= `/usr/local/bin/fastest_cvsup -Qc us`

     The  above  will  automatically cycle through the cvservers untill it finds
     one that is available when you run "make update"

     then cd /usr/ports and run "make update" this will get you the ports tree.

     alternative configuration

     You may set port configurations in /etc/make.conf instead	of  pm-020.conf.
     The advantage to setting configuration in make.conf is they will apply when
     ever  you	manually interact with the ports tree or if you also use another
     ports management program such as ports-mgmt/portupgrade.

     example /etc/makefile.conf entries:

      ########
      # ports
      ########
      ######################
      #global options
      ######################
      # so I don't always download from the same overburdened servers
      # note: been disappointed with this lately, too many slow servers
      # out there...
      RANDOMIZE_MASTER_SITES=yes
      #
      # change location of {portname}/work to /tmp/{portname}/work
      # so I build ports on the local drive and not the nfs'ed drive
      # where /usr/ports is located
      WRKDIRPREFIX=/tmp

      ######################
      #port specific options
      ######################
      #
      #Because I don't want my development version of portmanager
      #installing on top of the version in the ports tree
      .if ${.CURDIR:M*/local/ports-mgmt/portmanager}
      PREFIX=/home/mike/TEMP
      .endif
      #
      .if ${.CURDIR:M*/multimedia/mplayer}
      WITH_OPTIMIZED_CFLAGS=yes
      WITHOUT_RUNTIME_CPUDETECTION=yes
      WITH_GTK1=yes
      WITH_RTC=yes
      WITH_LIBUNGIF=yes
      WITH_ARTS=yes
      WITH_FRIBIDI=yes
      WITH_CDPARANOIA=yes
      WITH_LIBDV=yes
      WITH_MAD=yes
      WITH_SVGALIB=yes
      WITH_AALIB=yes
      WITH_THEORA=yes
      WITH_SDL=yes
      WITH_ESOUND=yes
      WITH_VORBIS=yes
      WITH_XANIM=yes
      WITH_LIVEMEDIA=yes
      WITH_MATROSKA=yes
      WITH_XVID=yes
      WITH_LZO=yes
      WITH_XMMS=yes
      WITH_LANG=en
      .endif

BUGS
AUTHOR
     Michael C. Shultz <ringworm01@gmail.com>

FreeBSD 			   MARCH 2005			  PORTMANAGER(1)

home | help