Packaging - 6. Reference
6.1 The Build Process
To understand some of the fields, you need some knowledge of the
build process Fink uses. It consists of five phases: unpack, patch,
compile, install and build. The example paths below are for an
installation in /opt/sw
and the package gimp-1.2.1-1.
In the unpack phase the directory /opt/sw/src/fink.build/gimp-1.2.1-1
is created
and the source tarball(s) are unpacked there. In most cases, this will
create a directory gimp-1.2.1 with the source in it; all following
steps will be executed in that directory
(i.e. /opt/sw/src/fink.build/gimp-1.2.1-1/gimp-1.2.1
). Details can be controlled with
the SourceDirectory, NoSourceDirectory and SourceNExtractDir
fields.
In the patch phase the source is patched so that it will build on Darwin. The actions specified by the UpdateConfigGuess, UpdateLibtool, Patch and PatchScript fields will be executed, in that order.
In the compile phase the source is configured and
compiled. Usually this means calling the configure
script
with some parameters and then issuing a make
command. See the
CompileScript field description for details. If test suites are enabled
for the build (a new feature in fink 0.25, currently achieved by building in
maintainer mode), the TestScript will be run immediately after the
CompileScript.
In the install phase the package is installed to a temporary
directory, /opt/sw/src/fink.build/root-gimp-1.2.1-1
(= %d). (Note the "root-" part.)
All files that would normally be installed to /opt/sw
are installed in
/opt/sw/src/fink.build/root-gimp-1.2.1-1/opt/sw
(= %i = %d%p) instead. See the
InstallScript field description for details.
(Introduced in fink 0.9.9. It is possible to generate several
packages from a single package description using the SplitOff
field. Towards the end of the install phase, separate install directories
are created for each package being created, and files are moved to
the appropriate directory.)
In the build phase a binary package file (.deb) is built
from the temporary directory. You can't influence this step directly,
but various information from the package description is used to
generate a control
file for dpkg.
6.2 Fields
We have divided the list of fields into several categories.
The list of fields is not necessarily complete. :-)
Initial Data:
Field | Value |
---|---|
Package |
The package name. May contain lowercase letters, numbers and the special characters '.', '+' and '-'. No underscores ('_'), no capital letters. Required field. Percent expansion is applied to this field for %N, %{Ni}, %type_raw[], and %type_pkg[] only.
As per Fink packaging policy, a given package must always
compile with the same options enabled. If you have multiple variants
for a package (see documentation for the |
Version |
The upstream version number. Same limitations as the Package field. Required field.
Note that some programs use nonstandard version numbering schemes
that may cause sorting confusion or that contain characters that are
not allowed in this field. In these situations, when writing the
Fink package, you must convert the upstream value to one that is
acceptable and that allows the versions to be arranged in the
correct order. When in doubt about how version strings will be
sorted, you can use the dpkg --compare-versions 1.2.1 lt 1.3 && echo "true"
will print "true" because version string "1.2.1"
is less than "1.3". See the |
Revision |
The package revision. Increase this when you make a new description for the same upstream version. Revision numbers start at 1. Required field.
Fink's policy is that any time you make a change to the
|
Architecture |
A comma-separated list of fink architecture(s) for which the package
(and any splitoff packages) are intended.
As of fink-0.29.5, the valid values for architecture are
One common use of this field will be for packages which
require a compiler earlier than gcc-4.0 (or packages which depend on such
packages), which should be declared to have architecture
This field supports the standard conditional syntax for any value in
the value list and percent-expansions can be used (see
the Package: foo-pm%type_pkg[perl] Type: perl (5.8.8 5.10.0) Architecture: (%type_pkg[perl] = 5100) x86_64
will result in the field for the foo-pm5100 variant
being The example above gives a very common use of this field: since some modules for system-perl 5.10.0 on 10.6 do not build as 32-bit (i386), this field allows limiting multiple-type perl packages to specific systems. |
Distribution |
A comma-separated list of distribution(s) for which the package
(and any splitoff packages) are intended.
At present, the only valid values for distribution are
Since Fink's
This field supports the standard conditional syntax for any value in
the value list and percent-expansions can be used (see
the Package: foo-pm%type_pkg[perl] Type: perl (5.12.3 5.12.4) Distribution: (%type_pkg[perl] = 5123) 10.7, (%type_pkg[perl] = 5123) 10.8
will result in the Since python 2.5 is not available in the 10.7+ distributions, and the available perl versions vary by distribution, these package types provide a common use of this field. For reference, we note the availabilty of various perl versions in the 10.3 through 13.0 distributions (bolded systems indicate system-perl at that version): perl 5.6.0: 10.3 perl 5.8.0: 10.3 perl 5.8.1: 10.3, 10.4 perl 5.8.4: 10.3, 10.4 perl 5.8.6: 10.3, 10.4, 10.5 perl 5.8.8: 10.4, 10.5, 10.6 perl 5.10.0: 10.5, 10.6 perl 5.12.3: 10.7, 10.8, 10.9 perl 5.12.4: 10.7, 10.8, 10.9 perl 5.16.2: 10.7, 10.8, 10.9, 10.10, 10.11, 10.12, 10.13 perl 5.18.2: 10.7, 10.8, 10.9, 10.10, 10.11, 10.12, 10.13, 10.14, 10.14.5, 10.15, 11.0, 11.3, 12.0, 13.0, 14.0, 15.0 perl 5.18.4: 10.9, 10.10, 10.11, 10.12, 10.13, 10.14, 10.14.5, 10.15, 11.0, 11.3, 12.0, 13.0, 14.0, 15.0 perl 5.28.2: 10.9, 10.10, 10.11, 10.12, 10.13, 10.14, 10.14.5, 10.15, 11.0, 11.3, 12.0, 13.0, 14.0, 15.0 perl 5.30.2: 10.9, 10.10, 10.11, 10.12, 10.13, 10.14, 10.14.5, 10.15, 11.0, 11.3, 12.0, 13.0, 14.0, 15.0 perl 5.30.3: 10.9, 10.10, 10.11, 10.12, 10.13, 10.14, 10.14.5, 10.15, 11.0, 11.3, 12.0, 13.0, 14.0, 15.0 perl 5.34.1: 10.9, 10.10, 10.11, 10.12, 10.13, 10.14, 10.14.5, 10.15, 11.0, 11.3, 12.0, 13.0, 14.0, 15.0 A way to include all supported variants in a single finkinfo file is as follows. Package: foo-pm%type_pkg[perl] Type: perl (5.8.8 5.10.0 5.12.3 5.12.4 5.16.2) Distribution: << (%type_pkg[perl] = 588) 10.6, (%type_pkg[perl] = 5100) 10.6, (%type_pkg[perl] = 5123) 10.7, (%type_pkg[perl] = 5123) 10.8, (%type_pkg[perl] = 5123) 10.9, (%type_pkg[perl] = 5124) 10.7, (%type_pkg[perl] = 5124) 10.8, (%type_pkg[perl] = 5124) 10.9, (%type_pkg[perl] = 5162) 10.7, (%type_pkg[perl] = 5162) 10.8, (%type_pkg[perl] = 5162) 10.9 << Note that we do not include old distributions, such as 10.2 or 10.4-transitional, since the versions of fink which are relevant for them do not recognize this field. |
Epoch |
Introduced in fink 0.12.0. This optional field can be used to specify the epoch of the package (which defaults to 0 if not specified). For more information refer to the Debian Policy Manual. Because Fink and some of the underlying Debian tools use name-version-revision as the unique identifier of a package, you must not create a package that differs from another solely by its epoch.
When used in a version string, the Epoch appears before the Version
value, separated by a colon (1:3.14-2). Note that the Epoch is not part
of |
Description |
A short description of the package (what is it?). This is a one-line description that will be displayed in lists, so it must be short and informative. It should be less than 45 chars and must be less than 60. It is not necessary to repeat the package name in this field - it will always be displayed in proper context. Required field. |
Type |
This can be set to
Since fink 0.9.5 there is type Beginning in a CVS version of fink after fink-0.19.2, the language/language-version use has been generalized to allow any Maintainer-defined types and associated subtypes and more than a single type for a given package. The type and subtype are each arbitrary strings of non-whitespace characters (but parentheses, commas, braces, and percent signs should not be used); no percent-expansion is performed, and the type (not subtype) values are converted to all-lowercase. Multiple type values (each with an optional whitespace-separated subtype) are specified in a comma-separated list. In addition, the concept of "variants" exists, where a single .info file describes a family of related packages with various options enabled. The key to this whole process is the use of a list of subtypes. Instead of a single string, one uses a space-separated list of strings in parentheses. Fink clones the package description file for each subtype in the list and replaces this list with that single subtype. For example: Type: perl (5.12.3 5.12.4)
yields two package descriptions, one that behaves as if Type: -x11 (boolean) Type: -x11 (-x11 .) Subtype list expansion/package cloning is recursive; if there are multiple types with subtype lists, you will get all combinations: Type: -ssl (boolean), perl (5.12.3 5.12.4) One can access the specific variant subtype in other fields using the %type_raw[] and %type_pkg[] pseudo-hashes. Here are two example .info fragments: Info2: << Package: foo-pm%type_pkg[perl] Type: perl (5.12.3 5.12.4) Depends: perl%type_pkg[perl]-core << Info2: << Package: bar%type_pkg[-x11] Type: -x11 (boolean) Depends: (%type_raw[-x11] = -x11) x11 CompileScript: << #!/bin/bash -ev if [ "%type_raw[-x11]" == "-x11" ]; then ./configure %c --with-x11 else ./configure %c --without-x11 fi make << <<
Starting in fink 0.26.0, there is a special Info2: << Package: foo%type_pkg[-64bit] Type: -64bit (boolean) Depends: (%type_raw[-64bit] = -64bit) 64bit-cpu ConfigureParams: --libdir='${prefix}/%lib' SplitOff: << Package: %N-shlibs Files: %lib/libfoo.*.dylib Shlibs: << %p/%lib/libfoo.1.dylib 1.0.0 %n (>= 1.0-1) %type_num[-64bit] << << << Note that |
License |
This field gives the nature of the license under which the package is distributed. The value must be one of the values described in Package Licenses earlier in this document. Additionally, this field must only be given if the package actually complies to the packaging policy in these respects, i.e. a copy of the license is installed in the doc directory for the package. |
Maintainer |
The name and e-mail address of the person responsible for the package. This field is required, and there must be exactly one name and address in the following format: Firstname Lastname <user@host.domain.com> |
InfoN |
This field allows fink to implement backward-incompatible syntax changes in package description files. A given version of fink is configured with the maximum integer "N" that it can handle. Any package in a higher InfoN field will be ignored, so this mechanism should only be used when necessary, lest people with older versions of fink be needlessly alienated. To use this mechanism, embed the entire package description in the desired InfoN field. See the "File Format" section earlier in this document for a description of the syntax for multiline fields. Here are the features added for each InfoN level, along with the earliest version of fink that supports it:
|
Dependencies:
Field | Value |
---|---|
Depends |
A list of packages which must be installed before this package can be built. Percent expansion is performed on this field (as well as the other package list fields in this section: BuildDepends, RuntimeDepends, Provides, Conflicts, Replaces, Recommends, Suggests, and Enhances. Usually, this is just a comma-separated list for plain package names, but Fink now supports alternatives and version clauses with the same syntax as dpkg. A fully featured example: Depends: << daemonic (>= 20010902-1), emacs | xemacs <<
The layout above is the preferred format for the Note that there is no way to express real optional dependencies. If a package works both with and without another package, you must either make sure that the other package is not used even when it is present or add it to the Depends field. If you want to offer the user both options, make two separate packages, e.g. wget and wget-ssl.
Order of operations: logical "OR" (list of alternatives) has
a higher precedence (binds more tightly) than the logical
"AND" between each package (or set of alternatives) in the
comma-separated list. Unlike the use of parentheses in arithmetic,
there is no way to specify alternative groups of packages or otherwise
change the order of operations in
Starting with a post-0.18.2 CVS version of fink, you can have
conditional dependencies. These are specified by placing
You can use this format to simplify maintaining several similar packages. For example, the packages elinks and elinks-ssl could both list: Depends: << expat-shlibs, (%n = elinks-ssl) openssl097-shlibs << would have the same effect as having elinks list: Depends: expat-shlibs and elinks-ssl list: Depends: expat-shlibs, openssl097-shlibs
As an alternative syntax, you can also specify Package: nethack%type_pkg[-x11] Type: -x11 (boolean) Depends: (%type_pkg[-x11]) x11 would set the package x11 as a dependency for the nethack-x11 variant but not for the nethack variant. Note that when using Depends/BuildDepends for shared library packages for which more than one major-version is available, you must not do the following: Package: foo Depends: id3lib3.7-shlibs | id3lib4-shlibs BuildDepends: id3lib3.7-dev | id3lib4-dev even if your package could work with either library. Pick one (preferably the highest version that can be used successfully) and use it consistently in your package.
As explained in the Shared Library Policy, only one of the
-dev packages can be installed at a time, and each has links of the
same name that could point to different filenames in the associated
-shlibs package. When compiling package foo, the actual filename (in
the -shlibs package) gets hard-coded into the foo binary. That means
the resulting package needs the specific -shlibs package associated
with the -dev that was installed at compile-time. As a result, one
cannot have a In the past, non-essential packages implicitly depended on the essential ones; this is no longer true. |
BuildDepends |
Introduced in fink 0.9.0.
A list of dependencies that is applied at build time only.
This can be used to list tools (e.g. flex) that must be present to
build the package, but which are not used at run time.
Supports the same syntax as Depends. If a build is being done
with test suites enabled, the dependencies in the |
RuntimeDepends |
Introduced in fink 0.32.0. A list of dependencies that is applied at run time only, that is, when the package is being installed. This can be used to list packages that must be present to run the package, but which are not used at build time. Supports the same syntax as Depends. |
Provides |
A comma-separated list of package names that this package is
considered to "provide".
If a package named "pine" specifies Note that there is no versioning data associated with Provides items. They do not inherit from the parent package that contains the Provides list nor is there a syntax for specifying an arbitrary version in the Provides field itself. Further, a dependency that contains a version specification is not satisfied by a package that Provides that needed package name. As a result, having many variants provide a common surrogate package may be harmful, because it precludes the use of versioned dependencies. For example, if foo-gnome and foo-nognome both have "Provides: foo", another package with "Depends: foo (> 1.1)" will not work. |
Conflicts |
A comma-separated list of package names that must not be installed at the same time as this package. For virtual packages it is allowed to list the names of the provided packages here; they will be handled appropriately. This fields also supports versioned dependencies like the Depends field, but not alternatives (wouldn't make sense). If a package is listed in its own Conflicts, it will be (silently) removed from that list. (Introduced in a post-0.18.2 CVS version of fink.) Note: Fink itself currently ignores this field. However, it is passed on to dpkg and will be handled accordingly. In summary, it only effects run-time, not build-time. |
BuildConflicts |
A list of packages that must not be installed while this package is
being compiled. This can be used to prevent |
Replaces |
This is used together with "Conflicts", when this package not only takes over the function of the conflicting package, but also has some common files. Without this field, dpkg may generate errors when installing the package because files are still owned by the other package. It is also a hint that the two packages involved are genuine alternatives and one can be removed in favor of the other. If a package is listed in its own Replaces, it will be (silently) removed from that list. (Introduced in a post-0.18.2 CVS version of fink.) Note: Fink itself currently ignores this field. However, it is passed on to dpkg and will be handled accordingly. In summary, it only effects run-time, not build-time. |
Recommends, Suggests, Enhances |
These fields specify additional package relations in the same style as
the other dependency fields.
These three relations don't affect actual installation via
|
Pre-Depends |
A special variation of the Depends field with more strict semantics. This field must only be used after the case has been discussed on the developer mailing list and a consensus has been reached that it is necessary. |
Essential |
A boolean value that denotes essential packages. Essential
packages are installed as part of the bootstrap process. |
BuildDependsOnly |
Introduced in fink 0.9.9.
A boolean value which indicates that no other packages should Depend on
this one, they should only BuildDepend.
Unlike usual boolean fields, As of fink 0.20.5, the presence or absence of this field, and its value if present, are recorded into the .deb file when the package is built. Therefore, if you change the value of BuildDependsOnly or if you add or remove it, you must increase the revision number of the package. |
Unpack Phase:
Field | Value |
---|---|
CustomMirror |
A list of mirror sites. Each mirror site appears on a separate line,
in the following format: CustomMirror: << nam-US: ftp://ftp.fooquux.com/pub/bar asi-JP: ftp://ftp.qiixbar.jp/pub/mirror/bar eur-DE: ftp://ftp.barfoo.de/bar Primary: ftp://ftp.barbarorg/pub/ <<
The standard continent and country codes are listed in
|
Source |
An URL to the source tarball. It should be a HTTP or FTP URL, but
Fink doesn't really care - it just passes the URL to wget. This field
supports a special URL scheme for mirrors:
Since fink 0.18.0,
Sources that are only needed in order to run test suites should
use |
SourceN |
If a package consists of several tarballs, name them with these
additional fields, starting with N = 2. So, the first tarball (which
should be some kind of "main" tarball) goes into |
SourceDirectory |
Must be used when the tarball expands to a single directory, but the directory's name is different from the basename of the tarball. Usually, a tarball named "foo-1.0.tar.gz" will produce a directory named "foo-1.0". If it produces a directory with a different name, specify it with this parameter. Percent expansion is performed on this field. |
NoSourceDirectory |
Set this boolean parameter to a true value if the tarball does not expand to a single directory. Usually, a tarball named "foo-1.0.tar.gz" will produce a directory named "foo-1.0". If it just unpacks the files to the current directory, use this parameter and set it to a boolean true value. |
SourceNExtractDir |
Normally, an auxiliary tarball will be extracted in the same directory as the main tarball. If you need to extract it in a specific subdirectory instead, use this field to specify it. Source2ExtractDir corresponds to the Source2 tarball, as one would expect. See ghostscript, vim and tetex for examples of usage. |
SourceRename |
This field can rename a source tarball on the fly. This is useful
if for example the version of the source is encoded in the directory name on
the server, but the tarball itself has the same name for all versions, e.g.
SourceRename: %n-%v.tar.gz
In the above example this would result in the tarball being stored under
|
SourceNRename |
This is just the same as the |
Source-MD5 |
Introduced in fink 0.10.0. With this field you can specify the MD5 checksum of the source file. This information is then used by Fink to detect incorrect source files, that is, tarballs not matching the one the package creator used. Common causes for this problem include: incompletely downloaded tarballs; upstream maintainers silently replaced a tarball; a trojan or similar attacks; and so on. A typical usage example looks like this: Source-MD5: 4499443fa1d604243467afe64522abac
To compute the checksum, the fingolfin% md5sum /opt/sw/src/apache_1.3.23.tar.gz 4499443fa1d604243467afe64522abac /opt/sw/src/apache_1.3.23.tar.gz As you can see, the value to the left is exactly the value you need. |
SourceN-MD5 |
Introduced in fink 0.10.0.
This is just the same as the |
Source-Checksum |
Alternative method to list the checksum for a source file. This field takes a hash type, followed by the actual checksum. For example: Source-Checksum: SHA256(5048f1c8fc509cc636c2f97f4b40c293338b6041a5652082d5ee2cf54b530c56)
Current valid checksums are $ shasum -a 256 /opt/sw/src/libexif-0.6.22.tar.xz 5048f1c8fc509cc636c2f97f4b40c293338b6041a5652082d5ee2cf54b530c56 /opt/sw/src/libexif-0.6.22.tar.xz
The |
SourceN-Checksum |
This is just the same as the |
TarFilesRename |
Introduced in fink 0.10.0. This field only applies to source files that are using the tar format
With this field you can rename files in the given source tarball during
the extraction of the tarball. This is very useful to work around
the fact that the HFS+ file system is not case sensitive, as files like
In this field you simply specify a list of files that are to be renamed. You
can make use of wildcards. By default any given file will be renamed to its
current name with TarFilesRename: foo bar.* qux:quux Tar2FilesRename: directory/INSTALL:directory/INSTALL.txt |
TarNFilesRename |
Introduced in fink 0.10.0.
This is just the same as the |
Patch Phase:
Field | Value |
---|---|
UpdateConfigGuess |
A boolean value. If true, the files config.guess and config.sub in the build directory will be replaced with versions that know about Darwin. This happens in the patch phase and before the PatchScript is run. Only use this when you know it is necessary, i.e. when the configure script fails with a "unknown host" message. |
UpdateConfigGuessInDirs |
Introduced in a post-0.9.0 CVS version.
A list of subdirectories.
This does the same as UpdateConfigGuess, but is useful for packages
that have outdated config.guess files in several directories
throughout the source tree.
Previously you had to copy/move the files there manually in the
PatchScript.
With this new field you can just list the directories.
Use |
UpdateLibtool |
A boolean value. If true, the files ltconfig and ltmain.sh in the build directory will be replaced with versions that know about Darwin. This happens in the patch phase and before the PatchScript is run. Only use this when you know that the package needs it. Some packages can be broken by overwriting the libtool scripts with mismatching versions. See the libtool page for further information. |
UpdateLibtoolInDirs |
Introduced in a post-0.9.0 CVS version.
A list of subdirectories.
This does the same as UpdateLibtool, but is useful for packages
that have outdated libtool 1.3.x scripts in several directories
throughout the source tree.
Previously you had to copy/move the files there manually in the
PatchScript.
With this new field you can just list the directories.
Use |
UpdatePoMakefile |
A boolean value.
If true, the file
The patched version respects DESTDIR and makes sure that message
catalogs end up in |
Patch |
The filename of a patch to be applied with
Remember that %n includes all %type_ variant data, so you may want to
use %{ni} here (perhaps with some specific %type_ expansions). It's
easier to maintain a single patchfile and then make variant-specific
changes in
As of fink-0.29.0, this field should not be used.
Use |
PatchFile |
The same syntax as the
You may not use both |
PatchFileN |
If a package has several patch files, name them with these additional
fields, starting with N = 2. So, the first patch file goes into
|
PatchFile-MD5 |
The MD5 checksum of the file given in the |
PatchFileN-MD5 |
The MD5 checksum of the file given in the |
PatchScript |
A list of commands that are run in the patch phase. This is the place
to put commands that patch or otherwise modify the package source. See
the note on scripts
below. Before the commands are executed, percent expansion takes place. If
a patch -p1 < %{PatchFile}
If one or more patch -p1 < %{PatchFileN}
If there is no |
Compile Phase:
Field | Value |
---|---|
SetENVVAR |
Causes certain environment variables to be set in the compile and install phases. This can be used to pass compiler flags etc. to configure scripts and Makefiles. Currently supported variables are: CC, CFLAGS, CPP, CPPFLAGS, CXX, CXXFLAGS, DYLD_LIBRARY_PATH, JAVA_HOME, LD, LDFLAGS, LIBRARY_PATH, LIBS, MACOSX_DEPLOYMENT_TARGET, MAKE, MFLAGS, MAKEFLAGS. The value you specify is subject to the percent expansion described in the last section. A common example: SetLDFLAGS: -Wl,-strip_dead_dylibs Some environment variables have default preset values. If you specify a value for one of these, it will be prepended to the default value. The preset variables (and their default values) are: CPPFLAGS: -I%p/include LDFLAGS: -L%p/lib Starting in fink 0.26.0, there is one exception to these defaults:
if Finally, MACOSX_DEPLOYMENT_TARGET is set to a default value depending on which version of OSX is being run, but setting a value for it for a package will override (rather than prepend to) the default value. |
NoSetENVVAR |
When set to a true value, deactivates the default values for the preset
variables (such as
CPPFLAGS, LDFLAGS, CXXFLAGS mentioned above). For
example, if you want LDFLAGS to
remain unset, specify |
UseMaxBuildJobs |
When set to a true value, appends |
BuildAsNobody |
In fink >= 0.33.0, when set to a In earlier fink versions, this field does nothing. |
ConfigureParams |
Additional parameters to pass to the configure script. (See
CompileScript for details.)
For packages not of
If a build is being done
with test suites enabled, the value of the
Starting in fink-0.22.0, this field supports conditionals. The
syntax is the same as that used in the Type: -x11 (boolean) ConfigureParams: --mandir=%p/share/man (%type_pkg[-x11]) --with-x11 --disable-shared
will always pass the
This field supports placing parameters into multiple lines using multi-line field declarators. The field is handled as a shell command line and uses ConfigureParams: << --mandir=%p/share/man \ (%type_pkg[-x11]) --with-x11 \ --disable-shared << Note: do not place conditional parameters as the last line when using the multi-line field format. In instances when the conditional evaluates as false, the parameter immediately following is not evaluated and this breaks the shell. |
GCC |
This field specifies the GCC-ABI used by C++ code in this package. (It is needed because that ABI has changed twice, and any libraries which you link to containing C++ code must be compiled with the same ABI you are currently using.)
The allowed values are:
The GCC field does not have a default value, per se, since it is ignored
if it is not set. However, for each tree, there is an expected value
for GCC corresponding to the default g++ compiler for that tree.
The expected values for the various package trees are:
Note that when the GCC value is different from the expected value, the compiler must be specified within the package (typically by setting the CC or CXX flags), and a dependency on one of the (virtual) gcc packages should be specified. As of fink 0.13.8, when this flag is present, the version of gcc
is tested using This field was added to fink to aid maintainers in tracking the transition between the gcc compilers, which introduced a binary incompatibility between libraries that involve C++ code which is not reflected in the versioning scheme. |
CompileScript |
A list of commands that are run in the compile phase. This is the place to put commands that configure and compile the package. See the note on scripts below. Before the commands are executed, percent expansion takes place. Normally the default is: ./configure %c make This is appropriate for packages that use GNU autoconf. For packages with of type perl (as specified via the Type field) with the perl version not specified, the default instead (as of fink 0.13.4) is: perl Makefile.PL PREFIX=%p \ INSTALLPRIVLIB=%p/lib/perl5 \ INSTALLARCHLIB=%p/lib/perl5/darwin \ INSTALLSITELIB=%p/lib/perl5 \ INSTALLSITEARCH=%p/lib/perl5/darwin \ INSTALLMAN1DIR=%p/share/man/man1 \ INSTALLMAN3DIR=%p/share/man/man3 \ INSTALLSITEMAN1DIR=%p/share/man/man1 \ INSTALLSITEMAN3DIR=%p/share/man/man3 \ INSTALLBIN=%p/bin \ INSTALLSITEBIN=%p/bin \ INSTALLSCRIPT=%p/bin make make test If the type is perl$version Makefile.PL \ PERL=perl$version PREFIX=%p \ INSTALLPRIVLIB=%p/lib/perl5/$version \ INSTALLARCHLIB=%p/lib/perl5/$version/$perlarchdir \ INSTALLSITELIB=%p/lib/perl5/$version \ INSTALLSITEARCH=%p/lib/perl5/$version/$perlarchdir \ INSTALLMAN1DIR=%p/share/man/man1 \ INSTALLMAN3DIR=%p/share/man/man3 \ INSTALLSITEMAN1DIR=%p/share/man/man1 \ INSTALLSITEMAN3DIR=%p/share/man/man3 \ INSTALLBIN=%p/bin \ INSTALLSITEBIN=%p/bin \ INSTALLSCRIPT=%p/bin make make test where |
NoPerlTests |
Introduced in fink > 0.13.7.
A boolean value, specific for perl module packages.
If true, the |
Test Suites:
Field | Value |
---|---|
InfoTest |
Introduced in fink 0.25.
This field encapsulates information that will only be used when performing
a build with test suites enabled. It contains other fields.
If present, this field must contain a
Here's an example: InfoTest: << TestScript: make check || exit 2 TestConfigureParams: --enable-tests << |
Install Phase:
Field | Value |
---|---|
UpdatePOD |
Introduced in fink 0.9.5.
A boolean value, specific for perl module packages.
If true, this will add code to the install, postrm and postinst
scripts that maintains the .pod files provided by perl packages.
This includes adding and removing the .pod date from the central
|
InstallScript |
A list of commands that are run in the install phase. This is the place to put commands that copy all the necessary files into the temporary dpkg directory for the package. See the note on scripts below. Before the commands are executed, percent expansion takes place. Normally the default is: make install prefix=%i The default is appropriate for packages that use GNU autoconf. For packages with of type perl (as specified via the Type field) with the perl version not specified, the default instead (as of fink 0.13.4) is: make install INSTALLPRIVLIB=%i/lib/perl5 \ INSTALLARCHLIB=%i/lib/perl5/darwin \ INSTALLSITELIB=%i/lib/perl5 \ INSTALLSITEARCH=%i/lib/perl5/darwin \ INSTALLMAN1DIR=%i/share/man/man1 \ INSTALLMAN3DIR=%i/share/man/man3 \ INSTALLSITEMAN1DIR=%i/share/man/man1 \ INSTALLSITEMAN3DIR=%i/share/man/man3 \ INSTALLBIN=%i/bin \ INSTALLSITEBIN=%i/bin \ INSTALLSCRIPT=%i/bin If the type is make install INSTALLPRIVLIB=%i/lib/perl5/$version \ INSTALLARCHLIB=%i/lib/perl5/$version/$perlarchdir \ INSTALLSITELIB=%i/lib/perl5/$version \ INSTALLSITEARCH=%i/lib/perl5/$version/$perlarchdir \ INSTALLMAN1DIR=%i/share/man/man1 \ INSTALLMAN3DIR=%i/share/man/man3 \ INSTALLSITEMAN1DIR=%i/share/man/man1 \ INSTALLSITEMAN3DIR=%i/share/man/man3 \ INSTALLBIN=%i/bin \ INSTALLSITEBIN=%i/bin \ INSTALLSCRIPT=%i/bin where
If the package supports it, it is preferably to use |
AppBundles |
Introduced in a post-0.23.1 version.
This field installs the specified application bundle(s) into
AppBundles: build/*.app Foo.app |
JarFiles |
Introduced in fink 0.10.0.
This field is somewhat similar to DocFiles. It installs the specified jar
files into JarFiles: lib/*.jar foo.jar:fooBar.jar This will install all the jars that were in the lib directory and will install foo.jar as fooBar.jar.
It also ensures that these jar files (specifically: all files in
|
DocFiles |
This field provides a convenient way to install README or COPYING
files in the doc directory for the package,
|
Shlibs |
Introduced in fink 0.11.0.
This field declares the shared libraries which are installed in the
package. There is one line for each
shared library, which contains the |
RuntimeVars |
Introduced in fink 0.10.0.
This field provides a convenient way to set environment variables to some static value at runtime (if you need more flexibility, refer to the profile.d scripts section). As long as your package is installed, these variables will be set via the The value of your variable can contain spaces (trailing ones are trimmed); also, percent expansion takes place. For example: RuntimeVars: << SomeVar: %p/Value AnotherVar: foo bar << will set two environment variables 'SomeVar' and 'AnotherVar' and their values will be respectively '/opt/sw/Value' (or whatever your prefix is) and 'foo bar'. This field works by appending appropriate commands to the InstallScript. These commands add a setenv/export line for each variable to the package profile.d scripts, so you can provide your own ones, they won't be overwritten. The lines are prepended to the scripts, you can thus use these variables in your scripts. |
SplitOff |
Introduced in fink 0.9.9. Generate a second package from the same compile/install run. For details about how this works, see the separate splitoff section below. |
SplitOffN |
Introduced in fink 0.9.9.
This is the same as |
Files |
Introduced in fink 0.9.9.
Used only
within a |
Build Phase:
Field | Value |
---|---|
PreInstScript, PostInstScript, PreRmScript, PostRmScript |
These fields specify pieces of shell scripts that will be called when
the package is installed, upgraded or removed.
Fink automatically adds the shell script header
The scripts are called at the following times:
To make it more clear, an upgrade invokes both the ...Inst scripts of the new version and the ...Rm scripts of the old version. Details can be found in the Debian Policy Manual, Chapter 6. Percent expansion is performed on the scripts. Commands can generally be called without giving a full path. |
ConfFiles |
A space-separated list of files that are user-modifiable configuration
files.
Percent expansion is performed on this field.
The files must be specified with an absolute path,
e.g. |
InfoDocs |
Lists the names of Info documents that the package installs in
%p/share/info.
This will add appropriate code to the postinst and prerm scripts to
maintain the Info directory file, Note: Only use the un-numbered file in the case of split Info documents. E.g. if a package has: foo.info foo.info-1 foo.info-2 you should only use: InfoDocs: foo.info This feature is still in flux, more fields for finer control may be added in the future. |
DaemonicFile |
Gives a service description for |
DaemonicName |
A name for the |
Additional Data:
Field | Value |
---|---|
Homepage |
The URL of the upstream home page of the package. |
DescDetail |
A more detailed description than the one in the |
DescUsage |
This is for information that is needed to use the package (how do I use it?). As in "run wmaker.inst once before using WindowMaker". Multiple lines allowed. Because this field will be displayed without the benefit of word-wrap, you should manually insert line breaks in order to keep lines less than 79 chars (if possible). |
DescPackaging |
Notes about the packaging. Stuff like "patches the Makefile to put everything in place" goes here. Multiple lines allowed. |
DescPort |
Notes that are specific to porting the package to Darwin. Stuff like "config.guess and libtool scripts are updated, -no-cpp-precomp is necessary" goes here. Multiple lines allowed. |
6.3 SplitOffs
Beginning with fink 0.9.9, a single .info file can be used to build
multiple packages.
The install phase begins as usual, with the execution of the
InstallScript
and DocFiles
commands.
A SplitOff
or SplitOffN
field, if present, then triggers the
creation of an
additional install directory. Within the
SplitOff
or SplitOffN
field, the new install directory is referred to as %i,
while the original install directory of the parent
package is referred to as %I.
Each SplitOff
and SplitOffN
field must contain a number of fields of its
own. In fact, it resembles a complete package description, but with
certain fields missing. Here is what belongs in the sub-description
(by category):
- Initial Data: Only the
Package
needs to be specified, everything else is inherited from the parent package. You may modifyType
andLicense
by declaring the field within theSplitOff
orSplitOffN
. Percent expansion can be used, and it is often convenient to refer to the name %N of the parent package. - Dependencies: All of these are allowed.
- Unpack Phase, Patch Phase, Compile Phase: These fields are irrelevant and will be ignored.
- Install Phase, Build Phase: Any of these fields are allowed (except that SplitOffs cannot themselves contain additional SplitOffs).
- Additional Data: These are inherited from the parent package but may
be modified by declaring the field within the
SplitOff
orSplitOffN
.
Because %n-%v-%r is treated as the unique identifier of a package, you
must not have the same Package
(at the
same Version
and Revision
) listed as
a SplitOff
(or SplitOffN
) of
multiple packages. If you use variants, remember that each variant is
considered an independent package, so the following package layout is
forbidden:
Package: mime-base64-pm%type_pkg[perl] Type: perl (5.12.3 5.12.4) SplitOff: << Package: mime-base64-pm-bin <<
During the install phase, the InstallScript
and
DocFiles
of the parent package are executed first.
Next comes processing of the SplitOff
and
SplitOffN
fields. For each such field in turn,
the InstallScript
of that field is run, and then the
Files
command causes the listed files and directories
to be moved from the parent's installation directory %I to the
current installation directory %i. Then the DocFiles
and other Installation Phase fields of the given SplitOff
or SplitOffN
package are
executed.
At this time, the SplitOff
is processed first (if
present), followed by each SplitOffN
in
numerical order by N. However, this may change in the future, so, for
example, instead of:
SplitOff: << Description: Some header files Files: include/foo.h include/bar.h << SplitOff2: << Description: All other header files Files: include/* <<
which only works correctly if SplitOff
is processed
before SplitOff2
it's safer to list explicitly the files
for each (or use more specific filename globs).
During the build phase, the pre/post install/remove scripts for each of the packages is constructed by using the build phase commands which were specified for that package.
Each package being built is required
to document the licensing arrangement in %i/share/doc/%n (and of course
%n takes a different value for each package). Note that
DocFiles
copies files rather than moving them, so it is
possible to install identical copies of the documentation into each
of the packages by using DocFiles
several times.
6.4 Scripts
The PatchScript, CompileScript and InstallScript fields allow you
to specify shell commands to be executed. The build directory
(%b
) is the current directory when scripts are
executed. You should always use relative pathnames or
percent-expansions for files and directories in the fink hierarchy,
not complete absolute pathnames. Two forms are supported.
This field can be a simple list of commands. This is sort of like a
shell script. However, the commands are executed via system(), one
line at a time, so setting variables or changing the directory only
affects commands on that same line. Starting in a CVS version of fink
after 0.18.2, you can wrap long lines similar to normal shell scripts:
a backslash (\
) at the end of a line indicates that the
next line is a continuation.
Alternately, you can embed a complete script here, using the
interpreter of your choice. As with any Unix script, the first line
must begin with #!
followed by the full pathname of to
the interpreter and any needed flags (e.g., #!/bin/csh
,
#!/bin/bash -ev
, etc.). In this situation, the whole
*Script field is dumped into a temporary file that is then executed.
6.5 Patches
If your package needs a patch to compile on Darwin (or to work with fink), name the patch with the same name as the package description, using the extension ".patch" instead of ".info" and put it in the same directory as the .info file. Specify the filename of the patchfile with a line such as:
PatchFile: %n.patch
(For packages with variants, it may be better to use
%{ni}.patch
.)
You must also give the MD5 sum of the patchfile in the
PatchFile-MD5
field, and specify
BuildDepends: fink (>= 0.24.12)
(or a later version of fink).
When a PatchFileN
field is used, general custom
is to name the file %n-purpose-of-patch.patch
to make it easy to keep
track of. You must also use the field PatchFileN-MD5
and specify BuildDepends: fink (>= 0.30.0)
(or a later
version of fink).
When a PatchFile
declaration is present, there is a
default PatchScript
equivalent to:
PatchScript: patch -p1 < %{PatchFile}
Using PatchFileN
appends the following to the
default PatchScript
above:
patch -p1 < %{PatchFileN}
This will be overridden if you supply a PatchScript
of your own (for example, to perform a substitution on the patch file
before applying it).
If you need to have the user's chosen prefix in the patch file
it is recommended that you have a variable such as @PREFIX@
instead of /opt/sw
in the patch and then use:
PatchScript: sed 's|@PREFIX@|%p|g' < %{PatchFile} | patch -p1
Patches should be in unidiff format and are normally generated by using:
diff -urN <originalsourcedir> <patchedsourcedir>
If you have used emacs to edit files, you can add -x'*~'
to the diff command above in order to exclude automatically-generated backup files.
It must also be noted that extremely large patches should not be put in cvs.
They should be put on a web/ftp server and specified using the
SourceN:
field. If you don't have a website, fink project
admins can make the file available from fink's own website. If your
patch is larger than about 30Kb, you should consider making it a
separate download.
6.6 Profile.d scripts
If your package needs some run-time initialization (e.g. to setup environment variables), you can use profile.d scripts.
These script fragments are sourced by the /opt/sw/bin/init.[c]sh
scripts. Normally, all fink users will load these scripts in their shell startup files (.cshrc
and comparable files).
Your package must provide each script in two variants: one for sh compatible shells (sh, zsh, bash, ksh, ...) and one for csh compatible shells (csh, tcsh). They have to be installed as /opt/sw/etc/profile.d/%n.[c]sh
(where %n as usual stands for the package name).
Also, their executable and read bits have to be set (i.e. install them with -m 755), otherwise they will not be loaded correctly.
If you just need to set some environment variables (for example, QTDIR to '/opt/sw'), you can use the RuntimeVars field which is provided as a convenient way to achieve exactly this.