<<

fpm Documentation Release 1.9.0

Jordan Sissel

Sep 22, 2021

Contents

1 Table of Contents 3 1.1 Installation...... 3 1.2 Getting Started...... 4 1.3 FPM Command-line Reference...... 10 1.4 Contributing/Issues...... 34

i ii fpm Documentation, Release 1.9.0

Note: The documentation here is a work-in-progress; it is by no means extensive. If you want to contribute new docs or report problems, you are invited to do so on the project issue tracker.

Welcome to the FPM documentation! 1. Installation 2. Getting started 3. CLI reference 4. Contributing You can view the changelog here.

Contents 1 fpm Documentation, Release 1.9.0

2 Contents CHAPTER 1

Table of Contents

1.1 Installation

FPM is written in ruby and can be installed using gem. For some formats (like rpm and ), you will need certain packages installed to build them.

1.1.1 Installing FPM

Note: You must have ruby installed on your machine before installing fpm. Here are instructions to install Ruby on your machine.

You can install FPM with the gem tool: gem install fpm

To make sure fpm is installed correctly, try running the following command: fpm--version

You should get some output like this, although the exact output will depend on which version of FPM you have installed.:

% fpm--version 1.13.1

Now you can go on to using FPM!

3 fpm Documentation, Release 1.9.0

1.1.2 Installing optional dependencies

Warning: This section may be imperfect; please make sure you are installing the right package for your OS.

Some package formats require other tools to be installed on your machine to be built; especially if you are building a package for another /distribution. • RPM: rpm/rpm-tools/rpm-build [This dependency might be removed in the future, see issue #54 on ] • Snap: /squashfs-tools

Note: You will not be able to build an osxpkg package (.pkg) for MacOS unless you are running MacOS.

Here are instructions to install these dependencies on your machine: On OSX/macOS: brew install rpm squashfs

On Arch and Arch-based systems (, EndeavourOS, etc): pacman-S rpm-tools squashfs-tools

On and Debian-based systems (, , Pop!_OS, etc): -get install squashfs-tools

On systems (Fedora 22 or older, CentOS, , etc): install rpm-build squashfs-tools

On Fedora 23 or newer: install rpm-build squashfs-tools

On 7.x systems: yum-config-manager--enable ol7_optional_latest yum install rpm-build squashfs-tools

1.2 Getting Started

FPM takes your program and builds packages that can be installed easily on various operating systems.

1.2.1 Understanding the basics of FPM

The fpm command takes in three arguments: • The type of sources to include in the package • The type of package to output • The sources themselves

4 Chapter 1. Table of Contents fpm Documentation, Release 1.9.0

The source could be a: • file OR a directory with various files needed to run the program - dir • nodejs (npm) package - npm • ruby (gem) package - gem • python (using easy_install or a local setup.py) package - python • python virtualenv - virtualenv • package - pear • pearl (cpan) module - cpan • . package - deb • .rpm package - rpm • pacman (.pkg..zst) package - pacman • .pkgin package - pkgin • package without any files (useful for meta packages) - empty The target (output ) could be: • A .deb package (for Debian and Debian-based) - deb • A .rpm package (for RedHat based) - rpm • A .solaris package (for Solaris) - solaris • A . package (for FreeBSD) - freebsd • MacOS .pkg files - osxpkg • Pacman packages (.pkg.tar.zst) (for and Arch-based) - pacman • A puppet module - puppet • A p5p module - p5p • A self-extracting installer - sh • A tarfile that can be extracted into the root of any machine to install the program - tar • A zipfile that can be extracted into the root of any machine to install the program - • A directory that can be copied to the root of any machine to install the program - dir Given a source and a target, FPM can convert all the source files into a package of the target format.

1.2.2 Using it to package an executable

To simplyify things a bit, let’s take an example. Suppose you have a bash script that prints ‘Hello, world!’ in multiple colors when it is run:

--- File: hello-world

#!/usr/bin/env bash

# # == hello-world 0.1.0 == # (continues on next page)

1.2. Getting Started 5 fpm Documentation, Release 1.9.0

(continued from previous page) echo"Hello, world!"| lolcat

Let’s say you even wrote a manpage (manual page) for it:

--- File: hello-world.1

.TH HELLO WORLD"1""July 2021""hello-world 0.1.0""User Commands" .SH NAME hello-world \- manual page for hello-world 0.1.0 .SH DESCRIPTION .IP USAGE: hello-world .SH"SEE ALSO" .IP Website: https://example.com/hello-world .SH"OTHER" .IP Made by You The Amazing Person .IP This program is distributed under the AGPL 3.0 license.

Now you want to package this script and its manual page and distribute to the world as a .deb file. To do that using FPM, here is the command we need to run: fpm \ -s dir-t deb \ -p hello-world-0.1.0-1-any.deb \ --name hello-world \ --license agpl3 \ --version 0.1.0\ --architecture all\ --depends bash--depends lolcat \ --description"Say hi!"\ --url"https://example.com/hello-world"\ --maintainer"You The Amazing Person

˓→"\ hello-world=/usr/bin/hello-world hello-world.1=/usr/share/man/man1/hello-world.1

If you have installed FPM, and have the hello-world script in your current directory, you should be able to see a hello-world-0.1.0-1-any.deb file in your current directory after you run this command. Let’s break the command down, option by option: • -s dir [required] – The -s option tells FPM what sources to use to build the package. – In this case [dir], we are telling FPM that we want to build a package from source files that we have on our computer. • -t deb [required] – The -t option tells FPM what type of package to build (target package). – In this case [deb], we are telling FPM that we want to build a .deb package, that can be installed on Debian and Debian-based operating systems, such as Ubuntu. • -p hello-world-0.1.0-1-any.deb

6 Chapter 1. Table of Contents fpm Documentation, Release 1.9.0

– The -p option tells FPM what to name the package once it has been created. – In this case, we name it ---., but you can call it whatever you want. • --name hello-world – The name of the program that FPM is packaging. – In this case, it is hello-world. • --license agpl3 – The license the program uses – In this case, we use the AGPL 3.0 license (If you have a custom license, use custom instead of AGPL3) • --version 0.1.0 – The version of the program – In this case, the version is 0.1.0 • --architecture all – The architecture required to run the program [valid values are: x86_64/amd64, aarch64, native (cur- rent architecture), all/noarch/any] – In this case, the program is just a bash script, so we can run on all architectures • --depends bash --depends lolcat – The dependencies the program needs to run – In this case, we need bash and lolcat - bash to run the program itself, and lolcat to display the text in multiple colors • --description "Say hi!" – The program description – In this case, it is Say hi! • --url "https://example.com/hello-world" – The URL to the program‘‘s website or URL to program source • --maintainer "You The Amazing Person "

– The name and (optionally) email of the person creating the package • hello-world=/usr/bin/hello-world hello-world.1=/usr/share/man/man1/hello-world.1 [required]

– This is the most important part. It tells FPM which file (relative paths from the current directory) should be installed to which path in the machine. – In this case, we want the user to be able to execute the command hello-world from terminal; so we put the hello-world script in the user’s PATH, that is, in /usr/bin/. We also want the user to access the manual page using man hello-world, so we put the manpage (hello-world.1) in the /usr/share/man/man1/ directory. For more detailed documentation about each and every flag (there are some package-type-specific flags that exist as well), run fpm --help.

1.2. Getting Started 7 fpm Documentation, Release 1.9.0

1.2.3 Using it to package an existing package

We’ve seen how to package a program if you have an executable, but what if you already have a program that you have not written as an executable script, but in a language like nodejs instead? FPM can help here too. It can take any nodejs package, ruby gem or even a python package and turn it into a deb, rpm, pacman, etc. package. Here are a couple of examples.

Packaging a NodeJS application that’s already on NPM

Note: This assumes you have nodejs and npm already installed on your machine.

Run the following command: fpm-s npm-t

E.g.: To package yarn for Arch Linux: fpm-s npm-t pacman yarn

This will download the latest yarn package from npm.com and convert it to a .pkg.tar.zst (pacman) package. It will create a package named ‘node-yarn-VERSION_ARCH.deb’ with the appropriate version/arch in place. FPM will automatically pick the package name, version, maintainer, section, homepage, and description all from the npm package itself. Nothing for you to worry about :)

