- The Core Planners: [email protected]
Binary package
Binary packages can be set as runtime or build time dependencies. See Defining your dependencies for more information.
To add core/file as a depdendency, you can add one of the following to your plan file.
pkg_build_deps=(core/file)
pkg_deps=(core/file)
To install this plan, you should run the following commands to first install, and then link the binaries this plan creates.
hab pkg install core/file
» Installing core/file
☁ Determining latest version of core/file in the 'stable' channel
☛ Verifying core/file/5.37/20200305174635
...
✓ Installed core/file/5.37/20200305174635
★ Install of core/file/5.37/20200305174635 complete with 1 new packages installed.
hab pkg binlink core/file
» Binlinking file from core/file into /bin
★ Binlinked file from core/file/5.37/20200305174635 to /bin/file
You can now use the binary as normal:
/bin/file --help
or file --help
Usage: file [OPTION...] [FILE...]
Determine type of FILEs.
--help display this help and exit
-v, --version output version information and exit
-m, --magic-file LIST use LIST as a colon-separated list of magic
number files
...
In addition to the file
command, this package also provides the magic.mgc
data file that is typically available at /usr/share/misc/magic.mgc
The MAGIC
environment variable is commonly used for instructing applications to look for this file in a nonstandard location. A PHP application, for example, could be configured to make use of this magic.mgc
file by adding a custom runtime environment variable to the application's plan.sh
:
do_setup_environment() {
set_runtime_env MAGIC "$(pkg_path_for file)/share/misc/magic.mgc"
}