# -*- ruby -*-1#2# pkgtools.conf - the configuration file for the pkgtools suite3#45# Syntax:6# string: '...' or "..."; use the `+' operator to concatenate7# boolean: true or false8# array: [ value, ... ]; use the `+' operator to concatenate9# hash: { key => value, ... }10# procedure: proc { |arglist| statements; return_value }1112# Useful predefined constants:13#14# Name: Example values:15# OS_RELEASE: "7.0-CURRENT" "6.1-RELEASE-p8"16# OS_REVISION: "7.0" "6.1"17# OS_MAJOR: "7" "6"18# OS_BRANCH: "CURRENT" "RELEASE"19# OS_PATCHLEVEL: "" "-p8"20# OS_PLATFORM: "i386" "amd64"21# OS_PKGBRANCH: "7-current" "6.1-release"2223# Useful predefined functions:24#25# localbase()26# Returns LOCALBASE.27#28# x11base()29# Returns X11BASE.30#31# pkg_site_builder(true|false)32# Returns an URI of the packages directory on the package builder site;33# if an argument is true, a 'latest' directory is used for path,34# 'full' is used otherwise.35# Equivalent to:36# on i386:37# sprintf('http://pointyhat.FreeBSD.org/errorlogs/%s-%s-packages-%s/',38# OS_PLATFORM, OS_MAJOR, latest ? 'latest' : 'full')39#40# pkg_site_mirror(root)41# Returns an URI of the packages directory on the preferred mirror site;42# where <root> is any quoted string.43# Equivalent to:44# sprintf('%s/pub/FreeBSD/ports/%s/packages-%s/',45# root || ENV['PACKAGEROOT'] || 'ftp://ftp.FreeBSD.org',46# OS_PLATFORM, OS_PKGBRANCH)47#48# pkg_site_primary()49# Returns an URI of the packages directory on the primary FTP site;50# Equivalent to:51# pkg_site_mirror('ftp://ftp.FreeBSD.org')52#53# deorigin(origin)54# Returns an installed package name which was installed from the55# given origin port.56# e.g.57# deorigin('sysutils/portupgrade') => 'portupgrade-YYYYMMDD'58#59# enabled_rc_scripts(origin_or_pkgname)60# Returns an array of "enabled" rc scripts ($PREFIX/etc/rc.d/*.sh)61# for the given package. "Enabled" here means that files such as62# *.sh.sample are ignored, however, if a package installs63# foo.sh.sample and there is foo.sh, it is considered as an enabled64# rc file for the package and thus returned.65#66# disabled_rc_scripts(origin_or_pkgname)67# Returns an array of disabled rc scripts ($PREFIX/etc/rc.d/*.sh.*)68# that the given package installed. If a package installs69# foo.sh.sample and there is foo.sh, it is considered as enabled70# and thus ignored.71#72# cmd_start_rc(origin_or_pkgname)73# Returns a command line string that starts the services of the74# given package, if any. (Yields "start" for each enabled rc75# script)76#77# cmd_stop_rc(origin_or_pkgname)78# Returns a command line string that stops the services of the79# given package, if any. (Yields "stop" for each enabled rc script)80#81# cmd_restart_rc(origin_or_pkgname)82# Returns a command line string that restarts the services of the83# given package, if any. (Yields "stop", sleeps for 3 seconds, then84# yields "start" for each enabled rc script)85#86# cmd_enable_rc(origin_or_pkgname)87# Returns a command line string that enables the disabled rc88# scripts of given package, if any.89#90# cmd_disable_rc(origin_or_pkgname)91# Returns a command line string that disables the enabled rc92# scripts of given package, if any.93#94# include_env(file)95# Include and evaluate the file. The file is looked inside PREFIX.96#97# include_hash(glob)98# Read file(s) and convert them to hash. Files should contain lines99# in a format: 'key' => 'value'100# (Glob path is inside PREFIX).101# E.g. ALT_PKGDEP = include_hash('etc/pkgtools/alt_pkgdep/*')102#103104module PkgConfig105106# Environment Variables: string107#108# Uncomment and edit as necessary. The `||=' operator means `set only109# if it is not set', i.e. it gives a variable its default value.110#111# It is particularly recommended that you set PORTS_INDEX to112# something other than the default value to avoid conflicts with CVS,113# CVSup, and CTM.114#115# cf. portupgrade(1), pkg_which(1)116#117# defaults:118# ENV['PORTSDIR'] ||= '/usr/ports'119# ENV['PORTS_INDEX'] ||= ENV['PORTSDIR'] + '/INDEX'120# ENV['PORTS_DBDIR'] ||= ENV['PORTSDIR']121# ENV['PKG_DBDIR'] ||= '/var/db/pkg'122#123# ENV['PKG_TMPDIR'] ||= '/var/tmp'124#125# ENV['PACKAGES'] ||= ENV['PORTSDIR'] + '/packages'126#127# ENV['PKG_DBDRIVER'] ||= 'bdb_btree' and if it's failed to load128# the driver it will fall to bdb1_btree driver. If the driver129# failed too, it will fall to 'dbm_hash' that require no external130# modules.131# Possible values for ENV['PKG_DBDRIVER'] are bdb_btree, bdb_hash,132# bdb1_btree, bdb1_hash and dbm_hash.133#134# e.g.:135# ENV['PORTSDIR'] ||= '/export/freebsd/ports'136# ENV['PORTS_INDEX'] ||= ENV['PORTSDIR'] + '/INDEX.local'137# ENV['PORTS_DBDIR'] ||= ENV['PKG_DBDIR']138#139# ENV['PACKAGES'] ||= sprintf('/export/freebsd/packages-%s',140# OS_PKGBRANCH)141# ENV['PKG_PATH'] ||= ENV['PACKAGES'] + '/All'142# ENV['PKG_BACKUP_DIR'] || ENV['PKG_PATH']143#144# ENV['PKG_SUFX'] ||= '.tbz'145# This variable defines extension used by pkg_create(1) while146# creating backup copy of old package before de-installing it.147# Defaults to '.tbz' (bzip2 compression).148# Possible values are '.tbz', '.tgz' (use gzip) and149# '.tar' (don't compress at all).150# See pkg_create(1) manual page for details.151#152# ENV['PKG_FETCH'] = "wget -O '%2$s' '%1$s'"153# ENV['PKG_FETCH'] = "curl '%s' -o '%s'"154# ENV['PKG_FETCH'] = 'false' # never fetch packages from a remote site155# ENV['PACKAGEROOT'] = 'ftp://ftpN.XX.FreeBSD.org'156#157# overwrite some defaults:158#159# include_env('etc/pkgtools.local')160#161162ENV['PORTSDIR'] ||= '/usr/ports'163ENV['PACKAGES'] ||= ENV['PORTSDIR'] + '/packages'164ENV['PKG_PATH'] ||= ENV['PACKAGES'] + '/All'165ENV['PKG_BACKUP_DIR'] ||= ENV['PKG_PATH']166167# SANITY_CHECK: boolean (default: true)168#169# If true, perform sanity checks on stale dependencies. This makes170# it up to 50% slower to parse package globs but offers unfailing171# upgrades. If you are sure you won't forget to run `pkgdb -F'172# regularly, turn this off to improve performance. (default: true)173#174# cf. -O/--omit-check of pkg_deinstall(1), pkg_glob(1),175# portupgrade(1) and portversion(1)176177SANITY_CHECK = true178179# IGNORE_CATEGORIES: array180#181# This is a list of port categories you want the pkgtools to ignore.182# Typically you want to list language specific categories of the183# languages you don't use.184#185# After configuring this list, you need to rebuild the ports186# database to reflect the changes. (run 'portsdb -Ufu')187#188# e.g.:189# IGNORE_CATEGORIES = [190# 'chinese',191# 'french',192# 'german',193# 'hebrew',194# 'japanese',195# 'korean',196# 'russian',197# 'ukrainian',198# 'vietnamese',199# ]200201IGNORE_CATEGORIES = [202]203204# EXTRA_CATEGORIES: array205#206# This is a list of extra port categories you put your locally207# maintained ports into. You must prepare a Makefile in each directory208# that defines a variable SUBDIR which lists all the ports in the209# category.210#211# After configuring this list, you need to rebuild the ports212# database to reflect the change. (run 'portsdb -Ufu')213#214# e.g.:215# EXTRA_CATEGORIES = [216# 'local',217# ]218219EXTRA_CATEGORIES = [220]221222# ALT_INDEX: array223#224# An additional local INDEX file(s).225#226# e.g.227# ALT_INDEX = [228# ENV['PORTSDIR'] + '/INDEX.local',229# ]230231ALT_INDEX = [232]233234# ALT_MOVED: array235#236# This is a list of local MOVED files. They'll be applied after237# the main MOVED file. The feature may be useful for ports moved238# inside EXTRA_CATEGORIES.239#240# e.g.241# ALT_MOVED = [242# ENV['PORTSDIR'] + '/MOVED.local',243# ]244245ALT_MOVED = [246]247248# HOLD_PKGS: array249#250# This is a list of ports you don't want portupgrade(1) to upgrade,251# portversion(1) to suggest upgrading, or pkgdb(1) to fix.252# You can use wildcards ("ports glob" and "pkgname glob").253# -f/--force with each command will override the held status.254#255# To completely hide the existence of a package, put a dummy file256# named "+IGNOREME" in the package directory.257#258# cf. pkg_glob(1), ports_glob(1)259#260# e.g.:261# HOLD_PKGS = [262# 'bsdpan-*',263# 'x11*/XFree86*',264# ]265266HOLD_PKGS = [267'bsdpan-*',268]269270# IGNORE_MOVED: array271#272# This is a list of ports you do not want to trace "MOVED".273# You can use wildcards ("ports glob" and "pkgname glob").274#275# e.g.:276# IGNORE_MOVED = [277# 'php4-*',278# 'devel/bison',279# ]280281IGNORE_MOVED = [282'devel/bison',283]284285# USE_PKGS: array286# USE_PKGS_ONLY: array287#288# These are lists of ports that you prefer to use packages to289# upgrade or install. They apply -P/--use-packages and290# -PP/--use-packages-only to specific ports, respectively.291#292# cf. -P/--use-packages and -PP/--use-packages-only of293# portupgrade(1) and portinstall(1)294#295# e.g.:296# USE_PKGS = [297# 'perl',298# 'ruby',299# 'python',300# ]301#302# USE_PKGS_ONLY = [303# 'x11*/XFree86*',304# '*openoffice*',305# ]306307USE_PKGS = [308]309310USE_PKGS_ONLY = [311]312313# USE_PORTS_ONLY: array314#315# This is a list of ports that you always want to build from source.316# This will casue the pacakge to be installed from the local port even317# if there is a package available and the -P option is passed. It is318# primarily used when you have a custom configuration for a package but319# still want to be able to to an automated update from packages of the320# rest of the system.321#322# e.g.:323# USE_PORTS_ONLY = [324# 'php5',325# 'php5-mysql',326# ]327328329USE_PORTS_ONLY = [330]331332# ALT_PKGDEP: hash333#334# This is a hash to define alternative package dependencies. For335# each pair A => B, when a package X claims that it depends on a336# package that matches the "pkgname glob" pattern A which is not337# installed, the dependency is replaced with one installed338# package that matches the "pkgname glob" pattern B. If glob B339# matches more than one installed package, replacement is not done340# automatically. <:delete> and <:skip> are special symbols that can341# be used as B values, instead of pkgname glob patterns. <:delete>342# means to delete the dependency and <:skip> to skip it.343#344# This replacement is done when "pkgdb -F" is executed.345#346# cf. pkg_glob(1), pkgdb(1)347#348# e.g.:349# ALT_PKGDEP = {350# # If you use apache13-modssl instead of apache13351# 'apache-1.3.*' => 'apache+mod_ssl-1.3.*',352#353# # The same as above; you can use origins also354# 'www/apache13' => 'www/apache13-modssl',355#356# # If you install Apache from source (not from ports/packages)357# 'apache' => :delete,358#359# # You can specify pkgname w/o version; see pkg_glob(1)360# 'w3m' => 'w3m-m17n',361# }362363ALT_PKGDEP = {364}365366# MAKE_ARGS: hash367# MAKE_ENV: hash368#369# These are hashes of ports glob or package glob => arguments mapping.370# pkgtools looks it up to pick command line arguments and environment371# variables to pass them to make(1).372# You can use wildcards ("ports glob" or "package glob").373# If a port/package matches multiple entries, all the arguments are374# joined using the space as separator.375#376# cf. -m/--make-args and -M/--make-env of portupgrade(1), ports_glob(1)377#378# You can alternatively specify a procedure instead of a string if379# you want to specify arguments which can vary depending on the port.380# The procedure is called with a port origin as an argument.381#382# e.g.:383# MAKE_ARGS = {384# 'databases/mysql323-*' => 'WITH_CHARSET=ujis',385# 'ruby18-*' => 'RUBY_VER=1.8',386# 'ruby16-*' => 'RUBY_VER=1.6',387# }388#389# To specify multiple arguments for each port, use one of the390# following:391#392# MAKE_ARGS = {393# # a) Separate them with the space394# 'databases/mysql41-*' => 'WITH_LINUXTHREADS=1 SKIP_DNS_CHECK=1',395#396# # b) Specify them using an array397# 'databases/mysql41-*' => [398# 'WITH_LINUXTHREADS=1',399# 'SKIP_DNS_CHECK=1',400# ],401# }402403MAKE_ARGS = {404}405406MAKE_ENV = {407}408409# BEFOREBUILD: hash410#411# This is a hash of ports glob => command mapping. portupgrade(1)412# and portinstall(1) look it up to pick commands to run before413# building a port. You can use wildcards ("ports glob"). If a414# port/package matches multiple entries, all the commands are joined415# using the semicolon as separator and run.416#417# cf. -B/--beforebuild of portupgrade(1), ports_glob(1)418#419# You can alternatively specify a procedure instead of a string if420# you want to run a command which can vary depending on the port.421# The procedure is called with a port origin as an argument. See422# the examples in the AFTERINSTALL paragraph.423#424# e.g.:425# BEFOREBUILD = {426# # Always do cvs update before building a port427# '*' => 'cvs update',428# }429430BEFOREBUILD = {431}432433# BEFOREDEINSTALL: hash434#435# This is a hash of ports glob => command mapping. pkg_deinstall(1)436# looks it up to pick commands to run after installing a port. You437# can use wildcards ("ports glob"). If a port/package matches438# multiple entries, all the commands are joined using the semicolon439# as separator and run.440#441# You can alternatively specify a procedure instead of a string if442# you want to run a command which can vary depending on the port.443# The procedure is called with a port origin as an argument. See444# the following examples.445#446# e.g.:447# BEFOREDEINSTALL = {448# # Automatically stop the service for each package that has a449# # rc script enabled450# '*' => proc { |origin|451# cmd_stop_rc(origin)452# },453#454# # Stop postfix455# 'mail/postfix*' => localbase() + '/sbin/postfix stop',456# }457458BEFOREDEINSTALL = {459}460461# AFTERINSTALL: hash462#463# This is a hash of ports glob => command mapping. portupgrade(1)464# and portinstall(1) look it up to pick commands to run after465# installing a port. You can use wildcards ("ports glob"). If a466# port/package matches multiple entries, all the commands are joined467# using the semicolon as separator and run.468#469# cf. -B/--afterinstall of portupgrade(1), ports_glob(1)470#471# You can alternatively specify a procedure instead of a string if472# you want to run a command which can vary depending on the port.473# The procedure is called with an argument of a port origin. See474# the following examples.475#476# e.g.:477# AFTERINSTALL = {478# # Re-enable the X wrapper479# 'x11-servers/XFree86-4-Server' => sprintf('cd %s/bin && if [ -x Xwrapper-4 ]; then ln -sf Xwrapper-4 X; fi', x11base()),480#481# # Automatically start the server for each package that482# # installs a rc file enabled483# # This is replaced by HANDLE_RC_SCRIPTS: true in /usr/local/etc/pkg.conf484# '*' => proc { |origin|485# cmd_start_rc(origin)486# },487#488# # Automatically start MySQL server489# 'databases/mysql323-server' => proc { |origin|490# cmd_enable_rc(origin) + ';' + cmd_start_rc(origin)491# },492#493# # Start postfix494# 'mail/postfix*' => localbase() + '/sbin/postfix start',495# }496497AFTERINSTALL = {498# Re-enable the X wrapper499'x11-servers/XFree86-4-Server' => sprintf(500'cd %s/bin && if [ -x Xwrapper-4 ]; then ln -sf Xwrapper-4 X; fi',501x11base()),502}503504# PKG_SITES: array505#506# This is a list of URI's to get packages from. Each site directory507# must contain directories named 'All' and 'Latest'. The value of508# the environment variable `PKG_SITES' is automatically prepended to509# the list. (default: [pkg_site_mirror()])510#511# e.g.:512# PKG_SITES = [513# sprintf('ftp://ftp.localdomain/pub/freebsd/packages-%s/', OS_MAJOR),514# pkg_site_builder(true),515# pkg_site_builder(),516# pkg_site_mirror(),517# pkg_site_primary(),518# ]519520PKG_SITES = [521pkg_site_mirror(),522]523524# PORTUPGRADE_ARGS: string525#526# This sets the default options passed to portupgrade(1).527#528# e.g.:529# PORTUPGRADE_ARGS = ENV['PORTUPGRADE'] || \530# '-v -D -l /var/tmp/portupgrade.results ' + \531# '-L /var/tmp/portupgrade-%s::%s.log'532533PORTUPGRADE_ARGS = ENV['PORTUPGRADE']534535end536537538