Packaging a ruby gem

Note: This assumes you have ruby already installed on your machine.

Run the following command: fpm-s gem-t

E.g.: To package FPM using FPM for Debian:

# FPM-ception :D fpm-s gem-t deb fpm

This will download the latest fpm rubygem from rubygems.org and convert it to a .deb. It will create a package named ‘rubygem-fpm-VERSION_ARCH.deb’ with the appropriate version/arch in place. FPM will automatically pick the package name, version, maintainer, section, homepage, and description all from the rubygem itself. Nothing for you to worry about :)

Packaging a CPAN module

Note: This assumes you have perl already installed on your machine.

Run the following command: E.g.: To package Fennec for Debian:

8 Chapter 1. Table of Contents fpm Documentation, Release 1.9.0

fpm-s cpan-t deb Fennec

This will download Fennec from CPAN and build a Debian package of the Fennec Perl module locally. By default, FPM believes the following to be true: • That your local Perl lib path will be the target Perl lib path • That you want the package name to be prefixed with the word perl • That the dependencies from CPAN are valid and that the naming scheme for those dependencies are prefixed with perl If you wish to change any of the above, use the following: fpm -t deb -s cpan --cpan-perl-lib-path /usr/share/perl5 Fennec fpm -t deb -s cpan --cpan-package-name-prefix fubar /usr/share/perl5 Fennec

The first command will change the target path to where perl will be. Your local perl install may be /opt/usr/share/perl5.10 but the package will be constructed so that the module will be installed to /usr/share/perl5 The second command will change the prefix of the package, i.e., from perl-Fennec to fubar-Fennec.

1.2.4 Configuration file

If you are using FPM in to build packages for multiple targets and keep repeating several options (like version, de- scription, name, license, maintainer, url, architecture, files to package, etc.), you can add a .fpm file in your working directory, with a list of options as well as arguments that you want to pass to the CLI. Extending the example of the hello-world program, say we want to package it as a .deb and a .rpm. We could create the following .fpm file:

--- File:.fpm

-s dir --name hello-world --license agpl3 --version 0.1.0 --architecture all --depends bash--depends lolcat --description"Say hi!" --url"https://example.com/hello-world" --maintainer"You The Amazing Person " hello-world=/usr/bin/hello-world hello-world.1=/usr/share/man/man1/hello-world.1

Note: CLI flags will override those in the .fpm file.

Meanwhile, we could run the following commands in terminal to build the .deb and .rpm: fpm-t deb-p hello-world-0.1.0-1-any.deb fpm-t rpm-p hello-world-0.1.0-1-any.rpm

Tada! You will have a .deb (for Debian) and .rpm (for RedHat), with no unnecessary duplication of metadata. You can put any other valid CLI options in the .fpm file too. For more detailed information regarding all CLI flags, see the CLI reference.

1.2. Getting Started 9 fpm Documentation, Release 1.9.0

1.3 FPM Command-line Reference

This page documents the command-line flags available in FPM. You can also see this content in your terminal by running fpm --help

1.3.1 General Options

• -t OUTPUT_TYPE – Alternate option spellings: --output-type – the type of package you want to create (deb, rpm, solaris, etc) • -s INPUT_TYPE – Alternate option spellings: --input-type – the package type to use as input (gem, rpm, python, etc) • - CHDIR – Alternate option spellings: --chdir – Change directory to here before searching for files • --prefix PREFIX – A path to prefix files with when building the target package. This may not be necessary for all input packages. For example, the ‘gem’ type will prefix with your gem directory automatically. • -p OUTPUT – Alternate option spellings: --package – The package file path to output. • -f – Alternate option spellings: --force – Force output even if it will overwrite an existing file • -n NAME – Alternate option spellings: --name – The name to give to the package • --log LEVEL – Set the log level. Values: error, warn, info, debug. • --verbose – Enable verbose output • --debug – Enable debug output • --debug-workspace – Keep any file workspaces around for debugging. This will disable automatic cleanup of package staging and build paths. It will also print which directories are available. • -v VERSION

10 Chapter 1. Table of Contents fpm Documentation, Release 1.9.0

– Alternate option spellings: --version – The version to give to the package • --iteration ITERATION – The iteration to give to the package. RPM calls this the ‘release’. FreeBSD calls it ‘PORTREVI- SION’. Debian calls this ‘debian_revision’ • --epoch EPOCH – The epoch value for this package. RPM and Debian calls this ‘epoch’. FreeBSD calls this ‘PORTEPOCH’ • --license LICENSE – (optional) license name for this package • --vendor VENDOR – (optional) vendor name for this package • --category CATEGORY – (optional) category this package belongs to • -d DEPENDENCY – Alternate option spellings: --depends – A dependency. This flag can be specified multiple times. Value is usually in the form of: -d ‘name’ or -d ‘name > version’ • --no-depends – Do not list any dependencies in this package • --no-auto-depends – Do not list any dependencies in this package automatically • --provides PROVIDES – What this package provides (usually a name). This flag can be specified multiple times. • --conflicts CONFLICTS – Other packages/versions this package conflicts with. This flag can be specified multiple times. • --replaces REPLACES – Other packages/versions this package replaces. Equivalent of rpm’s ‘Obsoletes’. This flag can be specified multiple times. • --config-files CONFIG_FILES – Mark a file in the package as being a config file. This uses ‘conffiles’ in debs and %config in rpm. If you have multiple files to mark as configuration files, specify this flag multiple times. If argument is directory all files inside it will be recursively marked as config files. • --directories DIRECTORIES – Recursively mark a directory as being owned by the package. Use this flag multiple times if you have multiple directories and they are not under the same parent directory • -a ARCHITECTURE – Alternate option spellings: --architecture

1.3. FPM Command-line Reference 11 fpm Documentation, Release 1.9.0

– The architecture name. Usually matches ‘uname -m’. For automatic values, you can use ‘-a all’ or ‘-a native’. These two strings will be translated into the correct value for your platform and target package type. • -m MAINTAINER – Alternate option spellings: --maintainer – The maintainer of this package. • -S PACKAGE_NAME_SUFFIX – Alternate option spellings: --package-name-suffix – a name suffix to append to package and dependencies. • -e – Alternate option spellings: --edit – Edit the package spec before building. • -x EXCLUDE_PATTERN – Alternate option spellings: --exclude – Exclude paths matching pattern (shell wildcard globs valid here). If you have multiple file patterns to exclude, specify this flag multiple times. • --exclude-file EXCLUDE_PATH – The path to a file containing a newline-sparated list of patterns to exclude from input. • --description DESCRIPTION – Add a description for this package. You can include ‘n’ sequences to indicate newline breaks. • --url URI – Add a url for this package. • --inputs INPUTS_PATH – The path to a file containing a newline-separated list of files and dirs to use as input. • --post-install FILE – (DEPRECATED, use –after-install) A script to be run after package installation • --pre-install FILE – (DEPRECATED, use –before-install) A script to be run before package installation • --post-uninstall FILE – (DEPRECATED, use –after-remove) A script to be run after package removal • --pre-uninstall FILE – (DEPRECATED, use –before-remove) A script to be run before package removal • --after-install FILE – A script to be run after package installation • --before-install FILE – A script to be run before package installation • --after-remove FILE

12 Chapter 1. Table of Contents fpm Documentation, Release 1.9.0

– A script to be run after package removal • --before-remove FILE – A script to be run before package removal • --after-upgrade FILE – A script to be run after package upgrade. If not specified, –before-install, –after-install, –before- remove, and –after-remove will behave in a backwards-compatible manner (they will not be upgrade- case aware). Currently only supports deb, rpm and pacman packages. • --before-upgrade FILE – A script to be run before package upgrade. If not specified, –before-install, –after-install, –before- remove, and –after-remove will behave in a backwards-compatible manner (they will not be upgrade- case aware). Currently only supports deb, rpm and pacman packages. • --template-scripts – Allow scripts to be templated. This lets you use ERB to template your packaging scripts (for –after- install, etc). For example, you can do things like <%= name %> to get the package name. For more information, see the fpm wiki: https://github.com/jordansissel/fpm/wiki/Script-Templates • --template-value KEY=VALUE – Make ‘key’ available in script templates, so <%= key %> given will be the provided value. Implies –template-scripts • --workdir WORKDIR – The directory you want fpm to do its work in, where ‘work’ is any file copying, downloading, etc. Roughly any scratch space fpm needs to build your package. • --source-date-epoch-from-changelog – Use release date from changelog as timestamp on generated files to reduce nondeterminism. Experi- mental; only implemented for gem so far. • --source-date-epoch-default SOURCE_DATE_EPOCH_DEFAULT – If no release date otherwise specified, use this value as timestamp on generated files to reduce non- determinism. Reproducible build environments such as -dev and rpmbuild set this via envion- ment variable SOURCE_DATE_EPOCH variable to the integer unix timestamp to use in generated archives, and expect tools like fpm to use it as a hint to avoid nondeterministic output. This is a Unix timestamp, i.e. number of seconds since 1 Jan 1970 UTC. See https://reproducible-builds.org/specs/ source-date-epoch • --gem-bin-path DIRECTORY – (gem only) The directory to install gem executables • --gem-package-prefix NAMEPREFIX – (gem only) (DEPRECATED, use –package-name-prefix) Name to prefix the package name with. • --gem-package-name-prefix PREFIX – (gem only) Name to prefix the package name with. • --gem-gem PATH_TO_GEM – (gem only) The path to the ‘gem’ tool (defaults to ‘gem’ and searches your $PATH) • --gem-shebang SHEBANG – (gem only) Replace the shebang in the executables in the bin path with a custom string

1.3. FPM Command-line Reference 13 fpm Documentation, Release 1.9.0

• --[no-]gem-fix-name – (gem only) Should the target package name be prefixed? • --[no-]gem-fix-dependencies – (gem only) Should the package dependencies be prefixed? • --[no-]gem-env-shebang – (gem only) Should the target package have the shebang rewritten to use env? • --[no-]gem-prerelease – (gem only) Allow prerelease versions of a gem • --gem-disable-dependency gem_name – (gem only) The gem name to remove from dependency list • --[no-]gem-embed-dependencies – (gem only) Should the gem dependencies be installed? • --[no-]gem-version-bins – (gem only) Append the version to the bins • --gem-stagingdir STAGINGDIR – (gem only) The directory where fpm installs the gem temporarily before conversion. Normally a random subdirectory of workdir. • --gem--repo GIT_REPO – (gem only) Use this git repo address as the source of the gem instead of rubygems.org. • --gem-git-branch GIT_BRANCH – (gem only) When using a git repo as the source of the gem instead of rubygems.org, use this git branch. • --[no-]deb-ignore-iteration-in-dependencies – (deb only) For ‘=’ (equal) dependencies, allow iterations on the specified version. Default is to be specific. This option allows the same version of a package but any iteration is permitted • --deb-build-depends DEPENDENCY – (deb only) Add DEPENDENCY as a Build-Depends • --deb-pre-depends DEPENDENCY – (deb only) Add DEPENDENCY as a Pre-Depends • --deb-compression COMPRESSION – (deb only) The compression type to use, must be one of gz, , xz, none. • --deb-dist DIST-TAG – (deb only) Set the deb distribution. • --deb-custom-control FILEPATH – (deb only) Custom version of the Debian control file. • --deb-config SCRIPTPATH – (deb only) Add SCRIPTPATH as debconf config file.

14 Chapter 1. Table of Contents fpm Documentation, Release 1.9.0

• --deb-templates FILEPATH – (deb only) Add FILEPATH as debconf templates file. • --deb-installed-size KILOBYTES – (deb only) The installed size, in kilobytes. If omitted, this will be calculated automatically • --deb-priority PRIORITY – (deb only) The debian package ‘priority’ value. • --[no-]deb-use-file-permissions – (deb only) Use existing file permissions when defining ownership and modes • --deb-user USER – (deb only) The owner of files in this package • --deb-group GROUP – (deb only) The group owner of files in this package • --deb-changelog FILEPATH – (deb only) Add FILEPATH as debian changelog • --[no-]deb-generate-changes – (deb only) Generate PACKAGENAME.changes file. • --deb-upstream-changelog FILEPATH – (deb only) Add FILEPATH as upstream changelog • --deb-recommends PACKAGE – (deb only) Add PACKAGE to Recommends • --deb-suggests PACKAGE – (deb only) Add PACKAGE to Suggests • --deb-meta-file FILEPATH – (deb only) Add FILEPATH to DEBIAN directory • --deb-interest EVENT – (deb only) Package is interested in EVENT trigger • --deb-activate EVENT – (deb only) Package activates EVENT trigger • --deb-interest-noawait EVENT – (deb only) Package is interested in EVENT trigger without awaiting • --deb-activate-noawait EVENT – (deb only) Package activates EVENT trigger • --deb-field 'FIELD: VALUE' – (deb only) Add custom field to the control file • --[no-]deb-no-default-config-files – (deb only) Do not add all files in /etc as configuration files by default for Debian packages.

1.3. FPM Command-line Reference 15 fpm Documentation, Release 1.9.0

• --[no-]deb-auto-config-files – (deb only) script and default configuration files will be labeled as configuration files for Debian packages. • --deb-shlibs SHLIBS – (deb only) Include control/shlibs content. This flag expects a string that is used as the contents of the shlibs file. See the following url for a description of this file and its format: http://www.debian.org/ doc/debian-policy/ch-sharedlibs.html#s-shlibs • --deb-init FILEPATH – (deb only) Add FILEPATH as an init script • --deb-default FILEPATH – (deb only) Add FILEPATH as /etc/default configuration • --deb- FILEPATH – (deb only) Add FILEPATH as an upstart script • --deb- FILEPATH – (deb only) Add FILEPATH as a systemd script • --[no-]deb-systemd-enable – (deb only) Enable service on install or upgrade • --[no-]deb-systemd-auto-start – (deb only) Start service after install or upgrade • --[no-]deb-systemd-restart-after-upgrade – (deb only) Restart service after upgrade • --deb-after-purge FILE – (deb only) A script to be run after package removal to purge remaining (config) files (a.k.a. postrm purge within apt-get purge) • --[no-]deb-maintainerscripts-force-errorchecks – (deb only) Activate errexit shell option according to lintian. https://lintian.debian.org/tags/ maintainer-script-ignores-errors.html • --npm-bin NPM_EXECUTABLE – (npm only) The path to the npm executable you wish to run. • --npm-package-name-prefix PREFIX – (npm only) Name to prefix the package name with. • --npm-registry NPM_REGISTRY – (npm only) The npm registry to use instead of the default. • --[no-]rpm-use-file-permissions – (rpm only) Use existing file permissions when defining ownership and modes. • --rpm-user USER – (rpm only) Set the user to USER in the %files section. Overrides the user when used with use-file- permissions setting.

16 Chapter 1. Table of Contents fpm Documentation, Release 1.9.0

• --rpm-group GROUP – (rpm only) Set the group to GROUP in the %files section. Overrides the group when used with use- file-permissions setting. • --rpm-defattrfile ATTR – (rpm only) Set the default file mode (%defattr). • --rpm-defattrdir ATTR – (rpm only) Set the default dir mode (%defattr). • --rpm-rpmbuild-define DEFINITION – (rpm only) Pass a –define argument to rpmbuild. • --rpm-dist DIST-TAG – (rpm only) Set the rpm distribution. • --rpm-digest md5|sha1|sha256|sha384|sha512 – (rpm only) Select a digest algorithm. md5 works on the most platforms. • --rpm-compression-level [0-9] – (rpm only) Select a compression level. 0 is store-only. 9 is compression. • --rpm-compression none|xz|xzmt||bzip2 – (rpm only) Select a compression method. gzip works on the most platforms. • --rpm-os OS – (rpm only) The operating system to target this rpm for. You want to set this to ‘linux’ if you are using fpm on OS X, for example • --rpm-changelog FILEPATH – (rpm only) Add changelog from FILEPATH contents • --rpm-summary SUMMARY – (rpm only) Set the RPM summary. Overrides the first line on the description if set • --[no-]rpm-sign – (rpm only) Pass –sign to rpmbuild • --[no-]rpm-auto-add-directories – (rpm only) Auto add directories not part of filesystem • --rpm-auto-add-exclude-directories DIRECTORIES – (rpm only) Additional directories ignored by ‘–rpm-auto-add-directories’ flag • --[no-]rpm-autoreqprov – (rpm only) Enable RPM’s AutoReqProv option • --[no-]rpm-autoreq – (rpm only) Enable RPM’s AutoReq option • --[no-]rpm-autoprov – (rpm only) Enable RPM’s AutoProv option • --rpm-attr ATTRFILE

1.3. FPM Command-line Reference 17 fpm Documentation, Release 1.9.0

– (rpm only) Set the attribute for a file (%attr), e.g. –rpm-attr 750,user1,group1:/some/file • --rpm-init FILEPATH – (rpm only) Add FILEPATH as an init script • --rpm-filter-from-provides REGEX – (rpm only) Set %filter_from_provides to the supplied REGEX. • --rpm-filter-from-requires REGEX – (rpm only) Set %filter_from_requires to the supplied REGEX. • --rpm-tag TAG – (rpm only) Adds a custom tag in the spec file as is. Example: –rpm-tag ‘Requires(post): /usr/sbin/alternatives’ • --[no-]rpm-ignore-iteration-in-dependencies – (rpm only) For ‘=’ (equal) dependencies, allow iterations on the specified version. Default is to be specific. This option allows the same version of a package but any iteration is permitted • --[no-]rpm-verbatim-gem-dependencies – (rpm only) When converting from a gem, leave the old (fpm 0.4.x) style dependency names. This flag will use the old ‘rubygem-foo’ names in rpm requires instead of the redhat style rubygem(foo). • --[no-]rpm-macro-expansion – (rpm only) install-time macro expansion in %pre %post %preun %postun scripts (see: https://rpm. org/user_doc/scriptlet_expansion.html) • --rpm-verifyscript FILE – (rpm only) a script to be run on verification • --rpm-pretrans FILE – (rpm only) pretrans script • --rpm-posttrans FILE – (rpm only) posttrans script • --rpm-trigger-before-install '[OPT]PACKAGE: FILEPATH' – (rpm only) Adds a rpm trigger script located in FILEPATH, having ‘OPT’ options and linking to ‘PACKAGE’. PACKAGE can be a comma seperated list of packages. See: http://rpm.org/api/4.4.2.2/ triggers.html • --rpm-trigger-after-install '[OPT]PACKAGE: FILEPATH' – (rpm only) Adds a rpm trigger script located in FILEPATH, having ‘OPT’ options and linking to ‘PACKAGE’. PACKAGE can be a comma seperated list of packages. See: http://rpm.org/api/4.4.2.2/ triggers.html • --rpm-trigger-before-uninstall '[OPT]PACKAGE: FILEPATH' – (rpm only) Adds a rpm trigger script located in FILEPATH, having ‘OPT’ options and linking to ‘PACKAGE’. PACKAGE can be a comma seperated list of packages. See: http://rpm.org/api/4.4.2.2/ triggers.html • --rpm-trigger-after-target-uninstall '[OPT]PACKAGE: FILEPATH'

18 Chapter 1. Table of Contents fpm Documentation, Release 1.9.0

– (rpm only) Adds a rpm trigger script located in FILEPATH, having ‘OPT’ options and linking to ‘PACKAGE’. PACKAGE can be a comma seperated list of packages. See: http://rpm.org/api/4.4.2.2/ triggers.html • --cpan-perl-bin PERL_EXECUTABLE – (cpan only) The path to the perl executable you wish to run. • --cpan-cpanm-bin CPANM_EXECUTABLE – (cpan only) The path to the cpanm executable you wish to run. • --cpan-mirror CPAN_MIRROR – (cpan only) The CPAN mirror to use instead of the default. • --[no-]cpan-mirror-only – (cpan only) Only use the specified mirror for metadata. • --cpan-package-name-prefix NAME_PREFIX – (cpan only) Name to prefix the package name with. • --[no-]cpan-test – (cpan only) Run the tests before packaging? • --[no-]cpan-verbose – (cpan only) Produce verbose output from cpanm? • --cpan-perl-lib-path PERL_LIB_PATH – (cpan only) Path of target Perl Libraries • --[no-]cpan-sandbox-non-core – (cpan only) Sandbox all non-core modules, even if they’re already installed • --[no-]cpan-cpanm-force – (cpan only) Pass the –force parameter to cpanm • --pear-package-name-prefix PREFIX – (pear only) Name prefix for pear package • --pear-channel CHANNEL_URL – (pear only) The pear channel url to use instead of the default. • --[no-]pear-channel-update – (pear only) call ‘pear channel-update’ prior to installation • --pear-bin-dir BIN_DIR – (pear only) Directory to put binaries in • --pear-php-bin PHP_BIN – (pear only) Specify php executable path if differs from the os used for packaging • --pear-php-dir PHP_DIR – (pear only) Specify php dir relative to prefix if differs from pear default (pear/php) • --pear-data-dir DATA_DIR – (pear only) Specify php dir relative to prefix if differs from pear default (pear/data)

1.3. FPM Command-line Reference 19 fpm Documentation, Release 1.9.0

• --python-bin PYTHON_EXECUTABLE – (python only) The path to the python executable you wish to run. • --python-easyinstall EASYINSTALL_EXECUTABLE – (python only) The path to the easy_install executable tool • --python- PIP_EXECUTABLE – (python only) The path to the pip executable tool. If not specified, easy_install is used instead • --python-pypi PYPI_URL – (python only) PyPi Server uri for retrieving packages. • --python-trusted-host PYPI_TRUSTED – (python only) Mark this host or host:port pair as trusted for pip • --python-package-prefix NAMEPREFIX – (python only) (DEPRECATED, use –package-name-prefix) Name to prefix the package name with. • --python-package-name-prefix PREFIX – (python only) Name to prefix the package name with. • --[no-]python-fix-name – (python only) Should the target package name be prefixed? • --[no-]python-fix-dependencies – (python only) Should the package dependencies be prefixed? • --[no-]python-downcase-name – (python only) Should the target package name be in lowercase? • --[no-]python-downcase-dependencies – (python only) Should the package dependencies be in lowercase? • --python-install-bin BIN_PATH – (python only) The path to where python scripts should be installed to. • --python-install-lib LIB_PATH – (python only) The path to where python libs should be installed to (default depends on your python installation). Want to find out what your target platform is using? Run this: python -c ‘from distu- tils.sysconfig import get_python_lib; print get_python_lib()’ • --python-install-data DATA_PATH – (python only) The path to where data should be installed to. This is equivalent to ‘python setup.py –install-data DATA_PATH • --[no-]python-dependencies – (python only) Include requirements defined in setup.py as dependencies. • --[no-]python-obey-requirements-txt – (python only) Use a requirements.txt file in the top-level directory of the python package for depen- dency detection. • --python-scripts-executable PYTHON_EXECUTABLE

20 Chapter 1. Table of Contents fpm Documentation, Release 1.9.0

– (python only) Set custom python interpreter in installing scripts. By default distutils will re- place python interpreter in installing scripts (specified by shebang) with current python in- terpreter (sys.executable). This option is equivalent to appending ‘build_scripts –executable PYTHON_EXECUTABLE’ arguments to ‘setup.py install’ command. • --python-disable-dependency python_package_name – (python only) The python package name to remove from dependency list • --python-setup-py-arguments setup_py_argument – (python only) Arbitrary argument(s) to be passed to setup.py • --osxpkg-identifier-prefix IDENTIFIER_PREFIX – (osxpkg only) Reverse domain prefix prepended to package identifier, ie. ‘org.great.my’. If this is omitted, the identifer will be the package name. • --[no-]osxpkg-payload-free – (osxpkg only) Define no payload, assumes use of script options. • --osxpkg-ownership OWNERSHIP – (osxpkg only) –ownership option passed to pkgbuild. Defaults to ‘recommended’. See pkgbuild(1). • --osxpkg-postinstall-action POSTINSTALL_ACTION – (osxpkg only) Post-install action provided in package metadata. Optionally one of ‘logout’, ‘restart’, ‘shutdown’. • --osxpkg-dont-obsolete DONT_OBSOLETE_PATH – (osxpkg only) A file path for which to ‘dont-obsolete’ in the built PackageInfo. Can be specified multiple times. • --solaris-user USER – (solaris only) Set the user to USER in the prototype files. • --solaris-group GROUP – (solaris only) Set the group to GROUP in the prototype file. • --p5p-user USER – (p5p only) Set the user to USER in the prototype files. • --p5p-group GROUP – (p5p only) Set the group to GROUP in the prototype file. • --p5p-zonetype ZONETYPE – (p5p only) Set the allowed zone types (global, nonglobal, both) • --p5p-publisher PUBLISHER – (p5p only) Set the publisher name for the repository • --[no-]p5p-lint – (p5p only) Check manifest with pkglint • --[no-]p5p-validate – (p5p only) Validate with pkg install • --freebsd- ABI

1.3. FPM Command-line Reference 21 fpm Documentation, Release 1.9.0

– (freebsd only) Sets the FreeBSD ‘origin’ pkg field • --snap-yaml FILEPATH – (snap only) Custom version of the snap.yaml file. • --snap-confinement CONFINEMENT – (snap only) Type of confinement to use for this snap. • --snap-grade GRADE – (snap only) Grade of this snap. • --pleaserun-name SERVICE_NAME – (pleaserun only) The name of the service you are creating • --pleaserun-chdir CHDIR – (pleaserun only) The working directory used by the service • --pacman-optional-depends PACKAGE – (pacman only) Add an optional dependency to the pacman package. • --[no-]pacman-use-file-permissions – (pacman only) Use existing file permissions when defining ownership and modes • --pacman-user USER – (pacman only) The owner of files in this package • --pacman-group GROUP – (pacman only) The group owner of files in this package • --pacman-compression COMPRESSION – (pacman only) The compression type to use, must be one of gz, bzip2, xz, zstd, none. • --virtualenv-pypi PYPI_URL – (virtualenv only) PyPi Server uri for retrieving packages. • --virtualenv-package-name-prefix PREFIX – (virtualenv only) Name to prefix the package name with. • --virtualenv-install-location DIRECTORY – (virtualenv only) DEPRECATED: Use –prefix instead. Location to which to install the virtualenv by default. • --[no-]virtualenv-fix-name – (virtualenv only) Should the target package name be prefixed? • --virtualenv-other-files-dir DIRECTORY – (virtualenv only) Optionally, the contents of the specified directory may be added to the package. This is useful if the virtualenv needs configuration files, etc. • --virtualenv-pypi-extra-url PYPI_EXTRA_URL – (virtualenv only) PyPi extra-index-url for pointing to your priviate PyPi • --[no-]virtualenv-setup-install

22 Chapter 1. Table of Contents fpm Documentation, Release 1.9.0

– (virtualenv only) After building virtualenv run setup.py install useful when building a virtualenv for packages and including their requirements from • --[no-]virtualenv-system-site-packages – (virtualenv only) Give the virtual environment access to the global site-packages • --virtualenv-find-links PIP_FIND_LINKS – (virtualenv only) If a url or path to an html file, then parse for links to archives. If a local path or file:// url that’s a directory, then look for archives in the directory listing.

1.3.2 apk

This package type has no additional options

1.3.3 cpan

• --[no-]cpan-cpanm-force – Pass the –force parameter to cpanm • --[no-]cpan-mirror-only – Only use the specified mirror for metadata. • --[no-]cpan-sandbox-non-core – Sandbox all non-core modules, even if they’re already installed • --[no-]cpan-test – Run the tests before packaging? • --[no-]cpan-verbose – Produce verbose output from cpanm? • --cpan-cpanm-bin CPANM_EXECUTABLE – The path to the cpanm executable you wish to run. • --cpan-mirror CPAN_MIRROR – The CPAN mirror to use instead of the default. • --cpan-package-name-prefix NAME_PREFIX – Name to prefix the package name with. • --cpan-perl-bin PERL_EXECUTABLE – The path to the perl executable you wish to run. • --cpan-perl-lib-path PERL_LIB_PATH – Path of target Perl Libraries

1.3. FPM Command-line Reference 23 fpm Documentation, Release 1.9.0

1.3.4 deb

• --[no-]deb-auto-config-files – Init script and default configuration files will be labeled as configuration files for Debian packages. • --[no-]deb-generate-changes – Generate PACKAGENAME.changes file. • --[no-]deb-ignore-iteration-in-dependencies – For ‘=’ (equal) dependencies, allow iterations on the specified version. Default is to be specific. This option allows the same version of a package but any iteration is permitted • --[no-]deb-maintainerscripts-force-errorchecks – Activate errexit shell option according to lintian. https://lintian.debian.org/tags/ maintainer-script-ignores-errors.html • --[no-]deb-no-default-config-files – Do not add all files in /etc as configuration files by default for Debian packages. • --[no-]deb-systemd-auto-start – Start service after install or upgrade • --[no-]deb-systemd-enable – Enable service on install or upgrade • --[no-]deb-systemd-restart-after-upgrade – Restart service after upgrade • --[no-]deb-use-file-permissions – Use existing file permissions when defining ownership and modes • --deb-activate EVENT – Package activates EVENT trigger • --deb-activate-noawait EVENT – Package activates EVENT trigger • --deb-after-purge FILE – A script to be run after package removal to purge remaining (config) files (a.k.a. postrm purge within apt-get purge) • --deb-build-depends DEPENDENCY – Add DEPENDENCY as a Build-Depends • --deb-changelog FILEPATH – Add FILEPATH as debian changelog • --deb-compression COMPRESSION – The compression type to use, must be one of gz, bzip2, xz, none. • --deb-config SCRIPTPATH – Add SCRIPTPATH as debconf config file. • --deb-custom-control FILEPATH

24 Chapter 1. Table of Contents fpm Documentation, Release 1.9.0

– Custom version of the Debian control file. • --deb-default FILEPATH – Add FILEPATH as /etc/default configuration • --deb-dist DIST-TAG – Set the deb distribution. • --deb-field 'FIELD: VALUE' – Add custom field to the control file • --deb-group GROUP – The group owner of files in this package • --deb-init FILEPATH – Add FILEPATH as an init script • --deb-installed-size KILOBYTES – The installed size, in kilobytes. If omitted, this will be calculated automatically • --deb-interest EVENT – Package is interested in EVENT trigger • --deb-interest-noawait EVENT – Package is interested in EVENT trigger without awaiting • --deb-meta-file FILEPATH – Add FILEPATH to DEBIAN directory • --deb-pre-depends DEPENDENCY – Add DEPENDENCY as a Pre-Depends • --deb-priority PRIORITY – The debian package ‘priority’ value. • --deb-recommends PACKAGE – Add PACKAGE to Recommends • --deb-shlibs SHLIBS – Include control/shlibs content. This flag expects a string that is used as the contents of the shlibs file. See the following url for a description of this file and its format: http://www.debian.org/doc/ debian-policy/ch-sharedlibs.html#s-shlibs • --deb-suggests PACKAGE – Add PACKAGE to Suggests • --deb-systemd FILEPATH – Add FILEPATH as a systemd script • --deb-templates FILEPATH – Add FILEPATH as debconf templates file. • --deb-upstart FILEPATH – Add FILEPATH as an upstart script

1.3. FPM Command-line Reference 25 fpm Documentation, Release 1.9.0

• --deb-upstream-changelog FILEPATH – Add FILEPATH as upstream changelog • --deb-user USER – The owner of files in this package

1.3.5 dir

This package type has no additional options

1.3.6 empty

This package type has no additional options

1.3.7 freebsd

• --freebsd-origin ABI – Sets the FreeBSD ‘origin’ pkg field

1.3.8 gem

• --[no-]gem-embed-dependencies – Should the gem dependencies be installed? • --[no-]gem-env-shebang – Should the target package have the shebang rewritten to use env? • --[no-]gem-fix-dependencies – Should the package dependencies be prefixed? • --[no-]gem-fix-name – Should the target package name be prefixed? • --[no-]gem-prerelease – Allow prerelease versions of a gem • --[no-]gem-version-bins – Append the version to the bins • --gem-bin-path DIRECTORY – The directory to install gem executables • --gem-disable-dependency gem_name – The gem name to remove from dependency list • --gem-gem PATH_TO_GEM – The path to the ‘gem’ tool (defaults to ‘gem’ and searches your $PATH) • --gem-git-branch GIT_BRANCH

26 Chapter 1. Table of Contents fpm Documentation, Release 1.9.0

– When using a git repo as the source of the gem instead of rubygems.org, use this git branch. • --gem-git-repo GIT_REPO – Use this git repo address as the source of the gem instead of rubygems.org. • --gem-package-name-prefix PREFIX – Name to prefix the package name with. • --gem-package-prefix NAMEPREFIX – (DEPRECATED, use –package-name-prefix) Name to prefix the package name with. • --gem-shebang SHEBANG – Replace the shebang in the executables in the bin path with a custom string • --gem-stagingdir STAGINGDIR – The directory where fpm installs the gem temporarily before conversion. Normally a random subdi- rectory of workdir.

1.3.9 npm

• --npm-bin NPM_EXECUTABLE – The path to the npm executable you wish to run. • --npm-package-name-prefix PREFIX – Name to prefix the package name with. • --npm-registry NPM_REGISTRY – The npm registry to use instead of the default.

1.3.10 osxpkg

• --[no-]osxpkg-payload-free – Define no payload, assumes use of script options. • --osxpkg-dont-obsolete DONT_OBSOLETE_PATH – A file path for which to ‘dont-obsolete’ in the built PackageInfo. Can be specified multiple times. • --osxpkg-identifier-prefix IDENTIFIER_PREFIX – Reverse domain prefix prepended to package identifier, ie. ‘org.great.my’. If this is omitted, the identifer will be the package name. • --osxpkg-ownership OWNERSHIP – –ownership option passed to pkgbuild. Defaults to ‘recommended’. See pkgbuild(1). • --osxpkg-postinstall-action POSTINSTALL_ACTION – Post-install action provided in package metadata. Optionally one of ‘logout’, ‘restart’, ‘shutdown’.

1.3. FPM Command-line Reference 27 fpm Documentation, Release 1.9.0

1.3.11 p5p

• --[no-]p5p-lint – Check manifest with pkglint • --[no-]p5p-validate – Validate with pkg install • --p5p-group GROUP – Set the group to GROUP in the prototype file. • --p5p-publisher PUBLISHER – Set the publisher name for the repository • --p5p-user USER – Set the user to USER in the prototype files. • --p5p-zonetype ZONETYPE – Set the allowed zone types (global, nonglobal, both)

1.3.12 pacman

• --[no-]pacman-use-file-permissions – Use existing file permissions when defining ownership and modes • --pacman-compression COMPRESSION – The compression type to use, must be one of gz, bzip2, xz, zstd, none. • --pacman-group GROUP – The group owner of files in this package • --pacman-optional-depends PACKAGE – Add an optional dependency to the pacman package. • --pacman-user USER – The owner of files in this package

1.3.13 pear

• --[no-]pear-channel-update – call ‘pear channel-update’ prior to installation • --pear-bin-dir BIN_DIR – Directory to put binaries in • --pear-channel CHANNEL_URL – The pear channel url to use instead of the default. • --pear-data-dir DATA_DIR – Specify php dir relative to prefix if differs from pear default (pear/data)

28 Chapter 1. Table of Contents fpm Documentation, Release 1.9.0

• --pear-package-name-prefix PREFIX – Name prefix for pear package • --pear-php-bin PHP_BIN – Specify php executable path if differs from the os used for packaging • --pear-php-dir PHP_DIR – Specify php dir relative to prefix if differs from pear default (pear/php)

1.3.14 pkgin

This package type has no additional options

1.3.15 pleaserun

• --pleaserun-chdir CHDIR – The working directory used by the service • --pleaserun-name SERVICE_NAME – The name of the service you are creating

1.3.16 puppet

This package type has no additional options

1.3.17 python

• --[no-]python-dependencies – Include requirements defined in setup.py as dependencies. • --[no-]python-downcase-dependencies – Should the package dependencies be in lowercase? • --[no-]python-downcase-name – Should the target package name be in lowercase? • --[no-]python-fix-dependencies – Should the package dependencies be prefixed? • --[no-]python-fix-name – Should the target package name be prefixed? • --[no-]python-obey-requirements-txt – Use a requirements.txt file in the top-level directory of the python package for dependency detection. • --python-bin PYTHON_EXECUTABLE – The path to the python executable you wish to run. • --python-disable-dependency python_package_name

1.3. FPM Command-line Reference 29 fpm Documentation, Release 1.9.0

– The python package name to remove from dependency list • --python-easyinstall EASYINSTALL_EXECUTABLE – The path to the easy_install executable tool • --python-install-bin BIN_PATH – The path to where python scripts should be installed to. • --python-install-data DATA_PATH – The path to where data should be installed to. This is equivalent to ‘python setup.py –install-data DATA_PATH • --python-install-lib LIB_PATH – The path to where python libs should be installed to (default depends on your python installation). Want to find out what your target platform is using? Run this: python -c ‘from distutils.sysconfig import get_python_lib; print get_python_lib()’ • --python-package-name-prefix PREFIX – Name to prefix the package name with. • --python-package-prefix NAMEPREFIX – (DEPRECATED, use –package-name-prefix) Name to prefix the package name with. • --python-pip PIP_EXECUTABLE – The path to the pip executable tool. If not specified, easy_install is used instead • --python-pypi PYPI_URL – PyPi Server uri for retrieving packages. • --python-scripts-executable PYTHON_EXECUTABLE – Set custom python interpreter in installing scripts. By default distutils will replace python interpreter in installing scripts (specified by shebang) with current python interpreter (sys.executable). This op- tion is equivalent to appending ‘build_scripts –executable PYTHON_EXECUTABLE’ arguments to ‘setup.py install’ command. • --python-setup-py-arguments setup_py_argument – Arbitrary argument(s) to be passed to setup.py • --python-trusted-host PYPI_TRUSTED – Mark this host or host:port pair as trusted for pip

1.3.18 rpm

• --[no-]rpm-auto-add-directories – Auto add directories not part of filesystem • --[no-]rpm-autoprov – Enable RPM’s AutoProv option • --[no-]rpm-autoreq – Enable RPM’s AutoReq option • --[no-]rpm-autoreqprov

30 Chapter 1. Table of Contents fpm Documentation, Release 1.9.0

– Enable RPM’s AutoReqProv option • --[no-]rpm-ignore-iteration-in-dependencies – For ‘=’ (equal) dependencies, allow iterations on the specified version. Default is to be specific. This option allows the same version of a package but any iteration is permitted • --[no-]rpm-macro-expansion – install-time macro expansion in %pre %post %preun %postun scripts (see: https://rpm.org/user_doc/ scriptlet_expansion.html) • --[no-]rpm-sign – Pass –sign to rpmbuild • --[no-]rpm-use-file-permissions – Use existing file permissions when defining ownership and modes. • --[no-]rpm-verbatim-gem-dependencies – When converting from a gem, leave the old (fpm 0.4.x) style dependency names. This flag will use the old ‘rubygem-foo’ names in rpm requires instead of the redhat style rubygem(foo). • --rpm-attr ATTRFILE – Set the attribute for a file (%attr), e.g. –rpm-attr 750,user1,group1:/some/file • --rpm-auto-add-exclude-directories DIRECTORIES – Additional directories ignored by ‘–rpm-auto-add-directories’ flag • --rpm-changelog FILEPATH – Add changelog from FILEPATH contents • --rpm-compression none|xz|xzmt|gzip|bzip2 – Select a compression method. gzip works on the most platforms. • --rpm-compression-level [0-9] – Select a compression level. 0 is store-only. 9 is max compression. • --rpm-defattrdir ATTR – Set the default dir mode (%defattr). • --rpm-defattrfile ATTR – Set the default file mode (%defattr). • --rpm-digest md5|sha1|sha256|sha384|sha512 – Select a digest algorithm. md5 works on the most platforms. • --rpm-dist DIST-TAG – Set the rpm distribution. • --rpm-filter-from-provides REGEX – Set %filter_from_provides to the supplied REGEX. • --rpm-filter-from-requires REGEX – Set %filter_from_requires to the supplied REGEX. • --rpm-group GROUP

1.3. FPM Command-line Reference 31 fpm Documentation, Release 1.9.0

– Set the group to GROUP in the %files section. Overrides the group when used with use-file- permissions setting. • --rpm-init FILEPATH – Add FILEPATH as an init script • --rpm-os OS – The operating system to target this rpm for. You want to set this to ‘linux’ if you are using fpm on OS X, for example • --rpm-posttrans FILE – posttrans script • --rpm-pretrans FILE – pretrans script • --rpm-rpmbuild-define DEFINITION – Pass a –define argument to rpmbuild. • --rpm-summary SUMMARY – Set the RPM summary. Overrides the first line on the description if set • --rpm-tag TAG – Adds a custom tag in the spec file as is. Example: –rpm-tag ‘Requires(post): /usr/sbin/alternatives’ • --rpm-trigger-after-install '[OPT]PACKAGE: FILEPATH' – Adds a rpm trigger script located in FILEPATH, having ‘OPT’ options and linking to ‘PACKAGE’. PACKAGE can be a comma seperated list of packages. See: http://rpm.org/api/4.4.2.2/triggers.html • --rpm-trigger-after-target-uninstall '[OPT]PACKAGE: FILEPATH' – Adds a rpm trigger script located in FILEPATH, having ‘OPT’ options and linking to ‘PACKAGE’. PACKAGE can be a comma seperated list of packages. See: http://rpm.org/api/4.4.2.2/triggers.html • --rpm-trigger-before-install '[OPT]PACKAGE: FILEPATH' – Adds a rpm trigger script located in FILEPATH, having ‘OPT’ options and linking to ‘PACKAGE’. PACKAGE can be a comma seperated list of packages. See: http://rpm.org/api/4.4.2.2/triggers.html • --rpm-trigger-before-uninstall '[OPT]PACKAGE: FILEPATH' – Adds a rpm trigger script located in FILEPATH, having ‘OPT’ options and linking to ‘PACKAGE’. PACKAGE can be a comma seperated list of packages. See: http://rpm.org/api/4.4.2.2/triggers.html • --rpm-user USER – Set the user to USER in the %files section. Overrides the user when used with use-file-permissions setting. • --rpm-verifyscript FILE – a script to be run on verification

1.3.19 sh

This package type has no additional options

32 Chapter 1. Table of Contents fpm Documentation, Release 1.9.0

1.3.20 snap

• --snap-confinement CONFINEMENT – Type of confinement to use for this snap. • --snap-grade GRADE – Grade of this snap. • --snap-yaml FILEPATH – Custom version of the snap.yaml file.

1.3.21 solaris

• --solaris-group GROUP – Set the group to GROUP in the prototype file. • --solaris-user USER – Set the user to USER in the prototype files.

1.3.22 tar

This package type has no additional options

1.3.23 virtualenv

• --[no-]virtualenv-fix-name – Should the target package name be prefixed? • --[no-]virtualenv-setup-install – After building virtualenv run setup.py install useful when building a virtualenv for packages and including their requirements from • --[no-]virtualenv-system-site-packages – Give the virtual environment access to the global site-packages • --virtualenv-find-links PIP_FIND_LINKS – If a url or path to an html file, then parse for links to archives. If a local path or file:// url that’s a directory, then look for archives in the directory listing. • --virtualenv-install-location DIRECTORY – DEPRECATED: Use –prefix instead. Location to which to install the virtualenv by default. • --virtualenv-other-files-dir DIRECTORY – Optionally, the contents of the specified directory may be added to the package. This is useful if the virtualenv needs configuration files, etc. • --virtualenv-package-name-prefix PREFIX – Name to prefix the package name with. • --virtualenv-pypi PYPI_URL

1.3. FPM Command-line Reference 33 fpm Documentation, Release 1.9.0

– PyPi Server uri for retrieving packages. • --virtualenv-pypi-extra-url PYPI_EXTRA_URL – PyPi extra-index-url for pointing to your priviate PyPi

1.3.24 zip

This package type has no additional options

1.4 Contributing/Issues

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. See the Code of Conduct for details. All contributions are welcome: ideas, patches, documentation, bug reports, complaints, and even something you drew up on a napkin :) It is more important that you are able to contribute and get help if you need it than it is how you contribute or get help. That said, some points to get started: • Have a problem you want FPM to solve for you? You can email the mailing list, or join the IRC channel #fpm on irc.freenode.org, or email me personally ([email protected]) • Have an idea or a feature request? File a ticket on github, or email the mailing list, or email me personally ([email protected]) if that is more comfortable. • If you think you found a bug, it probably is a bug. File it on github or send details to the mailing list. • If you want to send patches, best way is to fork this repo and send me a pull request. If you don’t know git, I also accept diff(1) formatted patches - whatever is most comfortable for you. • Want to lurk about and see what others are doing? IRC (#fpm on irc.freenode.org) is a good place for this as is the mailing list.

1.4.1 Contributing changes by forking from GitHub

First, create a GitHub account if you do not already have one. Log in to GitHub and go to [the main FPM GitHub page](https://github.com/jordansissel/fpm). At the top right, click on the button labeled “Fork”. This will put a forked copy of the main FPM repo into your account. Next, clone your account’s GitHub repo of FPM. For example: $ git clone [email protected]:yourusername/fpm.git

1.4.2 Development Environment

If you don’t already have the bundler gem installed, install it now: $ gem install bundler Now change to the root of the FPM repo and run: $ bundle install This will install all of the dependencies required for running FPM from source. Most importantly, you should see the following output from the bundle command when it lists the FPM gem:

34 Chapter 1. Table of Contents fpm Documentation, Release 1.9.0

. . . Using json (1.8.1) Using fpm (0.4.42) from source at . Using hitimes (1.2.1) . . . If your system doesn’t have bsdtar by default, make sure to install it or some tests will fail: apt-get install bsdtar yum install bsdtar Next, run make in root of the FPM repo. If there are any problems (such as missing dependencies) you should receive an error At this point, the FPM command should run directly from the code in your cloned repo. Now simply make whatever changes you want, commit the code, and push your commit back to master. If you think your changes are ready to be merged back to the main FPM repo, you can generate a pull request on the GitHub website for your repo and send it in for review.

1.4.3 Problems running bundle install?

If you are installing on Mac OS 10.9 (Mavericks) you will need to make sure that you have the standalone command line tools separate from Xcode: $ xcode-select –install Finally, click the install button on the prompt that appears.

1.4.4 Editing Documentation

If you want to edit the documentation, here’s a quick guide to getting started: • Install docker. • All documentation is located in the docs folder. cd into the docs folder and run the following command once:

make docker-prep

• Once that is done, run make build whenever you want to build the site. It will generate the html in the _build/html directory. • You can use any tool like serve _build/html (npm package) or python -m http.server -d _build/ html 5000 to serve the static html on your machine (http://localhost:5000). Now you can simply make whatever changes you want, commit the code, and push your commit back to master. If you think your changes are ready to be merged back to the main FPM repo, you can generate a pull request on the GitHub website for your repo and send it in for review.

1.4. Contributing/Issues 35