Compare commits

...

503 Commits
v1.6.2 ... main

Author SHA1 Message Date
Jordan Sissel e69cdca562 v1.17.0 :) 2025-10-02 16:37:32 -07:00
Jordan Sissel 5b9d922c84
Merge pull request #2109 from jordansissel/cleanup/remove-old-unused-files
Remove some older unused things
2025-10-02 13:33:29 -07:00
Jordan Sissel 93eaefd383 Remove some older unused things 2025-10-02 13:29:24 -07:00
Jordan Sissel 4cf32c5bc7 Update version in docs 2025-10-02 12:41:05 -07:00
Jordan Sissel 6115fe4c44
Merge pull request #2108 from jordansissel/issue/fix-readthedocs
Make readthedocs.org build the docs once again.
2025-10-02 12:30:06 -07:00
Jordan Sissel 781108fbf6 Update sphinx's project version to match fpm's just in case it's still used anywhere 2025-10-02 12:27:25 -07:00
Jordan Sissel 9c78876415 Fix?
> ModuleNotFoundError: No module named 'sphinx_rtd_theme'
2025-10-02 12:22:15 -07:00
Jordan Sissel a066c4447d Try to fix another error
>     sphinx.errors.ThemeError: no theme named 'sphinx_rtd_theme' found (missing theme.toml?)
2025-10-02 12:20:32 -07:00
Jordan Sissel e42a069c4f Update copyright text 2025-10-02 12:12:55 -07:00
Jordan Sissel 829b897456 A new error -
> ImportError: cannot import name 'Meta' from 'docutils.parsers.rst.directives.misc' (

This commit tries to resolve this by removing the 'docutils<0.18'
requirements entry.
2025-10-02 12:11:03 -07:00
Jordan Sissel 08e663916d Another missing required setting that wasn't required previously..
> Missing Sphinx configuration key The sphinx.configuration key is missing.

Reference: https://about.readthedocs.com/blog/2024/12/deprecate-config-files-without-sphinx-or-mkdocs-config/
2025-10-02 12:07:51 -07:00
Jordan Sissel e15d2c3a1f `build.tools` setting is also required. 2025-10-02 12:05:27 -07:00
Jordan Sissel 249d3b997f Try to fix readthedocs build error
> Config file validation error Config validation error in build.os. Value build not found.
2025-10-02 12:01:04 -07:00
Jordan Sissel bdbe351796
Merge pull request #2107 from jordansissel/release-prep/1.17.0
Release prep for v1.17.0
2025-10-02 11:56:31 -07:00
Jordan Sissel 45f78973e7 Set pre-release version 2025-10-02 11:56:05 -07:00
Jordan Sissel db535710f7 Fix link syntax 2025-10-02 11:53:58 -07:00
Jordan Sissel 6bf2885139 Generate docs 2025-10-02 11:49:16 -07:00
Jordan Sissel 644e538311 Add docs building to release-prep 2025-10-02 11:48:59 -07:00
Jordan Sissel 9c415246f2 Fix reST syntax 2025-10-02 11:48:37 -07:00
Jordan Sissel e8cd0920d7 s/podman/docker/ 2025-10-02 11:43:22 -07:00
Jordan Sissel 22d44e1c49 Use debian/apt packages for python deps instead of pip... mainly because Debian's pip3 errors when you try to use it warning to use venv instead... 2025-10-02 11:43:04 -07:00
Jordan Sissel ef63628054 Fix Sphinx warning that language needs to be set to something 2025-10-02 11:42:22 -07:00
Jordan Sissel e0c3a1fc1a Only show the general options in the 'general options' docs entry. Before this, *all* flags were included and that was not intentional. 2025-10-02 11:38:19 -07:00
Jordan Sissel e1113c24e0 Release prep - generate docs and bump version 2025-10-02 11:04:42 -07:00
Jordan Sissel 290fe0741c Reformat changelog entries slightly (no wrapping). Also found an identical PR for #2011 in #2054 and noted that w/ contributor details 2025-10-02 10:12:25 -07:00
Jordan Sissel b69b7e5787 More changelog updates 2025-10-02 10:02:20 -07:00
Jordan Sissel feecdfe87b WIP release changelog updates. 2025-10-02 10:02:20 -07:00
Jordan Sissel de7a214bf5 Work in progress - Prepare v1.17.0 release 2025-10-02 10:02:20 -07:00
Jordan Sissel c6069f5584 Replace ostruct with a custom class that acts almost the same.
This removes a warning in 3.4.0 and prepares for Ruby 3.5.0:
> warning: ostruct was loaded from the standard library, but will no longer
> be part of the default gems since Ruby 3.5.0. Add ostruct to your Gemfile or gemspec.

This seems preferable to adding ostruct as a gem dependency especially
since older rubies may not support the gem version of ostruct.
2025-10-01 22:36:03 -07:00
Jordan Sissel 583f7e4ba0 If the action runs with debug logging, run fpm specs with debug logging enabled 2025-10-01 22:13:44 -07:00
Jordan Sissel aa55aaca93 Python pyproject.toml and requirements.txt improvements
* --python-obey-requirements-txt behavior and tests. I swear this was
  working previously but the tests failed.
* Now supports packaging local python project directories containing
  a pyproject.toml
2025-10-01 22:13:44 -07:00
Jordan Sissel 23e7e0f554 Remove unused code and comments (fpm uses python to process dependency env markers) 2025-10-01 22:13:44 -07:00
Alexandr Zarubkin dd58d6714e Copy config file to staging if it doesn't exist there.
Fix #1823.
2025-10-01 17:36:56 -07:00
Jordan Sissel c76917a4e1 Add support for some uncommon package downloads.
* amqplib 1.0.2 downloads a file ending in .tgz instead of expected .tar.gz
* dnspython 1.15.0 has METADATA which includes a description body, but
  the metadata version is 2.0, and python core-metadata docs indicate
  v2.1 added support for description body. In this case, if the metadata
  version is 2.0, fpm now accepts a description body.

Reference: python core-metadata:
> Changed in version 2.1: This field may be specified in the message body instead.

Original report and fixes for this by @bugfood in #2002.
2025-09-30 15:25:44 -07:00
Jordan Sissel 17bc375e0b Add line continuation to keep ruby-lsp from warning about useless void context. 2025-09-30 15:25:44 -07:00
Jordan Sissel 42808ab943 Fix failing virtualenv tests
I hope this works? It works on my machine... :\

virtualenv and virtualenv-tools seem to be lesser-used these days. I
wonder if it'll be more useful to move to a different tool like venv...
2025-09-30 15:25:44 -07:00
Jordan Sissel 8e54e5ca49 Update rspec in order to use satisfy(description, &block)
Older rspec didn't allow a description to be given to satisfy(), but
newer ones do. I think I forgot to include this rspec version update
in PR #2103
2025-09-30 15:25:44 -07:00
Jordan Sissel 8b24206e19 Fix typo 2025-09-30 15:25:44 -07:00
Jordan Sissel f0e5b8abc0 Use python to parse python requires syntax and evaluate markers.
Not supported yet:
* Custom environment for marker evaluation.
* "extras" markers

Restore function to `--python-obey-requirements-txt`. This flag will
only work on python inputs that are provided as a directory, not a
wheel/tar.gz/etc.

Tests pass including the obey requirements.txt ones.

* Fix bug 'else File.directory?` -> `elsif File.directory?...` lol oops.
* Use Dir.entries instead of Dir.glob to allow python package extra
  syntax, with names like `django[bcrypt]` (Note, extras in requirements
  aren't evaluated yet)
2025-09-30 15:25:44 -07:00
Jordan Sissel b328c15ff6 Fix typo 2025-09-30 15:25:44 -07:00
Jordan Sissel 010093698a Work continues to center python package work around `pip` and away from setup.py
Working: Most python tests except for the --obey-requirements-text one
Breaking: Broke support for requirements.txt, for now.

* Deprecate --python-install-{bin,data,lib} flags since those are only
  supported by setup.py. `pip` just supports `--prefix` and maybe that's ok.
* Deprecate --python-scripts-executable for similar reasons. I don't
  think pip supports this?
* Add notes about unsupported Python dependency markers
* PythonMetadata is now a class with accessors providing name, version,
  requirements, homepage, maintainer, etc.
* Moved package url/homepage selection into PythonMetadata
* Fix bug where dependency list would have trailing spaces.
* Updated test suite with new python package name prefix selection
  (detecting python3, etc)
2025-09-30 15:25:44 -07:00
Jordan Sissel 002b42e98e Add accessors for parts of python metadata that we can use with fpm.
(Note: Not all parts of the metadata are used, and some could be used
that are not yet used...)

* Add more tests for parsing and PythonMetadata members
* maintainer: Use Maintainer-email if present, otherwise use Author-email
* license: Try the best field for using as the license label
  (License-Expression, License, or a Classifier entry)
* homepage: Try to pick the right value for the homepage, or close
  enough, since python packages can have multiple urls as project urls.
2025-09-30 15:25:44 -07:00
Jordan Sissel bc75218f37 Improvements to python wheel processing
Parsing Python METADATA files:
* Treat any 'multiple use' fields (as documented in the python
  core-metadata spec) as arrays at all times.
* If METADATA has a body, use it as the description (per spec)
* If Description comes from a header, then strip leading space-pipe text
  as per spec.
* Allow the last header (field: value) to end without a newline.
  (Using \Z regex)
  This allows the parser to process both METADATA and WHEEL files.
* Only use Project-URL as package url if one is given in METADATA
* Set package maintainer based on Maintainer-Email field

Python Environment:
* Move default python detection to a separate method

Also:
* Fix typo in `pip wheel` invocation with wrong variable name
* Remove 'json' require since it's no longer used.
2025-09-30 15:25:44 -07:00
Jordan Sissel fcee26e979 WIP to update python support to rely more on `pip`
Breaking:
* Removed calls to `setup.py` since this seems deprecated/unusable in
  almost any modern python package. [2]
* No longer work: `--python-install-data`, `--python-install-lib`, and
  `--python-install-bin`. The reason: `pip install ...` doesn't seem to
  support such flags, so there's no way to use these flags. Instead,
  you must set `--prefix` if you want to choose where the package
  installs if not the default location

New Behavior:
* When --python-bin isn't given to fpm, automatically try to find a
  correct python executable name[1]
* When --python-package-name-prefix isn't given, set a default based on
  the default --python-bin. That is, if python3 is being used, packages
  should default to a name prefix of "python3-"
* Package 'architecture' now will be "all" or "native" depending on the
  wheel file's `Root-Is-Purelib` field. It's unclear if this is the correct
  way to determine this, though.

Implementation Details:
* Parse package metadata from the wheel (METADATA and WHEEL files)
* Download pypi packages as wheels when available. Previously, fpm would
  specify `--no-binary :all:`, but no longer does.
* When source packages are only available, build a wheel locally.

Not yet tested:
* Not yet tested: Package a python module that exists in a local directory

[1] Python is sometimes available as python3, etc.
[2] https://packaging.python.org/en/latest/discussions/setup-py-deprecated/
2025-09-30 15:25:44 -07:00
Jordan Sissel 9a77831902 Move command running to verbose/info log instead of debug. 2025-09-30 15:25:44 -07:00
Jordan Sissel 873bff3820 Update cabin to fix Ruby ostruct deprecation/stdlib warning 2025-09-30 15:25:44 -07:00
Jordan Sissel 1c3cfe741e Change log message to note hardlink 2025-09-26 20:15:54 -07:00
Jordan Sissel 6025469d52 Only hardlink if the source file appears to be a hardlink and we have already copied one of it into the destination. This should fix #2102 2025-09-26 20:15:54 -07:00
Jordan Sissel fdfc384e71 Rely on copy_entry's logic to handle copying vs hardlinking. 2025-09-26 20:15:54 -07:00
Jordan Sissel 82ddba7a8c remove 'ostruct' require. ostruct's being moved out of ruby core, so this will help remove deprecation/move warnings 2025-09-26 20:15:54 -07:00
Jordan Sissel 7cc4aa7509 Add two tests to cover parts of #2102. The 'normal files' test covers the reported issue in #2102 and fails in this commit. 2025-09-26 20:15:54 -07:00
Jordan Sissel 207bd73577 Add ruby 3.4 and also run apt-get update to try and work around "apt-get install ..." failing sometimes unpredictably? 2025-09-22 13:38:06 -07:00
André Kelpe 7ef007ef5f fix RPM documentation links in docs and code (#2092)
The previous versions where all returning 404. This change points to the
new correct locations.
2025-03-05 20:42:25 -08:00
Markson Hon 3f044a426f
pacman.rb: fix aarch64 & arm7hf (#2017) 2025-03-05 20:18:15 -08:00
Jordan Sissel 4beb98f193
Merge pull request #2088 from jordansissel/issue/2087
rpm: Escape { and } characters in filenames
2025-03-05 20:15:07 -08:00
Jordan Sissel 2c301c733d Try to make {} file names work in RPM v4.18 and older.
RPM 4.19 added some changes to make it easier or at least more
consistent to escape 'unusual' filename characters. However, RPM v4.18
and earlier do not benefit from this change, so I'm hoping that
replacing {} with ? (wild-card single) characters will work on those
versions. It works fine on v4.19.
2024-12-20 20:52:45 -08:00
Jordan Sissel b10350b913 Fix bug causing DEBUG logging not to work in rspec 2024-12-19 13:34:08 -08:00
Jordan Sissel 93ac15729b Escape { and } characters in filenames
* Add test coverage for escaping { and } filename characters

Fixes #2087
2024-12-19 12:59:07 -08:00
Jordan Sissel 08dc21b8f1 Version bump and generate docs 2024-12-08 23:22:18 -08:00
Jordan Sissel f817f7a5da Update changelog prep for release. 2024-12-08 23:21:12 -08:00
Jordan Sissel f714f4b4f1
Merge pull request #2084 from jordansissel/pull/2009
When using zstd, use tar flags that are compatible with both gnu tar and bsdtar (#2009)
2024-12-08 22:53:24 -08:00
Jordan Sissel 28fea4c930
Merge pull request #2085 from jordansissel/feature/add-rpm-old-perl-flag
Add flag to allow using older 'perl' rpm dependency name for systems which do not have 'perl-interpreter' dependency available. (#2066)
2024-12-08 22:53:09 -08:00
Jordan Sissel b2f2fc6624
Merge branch 'main' into pull/2009 2024-12-08 22:45:49 -08:00
Jordan Sissel e7e7449815
Merge pull request #2053 from JordanStopford/main
Fix for #1627
2024-12-08 22:42:37 -08:00
Jordan Sissel 862a6863cd Add flag to allow using older 'perl' rpm dependency name for systems which do not have 'perl-interpreter' dependency available. (#2066) 2024-12-08 22:21:30 -08:00
Jordan Sissel 858d1c1419
Merge pull request #2066 from kduret/fix-rpm-perl-dependency-name
fix(rpm): replace perl dependency by perl-interpreter
2024-12-08 22:20:34 -08:00
Jordan Sissel 98cc060ede Merge branch 'chouquette/add_compression_level' (#2036) 2024-12-07 23:28:55 -08:00
Jordan Sissel 512f4a9eb3 Fix syntax I broke when doing a merge conflict 2024-12-07 23:28:42 -08:00
Jordan Sissel 8acb2f51d7
Merge branch 'main' into chouquette/add_compression_level 2024-12-07 23:24:39 -08:00
Jordan Sissel 468f455862
Merge pull request #2041 from UiP9AV6Y/feature_rpm_changelog
rpm: generate changelog if none is provided
2024-12-07 23:17:00 -08:00
Jordan Sissel e6b83c4788
Merge pull request #2062 from willaerk/main
Escape the pylib path when using it in a shell command
2024-12-07 23:12:58 -08:00
Jordan Sissel 13a3c6992e
Merge pull request #2063 from skoef/systemd-path-flag
Add option --deb-systemd-path
2024-12-07 23:11:12 -08:00
Jordan Sissel 572cf390a7
Merge branch 'main' into systemd-path-flag 2024-12-07 23:09:53 -08:00
Jordan Sissel d30e641bb8 Update changelog 2024-12-07 23:00:04 -08:00
Jordan Sissel ad4402f3bf
Merge pull request #2068 from mattaezell/pip_zip
Support pip download returning a zip file
2024-12-07 22:56:43 -08:00
Jordan Sissel c326b39d95 When using zstd, use tar flags that are compatible with both gnu tar and bsdtar (#2009) 2024-12-07 22:43:00 -08:00
Jordan Sissel e66a359a10
Merge pull request #2009 from SaltwaterC/main
Add support for zstd compression for deb packages.
2024-12-07 22:42:46 -08:00
Jordan Sissel c028e71206
Merge pull request #2082 from wheaney/patch-1
Update rpm.rb
2024-12-02 10:17:07 -08:00
Wayne Heaney 0fb0d26152
Update rpm.rb
Leave old `--define` argument in place for `buildroot`
2024-11-04 22:02:31 -08:00
Wayne Heaney b852c59b02
Update rpm.rb
Fix how buildroot is specified to better conform with the rpmbuild CLI. The old way was failing with `File not found` errors.
2024-10-29 13:45:47 -07:00
Matt Ezell 790f53c766 Support pip download returning a zip file
Signed-off-by: Matt Ezell <ezellma@ornl.gov>
2024-09-23 10:33:57 -04:00
Jordan Sissel d81a1ad1ac
Merge pull request #2064 from TwitchCaptain/main
Create FreeBSD packages with correct architecture
2024-09-12 10:56:52 -07:00
Jordan Sissel fd06d93533
Merge pull request #2067 from jordansissel/improvement/errors-not-exceptions
Configuration problems should print errors, not stack traces.
2024-09-12 10:52:50 -07:00
Jordan Sissel e94f56c01e Flag errors should use FPM::Package::InvalidArgument 2024-09-12 10:48:55 -07:00
Jordan Sissel 843c729b16 Configuration errors should raise a specific exception
Raising FPM::InvalidPackageConfiguration will allow the fpm command-line
to print an error message and exit non-zero.

Raising other exceptions will often produce a crash-like behavior which
prints the exception and a stack trace. Stack traces are not helpful
content in situations where a user has made a configuration error.
2024-09-12 10:39:55 -07:00
Jordan Sissel 18e04a70e1
Merge pull request #2065 from phillipp/main
Add support for .timer units to --deb-systemd
2024-09-12 10:20:56 -07:00
Kevin Duret e7903804af fix(rpm): replace perl dependency by perl-interpreter 2024-09-06 09:22:28 +02:00
Phillipp Röll 6957220642 Add support for .timer units to --deb-systemd
Before the change, when using an option --deb-systemd myunit.timer,
the actual file created would be
/lib/systemd/system/myunit.timer.service

Because of that, systemd would then not find the timer.

With this change, the correct extension is extracted from the file,
defaulting to .service.

Typically, there would be two files for installing a timer:

--deb-systemd myunit.service (where .service could be omitted) and
--deb-systemd myunit.timer

So that the .timer references a .service file.
2024-08-12 14:47:47 +02:00
David Newhall II bf0aa55655 build proper freebsd package 2024-08-08 06:07:24 -07:00
Reinier Schoof 5092c5f659 Add option --deb-systemd-path
This option will allow you to override the path within the staging directory
systemd service files are moved to in debian packages.

On some systems systemd should not go in the hardcoded /lib/systemd/system but
in /usr/lib/systemd/system instead. Many systems have the both symlinked, but
not all so assuming /lib/systemd/system can be dangerous.

Signed-off-by: Reinier Schoof <reinier@skoef.nl>
2024-06-26 15:54:02 +02:00
Kristof Willaert 5960c8c4a7 Escape the pylib path when using it in a shell command 2024-05-16 18:13:54 +02:00
Jordan Stopford eb56972540 Fix for #1627
Strip rpmlib dependencies
2024-04-23 17:30:48 +01:00
Jordan Stopford 20aa78c72c Fix for #1627
When packaging a deb sometimes a path to a binary comes into the requires field i.e. /bin/sh but this isn't valid for control files. Strip this out
2024-04-23 16:33:39 +01:00
Jordan Stopford ae8205261a Fix for #1627
When packaging a deb sometimes a path to a binary comes into the requires field i.e. /bin/sh but this isn't valid for control files. Strip this out
2024-04-23 16:01:42 +01:00
Jordan Stopford 0cba81fbe4
Merge branch 'jordansissel:main' into main 2024-04-17 16:31:26 +01:00
Jordan Sissel 9d3d96a93d
Merge pull request #2057 from brad/patch-1
fix the link to ruby installation instructions
2024-04-11 08:54:05 -07:00
Brad Pitcher 86be3cc802
fix the link to ruby installation instructions 2024-04-11 08:06:02 -06:00
Jordan Sissel 13228bf566
Merge pull request #2023 from cwegener/main
chore: relax 'clamp' version pin
2024-04-08 21:28:38 -07:00
Christoph Wegener d0884e8903 chore: relax 'clamp' version pin
Ubuntu 22.04 LTS comes with ruby-clamp 1.1.1 which seems to work just
fine with fpm 1.15.1

Relaxing the version pin seems to be the right thing to do.
2024-04-09 10:31:22 +10:00
Jordan Stopford 3b2b258020 Fix for #1627
When packaging a deb sometimes the architecture comes through as part of the provides (not sure why) but this causes problems with the deb package as it seems to only ever expect one set of round brackets which is the version indicator
2024-03-08 10:37:34 +00:00
Natanael Arndt 847ded9eba Update dir.rst
Fix formatting for `--prefix`
2024-01-02 07:08:01 -08:00
Gordon Bleux c9d749a3a7 rpm: generate changelog if none is provided
`rpmlint` considers a lack of a changelog an error.

this is a similar behaviour to the DEB packager, where a generic
default changelog is generated unless one is provided explicitly.
2023-12-14 21:21:33 +01:00
Hugo Beauzée-Luyssen 49093c3533
deb: add a --compression-level option
Fix #2006
2023-11-24 09:17:18 +01:00
SaltwaterC e0edc7e559 Add support for zstd compression for deb packages. 2023-04-28 20:25:00 +01:00
Jordan Sissel b085edc49c Check if an option has a default value before we try to look it up.
This fixes fpm when used with clamp 1.3.0 or above.

Fixes #1543
2023-03-25 23:17:34 -07:00
Jordan Sissel ad6b18a0aa Fix failing test when run on arm64/aarch64 systems - this was a bug in the test suite 2023-02-07 00:27:29 -08:00
Jordan Sissel 066b9b561a Use a temporary path when testing archive commands.
Previously, fpm would write to the current directory when using methods to check for the correct `ar` and `tar` commands.

This now uses Stud::Temporary to get a random path in the system temporary directory.

I found this error in the test suite when the fpm git workspace was not
writable -- for example, when mounted read-only through a container.

Error message, for posterity:

    1) FPM::Command -p | --package when given a directory should write the package to the given directory.
       Failure/Error: cmd.run(["-s", "empty", "-t", "deb", "-n", "example", "-p", path])
       Errno::EACCES:
         Permission denied @ rb_sysopen - fpm-dummy.tmp
2023-02-07 00:13:16 -08:00
Jordan Sissel 18233c334d Version bump 1.15.1 2023-01-31 19:49:10 -08:00
Nicholas Hubbard d0c139aea4 Replace deprecated {File,Dir}.exists? with {File,Dir}.exist? 2023-01-31 18:08:38 -08:00
Jordan Sissel 31506109ff Add test coverage for debian version field validation
For #1847
2022-12-03 18:26:30 -08:00
Jordan Sissel f898ef8232 Reject invalid Debian version values.
A hopefully-actionable error message is provided when an invalid version
is given when making a Debian package.

To aid readability, rewrote the relationship pattern as a multiline regex. Added separate pattern for version field.

Test coverage added for #1969's "v" prefix removal.

For #1847
2022-12-03 18:26:30 -08:00
Gábor Lipták c9a5cb4628 Update GHA build
Signed-off-by: Gábor Lipták <gliptak@gmail.com>
2022-12-03 18:25:54 -08:00
Gábor Lipták ada6012b5b Drop leading v from version for Debian
Signed-off-by: Gábor Lipták <gliptak@gmail.com>
2022-12-03 16:46:29 -08:00
Jordan Sissel db06af3c03 Only try splitting the license text if there's actually a license given. This avoids a crash. 2022-11-28 17:48:15 -08:00
Jordan Sissel dcbe0425db Close the file to make Python flush any pending writes. Without this, some versions of python will /not/ write anything to our file which makes it empty and causes a failure in fpm. 2022-11-28 17:48:15 -08:00
Jordan Sissel df26ed08f7 Fix typo in changelog 2022-11-13 23:48:41 -08:00
Jordan Sissel 906cf8054a Release 1.15.0 2022-11-13 23:25:55 -08:00
Jordan Sissel fdd5e559ac Version bump 2022-11-13 23:25:07 -08:00
Jordan Sissel 10c8471179 Change docs tooling to use podman instead of docker 2022-11-13 23:24:21 -08:00
Jordan Sissel 42f2660a58 Regenerate docs with new flag sorting method. 2022-11-13 23:07:42 -08:00
Jordan Sissel d8bc03a63c Try to more-reliably sort options by name
New feature here is that --foo and --[no-]foo are both sorted as "foo",
so flags should be reasonably grouped together now.
2022-11-13 23:07:42 -08:00
Jordan Sissel 15aaf1cfce Add LOAD_PATH flag for cli generator 2022-11-13 23:07:42 -08:00
Jordan Sissel 601cfda057 Update changelog 2022-11-13 23:07:42 -08:00
C. Cooke 88c1e6ab0a Fix Debain package name relation regex
- Package names must start with an alphanumeric
- Package names must be at least two characters
- Package names may include a '.'
2022-11-13 21:14:33 -08:00
Gnought 72ccedc45d chore: refactor Dockerfile
- change base image to ubuntu:20.04
- support ruby 2.7
- docker lint
2022-11-13 21:11:51 -08:00
Jordan Sissel 5b104bccf0 Error if --workdir flag points somewhere that doesn't exist or is not a directory.
Fixes #1938
2022-11-13 20:23:59 -08:00
Nicholas Hubbard 3ba61bc0bd Test that the logger pipe method is invoked during safesystem 2022-11-13 17:54:10 -08:00
Nicholas Hubbard 8a6460d0d3 Test to ensure safesystem does not prompt user for input 2022-11-13 17:54:10 -08:00
Nicholas Hubbard b0ca926d49 execmd: close stdin for writing if called non-interactively 2022-11-13 17:54:10 -08:00
Jordan Sissel 3653f1a10c Use pkgbuild's --install-location flag when fpm's --prefix is given.
A user reported that on macOS Catalina, the default pkgbuild install
location may result in a .pkg file which cannot be installed.

This change makes fpm's `--prefix` option pass through to `pkgbuild`'s
`--install-location` flag

> With macOS Catalina, you can no longer store files or data in the read-only system volume, nor can you write to the "root" directory ( / ) from the command line, such as with Terminal.

References:
* macOS Catalina's new read-only root filesystem: https://support.apple.com/en-us/HT210650

Fixes #1908
2022-11-09 22:43:35 -08:00
Jordan Sissel 63d4ac8dfc Move `require` closer to where it is used.
This helps avoid a startup crash on Ruby 1.9.3 where the `rexml` gem
crashes when loaded due to syntax errors.

Fixes #1798, #1800, #1784
2022-11-02 21:49:17 -07:00
Jordan Sissel ad2b1a8966 Call String#dup on RUBY_VERSION to avoid crashing on older ruby versions
On older versions of rubygems, `Gem::Version.new(...)` calls
`String#strip!` on the argument in the constructor. This causes a
problem on Ruby 1.9.3 where the RUBY_VERSION constant is a frozen
string.

The workaround is to make a copy of this string that is unfrozen, and
`String#dup` seems to work :)
2022-11-02 21:49:17 -07:00
Jordan Sissel d9ba0b4545 Remove 'json' gem dependency.
The original `json` gem dependency was added in the original fpm.gemspec
because, at the time, Ruby 1.8.7 was common and required an external
`json` dependency for parsing JSON.

Later, Ruby releases since 1.9.1 have bundled `json`[1].

Therefore, it feels safe to remove this dependency. As a bonus, the
rubygems `json` gem places requirements on the minimum version of Ruby.
At this time, the latest `json` gem requires Ruby >= 2.3.

If the `json` gem dependency is removed, fpm will still retain the
ability to process JSON while lowering the minimum required Ruby version
to Ruby 1.9.x -- It's not perfect, but it's a start! :)

[1] https://docs.ruby-lang.org/en/2.3.0/NEWS-1_9_1.html

The idea for this change change came originally from a discussion
with @edolnx in #1949

Fixes #1741, #1264, #1949
2022-11-02 21:49:17 -07:00
Nicholas Hubbard 56a97c43be Fixed typo: stdin_w_close -> stdin_w.close 2022-10-31 15:17:48 -07:00
Jordan Sissel cd7a6855d3 Try to improve the flag description 2022-10-28 23:11:25 -07:00
Jordan Sissel c6b85be6a2 Improve tests and raise exception when the flags file is too large. 2022-10-28 23:11:25 -07:00
Jordan Sissel ce8fd6cb64 Remove debug print 2022-10-28 23:11:25 -07:00
Jordan Sissel 16c7e280a7 Support single-character flags in option files. 2022-10-28 23:11:25 -07:00
Jordan Sissel 7d6b5cd58c Add test coverage for --fpm-options-file
Cases:
* Option ordering (the flag operates in-place)
* Multiple --long-flags on a single line
* Multiple single flags on a single line (both like '-ff' and '-f -f')
* File self-reference errors
2022-10-28 23:11:25 -07:00
Jordan Sissel ec82bc649b Add option --fpm-options-file
This option flag will cause fpm to load additional flags, in place, from
the given file.

For example, if a file "foo" contains one line, "--version 5.10", then
`fpm -s empty -t deb -n example --fpm-options-file foo` act as if
`--version 5.10` was given on the command-line in the same position as
the `--fpm-options-file` flag.

Error conditions checked:
* Has the file already been loaded?
* Does the file exist?
* Is the file readable?

No tests included at this time. This code is likely missing some edge
cases (combined single-letter flags, multiple flag entries on a line,
etc).
2022-10-28 23:11:25 -07:00
Nicholas Hubbard 110419b695 Test unpack method directly 2022-10-28 16:06:34 -07:00
Nicholas Hubbard 11175cc47f Add test for building Alien::astyle version 0.010000 2022-10-28 16:06:34 -07:00
Nicholas Hubbard c8d364b0ab Fix broken tar command 2022-10-28 16:06:34 -07:00
Jordan Sissel 3fcaefb9fd Remove `git` gem dependency.
Folks are reporting that fpm cannot be installed easily (or at all) on
older systems because a transitive dependency(1) rejects ruby versions
older than 2.6.

(1) rubygem git depends on addressable which depends on public_suffix

Since the `git` dependency is only used in the `gem` source when
using a git repo as a installation source, and that usage seems pretty
simple -- clone a repo, checkout a branch, etc -- it feels safe to
remove this dependency while still keeping the same functionality.

Fixes #1923
2022-10-26 14:48:12 -07:00
Jordan Sissel d16b531a2f Trying GitHub Actions for testing
Attempting to figure out why rspec passes but the action still fails.
2022-10-24 20:38:08 -07:00
Jordan Sissel 6c87589f32
Update ruby.yml 2022-10-24 19:07:08 -07:00
Jordan Sissel 72b2f26ad3
Create ruby.yml 2022-10-24 19:04:51 -07:00
Nicholas Hubbard bfb192c417 Add test for CPAN dist with missing author 2022-10-21 17:23:36 -07:00
Jordan Sissel f168571abf Support newer version of lintian in the test suite.
Fixes #1907
2022-10-16 17:44:17 -07:00
Nicholas Hubbard 409a3b27df Prevent crash if CPAN distribution has blank author field 2022-10-16 16:23:07 -07:00
loic.chabert 788387c0d2 Add space on changes.erb to conform with debian specs 2022-10-03 13:34:22 -07:00
loic.chabert 37f56269c3 Replace whatever in changelog.erb and deb.changes.erb
In order to support packaging upload, the distribution must be
set/aligned in changelog and changes files.
Required for example inside dput-ng repo upload app.
2022-10-03 13:34:22 -07:00
Evgeny Stambulchik c40f6818f8 Recognize "--pleaserun-user" option 2022-07-05 16:26:24 -07:00
Chris Novakovic 9b32d9a116 Change default Debian package priority to optional
Since Debian Policy version 4.0.1, the "extra" priority has been
deprecated and replaced with "optional"; this triggers Lintian warnings
for Debian packages built by FPM. Make this the new default for Debian
package outputs when no value of --deb-priority is given.

Fixes #1398.
2022-06-24 13:49:32 -07:00
Jordan Sissel 40795d4d85 Load gem specifications using YAML's safe loading
On older rubies, YAML.load _is_ the unsafe load method. At some point,
Ruby 3.1.0 / Psych 4(?) made two renames:

* YAML.load -> YAML.unsafe_load
* YAML.safe_load -> YAML.load

A quick test is to try converting a gem. This would fail if `YAML.load`
was the "safe" method because it would fail with this message:

    Tried to load unspecified class: Gem::Specification (Psych::DisallowedClass

`fpm -s gem -t empty rails` will crash on Ruby 3.1.0 prior to this
commit.

Fixes #1895

Add necessary classes to safely load yaml from gem specs
2022-05-19 20:19:44 -07:00
Jordan Sissel 7881705985 Call ERB.new correctly depending on the RUBY_VERSION
* On Ruby 3.0.x and older, call ERB.new(template_code, nil, "-")
* On Ruby 3.1.0 and newer, call ERB.new(template_code, trim_mode: "-")

Fixes #1894
2022-05-01 22:39:04 -07:00
Jordan Sissel 5d2b4854d3 Fix failing test.
Looks like at some point django changed the admin tool from
"django-admin" to "django-admin.py"

Possibly this changed in upstream in Django on this commit, though I
don't know for certain:
85efc14a2e
2022-05-01 21:53:54 -07:00
Jordan Sissel 7f4718f9c2 Run `pip` without the `--build` flag
Previously, fpm would use `pip download ... --build ...` to instruct pip
to unpack a given python package to a specific directory for the purpose
of running something like `python setup.py` from it.

However, somewhere in 2021, pip removed this flag. First, I think, it
was deprecated and ignored, then finally removed. One reference to
this removal in the upstream pip project is this issue:
https://github.com/pypa/pip/issues/8333

Without `--build`, pip will place a single tarball in the destination
directory. Fpm cannot easily predict the name of this file because we
don't know the "real" name of the python package nor do we know the
version number being downloaded.

For example:

```
% python3 -m pip download --no-binary :all: --no-deps --no-clean django
...
Successfully downloaded django
% ls
Django-4.0.4.tar.gz
```

Best guess:
* we can expect exactly one file in the previously-empty target directory
* we can also expect that it is a .tar.gz

I don't know if these guesses are always correct, but it's a start.

As of this commit, the following command generates a Debian package:

`fpm -s python --python-bin python3 -t deb django`

Prior to this commit, with a newer version of pip, the command would
fail.

Fixes #1831
2022-05-01 21:53:54 -07:00
Jordan Sissel 82284c7a4b Rerun `make release-prep` 2022-03-31 00:15:23 -07:00
Jordan Sissel 60b4bd30b3 Add additional changelog entries 2022-03-31 00:09:25 -07:00
Jordan Sissel 377fcaf871 Add note about new documentation pages 2022-03-31 00:09:25 -07:00
Jordan Sissel 2943d82581 Version bump and update changelog 2022-03-31 00:09:25 -07:00
mszprejda f5d07520b7 pacman.rb: Fix typo in compression type matching 2022-03-30 23:52:51 -07:00
Jordan Sissel 0dfe21bab7 Add test case for files with spaces and quotatation marks.
Testing, this new test case fails on v1.14.1 and *succeeds* as expected
after #1882 was merged.

Fixes #1886
2022-03-30 23:50:55 -07:00
John Bollinger b2ba5c4a59 Fix filename mangling for RPM targets
Fixes the mangling FPM performs on the contents of RPM %files lists
to better match RPM's idiosyncratic filename handling.  FPM now
recognizes more cases that require special handling, and it
correctly distinguishes between the glob and non-glob cases,
which RPM itself treates differently.

Fixes #1385
2022-03-30 23:47:02 -07:00
Jordan Sissel 521d030420 Fix reStructuredText header length syntax 2022-03-30 23:15:59 -07:00
Jordan Sissel 106828fc12 Add description in header 2022-03-30 23:15:59 -07:00
Jordan Sissel 0c84173de0 Add description in header 2022-03-30 23:15:59 -07:00
Jordan Sissel 9b9a1b365f Add very basic package docs for each type of package.
Thanks to @alanc and _msw_ for quickly helping me figure out good words
to write to describe Solaris' p5p format.

For #1884.
2022-03-30 23:15:59 -07:00
John Howard eb5370d16e Fix `--deb-compression none`
Previously, we would pass the literal `""` as an argument to `tar`.
`tar` would interpret this as a file name, which does not exist, and
fail.

This fixes the command to just pass no compression flag at all to tar
when `--deb-compression none` is set.

I did not add tests since I couldn't figure out how to execute them -
this is my first time working in ruby.
2022-03-21 15:20:08 -07:00
Jordan Sissel 92886d922d Restore development_dependency on `rake`
A prior commit removed `rake` as a development dependency on the
assumption that nothing in fpm's development process actually required
the use of `rake`.

However, I had forgotten about #756 (year 2014) which adds FPM::RakeTask
and some test coverage. FPM::RakeTask was added to allow folks to more
easily invoke FPM from within a Rake task.

At this time, I see no reason to remove FPM::RakeTask. Further, because
`rake` is typically (in my experience) used only in development
environments. Therefore, I believe the right solution is to restore
`rake` as a development_dependency in order to allow the test suite to
pass. For users of FPM::RakeTask, I would assume (hopefully correctly!)
that they already have `rake` installed as a dependency in their own
project, so the `fpm` gem has no need to specify `rake` as a general-use
dependency.

When studying newer versions of Rake, I found:
* Rake v13 requires Ruby 2.2 or newer.
* Rake v12.xx and older are flagged as having security vulnerabilities.

In order to minimize chaos, this commit adds an unversioned dependency
on rake. This is to help fpm service more versions of Ruby and resist
efforts by any dependency to dictate which version of Ruby is used.

This reverts db9db670c3.

Fixes #1877
2022-02-23 18:04:51 -08:00
Corey Quinn 9aa1c1cb64 Update README to modernize the given example. 2022-02-07 15:26:36 -08:00
Geoff Beier 7a1302d1e8 fix typo in "perl" 2022-01-26 12:22:04 -08:00
Jordan Sissel 53f669219c Version bump 2021-11-10 15:01:34 -08:00
Jordan Sissel 20e754adfb Update changelog after #1854 was fixed. 2021-11-10 15:01:04 -08:00
Jordan Sissel d819e59a80 Require fpm/package/dir to make FPM::Package::Dir available (for #1854) 2021-11-10 14:58:50 -08:00
Jordan Sissel 021fc45047 Add requires so that other package types are available
When converting, we check if the original package was of a certain type.
In order for those types/constants to be available, we have to require
those files.

Test cases which now work correctly with this commit, but had failed
prior:

    % bundle exec ruby -r./lib/fpm/package/rpm.rb -e 'FPM::Package::RPM.new.tap { |x| x.name = "fancy" }.convert(FPM::Package::RPM)'
    % bundle exec ruby -r./lib/fpm/package/deb.rb -e 'FPM::Package::Deb.new.tap { |x| x.name = "fancy" }.convert(FPM::Package::Deb)'

Fixes #1854
2021-11-10 14:58:50 -08:00
Jordan Sissel 121989e0a0 Version bump 2021-11-09 22:30:01 -08:00
Jordan Sissel bba3114075 Regenerate in prep for release 2021-11-09 22:29:16 -08:00
Jordan Sissel 329b4758a6 Also regen per-package-type cli pages 2021-11-09 22:29:06 -08:00
Jordan Sissel 5b8e9fc334 Add release-prep target to regenerate certain files 2021-11-09 22:28:20 -08:00
Jordan Sissel 23c5790ec4 Update version in docs. Also fix link 2021-11-09 22:28:04 -08:00
Jordan Sissel d5985a5571 Fix sphinx error about empty block. 2021-11-09 22:27:50 -08:00
Jordan Sissel f722c4b3f5 Add introduction for the landing page. 2021-11-09 22:27:24 -08:00
Jordan Sissel 8437e50fe0 Update changelog from v1.13.1 to now 2021-11-09 22:27:14 -08:00
Jordan Sissel d43a017736 Have pip download packages to the build_path
Prior to this change, pip would download Python packages to $PWD which
leaves files hanging around.

The build_path is automatically removed when fpm exits.
2021-11-09 21:29:41 -08:00
Jordan Sissel c1930fc465 Try to find the right python executable. Also don't require easy_install anymore.
As part of making "internal pip" the default (#1820), the test suite
needed two main changes:
1) Don't check for easy_install anymore
2) Try to find the right python executable.

On my Ubuntu 20.04 system, installing Python gives Python v3 which only
makes the "python3" executable available. To compensate, the test suite
now tries to find any of "python", "python2", or "python3" to use with
the test suite. When found, it will set the appropriate `--python-bin`
flag in fpm for each test.

For #1820
2021-11-09 21:29:41 -08:00
Jordan Sissel 7b57e92ec4 Cite reason for using 'python -m pip' aka "internal pip"
* https://bugs.python.org/issue22295

At time of writing, the python 3 installation docs mention:

https://docs.python.org/3/installing/index.html

> The following command will install the latest version of a module and its dependencies from the Python Package Index:
>
> python -m pip install SomePackage
2021-11-09 21:29:41 -08:00
Jordan Sissel 9e3f75b628 By default, use pip for fetching and installing python packages.
This adds a new flag, --python-internal-pip, which is enabled by default.

"internal pip" means using 'python -m pip' to invoke pip. Ideally this will make fpm more correctly use pip.

Tested on python 2.7.17 and 3.6.9 on Ubuntu 18.04

All python tests passing 👍👍

Fixes #1820
2021-11-09 21:29:41 -08:00
Jordan Sissel 309e6b3c18 Only show /etc "config files" warning when files are present in /etc.
This should silence a warning in cases when packages do not contain any
/etc files. Prior to this commit, most debian package creation would
have this warning emitted:

```
Debian packaging tools generally labels all files in /etc as config files, as mandated by policy, so fpm defaults to this behavior for deb packages. You can disable this default behavior with --deb-no-default-config-files flag {:level=>:warn}
```

Fixes #1851
2021-11-09 21:10:34 -08:00
Jordan Sissel 052656b480 'empty' packages now default to "all" architecture.
This feels like the right default because empty packages have no files
(especially no binary, architecture-specific files) and therefore should
be installable on any architecture.

Fixes #1846
2021-11-09 21:02:17 -08:00
Jordan Sissel 809c726944 Use correct constant name 2021-11-09 16:47:02 -08:00
seph d69e648ce0 Skip tests which cannot be run due to missing dependencies.
Also fix at a failing deb lintian test which was failing due to a
missing 'lsb-base' dependency
2021-11-09 16:47:02 -08:00
seph 62f1418e4a Add documentation for running fpm from docker
Also add documentation for running the fpm test suite in docker.

From #1681
2021-11-09 16:47:02 -08:00
seph e1ef157dc3 fpm tests can now be run through docker.
This changes the Dockerfile to create docker images suitable for running tests (fpm rspec suite in docker) and also as a normal release (using fpm through docker).

Fixes #1682, #1453
2021-11-09 16:47:02 -08:00
Jordan Sissel db9db670c3 Remove rake development_dependency. I don't think Rake is used for fpm development ;) 2021-11-09 16:34:27 -08:00
Jordan Sissel 58ddeda91b Apply fix for readthedocs building errors.
https://blog.readthedocs.com/build-errors-docutils-0-18/

For #1848

Hoping this fixes it. Readthedocs emails me whenever doc build fails, and
for the past week or two, it has said the following:

```
Running Sphinx v1.8.5
loading translations [en]... done
making output directory...
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 37 source files that are out of date
updating environment: 37 added, 0 changed, 0 removed
reading sources... [  2%] changelog
reading sources... [  5%] changelog_links
reading sources... [  8%] cli-reference

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/fpm/envs/latest/lib/python2.7/site-packages/sphinx/cmd/build.py", line 304, in build_main
    app.build(args.force_all, filenames)
[ ... cut for brevity ... ]
  File "/home/docs/checkouts/readthedocs.org/user_builds/fpm/envs/latest/lib/python2.7/site-packages/sphinx/util/nodes.py", line 94, in apply_source_workaround
    for classifier in reversed(node.parent.traverse(nodes.classifier)):
TypeError: argument to reversed() must be a sequence
```
2021-11-09 15:52:31 -08:00
Jordan Sissel 11646b943f Add cpan docs per #1838 2021-11-09 15:44:37 -08:00
Jordan Sissel 13621c9722 Add special handling for converting CPAN to Deb.
I needed found this issue while trying to write documentation and
examples for fpm's cpan support. Fpm was generating invalid debian
packages as a result! This should fix things.
2021-11-09 15:44:37 -08:00
Jordan Sissel c6baaf9427 Fix formatting typo. Needed '::' to make the next paragraph pre-formatted code 2021-11-09 15:44:37 -08:00
Jordan Sissel 9efd56c54a Add npm/nodejs package documentation
This example uses the `ascii-art` npm package. I have realized that
using this package with its example ascii art is likely not accessible
for screen readers. I'll keep the example for now and revise it later.
2021-11-09 15:44:37 -08:00
Jordan Sissel 3540cfeb4b Add `dir` docs
For #1838
2021-11-09 15:44:37 -08:00
Jordan Sissel cb24061992 Fix formatting and rpm examples. 2021-11-09 15:44:37 -08:00
Jordan Sissel d6a77bff2a Add docs for 'empty' package type 2021-11-09 15:44:37 -08:00
Jordan Sissel e8fb21d725 Move generated cli docs to packages/cli/{type}.rst
I'm hoping this makes it easier to find files in the docs/packages
directory.
2021-11-09 15:44:37 -08:00
Jordan Sissel aecf23801d Add 'make view' in the docs/Makefile. Live-reloading sphinx html build.
Use sphinx-autobuild to run a server which autobuilds and reloads docs
in the browser.
2021-11-09 15:44:37 -08:00
Jordan Sissel c83461caf7 Add Debian package docs.
For #1838
2021-11-09 15:44:37 -08:00
Jordan Sissel 3e7ba8656b Fix Sphinx doc errors 2021-11-09 15:44:37 -08:00
Jordan Sissel 285c13554f Generate per-package-type command line docs
Add it to the rpm example.

Added make target in docs/ 'package-type-cli' to generate all the cli
docs pages.
2021-11-09 15:44:37 -08:00
Jordan Sissel 5bd26ad011 Add packaging types doc page 2021-11-09 15:44:37 -08:00
Jordan Sissel c4c0b32cfc Add test case for #1840 (deb compression creating invalid control.tar files)
Identified in #1840/#1841, `lintian` will error due to invalid
control.tar file, as shown below.

This test ensures that `lintian` will not crash. There were two options
I found: First, to run `lintian` and, when it crashes, it exits code 2.
Second, to run `lintian` with a single always-successful check. I chose
the second option because this allows me to rely on success/failure
(exit code 0 vs non-zero) in the event that `lintian` ever changes its
exit code, or that the crash exit code changes across older versions of
Debian.

```
% lintian example_1.0_amd64.deb
dpkg-deb: error: archive '/home/jls/projects/fpm/example_1.0_amd64.deb' uses unknown compression for member 'control.tar.bz2', giving up
/bin/tar: This does not look like a tar archive
/bin/tar: *control: Not found in archive
/bin/tar: Exiting with failure status due to previous errors
Skipping example_1.0_amd64.deb: could not read control data in /home/jls/projects/fpm/example_1.0_amd64.deb:  at /usr/share/perl5/Lintian/ProcessablePool.pm line 93.
```
2021-11-02 21:52:58 -07:00
Andrey Tikhonov 97dfed35ae When bzip2 is used for compression, use gzip on the control.tar.
This fixes a bug where fpm would create an invalid debian package file.
When `--deb-compression bzip2` was used, fpm would create
'control.tar.bz2' file inside the debian package. Debian does not
support bzip2-compressed control files. Per the deb(5) manpage:

> The second required member is named control.tar. It is a tar archive containing the package control information, either not compressed (supported since dpkg 1.17.6), or compressed with gzip (with .gz extension) or xz (with .xz extension, supported since 1.17.6)

With this commit, when bzip2 is chosen for data compression, fpm will
use gzip compression on the control.tar file.
2021-11-02 21:40:24 -07:00
Jordan Sissel 60de482c2c Make sure files we add to the package actually show up in the resulting output 2021-10-30 16:10:49 -07:00
Jordan Sissel 48200286c1 Add tests for FreeBSD packages.
- Files in the tarball should begin with / (#1811, #1844)
- Assert certain top-level manifest fields
- Assert manifest files are present

Idea from #1844
2021-10-30 16:10:49 -07:00
Clayton Wong 5995c7ac34 fix typo in readme 'installation guide' URL 2021-10-28 14:56:58 -07:00
Jordan Sissel 4f51caf8fc rpm: Replace dash with underscore.
(note: fpm calls 'iteration' what rpm calls 'release')

rpmbuild will reject the `Release` tag containing a dash with the
following error (via fpm --verbose):

```
error: line 41: Illegal char '-' (0x2d) in: Release: 1-1 {:level=>:info}
Process failed: rpmbuild failed (exit code 1).
```

This patch copies the dash-to-underscore operation that is already
applied to the version field.

Adds tests for both iteration and version field.

Fixes: #1833
2021-09-22 00:09:42 -07:00
Jordan Sissel 1a980dd3e7 Remove travis-ci.
It's been hard to debug travis failures for a long time, and since the recent credentials-issue[1] being handled poorly, I think we can close this chapter.

> After 3 days of pressure from multiple projects, [Travis CI] silently patched the issue on the 10th. No analysis, no security report, no post mortem, not warning any of their users that their secrets might have been stolen

[1] https://arstechnica.com/information-technology/2021/09/travis-ci-flaw-exposed-secrets-for-thousands-of-open-source-projects/
2021-09-21 23:35:12 -07:00
Jordan Sissel 16f1b4357f Reject invalid Provides fields for Debian packages
This resolves an issue caused by #1803 where a user was, historically, passing `--provides 'foo (<< 1.2.3)'` which was working correctly in prior versions of fpm but creating invalid Debian packages in the newer release.

This is a funny issue because previously fpm was removing the relationship text '(<< 1.2.3)' so it never made it into the resulting Debian package. Due to #1803, this text is now passed into the resulting package, and Debian package tooling rejects it.

Added tests to cover a few valid and invalid cases.

This change also adds code to validate other relationship fields (Depends, Suggests, etc) but does not actually do any validation.
2021-09-04 22:51:38 -07:00
Jordan Sissel c7e7b18731 Fix failing test.
This test was failing on a lintian check which reports:

```
E: name: init.d-script-needs-depends-on-lsb-base etc/init.d/test (line 14)
```

Added `lsb-base` dependency to resolve it.
2021-09-04 17:32:39 -07:00
Vlastimil Holer 63fdb94347 FreeBSD package: Fix missing leading `/` in archive
This is a simple workaround, which transforms the filenames inside the
tar archive so that they start with `/`. This happens only in case
the filename doesn't begin with `+`, which is expected (or at least is
very likely) to be a metadata file.

```
$ tar --list -f test-package-0.0.1.txz
+COMPACT_MANIFEST
+MANIFEST
/etc/config
/usr/bin/script

$ pkg install -y test-package-0.0.1.txz && echo OK
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	test-package: 0.0.1

Number of packages to be installed: 1
[1/1] Installing test-package-0.0.1...
Extracting test-package-0.0.1: 100%
OK
```

Fixes #1811

Signed-off-by: Vlastimil Holer <vholer@opennebula.io>
2021-08-15 23:11:38 -07:00
Joris Vandermeersch 0a8bccc511 Also use setuptools' extras_require which contains complex dependencies
ex. 'charset_normalizer~=2.0.0; python_version >= "3"' is now included if the marker matches the build environment.
2021-08-15 23:09:29 -07:00
Jordan Sissel 2ccf61c01f Generate reStructuredText documentation for command-line flags. 2021-08-15 23:05:34 -07:00
Vedant K 720e140d78 docs: fix case in command output 2021-08-15 21:57:40 -07:00
Vedant K cdf110d730 docs: remove fpm runtime deps (ruby, ffi, etc) from optional deps section 2021-08-15 21:57:40 -07:00
Vedant K 2834bb5816 docs: add link to issue #54 (rpm build dependency removal) 2021-08-15 21:57:40 -07:00
Vedant K 9fd97d747c docs: add -s flag to .fpm in getting started guide 2021-08-15 21:57:40 -07:00
Vedant K 37525ca4b0 docs: fix typo 2021-08-15 21:57:40 -07:00
Vedant K 3bb5e99f2a docs: add note about cli flags overriding .fpm file 2021-08-15 21:57:40 -07:00
Vedant K 99c5fcb485 rewrite some parts of documentation 2021-08-15 21:57:40 -07:00
Jordan Sissel 55f9613c0d Fix typo 2021-07-06 15:23:11 -07:00
Jordan Sissel 864e41c880 Update license copyright to year 2021 2021-07-06 14:32:08 -07:00
Jordan Sissel 01b67d747f Version bump 2021-07-06 14:31:42 -07:00
Jordan Sissel 541550a74d Allow versions in `Provides` field for Debian packages
This fixes #1788. This also reverts #280. For #280, at the time, this
change to ignore versions was correct. Two years after #280, Debian
began allowing `Provides` field to have versions.

This change also fixes bug in gem-to-deb conversion where previously an
incorrect Provides syntax would be generated (but thanks to #280,
removed), so this bug was only noticed after #280 was undone!

Computers are hard sometimes.

Added tests for gem-to-deb conversion specifically for the Provides
field.

Tested manually with Docker on Ubuntu 14.04 and 18.04 and results meet
expectations.

The history here is follows:
* In 2012, fpm was patched to remove version specifiers in Provides
  field because Debian didn't support it.
* In 2014, Debian dpkg[1] added support for versions in Provides field
* Somewhere between 2015-2018, Debian and Ubuntu included this new
  version of dpkg.
* Debian packaging policy docs (v4.4.0) was updated to allow versions
  in the Provides field.

Expected impacts:
* Older versions of dpkg/etc should _ignore_ the presence of a version
  specifier. Testing on Ubuntu 14.04 confirmed this.
* Newer versions of dpkg/etc should respect the presence of a version
  specifier. Testing on Ubuntu 18.04 confirmed this.

[1] https://launchpad.net/debian/+source/dpkg/1.17.11
2021-07-06 14:25:06 -07:00
Jordan Sissel 60bf90ae3c Only cleanup if needed
This fixes a warning when running `rspec`
2021-07-06 14:25:06 -07:00
allen joslin dbd8bafb5d Update installing.rst
add 'brew install rpm' as a prerequisite in the OSX/macOS section
2021-06-24 16:51:13 -07:00
Jordan Sissel e96dc2729a Version bump 2021-06-19 00:50:47 -07:00
Jordan Sissel 4eed9d671b Move loading of 'git' library nearer to where it's used.
This is necessary because `require "git"` (at time of writing) will
error if the `git` program is not available.

Upstream (ruby git) issue:
https://github.com/ruby-git/ruby-git/issues/311

Related fpm issues: #1748, #1751
2021-06-19 00:44:23 -07:00
Jordan Sissel bf9bcc8e2a Changelog update for #1760 2021-06-19 00:43:13 -07:00
Jordan Sissel 82580bb8e7 Add --deb-compression test coverage for #1760 2021-06-19 00:39:19 -07:00
Philippe Poilbarbe 13dde8304e Replace hardcoded control.tar.gz by name depending on compression (#1759) 2021-06-19 00:38:04 -07:00
Jordan Sissel 057a60387f Add more changelog entries to prep for release 2021-06-19 00:22:52 -07:00
Jo Vandeginste 067f4ccfd0 Add back newlines after sections with macro expansion
The previous commit eats too much whitespace after the section headers
(`%pre`, `%post` etc.). There should remain a newline.

Correct versions (for `%pre`):

```
%pre
ugrade () {
```

and

```
%pre -e
upgrade() {
```

Without this patch, we get these (wrong):

```
%pre ugrade () {
```

and

```
%pre -e upgrade() {
```

(exact number of spaces can be different, but should not be relevant)

Fixes #1750

Signed-off-by: Jo Vandeginste <Jo.Vandeginste@kuleuven.be>
2021-06-19 00:16:58 -07:00
Jordan Sissel 2b6e70b6fa Use rspec's skip feature to help show any skipped tests.
The previous method using :if actually hides the test entirely from the run.
Now an rspec run will correctly(I hope?) show any skipped tests. The
goal is to remind me that sometimes my dev environment is missing
important tooling needed to fully test fpm.

Also: Skip pacman tests if bsdtar and zstd programs are missing.
2021-06-19 00:09:49 -07:00
Jordan Sissel ab4eb18b5f FreeBSD package: Replace ruby-xz usage with alternative using `tar`
For #1795

This replaces another library which uses ffi with an implementation
that doesn't need ffi.

I am not certain this is an exact replacement, but for my casual tests,
comparing .txz files generated before/after this commit, things seem ok.
This would benefit from real freebsd testing, though.
2021-06-19 00:09:49 -07:00
Jordan Sissel 3965a0fd31 Remove childprocess library in the quest to remove ffi.
For #195.
2021-06-19 00:09:49 -07:00
Jordan Sissel 18c5adcd19 Remove the need to invoke mknod using FFI.
This removes fpm's direct use of FFI and removes `ffi` as a direct
dependency. For #1795

Cases:
* A unix socket.
* A named pipe
* A charDev should now fail (like /dev/tty)
* A blockDev should now fail (like /dev/sda1)

NOTE: In this change, chardev and blockdev support have been removed.
These "copies" previously were just calling `mknod` with identical
mode, basically copying the `mode` from stat(2) to mknod(2).
Exceptions are now thrown for chardev and blockdev.

Test cases:

    # Try to package a named pipe.
    % mkfifo /tmp/z.pipe
    % bundle exec bin/fpm -s dir -t rpm -n example /tmp/z.pipe
    Created package {:path=>"example-1.0-1.x86_64.rpm"}

    % rpm -qlvp example-1.0-1.x86_64.rpm
    prw-rw-r--    1 root     root                        0 Jun 17 22:40 /tmp/z.pipe

    # Create the unix socket
    % nc -lU /tmp/z.sock

    # Package it into an rpm
    % bin/fpm -s dir -t rpm -n example /tmp/z.sock |& less
    {:timestamp=>"2021-06-17T22:33:27.780347-0700", :message=>"Created package", :path=>"example-1.0-1.x86_64.rpm"}

    # Verify the file is of socket type ('s' at beginning of file mode
    % rpm -qlvp example-1.0-1.x86_64.rpm
    srwxrwxr-x    1 root     root                        0 Jun 17 22:33 /tmp/z.sock
2021-06-19 00:09:49 -07:00
Jordan Sissel e3b3f9d8e3 Begin replacing ChildProcess with Process.spawn()
The childprocess library uses `ffi`. Historically, installing ffi has
brought challenges for fpm users. This change is an attempt to use
ruby standard methods to replace ChildProcess.

For #1795
2021-06-19 00:09:49 -07:00
Jordan Sissel 3e42ff462c Update changelog for changes since v1.12.0. 2021-06-17 20:57:49 -07:00
Jordan Sissel 72a925b048 Ensure an if-then-else doesn't have an empty if block
Issue #1749
2021-06-17 08:30:31 -07:00
Jordan Sissel 2a6facbcce Escape single quotes in file names listed in `%files`
Fixes #1773
2021-06-17 08:21:41 -07:00
Steve Kamerman cc0a4e7369 Fixed Debian platform tag for aarch64/arm64 2021-06-17 07:58:02 -07:00
Zoe O'Connell d69ed14bd8 dir.rst: First example also requires trailing slash 2021-06-17 07:55:22 -07:00
Jordan Sissel d005508e18 Bump version of arr-pm to ensure 0.0.11 is used. That version fixes an issue on Ruby 3.0. #1786 2021-06-17 07:54:38 -07:00
Jordan Sissel 106d7b21e3 Add rexml as dependency
Previously, rexml was included standard in Ruby. However, in 3.0.0, ruby
moved this library to be a "bundled gem", per the release notes:

https://www.ruby-lang.org/en/news/2020/12/25/ruby-3-0-0-released/

> The following default gems are now bundled gems.
> * rexml

Tested on Ruby 2.7.0 and 3.0.1 w/ bundler and it works.

```
% (rbenv shell 3.0.1; bundle install; bundle exec bin/fpm -s empty -t empty -n example)
% (rbenv shell 2.7.0; bundle install; bundle exec bin/fpm -s empty -t empty -n example)
```

Fixes #1793
2021-06-15 11:53:16 -07:00
Jordan Sissel d50f756d0e Bump version prepare to release. 2021-01-19 15:12:20 -08:00
Andreas Ulm c795ed7ef4 implemented --deb-maintainerscripts-force-errorchecks (#1696)
Switched from always enabling errexit to fpm parameter as result of
discussion in #1696.

Signed-off-by: Andreas Ulm <andreas.ulm@root360.de>
2021-01-19 14:33:01 -08:00
Andreas Ulm feb53faa14 added set -e to debian maintainer scripts #1696
Signed-off-by: Andreas Ulm <andreas.ulm@root360.de>
2021-01-19 14:33:01 -08:00
Vlastimil Holer 292073fc35 deb: Fixes gem pessimistic version constrains for single component versions.
If gem had a version constraint with just major version (e.g., ~>1),
the Debian packages were generated with wrong zero upper limit
(e.g., >= 1 and << 0). This results in unresolvable dependencies.

Signed-off-by: Vlastimil Holer <vholer@opennebula.io>
2021-01-19 14:31:27 -08:00
Matt Patterson 073e4e7b74 Pin ffi to 1.12.x, for compatibility with Ruby 2.0
ffi 1.13 requires Ruby 2.3, which is not supplied by many still-supported distros (e.g Centos/RHEL 7), 1.12.X works there, so restrict to that.

Addresses #1708
2021-01-19 14:22:56 -08:00
Arnar Gauti Ingason cd7e428d9f Prepending pyfpm to PYTHONPATH instead of replacing 2021-01-19 14:16:34 -08:00
Frank Siler 73804ded35 Remove older rubies and add some extra OS tests
This change is cherry-picked from #1717
2021-01-19 13:17:24 -08:00
Chris Hodges 50ca2bfd05 Update virtualenv documentation for Python3
Original `virtualenv-tools` causes issues when building Python3 virtual environments. Previously reported in #1491.
2021-01-19 13:08:17 -08:00
Jose 3db202a52f removed some pritnt statement I added 2021-01-19 13:06:50 -08:00
Jose 9a16e43e4e changed xz for zst 2021-01-19 13:06:50 -08:00
Jose 6735f9df69 intermediate error checking 2021-01-19 13:06:50 -08:00
Jose b2dd4dadb6 syntax error 2021-01-19 13:06:50 -08:00
Jose 922d4c5d4f Copy_entry error prevented pacman from working 2021-01-19 13:06:50 -08:00
Jose ca3477b67b added zstd as standard compressoin 2021-01-19 13:06:50 -08:00
Jose 66a4dea525 added zstd compression, standard for pacman 2021-01-19 13:06:50 -08:00
Jose 6b4b61a3f8 changed backports for backports/latest 2021-01-19 13:06:50 -08:00
Jordan Sissel 90d131b075 Call safesystem() with a list
instead of a space-separated argument string

Tested with this command:

    bundle exec bin/fpm --debug -s python -t deb --python-pip =pip django

And verified that safesystem() to invoke pip is given a list.

Mentioned this here:
https://github.com/jordansissel/fpm/pull/1737#discussion_r560474705
2021-01-19 13:03:27 -08:00
James Logsdon 204fb1b1ff Use head/tail over sed for metadata fetching in sh.erb template 2021-01-19 12:49:18 -08:00
vv-p c9487a30c0 Add trusted-host option for pip 2021-01-19 12:36:59 -08:00
Kenyon Ralph 7d7b184d63 virtualenv.rst: fix heading level
This makes the "Example uses" heading a subsection of the virtualenv section.
2021-01-19 12:21:30 -08:00
Federico Lancerin e05790fa92 Addresses DIR -> DEB error on big directories
Fixes https://github.com/jordansissel/fpm/issues/1739
2021-01-19 12:20:58 -08:00
Cameron Nemo 945ba5b4b0 Update Docker base image to Alpine 3.12
Closes #1534
2021-01-19 12:17:41 -08:00
Jeff Solomon b1e956e071 Add a new --rpm-compression-level option which addresses issue 1675:
https://github.com/jordansissel/fpm/issues/1675

The value can be a number from 0 to 9 inclusive. The default mirrors
the current behavior of 9. If the --rpm-compression value is set to
"none", this value is ignored.

Setting the value to 5 sped up RPM creation on my RPM from 9 to
3 minutes.
2020-03-07 19:54:46 -08:00
Julian Trzeciak 8a40cd1db7 rpm: add option to enable install-time macro expansion in scripts
- spec file sections affected: %pre %post %preun %postun
2020-03-07 19:46:46 -08:00
Jeff Solomon cc7610f434 Issue 1678
fix .deb creation
2020-01-30 12:02:34 -08:00
Avi Miller 304619416b This improves the Oracle Linux install docs by removing the additional
repo that was added and enabling the ol7_optional_latest repo instead.
This ensures that fully supported packages are installed, including
the ruby-devel package.

This also corrects the product name.

Signed-off-by: Avi Miller <avi.miller@oracle.com>
2019-11-19 15:53:29 -08:00
Will H d9ddb21de4 Update outdated "gem install" command
The --no-ri and --no-rdoc switches have now been superseded by --no-document per https://guides.rubygems.org/command-reference/#gem_install
2019-11-19 15:27:41 -08:00
Mike Perham 83b4ad9d65 Use variable instead of hardcoded filename
The code specifies .gz when using non-gzip compression which breaks on recent debian packaging tools. Fixes #1647
2019-11-19 15:27:18 -08:00
c-ameron d7b466787d default to false for deb-systemd starts 2019-03-25 22:15:44 -07:00
c-aamm e066e632ed remove multiple systemd services on uninstall 2019-03-25 22:15:44 -07:00
c-aamm 823b3947fc allow starting of multiple deb systemd services 2019-03-25 22:15:44 -07:00
c-aamm a7626cb99b Allow auto-enable and auto-start for deb-systemd services after install
Adds in two new options to enable/disable and autostart systemd services
--[no-]deb-systemd-enable to enable the systemd service after install
--[no-]deb-systemd-auto-start to auto start the service after install

Additionally, any service start/stop/restart will use deb-systemd-invoke
wrapper if installed on the system
2019-03-25 22:15:44 -07:00
Richard Grainger 1c1ff7dc19 [Fixes #1557] Allow git repo as gem source 2019-03-25 22:13:29 -07:00
Alexander Weidinger 6628f175ff Dir#input: don't overwrite license and vendor
Calling Dir#input overwrote #license and #vendor with default values.
2019-03-25 22:10:02 -07:00
Jordan Sissel 69cb62ddce Add virtualenv to path on OSX
This should fix this error on travis:

```
Installing collected packages: virtualenv
  The script virtualenv is installed in '/Users/travis/Library/Python/2.7/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
```
2019-02-23 22:00:15 -08:00
Jordan Sissel fbbb80fd53 Skip snap package tests on ruby 1.9 and 2.0 2019-02-23 22:00:15 -08:00
Jordan Sissel 3895fccec9 Typo. I forgot String#any? doesn't exist. 2019-02-23 22:00:15 -08:00
Jordan Sissel b269c81ebe Fix travis check 2019-02-23 22:00:15 -08:00
Jordan Sissel 62fcf8c230 Disable another test that fails on travis, but not locally... 2019-02-23 22:00:15 -08:00
Jordan Sissel e8be82ebdc Disable certain tests on travis because they fail, and we don't have private access to the debug feature, so there's nothing we can do to debug it at this time. 2019-02-23 22:00:15 -08:00
Jordan Sissel 82ad8c6c2f Use python-3 2019-02-23 22:00:15 -08:00
Jordan Sissel b2c21dd285 Add perl 2019-02-23 22:00:15 -08:00
Jordan Sissel 4ff6fd7b91 Add ruby 2.6.0 2019-02-23 22:00:15 -08:00
Jordan Sissel b8fc631327 Disable triggerflags and triggerindex checks to make tests pass.
I'm not sure why this fails, but it seems to fail mostly on newer
rpm/rpmbuild systems. Maybe my arr-pm library is incorrectly parsing
these rpms somehow? Anyway... the tests are passing now.
2019-02-23 22:00:15 -08:00
Jordan Sissel 51067be1a5 Fix regression in python scripts #! line.
* Target python3 (newer djangos require it)
* Hardcode the django-admin path because easy_install's path/to/bin
  discovery is not working anymore.
2019-02-23 22:00:15 -08:00
Jordan Sissel 57fb023ee2 Support rubygems >= 3.0.0
This rubygems release renamed --no-ri and --no-rdoc to --no-document
2019-02-23 22:00:15 -08:00
Jordan Sissel 7a4372eaa0 Fix .attributes default value test
I think this test regression was introduced in 8f2dd451.
2019-02-23 22:00:15 -08:00
Ry Biesemeyer 29c9c13156 relax json dependency
rubies >= 2.5 ship with JSON 2.x, so allowing bundler to resolve to newer
implementations eliminates conflicts with dependency trees that include JSON
2.x.

Breaking changes for JSON 2.x include removed support for older rubies [1],
so specifying in this manner ensures that older rubies can find 1.x, while
newer ones can resolve to 2.x

[1]: https://github.com/flori/json/blob/master/CHANGES.md#2015-09-11-200

Resolves: https://github.com/jordansissel/fpm/issues/1599
2019-02-07 09:37:23 -08:00
Syed Ali 93e73c7ad5 Updated docs/installing.rst to reflect Oracle Enteprise Linux instructions 2019-02-07 09:31:00 -08:00
Colin Caine 591c0694d1 Deliberately omit a word 2019-02-03 15:00:35 -08:00
harbottle 625ad4bb1b Less strict pinning for childprocess #1592 2019-02-03 14:54:21 -08:00
Jordan Sissel 5e4e30ce0e version bump 2019-02-03 14:52:26 -08:00
João Ferreira 8d8428db04 Add Singularity definition file
This file is used to build a Singularity container with FPM installed
2019-02-03 14:50:37 -08:00
Jordan Sissel c1c82a45c4
Pin childprocess 0.9.0 to work around #1592 (#1593) 2019-01-30 10:29:29 -08:00
Jordan Sissel 40dc09925a
Testing workflows 2019-01-02 11:40:51 -08:00
Jordan Sissel 294f6180cf Upgrade Sphinx version to fix a crash in 'make build' (where newer sphinx_rtd_theme causes Sphinx 1.4.x to crash) 2018-12-23 14:29:46 -08:00
Morgan Rhodes 1f2f950581 Use `fix_dependency` when populating debian `Replaces` field (#1442)
The `Replaces` field needs to be formated 'package (operator version)'.
This makes use of the `fix_dependency` method for consistent formatting
with other dependencies.
2018-10-25 10:23:16 -07:00
Alexander Aleksandrovič Klimov 900d7560f4 Update links to use https (#1562) 2018-10-18 14:12:48 -07:00
Kyle Fazzari 8f6f285271 Introduce support for snap packages (#1490)
[Snaps][1] are self-contained squashfs images. Add basic support for
using them as inputs and outputs.

Typically Snapcraft is used to create snaps, but #1149 indicated a
desire to not use Snapcraft, so the snap is created natively, using
mksquashfs at the end to actually create the squashfs image. This may
not work for all use-cases (e.g. when the source doesn't already have
its dependencies bundled).

[1]: https://snapcraft.io/

Resolve #1181

Signed-off-by: Kyle Fazzari <kyrofa@ubuntu.com>
2018-10-16 15:59:17 -07:00
Dave L ca02692bcb Changed the mode of templates file for deb packages to 0644 (#1489)
If "--deb-templates" is used, fpm uses the wrong mode for this file. Since it is not an executable file, it should
not have the executable bits set. The lintian tool complains (with an error) that the mode is incorrect, and that
it should not be executable. Changing the mode to 0644 resolves this.
2018-10-16 15:57:03 -07:00
Mike Vastola 0d67ab9e3e Support different compression types for the deb control.tar file (#1542)
On input, the compression type is detected automatically. For output, the compression type is determined by the `--deb-compression` flag.

Fixes jordansissel/fpm#1540
2018-10-15 22:04:36 -07:00
Omer Katz 446b49c7c4 Added ruby 2.5 to the build matrix (#1532)
* Added ruby 2.5 to the build matrix.

* Require "date" since it's missing and failing a test.
2018-10-15 21:14:04 -07:00
Jordan Sissel bf54a505ed
Fix virtualenv failure on Python 3.6 (#1406) (#1556) 2018-10-15 20:46:13 -07:00
gcoxmoz 2b70a025f4 Preserve build-time timestamps when building rpms [#1538] (#1559) 2018-10-13 14:46:50 -07:00
Jordan Sissel 880e5512da Add missing change log entry 2018-10-13 14:22:24 -07:00
Fabian Mettler fa0d15d581 FIX: Proper indentation for changes (#1552)
Set the expected indentation format in changes according to the documentation: https://www.debian.org/doc/debian-policy/ch-source.html#s-dpkgchangelog
2018-09-10 17:37:30 -07:00
Jordan Sissel cad736ee6c
Version bump to 1.10.2 (#1516) 2018-07-03 22:11:58 -07:00
Jordan Sissel 20e89a6feb
Always treat perl dependency version as a string. (#1515)
Perl modules have both META.json and META.yml. In the JSON, the perl
dependency appears as a string `"5.004"`, but in YAML it appears as a
number `5.004`! This may cause fpm to fail when trying to convert the
perl version into a dependency, so we now always treat the perl version
as a string.

Fixes #1514
2018-07-03 22:08:48 -07:00
Jordan Sissel 3ab03e495f Set --no-cpan-test aka attributes[:cpan_test?]=false when doing a test package for cpan. This should make the test suite pass. 2018-07-03 22:05:59 -07:00
Jordan Sissel 3b6a415c35
Regenerate changelog links. (#1513)
I had forgotten how I did this and couldn't find notes, so... here's
how:

```
grep -Eo '`#([0-9]+)`_' CHANGELOG.rst | sed -re 's@^`#([0-9]+)`_$@.. _#\1: https://github.com/jordansissel/fpm/issues/\1@' | sort -u > docs/changelog_links.rst
```

This finds all \`#NNN\`_ entries in the CHANGELOG.rst and puts it sorted
into changelog_links.rst for reStructuredText linking.
2018-07-03 21:30:53 -07:00
Jordan Sissel c36416d63f
Version bump for a cpan bug fix (#1512) 2018-07-03 21:22:14 -07:00
William N. Braswell, Jr 7f5538f76f Perl CPAN Support, Fix Broken PERL5LIB & Add cpanm Verbose Option (#1511)
Perl CPAN Support, Fix Broken PERL5LIB & Add cpanm Verbose Option

Fixes #1509
2018-07-03 21:16:37 -07:00
Jordan Sissel 0c1ef4e106 Version bump 2018-05-18 17:31:58 -07:00
Jordan Sissel 2179b2f762 Version bump to 1.10
Minor bump because new features (flags) were added.
2018-05-18 17:27:46 -07:00
Marat Sharafutdinov 2ecfc640a2 Fix ruby-xz version 2018-05-21 14:53:42 -07:00
Allan Lewis 005baa9b98 Dockerfile: Follow best practices
In order to follow best practice for Dockerfiles, this commit:

* Removes leading and trailing blank lines.
* Pins the base image to a specific version of Alpine; the latest, 3.7, is used.
* Tells `apk` to not cache any package lists.
* Puts each dependency on its own line.
* Does some minor reformatting for readability.
2018-05-12 21:56:29 -07:00
Roman Vasilyev 1d04b94472 lignup 2018-05-12 21:16:35 -07:00
Roman Vasilyev 09fca24748 python3 fix 2018-05-12 21:16:35 -07:00
Arthur Burkart 68ec00e4cf Fixes typo; claims to make an rpm, but really deb 2018-05-12 21:09:58 -07:00
Jordan Sissel 40b1f2d741 Move the default value for `--deb-dist` into the option definition. 2018-05-11 22:12:31 -07:00
Timo Boettcher 07b0be428e Generate .changes file for Debian
This will generate .changes file for Debian packages. Some Debian
repository management tools use .changes files for importing packages.
The command line option --(no-)deb-generate-changes allows to select to
generate the .changes file, the option --deb-dist allows to set a
distribution (like sid) for the package.
2018-05-12 21:05:27 -07:00
Alexey Stepanov 384f54769f Add tests for python PEP0508 tags 2018-04-14 19:55:08 -07:00
Alexey Stepanov 51682db33e Process PEP0508 markers on python package requirements
Closes-bug: #1307
2018-04-14 19:55:08 -07:00
Jordan Sissel 8f2dd4516a Default :workdir attribute to Dir.tmpdir
This fixes a bug where rpm output passes an rpm build macro `_tmppath`
that is empty, and on Fedora 27 this causes rpmbuild to fail.

The test suite catches this by making most all RPM specs fail, and with
this change, most of them now pass.
2018-01-10 21:09:17 -08:00
Anthony Mastrean dfaa43a799 Switch from gitter to irc freenode link 2018-01-10 21:01:49 -08:00
Anthony Mastrean b43c393f4f Update README.rst
Bring those project-level badges front-and-center for Travis-CI builds, Gitter chat, and Rubygems.
2018-01-10 21:01:49 -08:00
Charles R. Portwood II b3c20f4e87 Fixes typo with APK control scripts
Alpine Linux describes the available control scripts at https://wiki.alpinelinux.org/wiki/Creating_an_Alpine_package.

This patch fixes an issue where `post-install` was registered multiple times, preventing `:after_install`, `:before_install`, `:before_upgrade`, and `:after_upgrade` from running the correct script.
2018-01-10 21:00:56 -08:00
Anthony Mastrean dce029dddb [Fixes #1397] Update fpm
Ruby 1.9 requires Rubygems internally and this is no longer strictly required. It's been this way since 2009, so it's a little hard to come by official documentation. I hope this works...

> Note: For Ruby 1.8 you must require 'rubygems' before requiring any gems.

http://guides.rubygems.org/rubygems-basics/#requiring-code
2018-01-10 21:00:06 -08:00
Anatoli Babenia c7c9043467 Link intro to full list of sources 2018-01-10 20:59:09 -08:00
Douglas Muth 4343397dfb Added Dockerfile 2018-01-08 16:07:54 -08:00
Jordan Sissel a996a8a404 Allow noarch rpms to contain binaries.
The reasoning for this is that some projects may ship single packages
containing everything necessary. For example, `Netty` and `JRuby` are
Java projects which contain platform-specific (for many platforms)
libraries -- for example, libjffi.
2017-12-24 06:00:04 -08:00
Chris Krelle 90a7f94067 add check for config file already in staging area
Check if config file already exists in the staging before attempting
to copy it
2017-12-23 13:02:43 -08:00
Chris Krelle fe0ab21476 add copy of local file to staging area so it is included in the package 2017-12-23 13:02:43 -08:00
Chris Krelle 8758734009 Fix issue 1440, createing deb packages with --config-files option
While I am not a ruby programer, I was able to come up with a solution to
the issue I was running into when attempting to create a .deb package when
using the --config-files option.
2017-12-23 13:02:43 -08:00
Torsten Schmidt c4b3cd863e fix: install loop problem in rpm.erb
When using install command (from /usr/bin/install) in after_install
shell in creates a endless loop, because it jumps to funtion beginning
of install(). So it's best practise to rename it to _install() to avoid
collision with /usr/bin/install command
2017-12-23 12:59:44 -08:00
Stephen 58b023c3cc exclude not working osx rvms 2017-12-23 00:04:38 -08:00
Stephen 8d85e0990c Update .travis.yml 2017-12-23 00:04:38 -08:00
Stephen f34bcac521 Create Brewfile 2017-12-23 00:04:38 -08:00
Stephen 19523e1873 turn osx tests on 2017-12-23 00:04:38 -08:00
Amnon BC d6ee7e199c add xzmt - multithreaded xz compression for rpmbuild 2017-12-23 00:01:14 -08:00
Marc-Andre Lafortune a0b3a1f078 Load only the backports that are needed 2017-12-15 23:53:38 -08:00
Marc-Andre Lafortune bfcc2b7d5e Specify minimal required ruby version 2017-12-15 23:53:38 -08:00
Jordan Sissel 92d134eaa5
Update to Contributor Covenant 1.4 (previously1.0) 2017-11-06 22:01:13 -08:00
Jordan Sissel ead229fb06
Update README.rst
Add project principles.
2017-11-06 21:54:22 -08:00
Anthony Mastrean 8a91a79088 [Fixes #1402] Update files.rst
Update the Jenkins/WAR example to use the more stable addresses, although they do redirect to mirrors and make the wget example output look nasty, it should be more reliable.
2017-09-28 08:36:45 -07:00
Jordan Sissel bd89a51f61 Version bump 2017-08-20 13:28:56 -07:00
Nemanja Boric 139793c8b3 Allow source=dest/ syntax for symlinks
PR #1253, while fixed the bug where `source.link=dest/source.link`
resulted in `source.link=dest/source.link/source.link` introduced a bug
where `source=dest/` syntax stopped working for symlinks (it is ok for
files). This is now fixed, as the symlink source now behaves the same as
it would with a single file input. Test case testing this behaviour is
also added.

Fixes #1395
2017-09-11 09:36:10 -07:00
Joseph Anthony Pasquale Holsten 6f07665db0 Merge pull request #1404 from yanca018/master
Update LICENSE
2017-08-26 20:13:58 -07:00
yanca018 03ea0c151b Update LICENSE 2017-08-14 03:04:21 -05:00
Jordan Sissel b7e82d49b4 Version bump 2017-07-29 01:27:51 -07:00
Jordan Sissel a15f60e20f Restore prior --config-files behavior
PR #1379/#860 introduced a new behavior for --config-files that fetches
config files from the local filesystem. The prior behavior was to
require these files to be provided by the source package (`--source`
flag).

This patch makes a hybrid solution which does, for any given
`--config-files foo` flag:

* does the path `foo` already exist in the staging area? Do nothing.
This means the package source (`-s gem` for example) provided this file.
* or, does the path `foo` exist in the local filesystem? If so, copy it
into the staging area.
* otherwise, consider this to be an error that the --config-files
setting cannot find the file, and fpm will fail with an error.
2017-07-29 14:49:16 -07:00
Jordan Sissel fcd4e70662 Try formatting with a definition list 2017-07-28 15:31:28 -07:00
Jordan Sissel bab1780b12 Add some answers to questions folks may have on pleaserun+fpm 2017-07-28 15:28:50 -07:00
Jordan Sissel d11567300f The phrase 'reasonably straightforward' is probably incorrect. Reprhase to express intent (we hope it's easy, etc) 2017-07-28 15:11:10 -07:00
Jordan Sissel 100a825796 Version bump for a newer pleaserun 2017-07-28 14:59:15 -07:00
Jordan Sissel b0fd3d2ef3 version bump 2017-07-28 14:53:45 -07:00
Jordan Sissel e4ade183c2 Add pleaserun docs. Happy sysadmin day! 2017-07-28 03:43:37 -07:00
Justin Kolberg efd05dd93b Add missing forward-slash to dir.rst
Without this forward-slash, installing the resulting deb package can wipe out directories.
2017-07-25 14:31:39 -07:00
Scott Van Hess e777018424 Rename `--include-dependencies` to `--embed-dependencies` 2017-07-21 10:24:13 -07:00
Scott Van Hess c63e6fa89d Optionally allow gem dependencies to be installed 2017-07-21 10:24:13 -07:00
Jordan Sissel b9f4c1e64f - fix another bad conversion from ftw to net/http. I hate net::http so
much.
2017-07-21 10:24:13 -07:00
Jordan Sissel 42b7c5acd3 - Version bump.
- This version adds solaris package support. Thanks to Ben Rockwood for
  donating a Joyent Solaris instance so I could work on this.
2017-07-21 10:24:13 -07:00
jakerobinson 783b06fe97 copy config files external to source 2017-07-21 10:09:23 -07:00
Ward Vandewege 55672427a5 Add --python-setup-py-arguments flag which can be used to pass arbitrary
arguments to setup.py.

This is helpful to package python modules that have a poorly written
setup.py that requires special arguments.
2017-07-21 09:55:01 -07:00
Alexander Weidinger 127b29194a Add --deb-after-purge FILE 2017-07-20 16:41:15 -07:00
Jordan Sissel 923ee23636 Merge pull request #1281 from rnowling/fix-nodejs-example-formatting
Correct formatting of commands in Node.js example
2017-07-20 14:57:35 -07:00
Jordan Sissel 8453c61112 Merge branch 'master' into fix-nodejs-example-formatting 2017-07-20 14:57:06 -07:00
Jan Delgado c7393be73f Performance optimization for apk packages: This patch dramatically improves
performance when building larger alpine apk packages.
2017-07-20 14:16:01 -07:00
Jordan Sissel 78853a81c9 Use 'false' not 'FALSE' constant 2017-07-20 14:12:18 -07:00
Thiago Figueiró 07e7e5399d Fix #1123 do not include empty .scripts directory 2017-07-20 14:12:18 -07:00
Thiago Figueiró 4d5b09778e Disable travis osx tests 2017-07-20 14:12:18 -07:00
Thiago Figueiró d6e136b457 Test against rubies 2.2.5, 2.3.3 and 2.4.0 2017-07-20 14:12:18 -07:00
Thiago Figueiró d2a71442c1 Add tar spec for #1123 2017-07-20 14:12:18 -07:00
Nemanja Boric fcd4dfd631 In case of a=b syntax where a is symlink, don't create directory (#1253)
Previously, if the symlink is included into the package and specified
with

my-sym-link.so=/usr/lib/my-sym-link.so

fpm would create directory, and put the
symlink inside `/usr/lib/my-sym-link.so/my-sym-link.so
which is very surprising and it doesn't follow the same
pattern as file copying is doing.

Fixes #1135
2017-07-20 14:00:21 -07:00
Jordan Sissel a8b431bc0b Use lowercase booleans. TRUE/FALSE cause Ruby to show warnings about deprecation 2017-07-20 13:50:10 -07:00
ServiusHack a3ddf38b84 Fix copy_entry for symlinks (#1348)
* Add test for copying symlinks

The test explicitly sets `preserve=true` and `remove_destination=true`
to show the currently broken behavior.

* Fix copy_entry for symlinks

The fourth argument to FileUtils.copy_entry is dereference_root to
which the value of remove_destination was passed.

The fix now passes the parameters in the required position.
2017-07-20 13:11:28 -07:00
Elan Ruusamäe fa31f84058 spec: stud is runtime dependency (#1354) 2017-07-20 13:05:44 -07:00
Philippe Poilbarbe c2db5985f6 Added --deb-interest-noawait and --deb-activate-noawait (#1225) (#1359) 2017-07-20 13:05:03 -07:00
Dan Kegel 14c4819e41 Implement reproducible gem -> deb conversion (#1360)
* Add option --source-date-epoch-default and implement for deb output.

This is the first step towards supporting bit-for-bit identical
output files given identical inputs.

Alas, Apple's ar is not too good at reading gnu ar archives,
so always use ar_cmd to find ar.

* deb: remove lines duplicated in a tragic merge conflict

Probably introduced by 62d0060178 and not removed by 500f0c052f

* Add options --source-date-epoch-from-changelog and --gem-stagingdir to support bit-for-bit reproducible gem -> deb conversion

In those cases where we can get the release date out of the changelog,
use it; otherwise fall back to the value given by SOURCE_DATE_EPOCH aka --source-date-epoch-default.

--gem-stagingdir is a bit of a kludge, only needed because no
compiler supports https://reproducible-builds.org/specs/build-path-prefix-map/ yet.
Could have been global option, but not sure any other package handler
invokes compilers?  Could hoist it up later.

Also:
- Defer initializing staging_path so subclasses can sneak in new value
- gem: remove build files

* gem: handle a few more gem changelog variants

* gem: also remove mkmf.log; lets ffi, kgio, raindrops, and ruby-ldap build reproducibly.

* deb: don't expect diffoscope to be installed in /usr/bin.  Lets it be found on mac.

* gem: document new options
2017-07-20 12:33:14 -07:00
Diego Martins 488863b321 remove archive-tar-minitar as a dependency (#1355) 2017-06-20 14:33:24 -07:00
liger1978 1bda1089a4 Fixes #1345 Test for nil before using metadata[module] in cpan.rb (#1346) 2017-06-19 10:00:41 -07:00
Jordan Sissel ed5a4356b5 Add libffi-devel to fedora 23+ install step. (#1352)
Fixes #1351
2017-06-14 22:04:20 -07:00
Jordan Sissel 10585bae35 Add link to install docs from readme 2017-06-14 21:54:45 -07:00
Joseph Anthony Pasquale Holsten 2ea5ecf65f package/dir: remove spurious pry (#1293)
Fixes #1259
2017-06-14 21:46:44 -07:00
Bob Bell b13f2f0a05 Translate Perl version dependencies like 5.008001 proper versions like 5.8.1 (#1342) 2017-06-14 21:41:03 -07:00
Perry Stoll 60b5ecff12 Fixed rst errors (#1349)
Fixed rst config to add text trailed by double colons to have the subsequent blocks correctly formatted as code.
2017-06-14 21:39:21 -07:00
liger1978 17cdacb782 Fixes #1343 Ensure self.version is converted to string (#1344) 2017-06-06 12:53:17 -07:00
Bob Bell 32d526fb14 Use capabilities in Perl dependencies (#1340) 2017-06-05 14:25:25 -07:00
Bob Bell 5148814866 Do not remove the leading "v" from version dependencies, since that is how the version of those dependencies themselves are being provided (#1339) 2017-06-05 14:24:12 -07:00
Bob Bell b930bcc874 Update to v1 of MetaCPAN API (#1341) 2017-06-05 13:06:24 -07:00
Bob Bell f393ca6382 Be consistent in letting newer Perl module versions meet the requirements, if not otherwise specified (#1338) 2017-06-05 11:44:13 -07:00
Paulo Sousa 37cc459dd8 pleaserun: add extra options to pleaserun (#1311) 2017-06-02 16:31:05 -07:00
Ryan Parman d4d52ef46b Update .travis.yml (#1266) 2017-06-02 16:25:41 -07:00
jesusbagpuss c79bb050a7 Add rubygems to CentOS install line (#1309)
For CentOS7, I needed to install rubygems.
Not sure if it is included in e.g. ruby-devel for previous versions?
2017-06-02 15:55:14 -07:00
memory 359e4847cb Add --virtualenv-find-links flag (#1318)
"pip install" in addition to the --index-url and --extra-index-url
flags, offers the `--find-links` flag, which tells pip to parse
an html index document looking for wheel/egg/source files without
expecting the "simple" pypi layout or to look in a local directory
for package files.
2017-05-26 08:30:45 -07:00
Bob Vincent c364b2a41e Fix zipfile target. (#1314)
* Fix zipfile target.

* Remove "-y" option which is unsupported on Windows.
2017-04-24 10:35:57 -07:00
Rob Young 6f6e59e8bd Fix OSX Python tests (#1320)
The test was failing because the calculated staging path is incorrect
with brew. If done in a virtualenv it is correct.
2017-04-21 08:33:43 -07:00
vbakayev 6dca7cabf0 fix wrong init.d shim naming (#1325) 2017-04-20 09:22:33 -07:00
ge-fa b5470f93b8 docs/installing: Fix build deps on Debian-derived systems (#1321) 2017-04-07 14:51:18 -07:00
Jordan Sissel 859f602f56 Merge pull request #1262 from nicobrevin/fix-virtualenv-prefix-behaviour
Fix virtualenv prefix behaviour (#1248)
2017-04-04 22:43:15 -07:00
Jordan Sissel fd7ef05966 Merge pull request #1291 from PabloCastellano/master
Update installing.rst
2017-02-17 12:13:19 -08:00
Pablo Castellano f2e38357a3 Update installing.rst
Apart from gcc and make you need other dependencies.
Without build-essentials I had an error complaining about "stdio.h not found"
2017-02-17 12:14:22 +01:00
Jordan Sissel 1752f4fcb2 Version bump 2017-02-05 01:46:58 -08:00
Jordan Sissel 051c4db507 Pin archive-tar-minitar to work around https://github.com/halostatue/minitar/issues/23 2017-02-05 01:45:32 -08:00
RJ Nowling 59b7721798 Correct formatting of commands in Node.js example
Two of the code blocks in the Node.js example were not being formatted as such.  This commit fixes that.
2017-01-14 22:34:29 -06:00
Nick Griffiths 719fec630c Fix weird clipboard fart 2016-12-30 20:01:47 +13:00
Nick Griffiths 5874236a2b Amend docs for virtualenv prefix 2016-12-30 19:57:15 +13:00
Nick Griffiths d72ea6c625 Fix for #1248 - fix prefix behaviour 2016-12-30 19:57:15 +13:00
Nick Griffiths 55f9355e90 Some docs for virtualenv support 2016-12-30 19:57:15 +13:00
Jordan Sissel 00adf41b20 update 2016-12-28 01:55:44 -08:00
Jordan Sissel 7f483848f9 Release 1.8.0 2016-12-28 01:50:47 -08:00
Jordan Sissel af305e7a87 Merge pull request #1218 from nzjrs/master
make virtualenv packages truly standalone
2016-12-07 15:51:49 -08:00
Jose Diaz-Gonzalez bd39f5886f Merge pull request #1252 from jaytho/patch-1
slight grammer and typo
2016-12-05 02:02:43 -07:00
jay thompson 4020de0d25 slight grammer and typo 2016-12-05 02:55:54 -06:00
Jordan Sissel 6fc914097d Merge pull request #1242 from nicobrevin/wip-rpm-docs
First stab at rpm docs
2016-11-29 23:44:02 -08:00
Jordan Sissel b560b0fcce Merge pull request #1241 from liger1978/fix_cpan_version_query
Fixes #1236 Fixed version number for metacpan search
2016-11-29 17:25:07 -08:00
Jordan Sissel 16401efae9 Version bump to 1.7.0 2016-11-28 15:45:54 -08:00
Jordan Sissel 023a4d1035 Remove part that fails under GNU Make 4.1. Previous this error would cause make to fail: 'Makefile.sphinx:11: ***recipe commences before first target. Stop.' 2016-11-28 15:45:36 -08:00
Nick Griffiths 4a71dd184d First stab at rpm docs 2016-11-28 22:28:48 +13:00
Richard Grainger 93dacaf0fb Fixes #1236 Fixed version number for metacpan search 2016-11-28 08:42:29 +00:00
Jordan Sissel b7ae0d9bde Merge pull request #1240 from jordansissel/update-docs-homepage
Docs are living on readthedocs now.
2016-11-27 23:10:12 -08:00
Jordan Sissel f47fc82f05 Docs are living on readthedocs now. 2016-11-27 23:09:50 -08:00
Jordan Sissel acb70cc9b0 Merge pull request #1239 from jordansissel/changelog-rst
Make changelog docs have issue hyperlinks to github.
2016-11-27 23:03:28 -08:00
Jordan Sissel b71cc71f05 Generate links to github issues 2016-11-27 23:03:04 -08:00
Jordan Sissel 00aefaccc8 Make issue references into links 2016-11-27 23:03:04 -08:00
Jordan Sissel e36ee9b319 Merge pull request #1238 from jordansissel/changelog-rst
Convert CHANGELIST to CHANGELOG.rst
2016-11-27 22:46:37 -08:00
Jordan Sissel c175e3e59a Convert CHANGELIST to CHANGELOG.rst
Changelog now also included in the docs.
2016-11-27 22:45:53 -08:00
Jordan Sissel 33ec8690f9 Docs are versioned. 2016-11-27 10:03:15 -08:00
Jordan Sissel 888b5860a9 Merge pull request #1235 from cfstras/master
pleaserun: support chdir parameter
2016-11-27 20:13:28 -08:00
Jordan Sissel 9d9df389a0 Merge pull request #1213 from shalq/bz2-support
deb data file should support bz2 format
2016-11-27 19:59:58 -08:00
Jordan Sissel 98af0f6787 Merge pull request #1226 from Daniel15/patch-1
Fix comment in apk.rb
2016-11-27 19:49:59 -08:00
Jordan Sissel 4a787359c6 Merge pull request #1234 from cfstras/patch-1
Add example: create rpm&deb packages with init scripts
2016-11-27 16:33:07 -08:00
Jordan Sissel fe9808f09f Merge pull request #1237 from jordansissel/sphinx
Initial work on fpm docs with sphinx and
2016-11-27 16:32:03 -08:00
Jordan Sissel b470c6885f Update project title 2016-11-27 04:04:11 -08:00
Jordan Sissel 835f59b58b Minor intro revision 2016-11-27 04:04:03 -08:00
Jordan Sissel 4663dc003a Update header. Add contributing to toc 2016-11-27 04:03:50 -08:00
Jordan Sissel 49c5049b7b Update readme to include docs pages 2016-11-27 04:02:58 -08:00
Jordan Sissel 0d33ff1f8f Fix directories such that the project root is included in the docker volume. This is necessary to make the root README.rst available 2016-11-27 02:47:48 -08:00
Jordan Sissel 408ea8ae4d Use README.rst in index 2016-11-27 02:47:10 -08:00
Jordan Sissel d336bc3002 Use rst for the README so it can be included in the docs. 2016-11-27 02:39:34 -08:00
Jordan Sissel 10ffb524f8 Add more docs converted from the wiki 2016-11-27 02:26:17 -08:00
Jordan Sissel e5f35be66c Not using gh-pages 2016-11-26 22:55:41 -08:00
Jordan Sissel 7a44b4045e Note the purpose of this Dockerfile 2016-11-26 22:54:42 -08:00
Jordan Sissel 42fae324f7 Start working on some better fpm documentation.
This time is using Sphinx and reST.

To build: `make build`
The docs will appear in docs/_build/html/
2016-11-26 22:49:10 -08:00
Claus Strasburger b999baf1b9 pleaserun: support chdir parameter
Added support for --pleaserun-chdir to specify the working directory of a
created service.
2016-11-25 14:13:00 +01:00
Claus F. Strasburger 9db164ad6e Add example: create rpm&deb packages with init scripts
Took me some time to figure out how to use the api -- So I am submitting this example to add some documentation for the API, specifically pleaserun.
2016-11-25 13:22:19 +01:00
Jordan Sissel 9b854df26e Merge pull request #1231 from josegonzalez/patch-1
Use StringIO from ruby stdlib
2016-11-22 23:26:48 -08:00
Jose Diaz-Gonzalez 098c9b2de5 Use StringIO from ruby stdlib
Closes #1148
2016-11-22 14:00:22 -07:00
Daniel Lo Nigro 0764bbdcd7 Fix comment in apk.rb
This file is for Alpine packages, not Debian packages! :D
2016-11-13 15:38:14 -08:00
Jordan Sissel 4c17c11904 Merge pull request #1208 from liger1978/fix_author
Fixes #1206 Improved download URL query for CPAN modules
2016-10-28 21:01:36 -07:00
John Stowers ca8aeb951d virtualenv: add option create with --system-site-packages
this allows virtualenv packages to see the system package
directory
2016-10-23 14:37:16 +02:00
John Stowers e72209b59c virtualenv: add option to also install the package in the virtualenv
one common use-case for a virtualenv requirements.txt source
is to distribute ones software and the dependencies in one
debian file. unfortunately the current implementation doesn't
get one all the way to that goal. Starting with a local checkout
of a python package (containing one's own software, setup.py and
requirements.txt) fpm can create a package that contains the
software dependencies, but not the software itself.

this commit adds an option to also run the package setup.py
after populating the virtualenv, thus giving a means to
package one's own application *and* the dependencies in
one step
2016-10-23 13:28:41 +02:00
Richard Grainger c7839af1f9 Fixes #1206 Improved download URL query for CPAN modules 2016-10-17 21:04:49 +01:00
Long Quan Sha afca45910e deb data file should support bz2 format 2016-10-17 06:29:17 +00:00
Jordan Sissel e9a6f63e2e Merge pull request #1203 from liger1978/fix_merge
Ensured result is not nil. Fixes #1202.
2016-10-15 19:33:10 -07:00
Jordan Sissel 9af51d7364 Merge pull request #1210 from nicobrevin/bugfix-virtualenv-various
Bugfix virtualenv various
2016-10-15 19:24:17 -07:00
Jordan Sissel 0926aa195e Merge pull request #1196 from hatt/task/1140-update-freebsd-arch
Use global architecture switch for FreeBSD ABI
2016-10-15 19:23:18 -07:00
Nick Griffiths d9490a520f Dumb attempt at getting virtualenv tests to run in travis/linux 2016-10-15 17:07:57 +13:00
Nick Griffiths 4cdab37074 Fix failing virtualenv test 2016-10-15 16:42:19 +13:00
Nick Griffiths fc648021e4 Cope with longer tmp dirs - shebangs must be < 128 chars 2016-10-15 16:11:17 +13:00
Jordan Sissel 06a7f6947f I don't use dk anymore 2016-10-10 03:01:05 -07:00
Richard Grainger 33216ad7d7 Ensured result is not nil. Fixes #1202. 2016-10-09 22:36:11 +01:00
Matt Sharpe 2e8583e42e Use global architecture switch for FreeBSD ABI 2016-09-28 17:36:28 +10:00
Jordan Sissel cda8262bab Version bump 2016-09-15 10:35:27 -07:00
Jordan Sissel b0367de0a2 Don't include 'pyc' (python bytecode) files in the fpm gem package. Will prevent #1191 from happening again. 2016-09-15 10:33:28 -07:00
Jordan Sissel 40aa7cf5ca Move fpm version query behavior to `run` method.
A bug pointed out by #1162 showed that `fpm --version` would fail when
a .fpm file was loaded.

Moving the short `fpm --version` handling to the `run` method lets us do
this check before we load FPMOPTS env or .fpm files.

Updated the tests to only try calling with a lone `-v` or `--version`
flag to verify this works with and without a .fpm file.

Fixes #1162 and #1125. Original work by @drwl!
2016-09-11 23:48:39 -07:00
Andrew Lee a6f25b9fda Fix --version when .fpm file exists 2016-09-11 23:48:17 -07:00
Jordan Sissel a9401ca0f5 Merge pull request #1158 from jomach/master
Install rpm-build dependencies
2016-09-11 21:43:10 -07:00
Jordan Sissel 9ec2b9fde6 Merge pull request #1184 from thijstriemstra/patch-1
fix typo
2016-09-11 21:40:14 -07:00
Jordan Sissel b48397b8b4 Merge pull request #1188 from hatt/feature/1187-longer-flags
Add long flag options for chdir, input, and output
2016-09-11 21:34:10 -07:00
Matt Sharpe 0e9e8f0a43 Add long flag options for chdir, input, and output
The flags for chdir, input, and output aren't immediately intuitive
as to what they're short for. This commit adds long versions and a
spec stub for chdir. Resolves #1187.
2016-09-02 17:19:12 +10:00
Thijs Triemstra 441d8e90d3 fix typo 2016-08-30 00:28:09 +02:00
Jordan Sissel 5b5d7efb31 Fix blank summary bug. When using the description field for the summary, instead of picking the first line, we now pick the first non-empty line. Fixes #1186. 2016-08-27 21:41:00 -07:00
Jordan Sissel 99f5e52fda Merge pull request #1182 from liger1978/fix_1179
Fix #1179 Remove .packlist files and empty parent directories from CPAN packages
2016-08-23 19:08:00 -07:00
Richard Grainger 5981a29f76 Fix #1179 Remove .packlist files and empty parent directories from CPAN packages 2016-08-23 23:47:20 +01:00
Jordan Sissel ab50185c48 Merge pull request #1178 from liger1978/fix-1114
Fix #1114 by looking for new-style keys in CPAN metadata
2016-08-19 08:58:05 -07:00
Richard Grainger b6ee8799ce Fix #1114 by looking for new-style keys in CPAN metadata 2016-08-19 15:49:43 +01:00
Jordan Sissel 64897df7c7 Merge pull request #1154 from Romain-Geissler-1A/fix-pacman-dependency-regex
Fix pacman dependency regex.
2016-08-08 13:30:51 -07:00
Jordan Sissel 1945b83ff7 Merge pull request #1170 from lloydpick/fix-apk-loading
add missing apk require
2016-08-04 12:26:36 -07:00
Lloyd Pick 6de809631a add missing apk require 2016-08-04 20:20:08 +01:00
Jordan Sissel 060f580b3c Merge pull request #1168 from kylegato/patch-1
Update README.md with freebsd in the targets list
2016-08-02 16:45:21 -07:00
Kyle Gato 4ba6b89ba0 Update README.md with freebsd in the targets list
Adding freebsd to the README due to recently introduced functionality.
2016-08-02 16:00:18 -07:00
Jordan Sissel 40ec0c3576 Merge pull request #1139 from luto/bugfix/1124
fix --workdir not having an effect on the build and staging dirs, fixes #1124
2016-07-25 16:14:44 -07:00
Jordan Sissel 8114803a53 Merge pull request #1030 from ZeroPointEnergy/feature/gem_set_shebang
gem: make it posssible to set the shebang
2016-07-22 10:49:14 -07:00
Andreas Zuber be71a16a40 gem: make sure only the shebang on the very first line of the script gets replaced 2016-07-22 09:16:48 +02:00
Andreas Zuber 8add9bcdd6 gem: make it posssible to set the shebang
This makes it possible to create packages from gems for ruby versions
which are not currently installed on the machine you build the package on.
2016-07-22 09:02:39 +02:00
Jorge Machado f5984e25e5 Install rpm-build dependencies 2016-07-11 08:37:39 +02:00
Romain Geissler 1cef669d07 Fix pacman dependency regex. 2016-07-05 21:34:50 +02:00
luto 454754064f fix --workdir not having an effect on the build and staging dirs, fixes #1124 2016-06-22 01:50:44 +02:00
150 changed files with 8044 additions and 1945 deletions

View File

@ -1,5 +0,0 @@
---
things:
ruby:
args:
- fpm

30
.github/workflows/ruby.yml vendored Normal file
View File

@ -0,0 +1,30 @@
name: Ruby
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-22.04
strategy:
matrix:
ruby-version: ['2.7', '3.0', '3.1', '3.4']
steps:
- run: |
sudo apt-get update
sudo apt install -y libarchive-tools lintian cpanminus
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- run: |
if [ ! -z "$RUNNER_DEBUG" ] ; then
DEBUG=1 bundle exec rspec -fd
else
bundle exec rspec
fi
env:
SHELL: /usr/bin/bash

9
.gitignore vendored
View File

@ -36,3 +36,12 @@ Gemfile.lock
.rbx
.vagrant
# RubyMine
.idea/
docs/_build
docs/.work
.docker-test-everything
.docker-test-minimal

14
.readthedocs.yaml Normal file
View File

@ -0,0 +1,14 @@
# https://blog.readthedocs.com/build-errors-docutils-0-18/
version: 2
build:
os: ubuntu-24.04
tools:
python: "3.13"
sphinx:
configuration: docs/conf.py
python:
install:
- requirements: docs/requirements.txt

View File

@ -1,32 +0,0 @@
os:
- linux
- osx
language: ruby
sudo: false
rvm:
# We use language features of Ruby that are not supported in Ruby 1.9.x or
# older.
#- 1.8.7
#- 1.9.2
- 1.9.3
- 2.0.0
- 2.1.1
- 2.2.1
before_install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi
# dpkg has also gnu-tar and xz as dependencies, these packages are used
# by pacman.rb, for example.
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install dpkg ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then which dpkg-deb || 'dpkg-deb not found'; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then which lintian || echo 'lintian not found'; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then which python || brew install python; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then which easy_install || echo 'easy_install not found'; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then which rpm || brew install rpm ; fi
script: bundle exec rspec
addons:
apt:
packages:
- bsdtar
- rpm
- lintian
- python-setuptools

4
Brewfile Normal file
View File

@ -0,0 +1,4 @@
brew 'dpkg'
brew 'rpm'
brew 'gnu-tar'
brew 'xz'

View File

@ -1,661 +0,0 @@
1.6.2 (July 1, 2016)
- Reduce `json` dependency version to avoid requiring Ruby 2.0 (#1146, #1147;
patch by Matt Hoffman)
- pacman: skip automatic dependnecies if --no-auto-depends is given (Leo P)
- rpm: Fix bug where --rpm-tag was accidentally ignored (#1134, Michal Mach)
- deb: Omit certain fields from control file if (Breaks, Depends, Recommends,
etc) if there are no values to put in that field. (#1113, TomyLobo)
- rpm: remove trailing slash from Prefix for rpm packages (#819, luto)
- virtualenv: Now supports being given a requirements.txt as the input. (Nick
Griffiths)
1.6.1 (June 10, 2016)
- freebsd: Only load xz support if we are doing a freebsd output. (#1132,
#1090, Ketan Padegaonkar)
1.6.0 (May 25, 2016)
- New source: pleaserun. This lets you create packages that will install a
system service. An after-install script is used in the package to determine
which service platform to target (systemd, upstart, etc). Originated from
Aaron Mildenstein's work on solving this problem for Logstash. (#1119,
#1112)
- New target: Alpine Linux "apk" packages. (#1054, George Lester)
- deb: don't append `.conf` to an upstart file if the file name already ends
in `.conf`. (#1115, josegonzalez)
- freebsd: fix bug where --package flag was ignored. (#1093, Paweł Tomulik)
- Improvements to the fpm rake tasks (#1101, Evan Gilman)
1.5.0 (April 12, 2016)
- Arch package support is now available via -s pacman and -t pacman.
(#916; wonderful community effort making this happen!)
- FreeBSD packages can now be built `-t freebsd`
(#1073; huge community effort making this happen!)
- You can now set fpm flags and arguments with the FPMOPTS environment
variable (#977, mildred)
- Using --exclude-file no longer causes a crash. Yay! (#982, wyaeld)
- A new rake task is available for folks who want to invoke fpm from rake
(#756, pstengel)
- On FreeBSD, when tarring, gtar is now used. (#1008, liv3d)
- virtualenv: Add --virtualenv-pypi-extra-url flag to specify additional PyPI
locations to use when searching for packages (#1012, Paul Krohn)
- deb: Init scripts, etc/default, and upstart files are automatically added
as config files in a debian package. Disable this behavior with
---deb-auto-config-files
- deb: Small changes to make lintian complain less about our resulting debs.
- deb: New flag --deb-systemd lets you specify a systemd service file to include
in your package. (#952, Jens Peter Schroer)
- cpan: Add --[no-]cpan-cpanm-force flag to pass --force to cpanm.
- rpm: File names with both spaces and symbols should now be packageable.
(#946, iwonbigbro)
- cpan: Now queries MetaCPAN for package info if we can't find any in the
cpan archive we just downloaded. (#849, BaxterStockman)
- rpm: You can now specify custom rpm tags at the command line. Be careful,
as no validation is done on this before sending to rpmbuild. (#687, vStone)
- cpan: Install if the package name given is a local file (#986, mdom)
- sh: Metadata now available as env vars for post-install scripts (#1006, Ed Healy)
- rpm: No more warning if you don't set an epoch. (#1053, Joseph Frazier)
1.4.0 (July 26, 2015)
- Solaris 11 IPS packages 'p5p' now supported `-t p5p`. (Jonathan Craig)
- Python Virtualenv is now supported `-t virtualenv` (#930, Simone
Margaritelli and Daniel Haskin)
- deb: Files in /etc are now by default marked as config files. (#877,
Vincent Bernat)
- `fpm --help` output now includes a list of supported package types (#896,
Daniel Haskin)
- cpan: --[no-]cpan-sandbox-non-core flag to make non-core module sandboxing
optional during packaging (#752, Matt Sharpe)
- rpm: Add --rpm-dist flag for specifically setting the target distribution
of an rpm. (Adam Lamar)
- rpm: Fix a crash if --before-upgrade or --after-upgrade were used. (#822,
Dave Anderson)
- deb: Ensure maintainer scripts have shebang lines (#836, Wesley Spikes)
- deb: Fix bug in maintainer scripts where sometimes we would write an empty
shell function. Empty functions aren't valid in shell. (Wesley Spikes)
- Fix symlink copying bug (#863, Pete Fritchman)
- python: Default to https for pypi queries (Timothy Sutton)
- New flag --exclude-file for providing a file containing line-delimited
exclusions (Jamie Lawrence)
- python: new flag --python-disable-dependency to disable specific python
dependencies (Ward Vandewege)
- python: ensure we avoid wheel packages for now until fpm better supports them.
(#885, Matt Callaway)
- deb: Add support for installation states "abort-remove" and "abort-install"
(#887, Daniel Haskin)
- If PATH isn't set, and we need it, tell the user (#886, Ranjib Dey)
- cpan: --[no-]cpan-test now works correctly (#853, Matt Schreiber)
- deb-to-rpm: some improved support for config file knowledge passing from
deb to rpm packages (Daniel Haskin)
1.3.3 (December 11, 2014)
- The fpm project now uses Contributor Covenant. You can read more about this on
the website: http://contributor-covenant.org/
- npm: Fix bug causing all `-s npm` attempts to fail due to a missing method.
This bug was introduced in 1.3.0. (#800, #806; Jordan Sissel)
- rpm: fix bug in rpm input causing a crash if the input rpm did not have any triggers
(#801, #802; Ted Elwartowski)
1.3.2 (November 4, 2014)
- deb: conversion from another deb will automatically use any changelog found in
the source deb (Jordan Sissel)
1.3.1 (November 4, 2014)
- deb: fix md5sums generation such that `dpkg -V` now works (#799, Matteo Panella)
- rpm: Use maximum compression when choosing xz (#797, Ashish Kulkarni)
1.3.0 (October 25, 2014)
- Fixed a bunch of Ruby 1.8.7-related bugs. (Jordan Sissel)
- cpan: Fix bug in author handling (#744, Leon Weidauer)
- cpan: Better removal of perllocal.pod (#763, #443, #510, Mathias Lafeldt)
- rpm: Use lstat calls instead of stat, so we don't follow symlinks (#765, Shrijeet Paliwal)
- rpm and deb: Now supports script actions on upgrades. This adds two new flags:
--before-upgrade and --after-upgrade. (#772, #661; Daniel Haskin)
- rpm: Package triggers are now supported. New flags: --rpm-trigger-before-install,
--rpm-trigger-after-install, --rpm-trigger-before-uninstall,
--rpm-trigger-after-target-uninstall. (#626, Maxime Caumartin)
- rpm: Add --rpm-init flag; similar to --deb-init. (Josh Dolitsky)
- sh: Skip installation if already installed for the given version. If forced,
the old installation is renamed. (#776, Chris Gerber)
- deb: Allow Vendor field to be omitted now by specifying `--vendor ""` (#778, Nate Brown)
- general: Add --log=level flag for setting log level. Levels are error, warn, info, debug. (Jordan SIssel)
- cpan: Check for Build.PL first before Makefile.PL (#787, Daniel Jay Haskin)
- dir: Don't follow symlinks when copying files (#658, Jordan Sissel)
- deb: Automatically provide a 'changes' file in debs because lintian
complains if they are missing. (#784, Jordan Sissel)
- deb: Fix and warn for package names that have spaces (#779, Grantlyk)
- npm: Automatically set the prefix to `npm prefix -g` (#758, Brady Wetherington and Jordan Sissel)
1.2.0 (July 25, 2014)
- rpm: Add --rpm-verifyscript for adding a custom rpm verify script to
your package. (Remi Hakim)
- Allow the -p flag to target a directory for writing the output package
(#656, Jordan Sissel)
- Add --debug-workspace which skips any workspace cleanup to let users debug things
if they break. (#720, #734; Jordan Sissel)
- rpm: Add --rpm-attr for controlling attribute settings per file. This setting
will likely be removed in the future once rpmbuild is no longer needed.
(#719)
- deb: Add --deb-meta-file to add arbitrary files to the control dir (#599, Dan Brown)
- deb: Add --deb-interest and --deb-activate for adding package triggers (#595, Dan Brown)
- cpan: Fix small bug in handling empty metadata fields (#712, Mathias Lafeldt)
- rpm: Fix bug when specifying both --architecture and --rpm-os (#707, #716; Alan Ivey)
- gem: Fix bug where --gem-version-bins is given but package has no bins (#688, Jan Vansteenkiste)
- deb: Set permissions correct on the package's internals. Makes lintian happier. (Jan Vansteenkiste)
- rpm: rpmbuild's _tmppath now respects --workdir (#714, Jordan Sissel)
- gem/rpm: Add --rpm-verbatim-gem-dependencies to use old-style (fpm 0.4.x)
rpm gem dependencies (#724, Jordan Sissel)
- gem/rpm: Fix bug for gem pessimistic constraints when converting to rpm (Tom Duckering)
- python: Fix small bug with pip invocations (#727, Dane Knecht)
1.1.0 (April 23, 2014)
- New package type: zip, for converting to and from zip files (Jordan Sissel)
- New package type: sh, a self-extracting package installation shell archive. (#651, Chris Gerber)
- 'fpm --version' will now emit the version of fpm.
- rpm: supports packaging fifo files (Adam Stephens)
- deb: Add --deb-use-file-permissions (Adam Stephens)
- cpan: Improve how fpm tries to find cpan artifacts for download (#614, Tim Nicholas)
- gem: Add --gem-disable-dependency for removing one or more specific rubygem
dependencies from the automatically-generated list (#598, Derek Olsen)
- python: Add --python-scripts-executable for setting a custom interpreter to
use for the hashbang line at the top of may python package scripts.
(#628, Vladimir Rutsky)
- Allow absolute paths with --directories even when --prefix is used (Vladimir Rutsky)
- dir: Now correctly identifies hardlinked files and creates a package correctly
with that knowledge (#365, #623, #659; Vladimir Rutsky)
- rpm: Add --rpm-auto-add-exclude-directories for excluding directories
from the --rpm-auto-add-directories behavior (#640, Vladimir Rutsky)
- general: --config-files now accepts directories and will recursively mark any
files within as config files inside the package (#642, Vladimir Rutsky)
- general: If you specify a --config-files path that doesn't exist, you will
now get an error. (#654, Alan Franzoni)
- python: Support --python-pypi when using --python-pip (#652, David Lindquist)
- deb: Tests now try to make packages ensure we don't upset lintian (#648, Sam Crang)
- rpm: Fix architecture targeting (#676, Rob Kinyon)
- rpm: Allow --rpm-user and --rpm-group to override the user/group even if
--rpm-use-file-permissions is enabled. (#679, Jordan Sissel)
- gem: Add --gem-version-bins for appending the gem version to the file name
of executable scripts a rubygem may install. (Jan Vansteenkiste)
- python: Attempt to provide better error messages for known issues in python
environments (#664, Jordan Sissel)
1.0.2 (January 10, 2013)
- rpm: No longer converts - to _ in dependency strings (#603, Bulat
Shakirzyanov)
- Handle Darwin/OSX tar invocations (now tries 'gnutar' and 'gtar'). (Jordan
Sissel)
- Process $HOME/.fpm, and $PWD/.fpm in the correct order and allow CLI flags
to override fpm config file settings. (#615, Jordan Sissel)
- Don't leave empty gem bin paths in packages that don't need them (#612,
Jordan Sissel)
- deb: Make --deb-compression=gz work correctly (#616, #617; Evan Krall,
Jason Yan)
1.0.1 (December 7, 2013)
- deb: Correctly handle --config-files given with a leading / (Jordan Sissel)
1.0.0 (December 5, 2013)
- Config file of flags is now supported. Searches for $HOME/.fpm and
$PWD/.fpm. If both exist, $HOME is loaded first so $PWD can override.
(Pranay Kanwar)
- pkgin: Basic support for SmartOS/pkgsrc's pkgin format. (#567, Brian Akins)
- cpan: catch more cases of perllocal.pod and delete them
(#510, Jordan Sissel)
- cpan: Correctly support module version selection (#518, Matt Sharpe)
- cpan: include builddeps in PERL5LIB when running cpan tests
(#500, Matt Sharpe)
- cpan: Avoid old system perl modules when doing module builds
(#442, #513; Matt Sharpe)
- python: safer gathering of python module dependencies.
- python: better handling of unicode strings in python package metadata
(#575, Bruno Renié)
- cpan: Support 'http_proxy' env var. (#491, Patrick Cable)
- deb: --deb-user and --deb-group both default to 'root' now
(#504, Pranay Kanwar)
- deb: convert '>' to '>>' in deb version constraints
(#503, #439, Pranay Kanwar)
- deb: Warn if epoch is set. Just so you know what's going on, since
the default filename doesn't include the epoch. (#502, Pranay Kanwar)
- deb,rpm: --config-files is now recursive if you give it a directory.
This seems to be the most expected behavior by users.
(#171, #506; Pranay Kanwar)
- dir: Respect -C when using path mapping (#498, #507; Pranay Kanwar)
- rpm: Add --rpm-ignore-iteration-in-dependencies to let you to depend
on any release (aka iteration) of the same version of a package.
(#364, #508; Pranay Kanwar)
- dir: Handle copying of special files when possible
(#347, #511, #539, #561; Pranay Kanwar)
- rpm: Don't mistake symlinks as actual directories (#521, Nathan Huff)
- npm: Choose an alternate npm registry with --npm-registry (#445, #524;
Matt Sharpe)
- cpan: Choose an alternate cpan server with --cpan-mirror. Additionally, you
can use --cpan-mirror-only to only use this mirror for metadata queries.
(#524, Matt Sharpe)
- deb: Fix broken --deb-changelog flag (#543, #544; Tray Torrance)
- deb: When --deb-upstart is given, automatically create an upstart-sysv
symlink /etc/init.d/<name> to /lib/init/upstart-job (#545, Igor Galić)
- rpm: Fix bug when generating spec file listings on files with strange
characters in the names. (#547, Chris Chandler)
- dir: Fix bug where the new directory mapping feature would cause you not
to be able to select files with '=' in the name for packaging.
(#556, #554; Pranay Kanwar)
- python: Fix some unicode string issues in package metadata
(#575, Bruno Renié)
- gem-rpm: Now respects the --gem-package-name-prefix when generating the
'rubygem(name)' provides statement (#585, Stepan Stipl)
- deb: Downcase and replace underscores with dashes in 'provides' list.
(#591, Eric Connell)
- deb: Fix a lintian complaint about md5sums permissions (#593, Sam Crang)
- cpan: Modules with 'MYMETA' files are now supported (#573, Michael Donlon)
0.4.42 (July 23, 2013)
- dir: make source=destination mappings behave the same way 'rsync -a' does
with respect to source and destination paths.
0.4.41 (July 17, 2013)
- cpan: handle cases where modules don't specify a license
- deb: support multiple init scripts (#487, patch by Kristian Glass)
0.4.40 (July 12, 2013)
- dir: supports mapping one path to another.
You set mappings by using 'source=destination' syntax. For example:
% fpm -s dir -t deb -n example /home/jls/.zshrc=/etc/skel/
The key above is the '=' symbol. The result of the above will be a package
containing only /etc/skel/.zshrc
For more, see https://github.com/jordansissel/fpm/wiki/Source:-dir#mapping
- python: the default scripts location is now chosen by python itself. The
previous default was "/usr/bin" and was not a good default. (#480)
- rpm: config files should have attributes (#484, patch by adamcstephens)
- python: correctly log the python setup.py exit code (#481, patch by Derek
Ludwig)
0.4.39 (June 27, 2013)
- cpan: support more complex dependency specifications (reported by Mabi
Knittel)
0.4.38 (June 24, 2013)
- cpan: fpm's cpan code now works under ruby 1.8.7
- python: fix a bug in dependency handling (#461, Pranay Kanwar)
- pear: Added --pear-data-dir flag (#465, Zsolt Takács)
- cpan: fix a bug with some clean up on certain 64bit systems
- gem: improve detection of the gem bin install path (#476, Tray Torrance)
- rpm: fix bug when calling using --rpm-use-file-permissions
(#464, Rich Horwood)
0.4.37 (May 30, 2013)
- deb: fix creation failures on OS X (#450, patch by Anthony Scalisi and
Matthew M. Boedicker)
- deb: you can now set --deb-build-depends. This is generally for extremely
rare use cases. (#451, patch by torrancew)
- perl: add --cpan-perl-lib-path for a custom perl library installation path
(#447, patch by Brett Gailey)
0.4.36 (May 15, 2013)
- pear: only do channel-discover if necessary (#438, patch by Hatt)
- cpan: now supports cpan modules that use Module::Build
- cpan: --no-cpan-test now skips tests for build/configure dependencies
- rpm: Add --rpm-defattrfile and --rpm-defattrdir flags (#428, patch
by phrawzty)
0.4.35 -- was not announced
0.4.34 (May 7, 2013)
- Now supports CPAN - Perl mongers rejoice! For example:
'fpm -s cpan -t deb DBI'
- deb: fixed some additional complaints by lintian (#420, patch by Pranay
Kanwar)
- rpm: add flags --rpm-autoreqprov, --rpm-autoreq, and --rpm-autoprov
to tell rpm to enable that feature in the rpm spec. (#416, patch by Adam
Stephens)
0.4.33 (April 9, 2013)
- Now supports npm, the node package manager. For example:
'fpm -s npm -t deb express'
0.4.32 (April 9, 2013)
- COMPATIBILITY WARNING: rpm: The default epoch is now nothing because this
aligns more closely with typical rpm packages in the real world. This
decision was reached in #381. If you need the previous behavior, you
must now specify '--epoch 1' (#388, patch by Pranay Kanwar)
- python: new flag --python-obey-requirements-txt which makes a
requirements.txt file from the python package used for the package
dependencies instead of the usual setup.py dependencies. The default
behavior without this flag is to respect setup.py. (#384)
- deb: new flag --deb-shlibs to specify the content of the 'shlibs' file
in the debian package (#405, patch by Aman Gupta)
- deb: fixed a few lintian errors (empty conffiles, md5sums on symlinks, etc)
- Add '-f' / '--force' flag to force overwriting an existing package output
path (#385, Timothy Sutton)
- New flag: --no-auto-depends flag to skip any automatic dependencies
that would normally be added by gem, python, deb, and rpms input packages.
(#386, #374; patch by Pranay Kanwar)
- gem: Use 'gem' command to download gems and read gem package information.
(#389, #394, #378, #233; patches by Pranay Kanwar and Chris Roberts)
- rpm: dashes are now replaced with underscores in rpm version strings
(#395, #393, #399; patches by Jeff Terrace and Richard Guest)
- python: Only use the first line of a license; some python packages (like
'requests') embed their full license copy into the license field. For
the sake of sanity and function with most packaging systems, fpm only
uses the first line of that license.
- rpm: Add new 'none' option to --rpm-compression to disable compression
entirely. (#398, patch by Richard Guest)
- deb: Make dependencies using the '!=' operator represented as "Breaks"
in the deb package (previously used "Conflicts"). (#400)
- deb: Add md5sums to the debian packages which improves correctness
of the package. (#403, #401; patch by Pranay Kanwar)
- rpm: Convert all '!=' dependency operators to 'Conflicts'. Previously,
this only applied to packages converting from python to rpm.
(#404, #396; patch by Pranay Kanwar)
0.4.31 (March 21, 2013)
- rpm: new flag --rpm-use-file-permissions which try to create an rpm
that has file ownership/modes that exactly mirror how they are on
the filesystem at package time. (#377, patch by Paul Rhodes)
- general: remove empty directories only when they match the exclude
pattern (#323, patch by Pranay Kanwar)
0.4.30 (March 21, 2013)
- Solaris: --solaris-user and --solaris-group flags to specify
the owner of files in a package. (#342, patch by Derek Olsen)
- rpm: (bug fix) epoch of 0 is permitted now (#343, patch by Ben Hughes)
- pear: add flags --pear-bin-dir --pear-php-bin --pear-php-dir (#358, patch
by Zsolt Takács)
- New 'source' type: empty. Allows you to create packages without any files
in them (sometimes called 'meta packages'). Useful when you want to have
one package be simply dependencies or when you want to spoof a package
you don't want installed, etc. (#359, 349; patch by Pranay Kanwar)
- solaris: Add --solaris-user and --solaris-group flags (#342, Patch by Derek
Olsen)
- gem: new flag --env-shebang; default true (disable with --no-env-shebang).
Lets you disable #! (shebang) mangling done by gem installation. (#363,
patch by Grier Johnson)
- deb: fix bug on changelog handling (#376, patch by mbakke)
- rpm: fix --rpm-rpmbuild-define (#383, patch by Eric Merritt)
0.4.29 (January 22, 2013)
- Copy links literally, not what they point at (#337, patch by Dane Knecht)
0.4.28 (January 21, 2013)
- Fix a dependency on the 'cabin' gem. (#344, reported by Jay Buffington)
0.4.27 (January 16, 2013)
- Make all fpm output go through the logger (#329; patch by jaybuff)
- New package type: osxpkg, for building packages installable on OS X. (#332,
patch by Timothy Sutton)
- Fix crash bug when converting rpms to something else (#316, #325; patch by
rtucker-mozilla)
- deb: Add --deb-field for setting a custom field in the control file.
For more information on this setting, see section 5.7 "User-defined fields"
of the debian policy manual:
http://www.debian.org/doc/debian-policy/ch-controlfields.html#s5.7
- deb: Add --deb-recommends and --deb-suggests (#285, #310; patch by Pranay
Kanwar)
- python to rpm: convert "!=" dependency operators in python to "Conflicts"
in rpm. (#263, #312; patch by Pranay Kanwar)
- python: fix bug - ignore blank lines in requirements.txt (#312, patch by
Pranay Kanwar)
0.4.26 (December 27, 2012)
- rpm: add --rpm-sign flag to sign packages using the 'rpmbuild --sign' flag.
(#311, Patch by Pranay Kanwar)
- rpm: fix flag ordering when calling rpmbuild (#309, #315, patch by Trotter
Cashion)
- deb: re-enable "Predepends" support (#319, #320, patch by Pranay Kanwar)
- rpm: fix default 'rpm os' value (#321, 314, 309)
0.4.25 (December 7, 2012)
- Added --deb-changelog and --rpm-changelog support flags. Both take a path to
a changelog file. Both must be valid changelog formats for their respective
package types. (#300, patch by Pranay Kanwar)
- deb: Multiple "provides" are now supported. (#301, patch by Pranay Kanwar)
- rpm: Added --rpm-os flag to set the OS target for the rpm. This lets you build
rpms for linux on OS X and other platforms (with --rpm-os linux). (#309)
- rpm: Avoid platform-dependent commands in the %install phase (#309, fixes
'cp -d' on OSX)
- python: ignore comments in requirements.txt (#304, patch by Pranay Kanwar)
- Fixed warning 'already initialized constant' (#274)
0.4.24 (November 30, 2012)
- Don't include an empty url in rpm spec (#296, #276; patch by Pranay Kanwar)
- Don't require extra parameters if you use --inputs (#278, #297; Patch by
Pranay Kanwar)
- python: supports requirements.txt now for dependency information.
- python: supports pip now. Use '--python-pip path/to/pip' to have fpm use
it instead of easy_install.
- solaris: package building works again (#216, #299, patch by Pierre-Yves
Ritschard)
0.4.23 (November 26, 2012)
- The --directories flag is now recursive when the output package is rpm.
This makes all directories under a given path as owned by the package
so they'll be removed when the package is uninstalled (#245, #293, #294,
patch by Justin Ellison)
- Add fpm version info to '--help' output (#281)
- gem to rpm: Use 'rubygem(gemname)' for dependencies (#284, patch by
Jan Vansteenkiste)
- Fix a bug in gem version mangling (#292, #291; patch by Pranay Kanwar)
- Fix compatibility with Python 2.5 (#279, patch by Denis Bilenko)
0.4.22 (November 15, 2012)
- Add --no-depends flag for creating packages with no dependencies listed
(#289, patch by Brett Gailey)
- Fix a bug where blank lines were present in a debian control file.
(#288, patch by Andrew Bunday)
0.4.21 (November 8, 2012)
- gem: remove restriction on expected gem names (#287)
- add --directory flag; lets you mark a directory as being owned by a
package. (#260, #245, patch by ajf8)
- deb: don't include a version in the Provides field (#280)
- gem: if the version is '1.1' make it imply '1.1.0' (#269, patch by
Radim Marek)
0.4.20 (October 5, 2012)
- python: only specify --install-{scripts,lib,data} flags to setup.py if
they were given on the command line to fpm. Fixes #273.
0.4.19 (September 26, 2012)
- Escape '%' characters in file names (#266, #222. Patch by John Wittkoski)
0.4.18 (September 25, 2012)
- Fix regression in rpm building where the epoch in was missing in the rpm,
but prior fpm versions defaulted it to 1. This caused rpms built with newer
fpms to appear "older" than older rpms. Tests added to ensure this regression
is caught prior to future releases! (Reported by eliklein)
0.4.17 (September 12, 2012)
- Remove accidental JSON warning when using '-s python'
0.4.16 (September 6, 2012)
- Fix compatibility with Ruby 1.8.7 (broken in 0.4.15)
0.4.15 (September 6, 2012)
- pear: support custom channels with --pear-channel <channel> (#207)
Example: fpm -s pear -t deb --pear-channel pear.drush.org drush
- permit literal '\n' in --description, fpm will replace with a newline
character. Example: fpm --description "line one\nline two" (#251)
- improve error messaging when trying to output a package to a directory that
doesn't exist (#244)
- deb: convert '>' and '<' dependency operators to the correct '>>' and '<<'
debian version operators (#250, patch by Thomas Meson).
- deb: add --deb-priority flag (#232) for setting the debian 'priority'
value for your package.
- add --template-value. Used to expose arbitrary values to script templates.
If you do --template-value hello=world, in your template you can do
<%= hello %> to get 'world' to show up in your maintainer scripts.
- python: add --python-install-data flag to set the --install-data option to
setup.py (#255, patch by Thomas Meson)
- Reject bad dependency flags (ones containing commas) and offer alternative.
(#257)
- Try to copy a file if hardlinking fails with permission problems (#253,
patch by Jacek Lach)
- Make --exclude, if a directory, include itself and any children, recursive.
(#248)
0.4.14 (August 24, 2012)
- rpm: Replace newlines with space in any license setting. (#252)
0.4.13 (August 14, 2012)
- Make --exclude accept path prefixes as well. If you have a files in
'usr/share/man' in your package, you can now exclude all of a subdir
by doing '--exclude usr/share/man'
0.4.12 (August 10, 2012)
- Fix a major bug introduced in 0.4.11 that caused all deb packages to
contain empty maintainer scripts if not otherwise specified, which made
apt/dpkg quite unhappy
0.4.11 (August 7, 2012)
- Fix some symlink handling to prevent links from being followed during
cleanup (#228, patch by sbuss)
- rpm: 'vendor' in rpm spec is now omitted if empty or nil. This fixes a bug
where rpmbuild fails due to empty 'Vendor' tag if you convert rpm to rpm.
- internal: remove empty directories marked by --exclude (#205, patch by
jimbrowne)
- dir: don't try to set utime on symlinks (#234, #240, patch by ctgswallow)
- rpm: relocatable rpms now supported when using the '--prefix' flag.
Example: fpm -s dir -t rpm --prefix /usr/local -n example /etc/motd
(patch by jkoppe)
- deb: --deb-compression flag: Support different compression methods.
Default continues to be gzip.
- new flag: --template-scripts. This lets you write script templates for
--after-install, etc. Templates are ERB, so you can do things like
'<%= name %>' to get the package name in the script, etc.
- warn on command invocations that appear to have stray flags to try and
help users who have complex command lines that are failling.
0.4.10 (May 25, 2012)
- Fix python package support for python3 (#212, patch by Slezhuk Evgeniy)
- Preserve file metadata (time, owner, etc) when copying with the dir
package. (#217, patch by Marshall T. Vandegrift)
- Missing executables will now error more readably in fpm.
- Fix gem and python 'version' selection (#215, #204)
- Dependencies using '!=' will now map to 'Conflicts' in deb packages. (#221,
patch by Sven Fischer)
- Allow setting default user/group for files in rpm packages (#208, patch by
Jason Rogers). Note: This adds --user and --group flags to effect this.
These flags may go away in the future, but if they do, they will be
- In python packages set 'install-data' correctly. (#223, patch by Jamie
Scheinblum)
0.4.9 (April 25, 2012)
- Fix --prefix support when building gems (#213, patch by Jan Vansteenkiste)
0.4.8 (April 25, 2012)
- RPM: use 'noreplace' option for config files (#194, patch by Steve Lum)
- Python: Fix bug around exact dependency versions (#206, patch by Lars van
de Kerkhof)
- Gem->RPM: Make 'provides' "rubygem(thegemname)" instead of "rubygem-thegemname"
- Fix oddity where Ruby would complain about constant redefinition (#198,
patch by Marcus Vinicius Ferreira)
0.4.7 skipped.
0.4.6 (April 10, 2012)
- Work around more problems in RPM with respect to file listing (#202)
0.4.5 (April 3, 2012)
- Fix gem->rpm conversion where the '~>' rubygem version operator (#193,
patch by antoncohen)
- Escape filenames RPM install process (permits files with spaces, dollar signs, etc)
(#196, reported by pspiertz)
0.4.4 (March 30, 2012)
- Fix a bug in gem bin_dir handling (Calen Pennington)
- The --config-files flag should work again (Brian Akins)
- Fix syntax error when using --deb-pre-depends (Andrew Bennett)
- Make --exclude work again (#185, #186) (Calen Pennington)
- Fix file listing so that rpm packages don't declare ownership on / and
/usr, etc.
- make --deb-custom-control to work again (Tor Arne Vestbø)
- Add --rpm-digest flag to allow selection of the rpm 'file name' digest
algorithm. Default is 'md5' since it works on the most rpm systems.
- Reimplement old behavior assuming "." as the input when using '-s dir' and
also setting -C (#187)
- Set BuildRoot on rpm to work around an rpmbuild bug(?) on CentOS 5 (#191)
- Add --rpm-compression flag to allow selection of the rpm payload
compression. Default is 'gzip' since it works on the most rpm systems
- Specs now pass on ubuntu/32bit systems (found by travis-ci.org's test runner)
- Improve default values of iteration and epoch (#190)
- Make FPM::Package#files list only 'leaf' nodes (files, empty directories,
symlinks, etc).
0.4.3 (March 21, 2012)
- Fix bug in python packaging when invoked with a relative path to a setup.py
(Reported by Thomas Meson, https://github.com/jordansissel/fpm/pull/180)
0.4.2 (March 21, 2012)
- Set default temporary directory to /tmp
(https://github.com/jordansissel/fpm/issues/174)
- Improve symlink handling (patch by Aleix Conchillo Flaqué, pull/177))
- Python package support changes (thanks to input by Luke Macken):
* New flag: --python-install-bin. Sets the location for python package
scripts (default: /usr/bin)
* New flag: --python-install-lib. Sets the location for the python
package to install libs to, default varies by system. Usually something
like /usr/lib/python2.7/site-packages.
* Fix up --prefix support
* Improve staged package installation
0.4.1 (March 19, 2012)
- Fix fpm so it works in ruby 1.8 again.
Tests run, and passing:
rvm 1.8.7,1.9.2,1.9.3 do bundle exec rspec
0.4.0 (March 18, 2012)
- Complete rewrite of pretty much everything.
* Otherwise, the 'fpm' command functionality should be the same
* Please let me know if something broke!
- Now has an API (see examples/api directory)
- Also has a proper test suite
- Updated the rpm spec generator to disable all the ways I've found rpmbuild
to molest packages. This means that fpm-generated rpms will no longer
strip libraries, move files around, randomly mutate jar files, etc.
- Add --license and --vendor settings (via Pieter Loubser)
- python support: try to name python packages sanely. Some pypi packages
are literally called 'python-foo' so make sure we generate packages named
'python-foo' and not 'python-python-foo' (via Thomas Meson)
- rpm support: Add --rpm-rpmbuild-define for passing a --define flag to rpmbuild
(via Naresh V)
- PHP pear source support (fpm -s pear ...) (via Andrew Gaffney)
0.3.10 (Oct 10, 2011)
- Allow taking a list of files/inputs on stdin with '-' or with the --inputs
flag. (Matt Patterson)
- (python) pass -U to easy_install (Khalid Goudeaux)
- (debian) quote paths in md5sum calls (Matt Patterson)
- (debian) quiet stderr from dpkg --print-architecture
0.3.9 (Sep 8, 2011)
- Fix bug in 'dir' source that breaks full paths
- Added a bunch of tests (yaay)
0.3.8 and earlier: I have not kept this file up to date very well... Sorry :(
0.2.29 (May 20, 2011)
- Add 'tar' source support. Useful for binary releases to repackage as rpms
and debs. Example:
fpm -s tar -t rpm -n firefox -v 4.0.1 \
--prefix /opt/firefox/4.0.1 firefox-4.0.1.tar.bz2
0.2.28 (May 18, 2011)
- Use --replaces as "Obsoletes" in rpms.
0.2.27 (May 18, 2011)
- If present, DEBEMAIL and DEBFULLNAME environment variables will be used as
the default maintainer. Previously the default was simply <$user@$hostname>
https://github.com/jordansissel/fpm/issues/37
- Add '--replaces' flag for specifying packages replaced by the one you are
building. This only functions in .deb packages now until I find a suitable
synonym in RPM.
- Add --python-bin and --python-easyinstall flags. This lets you choose specific
python and easy_install tools to use when building. Default is simply
'python' and 'easy_install' respectively.
- Add support for ~/.fpmrc - The format of this file is the same as the flags.
One flag per line. https://github.com/jordansissel/fpm/issues/38
Example:
--python-bin=/usr/bin/python2.7
--python-easyinstall=/usr/bin/easy_install2.7
0.2.26 and earlier
No changelist tracked. My bad, yo.

739
CHANGELOG.rst Normal file
View File

@ -0,0 +1,739 @@
Release Notes and Change Log
============================
1.17.0 (October 2, 2025)
^^^^^^^^^^^^^^^^^^^^^^^^
* python: Support modern Python project features: pyproject.toml, wheels, etc. Now, any project that can be built or installed with ``pip`` can be packaged by fpm. Previously, fpm relied on a long-deprecated features in setup.py to see a python project's metadata such as name, version, and dependencies. Fpm now uses python's package tools to identify the project's name, version, dependencies, and other information. (`#2104`_, `#2105`_, `#2040`_, `#1982`_, `#2029`_; Jordan Sissel, cwegener, amdei, gmabey)
* dir: When copying files, only use hardlinks if the original files were also hardlinks. (`#2103`_, `#2102`_; Michael Telatynski, Matthew Rathbone, Jordan Sissel). :w
Related: https://github.com/electron-userland/electron-builder/issues/5721
* deb: bug fix: when a file given with ``--config-files <path>`` copied into the package, fpm was forgetting to mark the file as being a config file in the package, aka Debian "conffiles" (`#2027`_, `#1823`_; Alexandr Zarubkin, Kientz Arnaud)
* pacman: Now can build packages with aarch64 and arm7hf architecture (`#2017`_; Markson Hon)
* rpm: Paths with '{' and '}' characters can now be included in rpms (`#2088`_ `#2087`_; Jordan Sissel, Manish2481983)
* docs: Updated urls which pointed at rpm documentation (`#2092`_, `#2011`_, `#2054`_; André Kelpe, Natanael Arndt)
* Ruby 3.4.0 no longer gives warnings related to `ostruct` (`#2106`_, also `#2104`_ and `#2103`_; Jordan Sissel)
1.16.0 (December 8, 2024)
^^^^^^^^^^^^^^^^^^^^^^^^^
* deb: Add support for zstd compression (`#2009`_, `#2084`_; Ștefan Rusu)
* deb: Add compression level setting, ``--deb-compression-level`` (`#2036`_; Hugo Beauzée-Luyssen)
* rpm: Generate an empty rpm changelog if none is given. This should help cases where ``rpmlint`` would complain about missing a changelog entry in the rpm. (`#2041`_; Gordon Bleux)
* deb: When converting from an rpm, remove package information that is not valid on Debian systems. (`#2053`_, `#1627`; Jordan Stopford, Jamesits)
* python: Fix bug when PYTHONPATH has spaces in it (`#2062`_; Kristof Willaert)
* deb: You can now choose a different systemd directory with ``--deb-systemd-path`` (`#2063`_; Reinier Schoof)
* freebsd: OS version can now be specified with ``--freebsd-osversion``: (`#2064`_; David Newhall II)
* freebsd: Improve the 'architecture' value used by fpm to generate freebsd packages (`#2064`_, `#1880`_; David Newhall II, Matthew R Kasun)
* deb: Timer units can be given to ``--deb-systemd`` now (`#2065`_, `#1978`_; phillipp, Robert Schneider)
* rpm: When converting cpan packages, use newer ``perl-interpreter`` dependency name. To use the old dependency name ``perl``, use the flag ``--rpm-old-perl-dependency-name`` (`#2066`_, `#2085`_; Kevin Duret, Nicholas Hubbard, William N. Braswell, Jr., Jordan Sissel))
* Some errors now correctly print just an error message instead of dumping a ruby stack trace (`#2067`_; Jordan Sissel)
* python: Support modules which download as zip files (`#2068`_, `#2074`_, `#2072`_; Matt Ezell, hussainbani, hbani)
* rpm: Fix rpm build failures on Fedora 41 (`#2082`_, `#2076`_; Wayne Heaney, Antheas Kapenekakis, Romain Geissler)
1.15.1 (January 31, 2023)
^^^^^^^^^^^^^^^^^^^^^^^^^
* Ruby 3.2.0 now supported. This fixes error 'undefined method exists? for File' '(`#1981`_, `#1988`_; Nicholas Hubbard, romulasry)
1.15.0 (November 13, 2022)
^^^^^^^^^^^^^^^^^^^^^^^^^^
* New flag ``--fpm-options-file path/to/file`` which allows you to specify additional fpm flags in an external file of your choosing. (`#1905`_, `#1902`_, `#1827`_; Jordan Sissel, Will Furnell, hjpotter92)
* deb: Periods are now accepted in package names (`#1899`_; C. Cooke)
* Fix bug where fpm would crash if ``--workdir`` pointed at a path that didn't
exist. (`#1959`_; Jordan Sissel)
* osxpkg: this package format now supports the fpm ``--prefix`` flag(`#1909`_, `#1908`_; Jordan Sissel, mcataga)
* cpan: Fix bug where fpm would fail on certain Perl modules due to their source tarball structure (`#1940`_; Nicholas Hubbard, William N. Braswell, Jr.)
* cpan: Fix crash on certain CPAN modules where the author field was blank (`#1942`_, `#1937`_, `#1523`_, `#1528`_; Nicholas Hubbard, William N. Braswell, Jr.)
* deb: The distribution field of the debian changelog and changes files will now use the value set by ``--deb-dist`` (default is "unstable") (`#1934`_; Chabert Loïc)
* python: Fix errors in how fpm invoked ``pip``. Previously, fpm would use pip's ``--build`` flag, but this was removed a while ago, and fpm is now aware! (`#1896`_, `#1831`_, `#1893`_, `#1916`_; Jordan Sissel, Svyatogor Chuykov)
* pleaserun: Add ``--pleaserun-user`` flag. (`#1912`_; Evgeny Stambulchik)
* deb: The default ``--deb-priority`` is now "optional" instead of "extra" (`#1913`_; Chris Novakovic)
* Enable installation of fpm on older versions of ruby. This change removed ``git`` rubygem dependency. (`#1946`_, `#1923`_; Jordan Sissel, Andreas Wirooks, Ruslan Kuprieiev, jamshid, Lorenzo Castellino, Sam Hughes)
* Enable operation of fpm on very old versions of ruby (as old as Ruby 1.9.3). This changed removed ``json`` rubygem dependency. (`#1950`_, `#1949`_, `#1741`_, `#1264`_, `#1798`_, `#1800`_, `#1784`_; Jordan Sissel and many others)
* Fix bug where subprocesses could hang waiting for input (`#1955`_, `#1519`_, `#1522`_; Nicholas Hubbard, William N. Braswell, Jr.)
* Update Dockerfile to use ubuntu:20.04 (`#1935`_; Gnought)
* internal: Fix a code typo (`#1948`_; Nicholas Hubbard)
* internal tests: Support newer versions of lintian (`#1939`_, `#1907`_; Jordan Sissel)
* Improve support for Ruby 3.1.0 and newer that would previously crash with an error mentioning Psych::DisallowedClass (`#1898`_, `#1895`_; Jordan Sissel, Alexandre ZANNI)
* Improve support for Ruby 3.1.0 and newer that changed the API for ERB (`#1897`_; Jordan Sissel)
1.14.2 (March 30, 2022)
^^^^^^^^^^^^^^^^^^^^^^^
* deb: fix bug causing ``--deb-compression none`` to invoke ``tar`` incorrectly (`#1879`_; John Howard)
* rpm: Better support for paths that have spaces and mixed quotation marks in them. (`#1882`_, `#1886`_, `#1385`_; John Bollinger and Jordan Sissel)
* pacman: Fix typo preventing the use of ``--pacman-compression xz`` (`#1876`_; mszprejda)
* docs: All supported package types now have dedicated documentation pages. Some pages are small stubs and would benefit from future improvement. (`#1884`_; mcandre, Jordan Sissel)
* docs: Small but lovely documentation fixes (`#1875`_ by Corey Quinn, `#1864`_ by Geoff Beier)
* Fixed mistake causing the test suite to fail when ``rake`` wasn't available. (`#1877`_; Jordan Sissel)
1.14.1 (November 10, 2021)
^^^^^^^^^^^^^^^^^^^^^^^^^^
* Fix a bug that impacted fpm api usage (from other ruby programs) that caused an error "NameError: uninitialized constant FPM::Package::CPAN" when trying to output a Deb package. (`#1854`_, `#1856`_; Karol Bucek, Jordan Sissel)
1.14.0 (November 9, 2021)
^^^^^^^^^^^^^^^^^^^^^^^^^
* python: Use pip by default for fetching Python packages. This matches the Python 3 "installation" docs which recommend calling pip as ``python -m pip`` where ``python`` depends on ``--python-bin`` (default "python"). Previous default was to use `easy_install` which is no longer available on many newer systems. To use easy_install, you can set ``--no-python-internal-pip`` to revert this pip default. Further, you can specify your own pip path instead of using ``python -m pip`` with the ``--python-pip /path/to/pip`` flag. (`#1820`_, `#1821`_; Jordan Sissel)
* python: Support extras_require build markers in python packages (`#1307`_, `#1816`_; Joris Vandermeersch)
* freebsd: Fix bug which caused fpm to generate incorrect FreeBSD packages "missing leading `/`" (`#1811`_, `#1812`_, `#1844`_, `#1832`_, `#1845`_; Vlastimil Holer, Clayton Wong, Markus Ueberall, Jordan Sissel)
* deb: In order to only allow fpm to create valid packages, fpm now rejects packages with invalid "provides" (``--provides``) values. (`#1829`_, `#1825`_; Jordan Sissel, Peter Teichman)
* deb: Only show a warning about /etc and config files if there are files in /etc (`#1852`_, `#1851`_; Jordan Sissel)
* rpm: replace dash with underscore in rpm's "Release" field aka what fpm calls ``--iteration``. (`#1834`_, `#1833`_; Jordan Sissel)
* empty: `fpm -s empty ...` now defaults to "all" architecture instead of "native". (`#1850`_, `#1846`_; Jordan Sissel)
* Significant documentation improvements rewriting most of the documentation. New overview pages, full CLI flag listing, and new sections dedicated package types (rpm, cpan, deb, etc). (`#1815`_, `#1817`_, `#1838`_; Vedant K, Jordan Sissel)
* Typo fixes in documentation are always appreciated! (`#1842`_; Clayton Wong)
* fpm can now (we hope!) now be tested more easily from docker (`#1818`_, `#1682`_, `#1453`_; @directionless, Jordan Sissel, Douglas Muth)
1.13.1 (July 6, 2021)
^^^^^^^^^^^^^^^^^^^^^
* deb: The `--provides` flag now allows for versions. Previously, fpm would
remove the version part of a provides field when generating deb packages.
(`#1788`_, `#1803`_; Jordan Sissel, Phil Schwartz, tympanix)
* osxpkg: Update documentation to include installing `rpm` tools on OSX
(`#1797`_; allen joslin)
1.13.0 (June 19, 2021)
^^^^^^^^^^^^^^^^^^^^^^
* Apple M1 users should now work (`#1772`_, `#1785`_, `#1786`_; Jordan Sissel)
* Removed `ffi` ruby library as a dependency. This should make it easier to support a wider range of Ruby versions (Ruby 2.2, 3.0, etc) and platforms (like arm64, Apple M1, etc) in the future. (`#1785`_, `#1786`_; Jordan Sissel)
* Now uses the correct architecture synonym for ARM 64 systems. Debian uses `arm64` as a synonym for what other systems call `aarch64` (linux kernel, RPM, Arch Linux). (`#1775`_; Steve Kamerman)
* Docs: Fix a typo in an example (`#1785`_; Zoe O'Connell)
* rpm: File paths can now contain single-quote characters (`#1774`_; Jordan Sissel)
* rpm: Use correct SPEC syntax when using --after-upgrade or similar features (`#1761`_; Jo Vandeginste. Robert Fielding)
* Ruby 3.0 support: Added `rexml` as a runtime dependency. In Ruby 2.0, `rexml` came by default, but in Ruby 3.0, `rexml` is now a bundled gem and some distributiosn do not include it by default. (`#1794`_; Jordan Sissel)
* Fix error "git: not found (Git::GitExecuteError)". Now loads `git` library only when using git features. (`#1753`_, `#1748`_, `#1751`_, `#1766`_; Jordan Sissel, Cameron Nemo, Jason Rogers, Luke Short)
* deb: Fix syntax error in `postinst` (`--after-install`) script. (`#1752`_, `#1749`_, `#1764`_; rmanus, Adam Mohammed, Elliot Murphy, kimw, Jordan Sissel)
* deb: --deb-compression now uses the same compression and file suffix on the control.tar file (`#1760`_; Philippe Poilbarbe)
1.12.0 (January 19, 2021)
^^^^^^^^^^^^^^^^^^^^^^^^^
* Pin ffi dependency to ruby ffi 1.12.x to try keeping fpm compatible with older/abandoned rubies like 2.0 and 2.1. (`#1709`_; Matt Patterson)
* deb: New flag to add 'set -e' to all scripts. `--deb-maintainerscripts-force-errorchecks` which defaults to off. (`#1697`_; Andreas Ulm)
* deb: Fix bug when converting rubygems to debs where certain constraints like `~>1` would generate a deb dependency that couldn't be satisfied. (`#1699`_; Vlastimil Holer)
* deb: Fix error 'uninitialized constant FPM::Package::Deb::Zlib' (`#1739`_, `#1740`_; Federico Lancerin)
* python: Prepend to PYTHONPATH instead of replacing it. This should help on platforms that rely heavily on PYTHONPATH, such as NixOSX (`#1711`_, `#1710`_; anarg)
* python: Add `--python-trusted-host` flag which passes `--trusted-host` flag to `pip` (`#1737`_; Vladimir Ponarevsky)
* Documentation improvements (`#1724`_, `#1738`_, `#1667`_, `#1636`_)
* Dockerfile updated to Alpine 3.12 (`#1745`_; Cameron Nemo)
* Remove the 'backports' deprecation warning (`#1727`_; Jose Galvez)
* sh: Performance improvement when printing package metadata (`#1729`_; James Logsdon, Ed Healy)
* rpm: Add support for `xzmt` compression (multithreaded xz compressor) to help when creating very large packages (several gigabytes). (`#1447`_, `#1419`_; amnobc)
* rpm: Add `--rpm-macro-expansion` flag to enable macro expansion in scripts during rpmbuild. See https://rpm.org/user_doc/scriptlet_expansion.html for more details. (`#1642`_; juliantrzeciak)
* deb: use correct control.tar filename (`#1668`_; Mike Perham)
1.11.0 (January 30, 2019)
^^^^^^^^^^^^^^^^^^^^^^^^^
* snap: Snap packages can now be created! (`#1490`_; kyrofa)
* Fix an installation problem where a dependency (childprocess) fails to install correctly. (#1592; Jordan Sissel)
1.10.2 (July 3, 2018)
^^^^^^^^^^^^^^^^^^^^^
* cpan: Fix a crash where fpm would crash trying to parse a perl version string (`#1515`_, `#1514`; Jordan Sissel, William N. Braswell, Jr)
1.10.1 (July 3, 2018)
^^^^^^^^^^^^^^^^^^^^^
* cpan: Fixes some package building by setting PERL5LIB correctly (`#1509`_, `#1511`_; William N. Braswell, Jr)
* cpan: Adds `--[no-]cpan-verbose` flag which, when set, runs `cpanm` with the `--verbose` flag (`#1511`_; William N. Braswell, Jr)
1.10.0 (May 21, 2018)
^^^^^^^^^^^^^^^^^^^^^
* Pin `ruby-xz` dependency to one which allows Ruby versions older than 2.3.0 (`#1494`_; Marat Sharafutdinov)
* Documentation improvements: `#1488`_; Arthur Burkart. `#1384`_; Justin Kolberg. `#1452`_; Anatoli Babenia.
* python: Improve support for the `~=` dependency comparison. (`#1482`_; Roman Vasilyev)
* deb: Add `--deb-generate-changes` flag to have fpm output a `.changes` file (`#1492`_; Spida)
* deb: Add `--deb-dist` flag to set the target distribution (similar to `--rpm-dist`). (`#1492`_; Spida)
* apk: Make --before-install, --before-upgrade, and --after-upgrade work correctly. (`#1422`_; Charles R. Portwood II)
* rpm: add `xzmt` for multithreaded xz compression (Amnon BC)
* rpm: fix shell function name `install` conflicting with `install` program. In
postinst (after-install), the function is now called `_install` to avoid
conflicting with `/usr/bin/install` (`#1434`_; Torsten Schmidt)
* rpm: Allow binary "arch dependent" files in noarch rpms (Jordan Sissel)
* - deb: --config-files ? (`#1440`_, `#1443`_; NoBodyCam)
* FPM source repo now contains a Brewfile for use with Homebrew.
* FPM source repo has a Dockerfile for invoking fpm with docker. (`#1484`_, ;Allan Lewis
1.9.3 (September 11, 2017)
^^^^^^^^^^^^^^^^^^^^^^^^^^
* fix a bug when coyping a symlink using path mapping would result in the link creating a directory to hold think. (`#1395`_; Nemanja Boric)
1.9.2 (July 29, 2017)
^^^^^^^^^^^^^^^^^^^^^
* rpm: Fix `--config-files` handling (`#1390`_, `#1391`_; Jordan Sissel)
1.9.1 (July 28, 2017) happy sysadmin day!
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
* Documentation improvements: `#1291`_; Pablo Castellano. `#1321`_; ge-fa. `#1309`_; jesusbagpuss. `#1349`_; Perry Stole. `#1352`_, Jordan Sissel. `#1384`_; Justin Kolberg.
* Testing improvements: `#1320`_; Rob Young. `#1266`_; Ryan Parman. `#1374`_; Thiago Figueiró.
* Fix bug so fpm can now copy symlinks correctly (`#1348`_; ServiusHack)
* apk: Improve performance (`#1358`_; Jan Delgado)
* cpan: Fix crash when CPAN query returns a version value that was a number and fpm was expecting a string. (`#1344`_, `#1343`_; liger1978)
* cpan: Fix MetaCPAN searches to use v1 of MetaCPAN's API. The v0 API is no longer provided by MetaCPAN. (`#1341`_, `#1339`_; Bob Bell)
* cpan: Have perl modules implicitly "provide" (`--provides`) capabilities. (`#1340`_; Bob Bell. `#1345`_; liger1978)
* cpan: Now transforms perl version values like "5.008001" to "5.8.1" (`#1342`_; Bob Bell)
* cpan: Use `>=` ("this version or newer") for package dependencies instead of `=` ("exactly this version"). (`#1338`_; Bob Bell)
* deb: Add `--deb-after-purge` flag for running a script after `apt-get purge` is run. (Alexander Weidinger)
* deb: fix bug when using `--deb-upstart` would use the wrong file name (`#1325`_, `#1287`_; vbakayev)
* deb: New flags `--deb-interest-noawait` and `--deb-activate-nowait`. (`#1225`_, `#1359`_; Philippe Poilbarbe)
* dir: Remove a debug statement that would put fpm into a debug prompt (`#1293`_, `#1259`_; Joseph Anthony Pasquale Holsten)
* dir: When using `path mapping`_ (`a=b` syntax), and `a` is a symlink, use the path `b` as the symlink, not `b/a` (`#1253`_, Nemanja Boric)
* gem: Can now make reproducible_builds_ when building a deb (`-s gem -t deb`). See the `Deterministic output`_ docs.
* gem: Add `--gem-embed-dependencies` flag to include in the output package all dependent gems of the target. For example, `fpm -s gem -t rpm --gem-embed-dependencies rails` will create a single `rails` rpm that includes active_support, active_record, etc.
* pleaserun: Add more flags (`--pleaserun-chdir`, `--pleaserun-user`, etc) to allow more customization of pleaserun services. (`#1311`_; Paulo Sousa)
* python: Add `--python-setup-py-arguments` flag for passing arbitrary flags to `python setup.py install` (`#1120`_, `#1376`_; Ward Vandewege, Joseph Anthony Pasquale Holsten)
* rpm: --config-files can now copy files from outside of the package source. This means you can do things like `fpm -s gem -t rpm --config-files etc/my/config` and have `etc/my/config` come from the local filesystem. (`#860`_, `#1379`_; jakerobinson, Joseph Anthony Pasquale Holsten)
* tar: Only create `.scripts` directory if there are scripts to include (`#1123`_, `#1374`_; Thiago Figueiró)
* virtualenv: Add `--virtualenv-find-links` flag which appends `--find-links` to the `pip install` command.
* virtualenv: documentation improvements (Nick Griffiths)
* virtualenv: Make `--prefix` useful and deprecate `--virtualenv-install-location` (`#1262`_; Nick Griffiths)
* zip: fix bug in output where the temporary directory would be included in the file listing (`#1313`_, `#1314`_; Bob Vincent)
* Other: Remove unused archive-tar-minitar as a dependency of fpm (`#1355`_; Diego Martins)
* Other: Add stud as a runtime dependency (`#1354`_; Elan Ruusamäe)
.. _reproducible_builds: https://reproducible-builds.org/
.. _path mapping: source/dir.html#path-mapping
.. _Deterministic output: source/gem.html
1.9.0 (July 28, 2017)
^^^^^^^^^^^^^^^^^^^^^
Yanked offline. I forgot some dependency changes. Hi.
1.8.1 (February 7, 2017)
^^^^^^^^^^^^^^^^^^^^^^^^
* Pin archive-tar-minitar library to version 0.5.2 to work around a problem breaking `gem install fpm`
1.8.0 (December 28, 2016)
^^^^^^^^^^^^^^^^^^^^^^^^^
* virtualenv: Add `--virtualenv-setup-install` flag to run `setup.py install` after pip finishes installing things. (`#1218`_; John Stowers)
* virtualenv: Add `--virtualenv-system-site-package` flag which creates the virtualenv in a way that allows it to use the system python packages. (`#1218`_; John Stowers)
* cpan: Fix bug preventing some perl modules from being installed (`#1236`_, `#1241`_; Richard Grainger)
* rpm: Documentation improvements (`#1242`_; Nick Griffiths)
1.7.0 (November 28, 2016)
^^^^^^^^^^^^^^^^^^^^^^^^^
* virtualenv: Fix a bug where `pip` might be run incorrectly (`#1210`_; Nico Griffiths)
* FreeBSD: --architecture (-a) flag now sets FreeBSD package ABI (`#1196`_; Matt Sharpe)
* perl/cpan: Fix bug and now local modules can be packaged (`#1202`_, `#1203`_; liger1978)
* perl/cpan: Add support for `http_proxy` environment variable and improve how fpm queries CPAN for package information. (`#1206`_, `#1208`_; liger1978)
* Fix crash for some users (`#1231`_, `#1148`_; Jose Diaz-Gonzalez)
* Documentation now published on fpm.readthedocs.io. This is a work-in progress. Contributions welcome! <3 (`#1237`_, Jordan Sissel)
* deb: Can now read bz2-compressed debian packages. (`#1213`_; shalq)
* pleaserun: New flag --pleaserun-chdir for setting the working directory of a service. (`#1235`_; Claus F. Strasburger)
1.6.3 (September 15, 2016)
^^^^^^^^^^^^^^^^^^^^^^^^^^
* Fix bug in fpm's release that accidentally included a few `.pyc` files (`#1191`_)
1.6.2 (July 1, 2016)
^^^^^^^^^^^^^^^^^^^^
* Reduce `json` dependency version to avoid requiring Ruby 2.0 (`#1146`_, `#1147`_; patch by Matt Hoffman)
* pacman: skip automatic dependencies if --no-auto-depends is given (Leo P)
* rpm: Fix bug where --rpm-tag was accidentally ignored (`#1134`_, Michal Mach)
* deb: Omit certain fields from control file if (Breaks, Depends, Recommends, etc) if there are no values to put in that field. (`#1113`_, TomyLobo)
* rpm: remove trailing slash from Prefix for rpm packages (`#819`_, luto)
* virtualenv: Now supports being given a requirements.txt as the input. (Nick Griffiths)
1.6.1 (June 10, 2016)
^^^^^^^^^^^^^^^^^^^^^
* freebsd: Only load xz support if we are doing a freebsd output. (`#1132`_, `#1090`_, Ketan Padegaonkar)
1.6.0 (May 25, 2016)
^^^^^^^^^^^^^^^^^^^^
* New source: pleaserun. This lets you create packages that will install a system service. An after-install script is used in the package to determine which service platform to target (systemd, upstart, etc). Originated from Aaron Mildenstein's work on solving this problem for Logstash. (`#1119`_, `#1112`_)
* New target: Alpine Linux "apk" packages. (`#1054`_, George Lester)
* deb: don't append `.conf` to an upstart file if the file name already ends in `.conf`. (`#1115`_, josegonzalez)
* freebsd: fix bug where --package flag was ignored. (`#1093`_, Paweł Tomulik)
* Improvements to the fpm rake tasks (`#1101`_, Evan Gilman)
1.5.0 (April 12, 2016)
^^^^^^^^^^^^^^^^^^^^^^
* Arch package support is now available via -s pacman and -t pacman. (`#916`_; wonderful community effort making this happen!)
* FreeBSD packages can now be built `-t freebsd` (`#1073`_; huge community effort making this happen!)
* You can now set fpm flags and arguments with the FPMOPTS environment variable (`#977`_, mildred)
* Using --exclude-file no longer causes a crash. Yay! (`#982`_, wyaeld)
* A new rake task is available for folks who want to invoke fpm from rake (`#756`_, pstengel)
* On FreeBSD, when tarring, gtar is now used. (`#1008`_, liv3d)
* virtualenv: Add --virtualenv-pypi-extra-url flag to specify additional PyPI locations to use when searching for packages (`#1012`_, Paul Krohn)
* deb: Init scripts, etc/default, and upstart files are automatically added as config files in a debian package. Disable this behavior with ---deb-auto-config-files
* deb: Small changes to make lintian complain less about our resulting debs.
* deb: New flag --deb-systemd lets you specify a systemd service file to include in your package. (`#952`_, Jens Peter Schroer)
* cpan: Add --[no-]cpan-cpanm-force flag to pass --force to cpanm.
* rpm: File names with both spaces and symbols should now be packageable. (`#946`_, iwonbigbro)
* cpan: Now queries MetaCPAN for package info if we can't find any in the cpan archive we just downloaded. (`#849`_, BaxterStockman)
* rpm: You can now specify custom rpm tags at the command line. Be careful, as no validation is done on this before sending to rpmbuild. (`#687`_, vStone)
* cpan: Install if the package name given is a local file (`#986`_, mdom)
* sh: Metadata now available as env vars for post-install scripts (`#1006`_, Ed Healy)
* rpm: No more warning if you don't set an epoch. (`#1053`_, Joseph Frazier)
1.4.0 (July 26, 2015)
^^^^^^^^^^^^^^^^^^^^^
* Solaris 11 IPS packages 'p5p' now supported `-t p5p`. (Jonathan Craig)
* Python Virtualenv is now supported `-t virtualenv` (`#930`_, Simone Margaritelli and Daniel Haskin)
* deb: Files in /etc are now by default marked as config files. (`#877`_, Vincent Bernat)
* `fpm --help` output now includes a list of supported package types (`#896`_, Daniel Haskin)
* cpan: --[no-]cpan-sandbox-non-core flag to make non-core module sandboxing optional during packaging (`#752`_, Matt Sharpe)
* rpm: Add --rpm-dist flag for specifically setting the target distribution of an rpm. (Adam Lamar)
* rpm: Fix a crash if --before-upgrade or --after-upgrade were used. (`#822`_, Dave Anderson)
* deb: Ensure maintainer scripts have shebang lines (`#836`_, Wesley Spikes)
* deb: Fix bug in maintainer scripts where sometimes we would write an empty shell function. Empty functions aren't valid in shell. (Wesley Spikes)
* Fix symlink copying bug (`#863`_, Pete Fritchman)
* python: Default to https for pypi queries (Timothy Sutton)
* New flag --exclude-file for providing a file containing line-delimited exclusions (Jamie Lawrence)
* python: new flag --python-disable-dependency to disable specific python dependencies (Ward Vandewege)
* python: ensure we avoid wheel packages for now until fpm better supports them. (`#885`_, Matt Callaway)
* deb: Add support for installation states "abort-remove" and "abort-install" (`#887`_, Daniel Haskin)
* If PATH isn't set, and we need it, tell the user (`#886`_, Ranjib Dey)
* cpan: --[no-]cpan-test now works correctly (`#853`_, Matt Schreiber)
* deb-to-rpm: some improved support for config file knowledge passing from deb to rpm packages (Daniel Haskin)
1.3.3 (December 11, 2014)
^^^^^^^^^^^^^^^^^^^^^^^^^
* The fpm project now uses Contributor Covenant. You can read more about this on the website: http://contributor-covenant.org/
* npm: Fix bug causing all `-s npm` attempts to fail due to a missing method. This bug was introduced in 1.3.0. (`#800`_, `#806`_; Jordan Sissel)
* rpm: fix bug in rpm input causing a crash if the input rpm did not have any triggers (`#801`_, `#802`_; Ted Elwartowski)
1.3.2 (November 4, 2014)
^^^^^^^^^^^^^^^^^^^^^^^^
* deb: conversion from another deb will automatically use any changelog found in the source deb (Jordan Sissel)
1.3.1 (November 4, 2014)
^^^^^^^^^^^^^^^^^^^^^^^^
* deb: fix md5sums generation such that `dpkg -V` now works (`#799`_, Matteo Panella)
* rpm: Use maximum compression when choosing xz (`#797`_, Ashish Kulkarni)
1.3.0 (October 25, 2014)
^^^^^^^^^^^^^^^^^^^^^^^^
* Fixed a bunch of Ruby 1.8.7-related bugs. (Jordan Sissel)
* cpan: Fix bug in author handling (`#744`_, Leon Weidauer)
* cpan: Better removal of perllocal.pod (`#763`_, `#443`_, `#510`_, Mathias Lafeldt)
* rpm: Use lstat calls instead of stat, so we don't follow symlinks (`#765`_, Shrijeet Paliwal)
* rpm and deb: Now supports script actions on upgrades. This adds two new flags: --before-upgrade and --after-upgrade. (`#772`_, `#661`_; Daniel Haskin)
* rpm: Package triggers are now supported. New flags: --rpm-trigger-before-install, --rpm-trigger-after-install, --rpm-trigger-before-uninstall, --rpm-trigger-after-target-uninstall. (`#626`_, Maxime Caumartin)
* rpm: Add --rpm-init flag; similar to --deb-init. (Josh Dolitsky)
* sh: Skip installation if already installed for the given version. If forced, the old installation is renamed. (`#776`_, Chris Gerber)
* deb: Allow Vendor field to be omitted now by specifying `--vendor ""` (`#778`_, Nate Brown)
* general: Add --log=level flag for setting log level. Levels are error, warn, info, debug. (Jordan SIssel)
* cpan: Check for Build.PL first before Makefile.PL (`#787`_, Daniel Jay Haskin)
* dir: Don't follow symlinks when copying files (`#658`_, Jordan Sissel)
* deb: Automatically provide a 'changes' file in debs because lintian complains if they are missing. (`#784`_, Jordan Sissel)
* deb: Fix and warn for package names that have spaces (`#779`_, Grantlyk)
* npm: Automatically set the prefix to `npm prefix -g` (`#758`_, Brady Wetherington and Jordan Sissel)
1.2.0 (July 25, 2014)
^^^^^^^^^^^^^^^^^^^^^
* rpm: Add --rpm-verifyscript for adding a custom rpm verify script to your package. (Remi Hakim)
* Allow the -p flag to target a directory for writing the output package (`#656`_, Jordan Sissel)
* Add --debug-workspace which skips any workspace cleanup to let users debug things if they break. (`#720`_, `#734`_; Jordan Sissel)
* rpm: Add --rpm-attr for controlling attribute settings per file. This setting will likely be removed in the future once rpmbuild is no longer needed. (`#719`_)
* deb: Add --deb-meta-file to add arbitrary files to the control dir (`#599`_, Dan Brown)
* deb: Add --deb-interest and --deb-activate for adding package triggers (`#595`_, Dan Brown)
* cpan: Fix small bug in handling empty metadata fields (`#712`_, Mathias Lafeldt)
* rpm: Fix bug when specifying both --architecture and --rpm-os (`#707`_, `#716`_; Alan Ivey)
* gem: Fix bug where --gem-version-bins is given but package has no bins (`#688`_, Jan Vansteenkiste)
* deb: Set permissions correct on the package's internals. Makes lintian happier. (Jan Vansteenkiste)
* rpm: rpmbuild's _tmppath now respects --workdir (`#714`_, Jordan Sissel)
* gem/rpm: Add --rpm-verbatim-gem-dependencies to use old-style (fpm 0.4.x) rpm gem dependencies (`#724`_, Jordan Sissel)
* gem/rpm: Fix bug for gem pessimistic constraints when converting to rpm (Tom Duckering)
* python: Fix small bug with pip invocations (`#727`_, Dane Knecht)
1.1.0 (April 23, 2014)
^^^^^^^^^^^^^^^^^^^^^^
* New package type: zip, for converting to and from zip files (Jordan Sissel)
* New package type: sh, a self-extracting package installation shell archive. (`#651`_, Chris Gerber)
* 'fpm --version' will now emit the version of fpm.
* rpm: supports packaging fifo files (Adam Stephens)
* deb: Add --deb-use-file-permissions (Adam Stephens)
* cpan: Improve how fpm tries to find cpan artifacts for download (`#614`_, Tim Nicholas)
* gem: Add --gem-disable-dependency for removing one or more specific rubygem dependencies from the automatically-generated list (`#598`_, Derek Olsen)
* python: Add --python-scripts-executable for setting a custom interpreter to use for the hashbang line at the top of may python package scripts. (`#628`_, Vladimir Rutsky)
* Allow absolute paths with --directories even when --prefix is used (Vladimir Rutsky)
* dir: Now correctly identifies hardlinked files and creates a package correctly with that knowledge (`#365`_, `#623`_, `#659`_; Vladimir Rutsky)
* rpm: Add --rpm-auto-add-exclude-directories for excluding directories from the --rpm-auto-add-directories behavior (`#640`_, Vladimir Rutsky)
* general: --config-files now accepts directories and will recursively mark any files within as config files inside the package (`#642`_, Vladimir Rutsky)
* general: If you specify a --config-files path that doesn't exist, you will now get an error. (`#654`_, Alan Franzoni)
* python: Support --python-pypi when using --python-pip (`#652`_, David Lindquist)
* deb: Tests now try to make packages ensure we don't upset lintian (`#648`_, Sam Crang)
* rpm: Fix architecture targeting (`#676`_, Rob Kinyon)
* rpm: Allow --rpm-user and --rpm-group to override the user/group even if --rpm-use-file-permissions is enabled. (`#679`_, Jordan Sissel)
* gem: Add --gem-version-bins for appending the gem version to the file name of executable scripts a rubygem may install. (Jan Vansteenkiste)
* python: Attempt to provide better error messages for known issues in python environments (`#664`_, Jordan Sissel)
1.0.2 (January 10, 2013)
^^^^^^^^^^^^^^^^^^^^^^^^
* rpm: No longer converts - to _ in dependency strings (`#603`_, Bulat Shakirzyanov)
* Handle Darwin/OSX tar invocations (now tries 'gnutar' and 'gtar'). (Jordan Sissel)
* Process $HOME/.fpm, and $PWD/.fpm in the correct order and allow CLI flags to override fpm config file settings. (`#615`_, Jordan Sissel)
* Don't leave empty gem bin paths in packages that don't need them (`#612`_, Jordan Sissel)
* deb: Make --deb-compression=gz work correctly (`#616`_, `#617`_; Evan Krall, Jason Yan)
1.0.1 (December 7, 2013)
^^^^^^^^^^^^^^^^^^^^^^^^
* deb: Correctly handle --config-files given with a leading / (Jordan Sissel)
1.0.0 (December 5, 2013)
^^^^^^^^^^^^^^^^^^^^^^^^
* Config file of flags is now supported. Searches for $HOME/.fpm and $PWD/.fpm. If both exist, $HOME is loaded first so $PWD can override. (Pranay Kanwar)
* pkgin: Basic support for SmartOS/pkgsrc's pkgin format. (`#567`_, Brian Akins)
* cpan: catch more cases of perllocal.pod and delete them (`#510`_, Jordan Sissel)
* cpan: Correctly support module version selection (`#518`_, Matt Sharpe)
* cpan: include builddeps in PERL5LIB when running cpan tests (`#500`_, Matt Sharpe)
* cpan: Avoid old system perl modules when doing module builds (`#442`_, `#513`_; Matt Sharpe)
* python: safer gathering of python module dependencies.
* python: better handling of unicode strings in python package metadata (`#575`_, Bruno Renié)
* cpan: Support 'http_proxy' env var. (`#491`_, Patrick Cable)
* deb: --deb-user and --deb-group both default to 'root' now (`#504`_, Pranay Kanwar)
* deb: convert '>' to '>>' in deb version constraints (`#503`_, `#439`_, Pranay Kanwar)
* deb: Warn if epoch is set. Just so you know what's going on, since the default filename doesn't include the epoch. (`#502`_, Pranay Kanwar)
* deb,rpm: --config-files is now recursive if you give it a directory. This seems to be the most expected behavior by users. (`#171`_, `#506`_; Pranay Kanwar)
* dir: Respect -C when using path mapping (`#498`_, `#507`_; Pranay Kanwar)
* rpm: Add --rpm-ignore-iteration-in-dependencies to let you to depend on any release (aka iteration) of the same version of a package. (`#364`_, `#508`_; Pranay Kanwar)
* dir: Handle copying of special files when possible (`#347`_, `#511`_, `#539`_, `#561`_; Pranay Kanwar)
* rpm: Don't mistake symlinks as actual directories (`#521`_, Nathan Huff)
* npm: Choose an alternate npm registry with --npm-registry (`#445`_, `#524`_; Matt Sharpe)
* cpan: Choose an alternate cpan server with --cpan-mirror. Additionally, you can use --cpan-mirror-only to only use this mirror for metadata queries. (`#524`_, Matt Sharpe)
* deb: Fix broken --deb-changelog flag (`#543`_, `#544`_; Tray Torrance)
* deb: When --deb-upstart is given, automatically create an upstart-sysv symlink /etc/init.d/<name> to /lib/init/upstart-job (`#545`_, Igor Galić)
* rpm: Fix bug when generating spec file listings on files with strange characters in the names. (`#547`_, Chris Chandler)
* dir: Fix bug where the new directory mapping feature would cause you not to be able to select files with '=' in the name for packaging. (`#556`_, `#554`_; Pranay Kanwar)
* python: Fix some unicode string issues in package metadata (`#575`_, Bruno Renié)
* gem-rpm: Now respects the --gem-package-name-prefix when generating the 'rubygem(name)' provides statement (`#585`_, Stepan Stipl)
* deb: Downcase and replace underscores with dashes in 'provides' list. (`#591`_, Eric Connell)
* deb: Fix a lintian complaint about md5sums permissions (`#593`_, Sam Crang)
* cpan: Modules with 'MYMETA' files are now supported (`#573`_, Michael Donlon)
0.4.42 (July 23, 2013)
^^^^^^^^^^^^^^^^^^^^^^
* dir: make source=destination mappings behave the same way 'rsync -a' does with respect to source and destination paths.
0.4.41 (July 17, 2013)
^^^^^^^^^^^^^^^^^^^^^^
* cpan: handle cases where modules don't specify a license
* deb: support multiple init scripts (`#487`_, patch by Kristian Glass)
0.4.40 (July 12, 2013)
^^^^^^^^^^^^^^^^^^^^^^
* dir: supports mapping one path to another. You set mappings by using 'source=destination' syntax. For example: % fpm -s dir -t deb -n example /home/jls/.zshrc=/etc/skel/ The key above is the '=' symbol. The result of the above will be a package containing only /etc/skel/.zshrc For more, see https://github.com/jordansissel/fpm/wiki/Source:-dir#mapping
* python: the default scripts location is now chosen by python itself. The previous default was "/usr/bin" and was not a good default. (`#480`_)
* rpm: config files should have attributes (`#484`_, patch by adamcstephens)
* python: correctly log the python setup.py exit code (`#481`_, patch by Derek Ludwig)
0.4.39 (June 27, 2013)
^^^^^^^^^^^^^^^^^^^^^^
* cpan: support more complex dependency specifications (reported by Mabi Knittel)
0.4.38 (June 24, 2013)
^^^^^^^^^^^^^^^^^^^^^^
* cpan: fpm's cpan code now works under ruby 1.8.7
* python: fix a bug in dependency handling (`#461`_, Pranay Kanwar)
* pear: Added --pear-data-dir flag (`#465`_, Zsolt Takács)
* cpan: fix a bug with some clean up on certain 64bit systems
* gem: improve detection of the gem bin install path (`#476`_, Tray Torrance)
* rpm: fix bug when calling using --rpm-use-file-permissions (`#464`_, Rich Horwood)
0.4.37 (May 30, 2013)
^^^^^^^^^^^^^^^^^^^^^
* deb: fix creation failures on OS X (`#450`_, patch by Anthony Scalisi and Matthew M. Boedicker)
* deb: you can now set --deb-build-depends. This is generally for extremely rare use cases. (`#451`_, patch by torrancew)
* perl: add --cpan-perl-lib-path for a custom perl library installation path (`#447`_, patch by Brett Gailey)
0.4.36 (May 15, 2013)
^^^^^^^^^^^^^^^^^^^^^
* pear: only do channel-discover if necessary (`#438`_, patch by Hatt)
* cpan: now supports cpan modules that use Module::Build
* cpan: --no-cpan-test now skips tests for build/configure dependencies
* rpm: Add --rpm-defattrfile and --rpm-defattrdir flags (`#428`_, patch by phrawzty)
0.4.35 -- was not announced
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
0.4.34 (May 7, 2013)
^^^^^^^^^^^^^^^^^^^^
* Now supports CPAN - Perl mongers rejoice! For example: 'fpm -s cpan -t deb DBI'
* deb: fixed some additional complaints by lintian (`#420`_, patch by Pranay Kanwar)
* rpm: add flags --rpm-autoreqprov, --rpm-autoreq, and --rpm-autoprov to tell rpm to enable that feature in the rpm spec. (`#416`_, patch by Adam Stephens)
0.4.33 (April 9, 2013)
^^^^^^^^^^^^^^^^^^^^^^
* Now supports npm, the node package manager. For example: 'fpm -s npm -t deb express'
0.4.32 (April 9, 2013)
^^^^^^^^^^^^^^^^^^^^^^
* COMPATIBILITY WARNING: rpm: The default epoch is now nothing because this aligns more closely with typical rpm packages in the real world. This decision was reached in `#381`_. If you need the previous behavior, you must now specify '--epoch 1' (`#388`_, patch by Pranay Kanwar)
* python: new flag --python-obey-requirements-txt which makes a requirements.txt file from the python package used for the package dependencies instead of the usual setup.py dependencies. The default behavior without this flag is to respect setup.py. (`#384`_)
* deb: new flag --deb-shlibs to specify the content of the 'shlibs' file in the debian package (`#405`_, patch by Aman Gupta)
* deb: fixed a few lintian errors (empty conffiles, md5sums on symlinks, etc)
* Add '-f' / '--force' flag to force overwriting an existing package output path (`#385`_, Timothy Sutton)
* New flag: --no-auto-depends flag to skip any automatic dependencies that would normally be added by gem, python, deb, and rpms input packages. (`#386`_, `#374`_; patch by Pranay Kanwar)
* gem: Use 'gem' command to download gems and read gem package information. (`#389`_, `#394`_, `#378`_, `#233`_; patches by Pranay Kanwar and Chris Roberts)
* rpm: dashes are now replaced with underscores in rpm version strings (`#395`_, `#393`_, `#399`_; patches by Jeff Terrace and Richard Guest)
* python: Only use the first line of a license; some python packages (like 'requests') embed their full license copy into the license field. For the sake of sanity and function with most packaging systems, fpm only uses the first line of that license.
* rpm: Add new 'none' option to --rpm-compression to disable compression entirely. (`#398`_, patch by Richard Guest)
* deb: Make dependencies using the '!=' operator represented as "Breaks" in the deb package (previously used "Conflicts"). (`#400`_)
* deb: Add md5sums to the debian packages which improves correctness of the package. (`#403`_, `#401`_; patch by Pranay Kanwar)
* rpm: Convert all '!=' dependency operators to 'Conflicts'. Previously, this only applied to packages converting from python to rpm. (`#404`_, `#396`_; patch by Pranay Kanwar)
0.4.31 (March 21, 2013)
^^^^^^^^^^^^^^^^^^^^^^^
* rpm: new flag --rpm-use-file-permissions which try to create an rpm that has file ownership/modes that exactly mirror how they are on the filesystem at package time. (`#377`_, patch by Paul Rhodes)
* general: remove empty directories only when they match the exclude pattern (`#323`_, patch by Pranay Kanwar)
0.4.30 (March 21, 2013)
^^^^^^^^^^^^^^^^^^^^^^^
* Solaris: --solaris-user and --solaris-group flags to specify the owner of files in a package. (`#342`_, patch by Derek Olsen)
* rpm: (bug fix) epoch of 0 is permitted now (`#343`_, patch by Ben Hughes)
* pear: add flags --pear-bin-dir --pear-php-bin --pear-php-dir (`#358`_, patch by Zsolt Takács)
* New 'source' type: empty. Allows you to create packages without any files in them (sometimes called 'meta packages'). Useful when you want to have one package be simply dependencies or when you want to spoof a package you don't want installed, etc. (`#359`_, 349; patch by Pranay Kanwar)
* solaris: Add --solaris-user and --solaris-group flags (`#342`_, Patch by Derek Olsen)
* gem: new flag --env-shebang; default true (disable with --no-env-shebang). Lets you disable #! (shebang) mangling done by gem installation. (`#363`_, patch by Grier Johnson)
* deb: fix bug on changelog handling (`#376`_, patch by mbakke)
* rpm: fix --rpm-rpmbuild-define (`#383`_, patch by Eric Merritt)
0.4.29 (January 22, 2013)
^^^^^^^^^^^^^^^^^^^^^^^^^
* Copy links literally, not what they point at (`#337`_, patch by Dane Knecht)
0.4.28 (January 21, 2013)
^^^^^^^^^^^^^^^^^^^^^^^^^
* Fix a dependency on the 'cabin' gem. (`#344`_, reported by Jay Buffington)
0.4.27 (January 16, 2013)
^^^^^^^^^^^^^^^^^^^^^^^^^
* Make all fpm output go through the logger (`#329`_; patch by jaybuff)
* New package type: osxpkg, for building packages installable on OS X. (`#332`_, patch by Timothy Sutton)
* Fix crash bug when converting rpms to something else (`#316`_, `#325`_; patch by rtucker-mozilla)
* deb: Add --deb-field for setting a custom field in the control file. For more information on this setting, see section 5.7 "User-defined fields" of the debian policy manual: http://www.debian.org/doc/debian-policy/ch-controlfields.html#s5.7
* deb: Add --deb-recommends and --deb-suggests (`#285`_, `#310`_; patch by Pranay Kanwar)
* python to rpm: convert "!=" dependency operators in python to "Conflicts" in rpm. (`#263`_, `#312`_; patch by Pranay Kanwar)
* python: fix bug - ignore blank lines in requirements.txt (`#312`_, patch by Pranay Kanwar)
0.4.26 (December 27, 2012)
^^^^^^^^^^^^^^^^^^^^^^^^^^
* rpm: add --rpm-sign flag to sign packages using the 'rpmbuild --sign' flag. (`#311`_, Patch by Pranay Kanwar)
* rpm: fix flag ordering when calling rpmbuild (`#309`_, `#315`_, patch by Trotter Cashion)
* deb: re-enable "Predepends" support (`#319`_, `#320`_, patch by Pranay Kanwar)
* rpm: fix default 'rpm os' value (`#321`_, 314, 309)
0.4.25 (December 7, 2012)
^^^^^^^^^^^^^^^^^^^^^^^^^
* Added --deb-changelog and --rpm-changelog support flags. Both take a path to a changelog file. Both must be valid changelog formats for their respective package types. (`#300`_, patch by Pranay Kanwar)
* deb: Multiple "provides" are now supported. (`#301`_, patch by Pranay Kanwar)
* rpm: Added --rpm-os flag to set the OS target for the rpm. This lets you build rpms for linux on OS X and other platforms (with --rpm-os linux). (`#309`_)
* rpm: Avoid platform-dependent commands in the %install phase (`#309`_, fixes 'cp -d' on OSX)
* python: ignore comments in requirements.txt (`#304`_, patch by Pranay Kanwar)
* Fixed warning 'already initialized constant' (`#274`_)
0.4.24 (November 30, 2012)
^^^^^^^^^^^^^^^^^^^^^^^^^^
* Don't include an empty url in rpm spec (`#296`_, `#276`_; patch by Pranay Kanwar)
* Don't require extra parameters if you use --inputs (`#278`_, `#297`_; Patch by Pranay Kanwar)
* python: supports requirements.txt now for dependency information.
* python: supports pip now. Use '--python-pip path/to/pip' to have fpm use it instead of easy_install.
* solaris: package building works again (`#216`_, `#299`_, patch by Pierre-Yves Ritschard)
0.4.23 (November 26, 2012)
^^^^^^^^^^^^^^^^^^^^^^^^^^
* The --directories flag is now recursive when the output package is rpm. This makes all directories under a given path as owned by the package so they'll be removed when the package is uninstalled (`#245`_, `#293`_, `#294`_, patch by Justin Ellison)
* Add fpm version info to '--help' output (`#281`_)
* gem to rpm: Use 'rubygem(gemname)' for dependencies (`#284`_, patch by Jan Vansteenkiste)
* Fix a bug in gem version mangling (`#292`_, `#291`_; patch by Pranay Kanwar)
* Fix compatibility with Python 2.5 (`#279`_, patch by Denis Bilenko)
0.4.22 (November 15, 2012)
^^^^^^^^^^^^^^^^^^^^^^^^^^
* Add --no-depends flag for creating packages with no dependencies listed (`#289`_, patch by Brett Gailey)
* Fix a bug where blank lines were present in a debian control file. (`#288`_, patch by Andrew Bunday)
0.4.21 (November 8, 2012)
^^^^^^^^^^^^^^^^^^^^^^^^^
* gem: remove restriction on expected gem names (`#287`_)
* add --directory flag; lets you mark a directory as being owned by a package. (`#260`_, `#245`_, patch by ajf8)
* deb: don't include a version in the Provides field (`#280`_)
* gem: if the version is '1.1' make it imply '1.1.0' (`#269`_, patch by Radim Marek)
0.4.20 (October 5, 2012)
^^^^^^^^^^^^^^^^^^^^^^^^
* python: only specify --install-{scripts,lib,data} flags to setup.py if they were given on the command line to fpm. Fixes `#273`_.
0.4.19 (September 26, 2012)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
* Escape '%' characters in file names (`#266`_, `#222`_. Patch by John Wittkoski)
0.4.18 (September 25, 2012)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
* Fix regression in rpm building where the epoch in was missing in the rpm, but prior fpm versions defaulted it to 1. This caused rpms built with newer fpms to appear "older" than older rpms. Tests added to ensure this regression is caught prior to future releases! (Reported by eliklein)
0.4.17 (September 12, 2012)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
* Remove accidental JSON warning when using '-s python'
0.4.16 (September 6, 2012)
^^^^^^^^^^^^^^^^^^^^^^^^^^
* Fix compatibility with Ruby 1.8.7 (broken in 0.4.15)
0.4.15 (September 6, 2012)
^^^^^^^^^^^^^^^^^^^^^^^^^^
* pear: support custom channels with --pear-channel <channel> (`#207`_) Example: fpm -s pear -t deb --pear-channel pear.drush.org drush
* permit literal '\n' in --description, fpm will replace with a newline character. Example: fpm --description "line one\nline two" (`#251`_)
* improve error messaging when trying to output a package to a directory that doesn't exist (`#244`_)
* deb: convert '>' and '<' dependency operators to the correct '>>' and '<<' debian version operators (`#250`_, patch by Thomas Meson).
* deb: add --deb-priority flag (`#232`_) for setting the debian 'priority' value for your package.
* add --template-value. Used to expose arbitrary values to script templates. If you do --template-value hello=world, in your template you can do <%= hello %> to get 'world' to show up in your maintainer scripts.
* python: add --python-install-data flag to set the --install-data option to setup.py (`#255`_, patch by Thomas Meson)
* Reject bad dependency flags (ones containing commas) and offer alternative. (`#257`_)
* Try to copy a file if hardlinking fails with permission problems (`#253`_, patch by Jacek Lach)
* Make --exclude, if a directory, include itself and any children, recursive. (`#248`_)
0.4.14 (August 24, 2012)
^^^^^^^^^^^^^^^^^^^^^^^^
* rpm: Replace newlines with space in any license setting. (`#252`_)
0.4.13 (August 14, 2012)
^^^^^^^^^^^^^^^^^^^^^^^^
* Make --exclude accept path prefixes as well. If you have a files in 'usr/share/man' in your package, you can now exclude all of a subdir by doing '--exclude usr/share/man'
0.4.12 (August 10, 2012)
^^^^^^^^^^^^^^^^^^^^^^^^
* Fix a major bug introduced in 0.4.11 that caused all deb packages to contain empty maintainer scripts if not otherwise specified, which made apt/dpkg quite unhappy
0.4.11 (August 7, 2012)
^^^^^^^^^^^^^^^^^^^^^^^
* Fix some symlink handling to prevent links from being followed during cleanup (`#228`_, patch by sbuss)
* rpm: 'vendor' in rpm spec is now omitted if empty or nil. This fixes a bug where rpmbuild fails due to empty 'Vendor' tag if you convert rpm to rpm.
* internal: remove empty directories marked by --exclude (`#205`_, patch by jimbrowne)
* dir: don't try to set utime on symlinks (`#234`_, `#240`_, patch by ctgswallow)
* rpm: relocatable rpms now supported when using the '--prefix' flag. Example: fpm -s dir -t rpm --prefix /usr/local -n example /etc/motd (patch by jkoppe)
* deb: --deb-compression flag: Support different compression methods. Default continues to be gzip.
* new flag: --template-scripts. This lets you write script templates for --after-install, etc. Templates are ERB, so you can do things like '<%= name %>' to get the package name in the script, etc.
* warn on command invocations that appear to have stray flags to try and help users who have complex command lines that are failling.
0.4.10 (May 25, 2012)
^^^^^^^^^^^^^^^^^^^^^
* Fix python package support for python3 (`#212`_, patch by Slezhuk Evgeniy)
* Preserve file metadata (time, owner, etc) when copying with the dir package. (`#217`_, patch by Marshall T. Vandegrift)
* Missing executables will now error more readably in fpm.
* Fix gem and python 'version' selection (`#215`_, `#204`_)
* Dependencies using '!=' will now map to 'Conflicts' in deb packages. (`#221`_, patch by Sven Fischer)
* Allow setting default user/group for files in rpm packages (`#208`_, patch by Jason Rogers). Note: This adds --user and --group flags to effect this. These flags may go away in the future, but if they do, they will be
* In python packages set 'install-data' correctly. (`#223`_, patch by Jamie Scheinblum)
0.4.9 (April 25, 2012)
^^^^^^^^^^^^^^^^^^^^^^
* Fix --prefix support when building gems (`#213`_, patch by Jan Vansteenkiste)
0.4.8 (April 25, 2012)
^^^^^^^^^^^^^^^^^^^^^^
* RPM: use 'noreplace' option for config files (`#194`_, patch by Steve Lum)
* Python: Fix bug around exact dependency versions (`#206`_, patch by Lars van de Kerkhof)
* Gem->RPM: Make 'provides' "rubygem(thegemname)" instead of "rubygem-thegemname"
* Fix oddity where Ruby would complain about constant redefinition (`#198`_, patch by Marcus Vinicius Ferreira)
0.4.7 skipped.
^^^^^^^^^^^^^^
0.4.6 (April 10, 2012)
^^^^^^^^^^^^^^^^^^^^^^
* Work around more problems in RPM with respect to file listing (`#202`_)
0.4.5 (April 3, 2012)
^^^^^^^^^^^^^^^^^^^^^
* Fix gem->rpm conversion where the '~>' rubygem version operator (`#193`_, patch by antoncohen)
* Escape filenames RPM install process (permits files with spaces, dollar signs, etc) (`#196`_, reported by pspiertz)
0.4.4 (March 30, 2012)
^^^^^^^^^^^^^^^^^^^^^^
* Fix a bug in gem bin_dir handling (Calen Pennington)
* The --config-files flag should work again (Brian Akins)
* Fix syntax error when using --deb-pre-depends (Andrew Bennett)
* Make --exclude work again (`#185`_, `#186`_) (Calen Pennington)
* Fix file listing so that rpm packages don't declare ownership on / and /usr, etc.
* make --deb-custom-control to work again (Tor Arne Vestbø)
* Add --rpm-digest flag to allow selection of the rpm 'file name' digest algorithm. Default is 'md5' since it works on the most rpm systems.
* Reimplement old behavior assuming "." as the input when using '-s dir' and also setting -C (`#187`_)
* Set BuildRoot on rpm to work around an rpmbuild bug(?) on CentOS 5 (`#191`_)
* Add --rpm-compression flag to allow selection of the rpm payload compression. Default is 'gzip' since it works on the most rpm systems
* Specs now pass on ubuntu/32bit systems (found by travis-ci.org's test runner)
* Improve default values of iteration and epoch (`#190`_)
* Make FPM::Package#files list only 'leaf' nodes (files, empty directories, symlinks, etc).
0.4.3 (March 21, 2012)
^^^^^^^^^^^^^^^^^^^^^^
* Fix bug in python packaging when invoked with a relative path to a setup.py (Reported by Thomas Meson, https://github.com/jordansissel/fpm/pull/180)
0.4.2 (March 21, 2012)
^^^^^^^^^^^^^^^^^^^^^^
* Set default temporary directory to /tmp (https://github.com/jordansissel/fpm/issues/174)
* Improve symlink handling (patch by Aleix Conchillo Flaqué, pull/177))
* Python package support changes (thanks to input by Luke Macken):
* New flag: --python-install-bin. Sets the location for python package scripts (default: /usr/bin)
* New flag: --python-install-lib. Sets the location for the python package to install libs to, default varies by system. Usually something like /usr/lib/python2.7/site-packages.
* Fix up --prefix support
* Improve staged package installation
0.4.1 (March 19, 2012)
^^^^^^^^^^^^^^^^^^^^^^
* Fix fpm so it works in ruby 1.8 again. Tests run, and passing: rvm 1.8.7,1.9.2,1.9.3 do bundle exec rspec
0.4.0 (March 18, 2012)
^^^^^^^^^^^^^^^^^^^^^^
* Complete rewrite of pretty much everything.
* Otherwise, the 'fpm' command functionality should be the same
* Please let me know if something broke!
* Now has an API (see examples/api directory)
* Also has a proper test suite
* Updated the rpm spec generator to disable all the ways I've found rpmbuild to be weird about packages. This means that fpm-generated rpms will no longer strip libraries, move files around, randomly mutate jar files, etc.
* Add --license and --vendor settings (via Pieter Loubser)
* python support: try to name python packages sanely. Some pypi packages are literally called 'python-foo' so make sure we generate packages named 'python-foo' and not 'python-python-foo' (via Thomas Meson)
* rpm support: Add --rpm-rpmbuild-define for passing a --define flag to rpmbuild (via Naresh V)
* PHP pear source support (fpm -s pear ...) (via Andrew Gaffney)
0.3.10 (Oct 10, 2011)
^^^^^^^^^^^^^^^^^^^^^
* Allow taking a list of files/inputs on stdin with '-' or with the --inputs flag. (Matt Patterson)
* (python) pass -U to easy_install (Khalid Goudeaux)
* (debian) quote paths in md5sum calls (Matt Patterson)
* (debian) quiet stderr from dpkg --print-architecture
0.3.9 (Sep 8, 2011)
^^^^^^^^^^^^^^^^^^^
* Fix bug in 'dir' source that breaks full paths
* Added a bunch of tests (yaay)
0.3.8 and earlier: I have not kept this file up to date very well... Sorry :(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
0.2.29 (May 20, 2011)
^^^^^^^^^^^^^^^^^^^^^
* Add 'tar' source support. Useful for binary releases to repackage as rpms and debs. Example::
fpm -s tar -t rpm -n firefox -v 4.0.1 --prefix /opt/firefox/4.0.1 firefox-4.0.1.tar.bz2
0.2.28 (May 18, 2011)
^^^^^^^^^^^^^^^^^^^^^
* Use --replaces as "Obsoletes" in rpms.
0.2.27 (May 18, 2011)
^^^^^^^^^^^^^^^^^^^^^
* If present, DEBEMAIL and DEBFULLNAME environment variables will be used as the default maintainer. Previously the default was simply <$user@$hostname> https://github.com/jordansissel/fpm/issues/37
* Add '--replaces' flag for specifying packages replaced by the one you are building. This only functions in .deb packages now until I find a suitable synonym in RPM.
* Add --python-bin and --python-easyinstall flags. This lets you choose specific python and easy_install tools to use when building. Default is simply 'python' and 'easy_install' respectively.
* Add support for ~/.fpmrc - The format of this file is the same as the flags. One flag per line. https://github.com/jordansissel/fpm/issues/38. Example::
--python-bin=/usr/bin/python2.7
--python-easyinstall=/usr/bin/easy_install2.7
0.2.26 and earlier
^^^^^^^^^^^^^^^^^^
No changelist tracked. My bad, yo.

View File

@ -1,13 +1,46 @@
# Contributor Code of Conduct
# Contributor Covenant Code of Conduct
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
## Our Pledge
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, age, or religion.
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
## Our Standards
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
Examples of behavior that contributes to creating a positive environment include:
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
This Code of Conduct is adapted from the [Contributor Covenant](http:contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at jls@semicomplete.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [https://contributor-covenant.org/version/1/4][version]
[homepage]: https://contributor-covenant.org
[version]: https://contributor-covenant.org/version/1/4/

View File

@ -20,6 +20,8 @@ llasram
sbuss
Brett Gailey (github: dnbert)
Daniel Haskin (github: djhaskin987)
Richard Grainger (github: liger1978)
seph (github: directionless)
If you have contributed (bug reports, feature requests, help in IRC, blog
posts, code, etc) and aren't listed here, please let me know if you wish to be

107
Dockerfile Normal file
View File

@ -0,0 +1,107 @@
# syntax=docker/dockerfile:1
# Are we running against the minimal container, or the everything
# container? Minimal is mostly the compiled package tools. Everything
# pulls in scripting langauges.
ARG BASE_ENV=everything
# Are we running tests, or a release? Tests build and run against the
# CWD, where release will use the downloaded gem.
ARG TARGET=test
# Container to throw an error if called with a bare `docker build .`
FROM ubuntu:20.04 as error
RUN <<EOF
printf '\n\n\n%s\n\n\n' "Hey! Use buildkit. See the Makefile or docs"
false
EOF
# Base container is used for various release and test things
FROM ubuntu:20.04 as minimal-base
ARG DEBIAN_FRONTEND=noninteractive
ARG TZ=Etc/UTC
# Runtime deps. Build deps go in the build or test containers
# hadolint ignore=DL3009
RUN <<EOF
apt-get update
apt-get install --no-install-recommends --no-install-suggests -y \
'ruby=*' \
'ruby-dev=*' \
'libarchive-tools=*' \
'cpio=*' \
'debsigs=*' \
'pacman=*' \
'rpm=*' \
'squashfs-tools=*' \
'xz-utils=*' \
'zip=*' \
'gcc=*' \
'libc6-dev=*' \
'make=*' \
'lintian=*' \
'git=*'
useradd -ms /bin/bash fpm
EOF
# everything container includes all the scripting languages. These
# greatly embiggen the underlying docker container, so they're
# conditionalized.
FROM minimal-base as everything-base
RUN <<EOF
apt-get install --no-install-recommends --no-install-suggests -y \
'cpanminus=*' \
'npm=*' \
'perl=*' \
'python3-pip=*'
pip3 --no-cache-dir install 'setuptools>=45' 'wheel>=0.34' 'virtualenv>=20' 'virtualenv-tools3>=2'
update-alternatives --install /usr/bin/python python /usr/bin/python3 10
EOF
# hadolint ignore=DL3006
FROM ${BASE_ENV}-base as base
RUN <<EOF
rm -rf /var/lib/apt/lists/*
apt-get clean
EOF
# Run tests against the current working directory. This is a bit
# orthogonal to the container release process, but it has a lot of
# same dependancies, so we reuse it. This uses COPY to allow rspect to
# initall the gems, but runtime usage expects you to mount a volume
# into /src
FROM base AS test
# installing ffi here is a bit of an optimization for how COPY and layer reuse works
RUN gem install --no-document ffi:*
USER fpm
WORKDIR /origsrc
ENV HOME=/origsrc
ENV BUNDLE_PATH=/origsrc/.bundle
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN <<EOF
# Install a specific version of bundler
install -d -o fpm /origsrc
gem install -v "$(grep -A1 '^BUNDLED WITH' Gemfile.lock | tail -1)" bundler:*
bundle install
EOF
CMD ["bundle", "exec", "rspec"]
# build a container from a released gem. install build deps here, so
# we can omit them from the final release package
FROM base AS build
ENV GEM_PATH=/fpm
ENV PATH="/fpm/bin:${PATH}"
# hadolint ignore=DL3028
RUN gem install --no-document --install-dir=/fpm fpm
FROM base as release
COPY --from=build /fpm /fpm
ENV GEM_PATH=/fpm
ENV PATH="/fpm/bin:${PATH}"
USER fpm
WORKDIR /src
ENTRYPOINT ["/fpm/bin/fpm"]
# This target is to help docker buildkit in resolving things.
# hadolint ignore=DL3006
FROM ${TARGET}

View File

@ -1,6 +1,6 @@
(This is an MIT-style license)
Copyright (c) 2011-2016 Jordan Sissel and contributors.
Copyright (c) 2011-2021 Jordan Sissel and contributors.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -49,3 +49,25 @@ install: $(GEM)
.PHONY:
clean:
rm -rf package-*/ *.rpm *.deb *.gz *.tar *.gem .yardoc/
publish-docs:
$(MAKE) -C docs publish
release-prep: package
rm -f docs/changelog_links.rst docs/cli-reference.rst
make -C docs build package-type-cli
# Testing in docker.
# The dot file is a sentinal file that will built a docker image, and tag it.
# The normal make target runs said image, mounting CWD against it.
SECONDARY: .docker-test-minimal .docker-test-everything
.docker-test-%: Gemfile.lock fpm.gemspec Dockerfile
DOCKER_BUILDKIT=1 docker build -t fpm-test-$* --build-arg BASE_ENV=$* --build-arg TARGET=test .
touch "$@"
docker-test-%: .docker-test-%
docker run -v `pwd`:/src fpm-test-$*
docker-release-%:
DOCKER_BUILDKIT=1 docker build -t fpm --build-arg BASE_ENV=$* --build-arg TARGET=release --squash .

View File

@ -1,53 +0,0 @@
# Debian notes
## C libraries
Linux seems to require 'ldconfig' runs after shared libraries are installed. I
haven't bothered digging into why, but many debian C library packages run
ldconfig as a postinstall step.
I'd like to avoid postinstall actions, so this needs research to see if this is
possible.
## Ruby
rubygems on Debian/Ubuntu is not very recent in most cases, and some gems have
a requirement of rubygems >= a version you have available.
Further, debian blocks 'gem update --system' which you can get around by doing:
% gem install rubygems-update
% ruby /var/lib/gems/1.8/gems/rubygems-update-1.3.1/bin/update_rubygems
I recommend packaging 'rubygems-update' (fpm -s gem -t deb rubygems-update) and
possibly running the update_rubygems as a postinstall, even though I don't like
postinstalls. I haven't looked yet to see what is required to mimic (if
possible) the actions of that script simply in a tarball.
## Python
http://www.debian.org/doc/packaging-manuals/python-policy/ap-packaging_tools.html
Debian python packages all rely on some form of python-central or
python-support (different tools that do similar/same things? I don't know)
As I found, disabling postinst scripts in Debian causes Python to stop working.
The postinst scripts generally look like this:
if which update-python-modules >/dev/null 2>&1; then
update-python-modules SOMEPACKAGENAME.public
fi
I don't believe in postinst scripts, and I also feel like requiring a
postinstall step to make a python module work is quite silly - though I'm sure
(I hope) Debian had good reason.
So, I'm going to try working on a howto for recommended ways to build python
packages with fpm in debian. It will likely require a one-time addition to
site.py (/usr/lib/python2.6/site.py) or some other PYTHONPATH hackery, though
I don't know just yet.
It will also require special setup.py invocations as Debian has patched distutils to
install python packages, by default, to a place that requires again the
python-central/support tools to run to make them work.

228
README.md
View File

@ -1,228 +0,0 @@
# Effing Package Management
[![Build Status](https://travis-ci.org/jordansissel/fpm.svg?branch=master)](https://travis-ci.org/jordansissel/fpm)
## Preface
Package maintainers work hard and take a lot of shit. You can't please
everyone. So, if you're a maintainer: Thanks for maintaining packages!
## What is fpm?
It helps you build packages quickly and easily (Packages like RPM and DEB
formats).
FUNDAMENTAL PRINCIPLE: IF FPM IS NOT HELPING YOU MAKE PACKAGES EASILY, THEN
THERE IS A BUG IN FPM.
Here is a presentation I gave on fpm at BayLISA: <http://goo.gl/sWs3Z> (I
included speaker notes you can read, too)
At BayLISA in April 2011, I gave a talk about fpm. At the end, I asked "What
can I package for you?"
Someone asked for memcached.
Google for 'memcached', download the source, unpack, ./configure, make, make
install, fpm, deploy.
In 60 seconds, starting from nothing, I had both an RPM and a .DEB of memcached
ready to deploy, and I didn't need to know how to use rpmbuild, rpm specfiles,
dh\_make, debian control files, etc.
## Backstory
Sometimes packaging is done wrong (because you can't do it right for all
situations), but small tweaks can fix it.
And sometimes, there isn't a package available for the tool you need.
And sometimes if you ask "How do I get python 3 on CentOS 5?" some unhelpful
trolls will tell you to "Use another distro"
Further, a job switches have me flipping between Ubuntu and CentOS. These use
two totally different package systems with completely different packaging
policies and support tools. Learning both was painful and confusing. I want to
save myself (and you) that pain in the future.
It should be easy to say "here's my install dir and here's some dependencies;
please make a package"
## The Solution - FPM
I want a simple way to create packages without all the bullshit. In my own
infrastructure, I have no interest in Debian policy and RedHat packaging
guidelines - I have interest in my group's own style culture and have a very strong
interest in getting work done.
(This is not to say that you can't create packages with FPM that obey Debian or
RedHat policies, you can and should if that is what you desire)
The goal of FPM is to be able to easily build platform-native packages.
* Creating packages easily (deb, rpm, etc)
* Tweaking existing packages (removing files, changing metadata/dependencies)
* Stripping pre/post/maintainer scripts from packages
## System packages
Many Linux distros do not ship ruby C headers or a compiler by default, and
you'll need that to install fpm.
```
# deb based distributions:
apt-get install ruby-dev gcc make
# rpm ones:
yum install ruby-devel gcc make
```
Additional packages will be required depending on the source and target package
types (rpmbuild for rpm, etc.). FPM will show the commands that are required
which you must map to your distribution's package names.
## Get with the download
You can install fpm with gem:
gem install fpm
(On OS X, you may also need gnutar: `brew install gnu-tar`.)
Building a package might look something like this:
fpm -s <source type> -t <target type> [list of sources]...
"Source type" is what your package is coming from; a directory (dir), a rubygem
(gem), an rpm (rpm), a python package (python), a php pear module (pear), etc.
"Target type" is what your output package form should be. Most common are "rpm"
and "deb" but others exist (solaris, etc)
You have two options for learning to run FPM:
1. If you're impatient, just scan through `fpm --help`; you'll need various
options, and they're reasonably straightforward. Impatient learning is
totally welcome, and if you run into issues, ask questions in #fpm on
freenode irc or on fpm-users@googlegroups.com!
1. [The wiki](https://github.com/jordansissel/fpm/wiki) has explanations and
examples. If you run into problems, I welcome you to ask questions in #fpm
on freenode irc or on fpm-users@googlegroups.com!
## Things that are in the works or should work:
Sources:
* gem (even autodownloaded for you)
* python modules (autodownload for you)
* pear (also downloads for you)
* directories
* tar(.gz) archives
* rpm
* deb
* node packages (npm)
* pacman (ArchLinux) packages
Targets:
* deb
* rpm
* solaris
* tar
* directories
* Mac OS X `.pkg` files (`osxpkg`)
* pacman (ArchLinux) packages
## Need Help or Want to Contribute?
All contributions are welcome: ideas, patches, documentation, bug reports,
complaints, and even something you drew up on a napkin.
It is more important to me that you are able to contribute and get help if you
need it..
That said, some basic guidelines, which you are free to ignore :)
* Have a problem you want fpm to solve for you? You can email the
[mailing list](http://groups.google.com/group/fpm-users), or
join the IRC channel #fpm on irc.freenode.org, or email me personally
(jls@semicomplete.com)
* Have an idea or a feature request? File a ticket on
[GitHub](https://github.com/jordansissel/fpm/issues), or email the
[mailing list](http://groups.google.com/group/fpm-users), or email
me personally (jls@semicomplete.com) if that is more comfortable.
* If you think you found a bug, it probably is a bug. File it on
[GitHub](https://github.com/jordansissel/fpm/issues) or send details to
the [mailing list](http://groups.google.com/group/fpm-users).
* 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](http://groups.google.com/group/fpm-users)
### Contributing by forking from GitHub
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.md](CODE_OF_CONDUCT.md).
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 git@github.com:yourusername/fpm.git
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:
...
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.
##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.
## More Documentation
[See the wiki for more docs](https://github.com/jordansissel/fpm/wiki)

101
README.rst Normal file
View File

@ -0,0 +1,101 @@
fpm
===
|Gem|
The goal of fpm is to make it easy and quick to build packages such as rpms,
debs, OSX packages, etc.
fpm, as a project, exists to help you build packages, therefore:
* If fpm is not helping you make packages easily, then there is a bug in fpm.
* If you are having a bad time with fpm, then there is a bug in fpm.
* If the documentation is confusing, then this is a bug in fpm.
If there is a bug in fpm, then we can work together to fix it. If you wish to
report a bug/problem/whatever, I welcome you to do on `the project issue tracker`_.
.. _the project issue tracker: https://github.com/jordansissel/fpm/issues
You can find out how to use fpm in the `documentation`_.
.. _documentation: https://fpm.readthedocs.io/en/latest/
You can learn how to install fpm on your platform in the `installation guide`_.
.. _installation guide: https://fpm.readthedocs.io/en/latest/installation.html
Project Principles
------------------
* Community: If a newbie has a bad time, it's a bug.
* Engineering: Make it work, then make it right, then make it fast.
* Capabilities: If it doesn't do a thing today, we can make it do it tomorrow.
Backstory
---------
Sometimes packaging is done wrong (because you can't do it right for all
situations), but small tweaks can fix it.
And sometimes, there isn't a package available for the tool you need.
And sometimes if you ask "How do I get python 3.9 on RHEL 8?" some unhelpful
trolls will tell you to "Use another distro"
Further, job switches have me flipping between Ubuntu and CentOS. These use
two totally different package systems with completely different packaging
policies and support tools. Learning both was painful and confusing. I want to
save myself (and you) that pain in the future.
It should be easy to say "here's my install dir and here's some dependencies;
please make a package"
The Solution - FPM
------------------
I wanted a simple way to create packages without needing to memorize too much.
I wanted a tool to help me deliver software with minimal steps or training.
The goal of FPM is to be able to easily build platform-native packages.
With fpm, you can do many things, including:
* Creating packages easily (deb, rpm, freebsd, etc)
* Tweaking existing packages (removing files, changing metadata/dependencies)
* Stripping pre/post/maintainer scripts from packages
.. include: docs/installing
Things that should work
-----------------------
Sources:
* gem (even autodownloaded for you)
* python modules (autodownload for you)
* pear (also downloads for you)
* directories
* tar(.gz) archives
* rpm
* deb
* node packages (npm)
* pacman (ArchLinux) packages
Targets:
* deb
* rpm
* solaris
* freebsd
* tar
* directories
* Mac OS X `.pkg` files (`osxpkg`)
* pacman (ArchLinux) packages
.. include: docs/contributing
.. |Gem| image:: https://img.shields.io/gem/v/fpm.svg
:target: https://rubygems.org/gems/fpm

View File

@ -1,6 +1,5 @@
#!/usr/bin/env ruby
require "rubygems"
$: << File.join(File.dirname(__FILE__), "..", "lib")
require "fpm"
require "fpm/command"

9
docs/Dockerfile Normal file
View File

@ -0,0 +1,9 @@
# This Dockerfile produces a docker image which is used to build the fpm docs.
FROM debian:latest
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python3-pip
RUN apt-get install -y python3-sphinx #pip3 install Sphinx
#==1.8
RUN apt-get install -y python3-sphinx python3-sphinx-rtd-theme python3-sphinx-autobuild
CMD ["/bin/bash"]

47
docs/Makefile Normal file
View File

@ -0,0 +1,47 @@
include Makefile.sphinx
IMAGE=fpm-sphinx
WORKDIR=./.work
GITROOT=$(shell git rev-parse --show-toplevel)
GITREMOTE=$(shell git remote -v | awk '/(push)/ {print $$2}')
GENERATED_FILES=cli-reference.rst changelog_links.rst
$(WORKDIR):
mkdir $(WORKDIR)
# A task to generate reST syntax for issue links mentioned in CHANGELOG.rst
changelog_links.rst: ../CHANGELOG.rst Makefile
grep -Eo '#[0-9]+' $< \
| tr -d '#' \
| awk '{printf ".. _#%s: https://github.com/jordansissel/fpm/issues/%s\n", $$1, $$1 }' \
| sort -u > $@
# CLI reference is generated based on the the command line flags
cli-reference.rst: generate-cli-reference.rb Makefile
cli-reference.rst: ../lib/fpm/package/*.rb ../lib/fpm/package.rb
ruby -I ../lib generate-cli-reference.rb > $@
package-type-cli:
$(MAKE) $(addprefix packages/cli/,$(addsuffix .rst,$(notdir $(basename $(wildcard ../lib/fpm/package/*.rb)))))
packages/cli:
mkdir $@
packages/cli/%.rst: ../lib/fpm/package/%.rb packages/cli generate-cli-reference.rb Makefile
ruby -I ../lib generate-cli-reference.rb $* > $@
.PHONY: docker-prep
docker-prep: Dockerfile
@docker images fpm-sphinx | grep -q '^fpm-sphinx ' \
|| docker build -t $(IMAGE) .
.PHONY: build
build: $(GENERATED_FILES) | docker-prep package-type-cli
docker run -it -v $$PWD/../:/project:z $(IMAGE) sh -xc 'make -C /project/docs html && chown -R 1000:1000 /project/docs'
.PHONY: build
view: $(GENERATED_FILES) | docker-prep
docker run -p 127.0.0.1:8000:8000 -it -v $$PWD/../:/project:z $(IMAGE) sh -xc 'make -C /project/docs livehtml'

221
docs/Makefile.sphinx Normal file
View File

@ -0,0 +1,221 @@
# Makefile for Sphinx documentation
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = _build
# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
.PHONY: help
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " applehelp to make an Apple Help Book"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " epub3 to make an epub3"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " texinfo to make Texinfo files"
@echo " info to make Texinfo files and run them through makeinfo"
@echo " gettext to make PO message catalogs"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " xml to make Docutils-native XML files"
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
@echo " coverage to run coverage check of the documentation (if enabled)"
.PHONY: clean
clean:
rm -rf $(BUILDDIR)/*
.PHONY: html
html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
.PHONY: dirhtml
dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
.PHONY: singlehtml
singlehtml:
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
.PHONY: pickle
pickle:
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."
.PHONY: json
json:
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."
.PHONY: htmlhelp
htmlhelp:
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."
.PHONY: qthelp
qthelp:
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/fpm.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/fpm.qhc"
.PHONY: applehelp
applehelp:
$(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp
@echo
@echo "Build finished. The help book is in $(BUILDDIR)/applehelp."
@echo "N.B. You won't be able to view it unless you put it in" \
"~/Library/Documentation/Help or install it in your application" \
"bundle."
.PHONY: devhelp
devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/fpm"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/fpm"
@echo "# devhelp"
.PHONY: epub
epub:
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
.PHONY: epub3
epub3:
$(SPHINXBUILD) -b epub3 $(ALLSPHINXOPTS) $(BUILDDIR)/epub3
@echo
@echo "Build finished. The epub3 file is in $(BUILDDIR)/epub3."
.PHONY: latex
latex:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."
.PHONY: latexpdf
latexpdf:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
.PHONY: latexpdfja
latexpdfja:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through platex and dvipdfmx..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
.PHONY: text
text:
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."
.PHONY: man
man:
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
.PHONY: texinfo
texinfo:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
@echo "Run \`make' in that directory to run these through makeinfo" \
"(use \`make info' here to do that automatically)."
.PHONY: info
info:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo "Running Texinfo files through makeinfo..."
make -C $(BUILDDIR)/texinfo info
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
.PHONY: gettext
gettext:
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
@echo
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
.PHONY: changes
changes:
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."
.PHONY: linkcheck
linkcheck:
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."
.PHONY: doctest
doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."
.PHONY: coverage
coverage:
$(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage
@echo "Testing of coverage in the sources finished, look at the " \
"results in $(BUILDDIR)/coverage/python.txt."
.PHONY: xml
xml:
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
@echo
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."
.PHONY: pseudoxml
pseudoxml:
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
@echo
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
livehtml:
sphinx-autobuild --host 0.0.0.0 "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

2
docs/changelog.rst Normal file
View File

@ -0,0 +1,2 @@
.. include:: changelog_links.rst
.. include:: ../CHANGELOG.rst

466
docs/changelog_links.rst Normal file
View File

@ -0,0 +1,466 @@
.. _#1006: https://github.com/jordansissel/fpm/issues/1006
.. _#1008: https://github.com/jordansissel/fpm/issues/1008
.. _#1012: https://github.com/jordansissel/fpm/issues/1012
.. _#1053: https://github.com/jordansissel/fpm/issues/1053
.. _#1054: https://github.com/jordansissel/fpm/issues/1054
.. _#1073: https://github.com/jordansissel/fpm/issues/1073
.. _#1090: https://github.com/jordansissel/fpm/issues/1090
.. _#1093: https://github.com/jordansissel/fpm/issues/1093
.. _#1101: https://github.com/jordansissel/fpm/issues/1101
.. _#1112: https://github.com/jordansissel/fpm/issues/1112
.. _#1113: https://github.com/jordansissel/fpm/issues/1113
.. _#1115: https://github.com/jordansissel/fpm/issues/1115
.. _#1119: https://github.com/jordansissel/fpm/issues/1119
.. _#1120: https://github.com/jordansissel/fpm/issues/1120
.. _#1123: https://github.com/jordansissel/fpm/issues/1123
.. _#1132: https://github.com/jordansissel/fpm/issues/1132
.. _#1134: https://github.com/jordansissel/fpm/issues/1134
.. _#1146: https://github.com/jordansissel/fpm/issues/1146
.. _#1147: https://github.com/jordansissel/fpm/issues/1147
.. _#1148: https://github.com/jordansissel/fpm/issues/1148
.. _#1191: https://github.com/jordansissel/fpm/issues/1191
.. _#1196: https://github.com/jordansissel/fpm/issues/1196
.. _#1202: https://github.com/jordansissel/fpm/issues/1202
.. _#1203: https://github.com/jordansissel/fpm/issues/1203
.. _#1206: https://github.com/jordansissel/fpm/issues/1206
.. _#1208: https://github.com/jordansissel/fpm/issues/1208
.. _#1210: https://github.com/jordansissel/fpm/issues/1210
.. _#1213: https://github.com/jordansissel/fpm/issues/1213
.. _#1218: https://github.com/jordansissel/fpm/issues/1218
.. _#1225: https://github.com/jordansissel/fpm/issues/1225
.. _#1231: https://github.com/jordansissel/fpm/issues/1231
.. _#1235: https://github.com/jordansissel/fpm/issues/1235
.. _#1236: https://github.com/jordansissel/fpm/issues/1236
.. _#1237: https://github.com/jordansissel/fpm/issues/1237
.. _#1241: https://github.com/jordansissel/fpm/issues/1241
.. _#1242: https://github.com/jordansissel/fpm/issues/1242
.. _#1253: https://github.com/jordansissel/fpm/issues/1253
.. _#1259: https://github.com/jordansissel/fpm/issues/1259
.. _#1262: https://github.com/jordansissel/fpm/issues/1262
.. _#1264: https://github.com/jordansissel/fpm/issues/1264
.. _#1266: https://github.com/jordansissel/fpm/issues/1266
.. _#1287: https://github.com/jordansissel/fpm/issues/1287
.. _#1291: https://github.com/jordansissel/fpm/issues/1291
.. _#1293: https://github.com/jordansissel/fpm/issues/1293
.. _#1307: https://github.com/jordansissel/fpm/issues/1307
.. _#1309: https://github.com/jordansissel/fpm/issues/1309
.. _#1311: https://github.com/jordansissel/fpm/issues/1311
.. _#1313: https://github.com/jordansissel/fpm/issues/1313
.. _#1314: https://github.com/jordansissel/fpm/issues/1314
.. _#1320: https://github.com/jordansissel/fpm/issues/1320
.. _#1321: https://github.com/jordansissel/fpm/issues/1321
.. _#1325: https://github.com/jordansissel/fpm/issues/1325
.. _#1338: https://github.com/jordansissel/fpm/issues/1338
.. _#1339: https://github.com/jordansissel/fpm/issues/1339
.. _#1340: https://github.com/jordansissel/fpm/issues/1340
.. _#1341: https://github.com/jordansissel/fpm/issues/1341
.. _#1342: https://github.com/jordansissel/fpm/issues/1342
.. _#1343: https://github.com/jordansissel/fpm/issues/1343
.. _#1344: https://github.com/jordansissel/fpm/issues/1344
.. _#1345: https://github.com/jordansissel/fpm/issues/1345
.. _#1348: https://github.com/jordansissel/fpm/issues/1348
.. _#1349: https://github.com/jordansissel/fpm/issues/1349
.. _#1352: https://github.com/jordansissel/fpm/issues/1352
.. _#1354: https://github.com/jordansissel/fpm/issues/1354
.. _#1355: https://github.com/jordansissel/fpm/issues/1355
.. _#1358: https://github.com/jordansissel/fpm/issues/1358
.. _#1359: https://github.com/jordansissel/fpm/issues/1359
.. _#1374: https://github.com/jordansissel/fpm/issues/1374
.. _#1376: https://github.com/jordansissel/fpm/issues/1376
.. _#1379: https://github.com/jordansissel/fpm/issues/1379
.. _#1384: https://github.com/jordansissel/fpm/issues/1384
.. _#1385: https://github.com/jordansissel/fpm/issues/1385
.. _#1390: https://github.com/jordansissel/fpm/issues/1390
.. _#1391: https://github.com/jordansissel/fpm/issues/1391
.. _#1395: https://github.com/jordansissel/fpm/issues/1395
.. _#1419: https://github.com/jordansissel/fpm/issues/1419
.. _#1422: https://github.com/jordansissel/fpm/issues/1422
.. _#1434: https://github.com/jordansissel/fpm/issues/1434
.. _#1440: https://github.com/jordansissel/fpm/issues/1440
.. _#1443: https://github.com/jordansissel/fpm/issues/1443
.. _#1447: https://github.com/jordansissel/fpm/issues/1447
.. _#1452: https://github.com/jordansissel/fpm/issues/1452
.. _#1453: https://github.com/jordansissel/fpm/issues/1453
.. _#1482: https://github.com/jordansissel/fpm/issues/1482
.. _#1484: https://github.com/jordansissel/fpm/issues/1484
.. _#1488: https://github.com/jordansissel/fpm/issues/1488
.. _#1490: https://github.com/jordansissel/fpm/issues/1490
.. _#1492: https://github.com/jordansissel/fpm/issues/1492
.. _#1494: https://github.com/jordansissel/fpm/issues/1494
.. _#1509: https://github.com/jordansissel/fpm/issues/1509
.. _#1511: https://github.com/jordansissel/fpm/issues/1511
.. _#1514: https://github.com/jordansissel/fpm/issues/1514
.. _#1515: https://github.com/jordansissel/fpm/issues/1515
.. _#1519: https://github.com/jordansissel/fpm/issues/1519
.. _#1522: https://github.com/jordansissel/fpm/issues/1522
.. _#1523: https://github.com/jordansissel/fpm/issues/1523
.. _#1528: https://github.com/jordansissel/fpm/issues/1528
.. _#1592: https://github.com/jordansissel/fpm/issues/1592
.. _#1627: https://github.com/jordansissel/fpm/issues/1627
.. _#1636: https://github.com/jordansissel/fpm/issues/1636
.. _#1642: https://github.com/jordansissel/fpm/issues/1642
.. _#1667: https://github.com/jordansissel/fpm/issues/1667
.. _#1668: https://github.com/jordansissel/fpm/issues/1668
.. _#1682: https://github.com/jordansissel/fpm/issues/1682
.. _#1697: https://github.com/jordansissel/fpm/issues/1697
.. _#1699: https://github.com/jordansissel/fpm/issues/1699
.. _#1709: https://github.com/jordansissel/fpm/issues/1709
.. _#1710: https://github.com/jordansissel/fpm/issues/1710
.. _#1711: https://github.com/jordansissel/fpm/issues/1711
.. _#171: https://github.com/jordansissel/fpm/issues/171
.. _#1724: https://github.com/jordansissel/fpm/issues/1724
.. _#1727: https://github.com/jordansissel/fpm/issues/1727
.. _#1729: https://github.com/jordansissel/fpm/issues/1729
.. _#1737: https://github.com/jordansissel/fpm/issues/1737
.. _#1738: https://github.com/jordansissel/fpm/issues/1738
.. _#1739: https://github.com/jordansissel/fpm/issues/1739
.. _#1740: https://github.com/jordansissel/fpm/issues/1740
.. _#1741: https://github.com/jordansissel/fpm/issues/1741
.. _#1745: https://github.com/jordansissel/fpm/issues/1745
.. _#1748: https://github.com/jordansissel/fpm/issues/1748
.. _#1749: https://github.com/jordansissel/fpm/issues/1749
.. _#1751: https://github.com/jordansissel/fpm/issues/1751
.. _#1752: https://github.com/jordansissel/fpm/issues/1752
.. _#1753: https://github.com/jordansissel/fpm/issues/1753
.. _#1760: https://github.com/jordansissel/fpm/issues/1760
.. _#1761: https://github.com/jordansissel/fpm/issues/1761
.. _#1764: https://github.com/jordansissel/fpm/issues/1764
.. _#1766: https://github.com/jordansissel/fpm/issues/1766
.. _#1772: https://github.com/jordansissel/fpm/issues/1772
.. _#1774: https://github.com/jordansissel/fpm/issues/1774
.. _#1775: https://github.com/jordansissel/fpm/issues/1775
.. _#1784: https://github.com/jordansissel/fpm/issues/1784
.. _#1785: https://github.com/jordansissel/fpm/issues/1785
.. _#1786: https://github.com/jordansissel/fpm/issues/1786
.. _#1788: https://github.com/jordansissel/fpm/issues/1788
.. _#1794: https://github.com/jordansissel/fpm/issues/1794
.. _#1797: https://github.com/jordansissel/fpm/issues/1797
.. _#1798: https://github.com/jordansissel/fpm/issues/1798
.. _#1800: https://github.com/jordansissel/fpm/issues/1800
.. _#1803: https://github.com/jordansissel/fpm/issues/1803
.. _#1811: https://github.com/jordansissel/fpm/issues/1811
.. _#1812: https://github.com/jordansissel/fpm/issues/1812
.. _#1815: https://github.com/jordansissel/fpm/issues/1815
.. _#1816: https://github.com/jordansissel/fpm/issues/1816
.. _#1817: https://github.com/jordansissel/fpm/issues/1817
.. _#1818: https://github.com/jordansissel/fpm/issues/1818
.. _#1820: https://github.com/jordansissel/fpm/issues/1820
.. _#1821: https://github.com/jordansissel/fpm/issues/1821
.. _#1823: https://github.com/jordansissel/fpm/issues/1823
.. _#1825: https://github.com/jordansissel/fpm/issues/1825
.. _#1827: https://github.com/jordansissel/fpm/issues/1827
.. _#1829: https://github.com/jordansissel/fpm/issues/1829
.. _#1831: https://github.com/jordansissel/fpm/issues/1831
.. _#1832: https://github.com/jordansissel/fpm/issues/1832
.. _#1833: https://github.com/jordansissel/fpm/issues/1833
.. _#1834: https://github.com/jordansissel/fpm/issues/1834
.. _#1838: https://github.com/jordansissel/fpm/issues/1838
.. _#1842: https://github.com/jordansissel/fpm/issues/1842
.. _#1844: https://github.com/jordansissel/fpm/issues/1844
.. _#1845: https://github.com/jordansissel/fpm/issues/1845
.. _#1846: https://github.com/jordansissel/fpm/issues/1846
.. _#1850: https://github.com/jordansissel/fpm/issues/1850
.. _#1851: https://github.com/jordansissel/fpm/issues/1851
.. _#1852: https://github.com/jordansissel/fpm/issues/1852
.. _#1854: https://github.com/jordansissel/fpm/issues/1854
.. _#1856: https://github.com/jordansissel/fpm/issues/1856
.. _#185: https://github.com/jordansissel/fpm/issues/185
.. _#1864: https://github.com/jordansissel/fpm/issues/1864
.. _#186: https://github.com/jordansissel/fpm/issues/186
.. _#1875: https://github.com/jordansissel/fpm/issues/1875
.. _#1876: https://github.com/jordansissel/fpm/issues/1876
.. _#1877: https://github.com/jordansissel/fpm/issues/1877
.. _#1879: https://github.com/jordansissel/fpm/issues/1879
.. _#187: https://github.com/jordansissel/fpm/issues/187
.. _#1880: https://github.com/jordansissel/fpm/issues/1880
.. _#1882: https://github.com/jordansissel/fpm/issues/1882
.. _#1884: https://github.com/jordansissel/fpm/issues/1884
.. _#1886: https://github.com/jordansissel/fpm/issues/1886
.. _#1893: https://github.com/jordansissel/fpm/issues/1893
.. _#1895: https://github.com/jordansissel/fpm/issues/1895
.. _#1896: https://github.com/jordansissel/fpm/issues/1896
.. _#1897: https://github.com/jordansissel/fpm/issues/1897
.. _#1898: https://github.com/jordansissel/fpm/issues/1898
.. _#1899: https://github.com/jordansissel/fpm/issues/1899
.. _#1902: https://github.com/jordansissel/fpm/issues/1902
.. _#1905: https://github.com/jordansissel/fpm/issues/1905
.. _#1907: https://github.com/jordansissel/fpm/issues/1907
.. _#1908: https://github.com/jordansissel/fpm/issues/1908
.. _#1909: https://github.com/jordansissel/fpm/issues/1909
.. _#190: https://github.com/jordansissel/fpm/issues/190
.. _#1912: https://github.com/jordansissel/fpm/issues/1912
.. _#1913: https://github.com/jordansissel/fpm/issues/1913
.. _#1916: https://github.com/jordansissel/fpm/issues/1916
.. _#191: https://github.com/jordansissel/fpm/issues/191
.. _#1923: https://github.com/jordansissel/fpm/issues/1923
.. _#1934: https://github.com/jordansissel/fpm/issues/1934
.. _#1935: https://github.com/jordansissel/fpm/issues/1935
.. _#1937: https://github.com/jordansissel/fpm/issues/1937
.. _#1939: https://github.com/jordansissel/fpm/issues/1939
.. _#193: https://github.com/jordansissel/fpm/issues/193
.. _#1940: https://github.com/jordansissel/fpm/issues/1940
.. _#1942: https://github.com/jordansissel/fpm/issues/1942
.. _#1946: https://github.com/jordansissel/fpm/issues/1946
.. _#1948: https://github.com/jordansissel/fpm/issues/1948
.. _#1949: https://github.com/jordansissel/fpm/issues/1949
.. _#194: https://github.com/jordansissel/fpm/issues/194
.. _#1950: https://github.com/jordansissel/fpm/issues/1950
.. _#1955: https://github.com/jordansissel/fpm/issues/1955
.. _#1959: https://github.com/jordansissel/fpm/issues/1959
.. _#196: https://github.com/jordansissel/fpm/issues/196
.. _#1978: https://github.com/jordansissel/fpm/issues/1978
.. _#1981: https://github.com/jordansissel/fpm/issues/1981
.. _#1982: https://github.com/jordansissel/fpm/issues/1982
.. _#1988: https://github.com/jordansissel/fpm/issues/1988
.. _#198: https://github.com/jordansissel/fpm/issues/198
.. _#2009: https://github.com/jordansissel/fpm/issues/2009
.. _#2011: https://github.com/jordansissel/fpm/issues/2011
.. _#2017: https://github.com/jordansissel/fpm/issues/2017
.. _#2027: https://github.com/jordansissel/fpm/issues/2027
.. _#2029: https://github.com/jordansissel/fpm/issues/2029
.. _#202: https://github.com/jordansissel/fpm/issues/202
.. _#2036: https://github.com/jordansissel/fpm/issues/2036
.. _#2040: https://github.com/jordansissel/fpm/issues/2040
.. _#2041: https://github.com/jordansissel/fpm/issues/2041
.. _#204: https://github.com/jordansissel/fpm/issues/204
.. _#2053: https://github.com/jordansissel/fpm/issues/2053
.. _#2054: https://github.com/jordansissel/fpm/issues/2054
.. _#205: https://github.com/jordansissel/fpm/issues/205
.. _#2062: https://github.com/jordansissel/fpm/issues/2062
.. _#2063: https://github.com/jordansissel/fpm/issues/2063
.. _#2064: https://github.com/jordansissel/fpm/issues/2064
.. _#2065: https://github.com/jordansissel/fpm/issues/2065
.. _#2066: https://github.com/jordansissel/fpm/issues/2066
.. _#2067: https://github.com/jordansissel/fpm/issues/2067
.. _#2068: https://github.com/jordansissel/fpm/issues/2068
.. _#206: https://github.com/jordansissel/fpm/issues/206
.. _#2072: https://github.com/jordansissel/fpm/issues/2072
.. _#2074: https://github.com/jordansissel/fpm/issues/2074
.. _#2076: https://github.com/jordansissel/fpm/issues/2076
.. _#207: https://github.com/jordansissel/fpm/issues/207
.. _#2082: https://github.com/jordansissel/fpm/issues/2082
.. _#2084: https://github.com/jordansissel/fpm/issues/2084
.. _#2085: https://github.com/jordansissel/fpm/issues/2085
.. _#2087: https://github.com/jordansissel/fpm/issues/2087
.. _#2088: https://github.com/jordansissel/fpm/issues/2088
.. _#208: https://github.com/jordansissel/fpm/issues/208
.. _#2092: https://github.com/jordansissel/fpm/issues/2092
.. _#2102: https://github.com/jordansissel/fpm/issues/2102
.. _#2103: https://github.com/jordansissel/fpm/issues/2103
.. _#2104: https://github.com/jordansissel/fpm/issues/2104
.. _#2105: https://github.com/jordansissel/fpm/issues/2105
.. _#2106: https://github.com/jordansissel/fpm/issues/2106
.. _#212: https://github.com/jordansissel/fpm/issues/212
.. _#213: https://github.com/jordansissel/fpm/issues/213
.. _#215: https://github.com/jordansissel/fpm/issues/215
.. _#216: https://github.com/jordansissel/fpm/issues/216
.. _#217: https://github.com/jordansissel/fpm/issues/217
.. _#221: https://github.com/jordansissel/fpm/issues/221
.. _#222: https://github.com/jordansissel/fpm/issues/222
.. _#223: https://github.com/jordansissel/fpm/issues/223
.. _#228: https://github.com/jordansissel/fpm/issues/228
.. _#232: https://github.com/jordansissel/fpm/issues/232
.. _#233: https://github.com/jordansissel/fpm/issues/233
.. _#234: https://github.com/jordansissel/fpm/issues/234
.. _#240: https://github.com/jordansissel/fpm/issues/240
.. _#244: https://github.com/jordansissel/fpm/issues/244
.. _#245: https://github.com/jordansissel/fpm/issues/245
.. _#248: https://github.com/jordansissel/fpm/issues/248
.. _#250: https://github.com/jordansissel/fpm/issues/250
.. _#251: https://github.com/jordansissel/fpm/issues/251
.. _#252: https://github.com/jordansissel/fpm/issues/252
.. _#253: https://github.com/jordansissel/fpm/issues/253
.. _#255: https://github.com/jordansissel/fpm/issues/255
.. _#257: https://github.com/jordansissel/fpm/issues/257
.. _#260: https://github.com/jordansissel/fpm/issues/260
.. _#263: https://github.com/jordansissel/fpm/issues/263
.. _#266: https://github.com/jordansissel/fpm/issues/266
.. _#269: https://github.com/jordansissel/fpm/issues/269
.. _#273: https://github.com/jordansissel/fpm/issues/273
.. _#274: https://github.com/jordansissel/fpm/issues/274
.. _#276: https://github.com/jordansissel/fpm/issues/276
.. _#278: https://github.com/jordansissel/fpm/issues/278
.. _#279: https://github.com/jordansissel/fpm/issues/279
.. _#280: https://github.com/jordansissel/fpm/issues/280
.. _#281: https://github.com/jordansissel/fpm/issues/281
.. _#284: https://github.com/jordansissel/fpm/issues/284
.. _#285: https://github.com/jordansissel/fpm/issues/285
.. _#287: https://github.com/jordansissel/fpm/issues/287
.. _#288: https://github.com/jordansissel/fpm/issues/288
.. _#289: https://github.com/jordansissel/fpm/issues/289
.. _#291: https://github.com/jordansissel/fpm/issues/291
.. _#292: https://github.com/jordansissel/fpm/issues/292
.. _#293: https://github.com/jordansissel/fpm/issues/293
.. _#294: https://github.com/jordansissel/fpm/issues/294
.. _#296: https://github.com/jordansissel/fpm/issues/296
.. _#297: https://github.com/jordansissel/fpm/issues/297
.. _#299: https://github.com/jordansissel/fpm/issues/299
.. _#300: https://github.com/jordansissel/fpm/issues/300
.. _#301: https://github.com/jordansissel/fpm/issues/301
.. _#304: https://github.com/jordansissel/fpm/issues/304
.. _#309: https://github.com/jordansissel/fpm/issues/309
.. _#310: https://github.com/jordansissel/fpm/issues/310
.. _#311: https://github.com/jordansissel/fpm/issues/311
.. _#312: https://github.com/jordansissel/fpm/issues/312
.. _#315: https://github.com/jordansissel/fpm/issues/315
.. _#316: https://github.com/jordansissel/fpm/issues/316
.. _#319: https://github.com/jordansissel/fpm/issues/319
.. _#320: https://github.com/jordansissel/fpm/issues/320
.. _#321: https://github.com/jordansissel/fpm/issues/321
.. _#323: https://github.com/jordansissel/fpm/issues/323
.. _#325: https://github.com/jordansissel/fpm/issues/325
.. _#329: https://github.com/jordansissel/fpm/issues/329
.. _#332: https://github.com/jordansissel/fpm/issues/332
.. _#337: https://github.com/jordansissel/fpm/issues/337
.. _#342: https://github.com/jordansissel/fpm/issues/342
.. _#343: https://github.com/jordansissel/fpm/issues/343
.. _#344: https://github.com/jordansissel/fpm/issues/344
.. _#347: https://github.com/jordansissel/fpm/issues/347
.. _#358: https://github.com/jordansissel/fpm/issues/358
.. _#359: https://github.com/jordansissel/fpm/issues/359
.. _#363: https://github.com/jordansissel/fpm/issues/363
.. _#364: https://github.com/jordansissel/fpm/issues/364
.. _#365: https://github.com/jordansissel/fpm/issues/365
.. _#374: https://github.com/jordansissel/fpm/issues/374
.. _#376: https://github.com/jordansissel/fpm/issues/376
.. _#377: https://github.com/jordansissel/fpm/issues/377
.. _#378: https://github.com/jordansissel/fpm/issues/378
.. _#381: https://github.com/jordansissel/fpm/issues/381
.. _#383: https://github.com/jordansissel/fpm/issues/383
.. _#384: https://github.com/jordansissel/fpm/issues/384
.. _#385: https://github.com/jordansissel/fpm/issues/385
.. _#386: https://github.com/jordansissel/fpm/issues/386
.. _#388: https://github.com/jordansissel/fpm/issues/388
.. _#389: https://github.com/jordansissel/fpm/issues/389
.. _#393: https://github.com/jordansissel/fpm/issues/393
.. _#394: https://github.com/jordansissel/fpm/issues/394
.. _#395: https://github.com/jordansissel/fpm/issues/395
.. _#396: https://github.com/jordansissel/fpm/issues/396
.. _#398: https://github.com/jordansissel/fpm/issues/398
.. _#399: https://github.com/jordansissel/fpm/issues/399
.. _#400: https://github.com/jordansissel/fpm/issues/400
.. _#401: https://github.com/jordansissel/fpm/issues/401
.. _#403: https://github.com/jordansissel/fpm/issues/403
.. _#404: https://github.com/jordansissel/fpm/issues/404
.. _#405: https://github.com/jordansissel/fpm/issues/405
.. _#416: https://github.com/jordansissel/fpm/issues/416
.. _#420: https://github.com/jordansissel/fpm/issues/420
.. _#428: https://github.com/jordansissel/fpm/issues/428
.. _#438: https://github.com/jordansissel/fpm/issues/438
.. _#439: https://github.com/jordansissel/fpm/issues/439
.. _#442: https://github.com/jordansissel/fpm/issues/442
.. _#443: https://github.com/jordansissel/fpm/issues/443
.. _#445: https://github.com/jordansissel/fpm/issues/445
.. _#447: https://github.com/jordansissel/fpm/issues/447
.. _#450: https://github.com/jordansissel/fpm/issues/450
.. _#451: https://github.com/jordansissel/fpm/issues/451
.. _#461: https://github.com/jordansissel/fpm/issues/461
.. _#464: https://github.com/jordansissel/fpm/issues/464
.. _#465: https://github.com/jordansissel/fpm/issues/465
.. _#476: https://github.com/jordansissel/fpm/issues/476
.. _#480: https://github.com/jordansissel/fpm/issues/480
.. _#481: https://github.com/jordansissel/fpm/issues/481
.. _#484: https://github.com/jordansissel/fpm/issues/484
.. _#487: https://github.com/jordansissel/fpm/issues/487
.. _#491: https://github.com/jordansissel/fpm/issues/491
.. _#498: https://github.com/jordansissel/fpm/issues/498
.. _#500: https://github.com/jordansissel/fpm/issues/500
.. _#502: https://github.com/jordansissel/fpm/issues/502
.. _#503: https://github.com/jordansissel/fpm/issues/503
.. _#504: https://github.com/jordansissel/fpm/issues/504
.. _#506: https://github.com/jordansissel/fpm/issues/506
.. _#507: https://github.com/jordansissel/fpm/issues/507
.. _#508: https://github.com/jordansissel/fpm/issues/508
.. _#510: https://github.com/jordansissel/fpm/issues/510
.. _#511: https://github.com/jordansissel/fpm/issues/511
.. _#513: https://github.com/jordansissel/fpm/issues/513
.. _#518: https://github.com/jordansissel/fpm/issues/518
.. _#521: https://github.com/jordansissel/fpm/issues/521
.. _#524: https://github.com/jordansissel/fpm/issues/524
.. _#539: https://github.com/jordansissel/fpm/issues/539
.. _#543: https://github.com/jordansissel/fpm/issues/543
.. _#544: https://github.com/jordansissel/fpm/issues/544
.. _#545: https://github.com/jordansissel/fpm/issues/545
.. _#547: https://github.com/jordansissel/fpm/issues/547
.. _#554: https://github.com/jordansissel/fpm/issues/554
.. _#556: https://github.com/jordansissel/fpm/issues/556
.. _#561: https://github.com/jordansissel/fpm/issues/561
.. _#567: https://github.com/jordansissel/fpm/issues/567
.. _#573: https://github.com/jordansissel/fpm/issues/573
.. _#575: https://github.com/jordansissel/fpm/issues/575
.. _#585: https://github.com/jordansissel/fpm/issues/585
.. _#591: https://github.com/jordansissel/fpm/issues/591
.. _#593: https://github.com/jordansissel/fpm/issues/593
.. _#595: https://github.com/jordansissel/fpm/issues/595
.. _#598: https://github.com/jordansissel/fpm/issues/598
.. _#599: https://github.com/jordansissel/fpm/issues/599
.. _#603: https://github.com/jordansissel/fpm/issues/603
.. _#612: https://github.com/jordansissel/fpm/issues/612
.. _#614: https://github.com/jordansissel/fpm/issues/614
.. _#615: https://github.com/jordansissel/fpm/issues/615
.. _#616: https://github.com/jordansissel/fpm/issues/616
.. _#617: https://github.com/jordansissel/fpm/issues/617
.. _#623: https://github.com/jordansissel/fpm/issues/623
.. _#626: https://github.com/jordansissel/fpm/issues/626
.. _#628: https://github.com/jordansissel/fpm/issues/628
.. _#640: https://github.com/jordansissel/fpm/issues/640
.. _#642: https://github.com/jordansissel/fpm/issues/642
.. _#648: https://github.com/jordansissel/fpm/issues/648
.. _#651: https://github.com/jordansissel/fpm/issues/651
.. _#652: https://github.com/jordansissel/fpm/issues/652
.. _#654: https://github.com/jordansissel/fpm/issues/654
.. _#656: https://github.com/jordansissel/fpm/issues/656
.. _#658: https://github.com/jordansissel/fpm/issues/658
.. _#659: https://github.com/jordansissel/fpm/issues/659
.. _#661: https://github.com/jordansissel/fpm/issues/661
.. _#664: https://github.com/jordansissel/fpm/issues/664
.. _#676: https://github.com/jordansissel/fpm/issues/676
.. _#679: https://github.com/jordansissel/fpm/issues/679
.. _#687: https://github.com/jordansissel/fpm/issues/687
.. _#688: https://github.com/jordansissel/fpm/issues/688
.. _#707: https://github.com/jordansissel/fpm/issues/707
.. _#712: https://github.com/jordansissel/fpm/issues/712
.. _#714: https://github.com/jordansissel/fpm/issues/714
.. _#716: https://github.com/jordansissel/fpm/issues/716
.. _#719: https://github.com/jordansissel/fpm/issues/719
.. _#720: https://github.com/jordansissel/fpm/issues/720
.. _#724: https://github.com/jordansissel/fpm/issues/724
.. _#727: https://github.com/jordansissel/fpm/issues/727
.. _#734: https://github.com/jordansissel/fpm/issues/734
.. _#744: https://github.com/jordansissel/fpm/issues/744
.. _#752: https://github.com/jordansissel/fpm/issues/752
.. _#756: https://github.com/jordansissel/fpm/issues/756
.. _#758: https://github.com/jordansissel/fpm/issues/758
.. _#763: https://github.com/jordansissel/fpm/issues/763
.. _#765: https://github.com/jordansissel/fpm/issues/765
.. _#772: https://github.com/jordansissel/fpm/issues/772
.. _#776: https://github.com/jordansissel/fpm/issues/776
.. _#778: https://github.com/jordansissel/fpm/issues/778
.. _#779: https://github.com/jordansissel/fpm/issues/779
.. _#784: https://github.com/jordansissel/fpm/issues/784
.. _#787: https://github.com/jordansissel/fpm/issues/787
.. _#797: https://github.com/jordansissel/fpm/issues/797
.. _#799: https://github.com/jordansissel/fpm/issues/799
.. _#800: https://github.com/jordansissel/fpm/issues/800
.. _#801: https://github.com/jordansissel/fpm/issues/801
.. _#802: https://github.com/jordansissel/fpm/issues/802
.. _#806: https://github.com/jordansissel/fpm/issues/806
.. _#819: https://github.com/jordansissel/fpm/issues/819
.. _#822: https://github.com/jordansissel/fpm/issues/822
.. _#836: https://github.com/jordansissel/fpm/issues/836
.. _#849: https://github.com/jordansissel/fpm/issues/849
.. _#853: https://github.com/jordansissel/fpm/issues/853
.. _#860: https://github.com/jordansissel/fpm/issues/860
.. _#863: https://github.com/jordansissel/fpm/issues/863
.. _#877: https://github.com/jordansissel/fpm/issues/877
.. _#885: https://github.com/jordansissel/fpm/issues/885
.. _#886: https://github.com/jordansissel/fpm/issues/886
.. _#887: https://github.com/jordansissel/fpm/issues/887
.. _#896: https://github.com/jordansissel/fpm/issues/896
.. _#916: https://github.com/jordansissel/fpm/issues/916
.. _#930: https://github.com/jordansissel/fpm/issues/930
.. _#946: https://github.com/jordansissel/fpm/issues/946
.. _#952: https://github.com/jordansissel/fpm/issues/952
.. _#977: https://github.com/jordansissel/fpm/issues/977
.. _#982: https://github.com/jordansissel/fpm/issues/982
.. _#986: https://github.com/jordansissel/fpm/issues/986

596
docs/cli-reference.rst Normal file
View File

@ -0,0 +1,596 @@
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``
General Options
---------------
* ``-C CHDIR``
- Alternate option spellings: ``--chdir``
- Change directory to here before searching for files
* ``-S PACKAGE_NAME_SUFFIX``
- Alternate option spellings: ``--package-name-suffix``
- a name suffix to append to package and dependencies.
* ``-a ARCHITECTURE``
- Alternate option spellings: ``--architecture``
- 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.
* ``-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'
* ``-e``
- Alternate option spellings: ``--edit``
- Edit the package spec before building.
* ``-f``
- Alternate option spellings: ``--force``
- Force output even if it will overwrite an existing file
* ``-m MAINTAINER``
- Alternate option spellings: ``--maintainer``
- The maintainer of this package.
* ``-n NAME``
- Alternate option spellings: ``--name``
- The name to give to the package
* ``-p OUTPUT``
- Alternate option spellings: ``--package``
- The package file path to output.
* ``-s INPUT_TYPE``
- Alternate option spellings: ``--input-type``
- the package type to use as input (gem, rpm, python, etc)
* ``-t OUTPUT_TYPE``
- Alternate option spellings: ``--output-type``
- the type of package you want to create (deb, rpm, solaris, etc)
* ``-v VERSION``
- Alternate option spellings: ``--version``
- The version to give to the package
* ``-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.
* ``--after-install FILE``
- A script to be run after package installation
* ``--after-remove FILE``
- A script to be run after 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-install FILE``
- A script to be run before package installation
* ``--before-remove FILE``
- A script to be run before package removal
* ``--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.
* ``--category CATEGORY``
- (optional) category this package belongs to
* ``--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.
* ``--conflicts CONFLICTS``
- Other packages/versions this package conflicts with. This flag can be specified multiple times.
* ``--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.
* ``--description DESCRIPTION``
- Add a description for this package. You can include '\n' sequences to indicate newline breaks.
* ``--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
* ``--epoch EPOCH``
- The epoch value for this package. RPM and Debian calls this 'epoch'. FreeBSD calls this 'PORTEPOCH'
* ``--exclude-file EXCLUDE_PATH``
- The path to a file containing a newline-sparated list of patterns to exclude from input.
* ``--fpm-options-file FPM_OPTIONS_FILE``
- A file that contains additional fpm options. Any fpm flag format is valid in this file. This can be useful on build servers where you want to use a common configuration or inject other parameters from a file instead of from a command-line flag..
* ``--inputs INPUTS_PATH``
- The path to a file containing a newline-separated list of files and dirs to use as input.
* ``--iteration ITERATION``
- The iteration to give to the package. RPM calls this the 'release'. FreeBSD calls it 'PORTREVISION'. Debian calls this 'debian_revision'
* ``--license LICENSE``
- (optional) license name for this package
* ``--log LEVEL``
- Set the log level. Values: error, warn, info, debug.
* ``--no-auto-depends``
- Do not list any dependencies in this package automatically
* ``--no-depends``
- Do not list any dependencies in this package
* ``--post-install FILE``
- (DEPRECATED, use --after-install) A script to be run after package installation
* ``--post-uninstall FILE``
- (DEPRECATED, use --after-remove) A script to be run after package removal
* ``--pre-install FILE``
- (DEPRECATED, use --before-install) A script to be run before package installation
* ``--pre-uninstall FILE``
- (DEPRECATED, use --before-remove) A script to be run before package removal
* ``--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.
* ``--provides PROVIDES``
- What this package provides (usually a name). 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.
* ``--source-date-epoch-default SOURCE_DATE_EPOCH_DEFAULT``
- If no release date otherwise specified, use this value as timestamp on generated files to reduce nondeterminism. Reproducible build environments such as dpkg-dev and rpmbuild set this via envionment 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
* ``--source-date-epoch-from-changelog``
- Use release date from changelog as timestamp on generated files to reduce nondeterminism. Experimental; only implemented for gem so far.
* ``--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
* ``--url URI``
- Add a url for this package.
* ``--vendor VENDOR``
- (optional) vendor name for this package
* ``--verbose``
- Enable verbose output
* ``--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.
apk
---
This package type has no additional options
cpan
----
* ``--cpan-cpanm-bin CPANM_EXECUTABLE``
- The path to the cpanm executable you wish to run.
* ``--[no-]cpan-cpanm-force``
- Pass the --force parameter to cpanm
* ``--cpan-mirror CPAN_MIRROR``
- The CPAN mirror to use instead of the default.
* ``--[no-]cpan-mirror-only``
- Only use the specified mirror for metadata.
* ``--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
* ``--[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?
deb
---
* ``--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)
* ``--[no-]deb-auto-config-files``
- Init script and default configuration files will be labeled as configuration files for Debian packages.
* ``--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, zst, none.
* ``--deb-compression-level [0-9]``
- Select a compression level. 0 is none or minimal. 9 is max compression.
* ``--deb-config SCRIPTPATH``
- Add SCRIPTPATH as debconf config file.
* ``--deb-custom-control FILEPATH``
- 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
* ``--[no-]deb-generate-changes``
- Generate PACKAGENAME.changes file.
* ``--deb-group GROUP``
- The group owner of files in this package
* ``--[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
* ``--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
* ``--[no-]deb-maintainerscripts-force-errorchecks``
- Activate errexit shell option according to lintian. https://lintian.debian.org/tags/maintainer-script-ignores-errors.html
* ``--deb-meta-file FILEPATH``
- Add FILEPATH to DEBIAN directory
* ``--[no-]deb-no-default-config-files``
- Do not add all files in /etc as configuration files by default for Debian packages.
* ``--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
* ``--[no-]deb-systemd-auto-start``
- Start service after install or upgrade
* ``--[no-]deb-systemd-enable``
- Enable service on install or upgrade
* ``--deb-systemd-path FILEPATH``
- Relative path to the systemd service directory
* ``--[no-]deb-systemd-restart-after-upgrade``
- Restart service after upgrade
* ``--deb-templates FILEPATH``
- Add FILEPATH as debconf templates file.
* ``--deb-upstart FILEPATH``
- Add FILEPATH as an upstart script
* ``--deb-upstream-changelog FILEPATH``
- Add FILEPATH as upstream changelog
* ``--[no-]deb-use-file-permissions``
- Use existing file permissions when defining ownership and modes
* ``--deb-user USER``
- The owner of files in this package
dir
---
This package type has no additional options
empty
-----
This package type has no additional options
freebsd
-------
* ``--freebsd-origin ABI``
- Sets the FreeBSD 'origin' pkg field
* ``--freebsd-osversion VERSION``
- Sets the FreeBSD 'version' pkg field, ie 12 or 13, use '*' for all.
gem
---
* ``--gem-bin-path DIRECTORY``
- The directory to install gem executables
* ``--gem-disable-dependency gem_name``
- The gem name to remove from dependency list
* ``--[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?
* ``--gem-gem PATH_TO_GEM``
- The path to the 'gem' tool (defaults to 'gem' and searches your $PATH)
* ``--gem-git-branch GIT_BRANCH``
- 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.
* ``--[no-]gem-prerelease``
- Allow prerelease versions of a gem
* ``--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 subdirectory of workdir.
* ``--[no-]gem-version-bins``
- Append the version to the bins
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.
osxpkg
------
* ``--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).
* ``--[no-]osxpkg-payload-free``
- Define no payload, assumes use of script options.
* ``--osxpkg-postinstall-action POSTINSTALL_ACTION``
- Post-install action provided in package metadata. Optionally one of 'logout', 'restart', 'shutdown'.
p5p
---
* ``--p5p-group GROUP``
- Set the group to GROUP in the prototype file.
* ``--[no-]p5p-lint``
- Check manifest with pkglint
* ``--p5p-publisher PUBLISHER``
- Set the publisher name for the repository
* ``--p5p-user USER``
- Set the user to USER in the prototype files.
* ``--[no-]p5p-validate``
- Validate with pkg install
* ``--p5p-zonetype ZONETYPE``
- Set the allowed zone types (global, nonglobal, both)
pacman
------
* ``--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.
* ``--[no-]pacman-use-file-permissions``
- Use existing file permissions when defining ownership and modes
* ``--pacman-user USER``
- The owner of files in this package
pear
----
* ``--pear-bin-dir BIN_DIR``
- Directory to put binaries in
* ``--pear-channel CHANNEL_URL``
- The pear channel url to use instead of the default.
* ``--[no-]pear-channel-update``
- call 'pear channel-update' prior to installation
* ``--pear-data-dir DATA_DIR``
- Specify php dir relative to prefix if differs from pear default (pear/data)
* ``--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)
pkgin
-----
This package type has no additional options
pleaserun
---------
* ``--pleaserun-chdir CHDIR``
- The working directory used by the service
* ``--pleaserun-name SERVICE_NAME``
- The name of the service you are creating
* ``--pleaserun-user USER``
- The user to use for executing this program.
puppet
------
This package type has no additional options
python
------
* ``--python-bin PYTHON_EXECUTABLE``
- The path to the python executable you wish to run.
* ``--[no-]python-dependencies``
- Include requirements defined by the python package as dependencies.
* ``--python-disable-dependency python_package_name``
- The python package name to remove from dependency list
* ``--[no-]python-downcase-dependencies``
- Should the package dependencies be in lowercase?
* ``--[no-]python-downcase-name``
- Should the target package name be in lowercase?
* ``--python-easyinstall EASYINSTALL_EXECUTABLE``
- The path to the easy_install executable tool
* ``--[no-]python-fix-dependencies``
- Should the package dependencies be prefixed?
* ``--[no-]python-fix-name``
- Should the target package name be prefixed?
* ``--python-install-bin BIN_PATH``
- (DEPRECATED, does nothing) The path to where python scripts should be installed to.
* ``--python-install-data DATA_PATH``
- (DEPRECATED, does nothing) 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``
- (DEPRECATED, does nothing) 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()'
* ``--[no-]python-internal-pip``
- Use the pip module within python to install modules - aka 'python -m pip'. This is the recommended usage since Python 3.4 (2014) instead of invoking the 'pip' script
* ``--[no-]python-obey-requirements-txt``
- Use a requirements.txt file in the top-level directory of the python package for dependency detection.
* ``--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``
- (DEPRECATED) 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 option is equivalent to appending 'build_scripts --executable PYTHON_EXECUTABLE' arguments to 'setup.py install' command.
* ``--python-setup-py-arguments setup_py_argument``
- (DEPRECATED) 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
rpm
---
* ``--rpm-attr ATTRFILE``
- Set the attribute for a file (%attr), e.g. --rpm-attr 750,user1,group1:/some/file
* ``--[no-]rpm-auto-add-directories``
- Auto add directories not part of filesystem
* ``--rpm-auto-add-exclude-directories DIRECTORIES``
- Additional directories ignored by '--rpm-auto-add-directories' flag
* ``--[no-]rpm-autoprov``
- Enable RPM's AutoProv option
* ``--[no-]rpm-autoreq``
- Enable RPM's AutoReq option
* ``--[no-]rpm-autoreqprov``
- Enable RPM's AutoReqProv option
* ``--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``
- Set the group to GROUP in the %files section. Overrides the group when used with use-file-permissions setting.
* ``--[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
* ``--rpm-init FILEPATH``
- Add FILEPATH as an init script
* ``--[no-]rpm-macro-expansion``
- install-time macro expansion in %pre %post %preun %postun scripts (see: https://rpm-software-management.github.io/rpm/manual/scriptlet_expansion.html)
* ``--[no-]rpm-old-perl-dependency-name``
- Use older 'perl' depdency name. Newer Red Hat (and derivatives) use a dependency named 'perl-interpreter'.
* ``--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.
* ``--[no-]rpm-sign``
- Pass --sign 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: https://rpm-software-management.github.io/rpm/manual/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: https://rpm-software-management.github.io/rpm/manual/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: https://rpm-software-management.github.io/rpm/manual/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: https://rpm-software-management.github.io/rpm/manual/triggers.html
* ``--[no-]rpm-use-file-permissions``
- Use existing file permissions when defining ownership and modes.
* ``--rpm-user USER``
- Set the user to USER in the %files section. Overrides the user when used with use-file-permissions setting.
* ``--[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-verifyscript FILE``
- a script to be run on verification
sh
--
This package type has no additional options
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.
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.
tar
---
This package type has no additional options
virtualenv
----------
* ``--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.
* ``--[no-]virtualenv-fix-name``
- Should the target package name be prefixed?
* ``--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``
- PyPi Server uri for retrieving packages.
* ``--virtualenv-pypi-extra-url PYPI_EXTRA_URL``
- PyPi extra-index-url for pointing to your priviate PyPi
* ``--[no-]virtualenv-setup-install``
- After building virtualenv run setup.py install useful when building a virtualenv for packages and including their requirements from requirements.txt
* ``--[no-]virtualenv-system-site-packages``
- Give the virtual environment access to the global site-packages
zip
---
This package type has no additional options

288
docs/conf.py Normal file
View File

@ -0,0 +1,288 @@
# -*- coding: utf-8 -*-
#
# fpm documentation build configuration file, created by
# sphinx-quickstart on Sun Nov 27 05:23:34 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
import sys
import os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx_rtd_theme'
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
# The encoding of source files.
#source_encoding = 'utf-8-sig'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = u'fpm - packaging made simple'
copyright = u'2025, Jordan Sissel and contributors'
author = u'Jordan Sissel'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = u'1.17'
# The full version, including alpha/beta/rc tags.
release = u'1.17.0'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = "en"
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%B %d, %Y'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
# The reST default role (used for this markup: `text`) to use for all
# documents.
#default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
#add_module_names = True
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []
# If true, keep warnings as "system message" paragraphs in the built documents.
#keep_warnings = False
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False
# -- Options for HTML output ----------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'sphinx_rtd_theme'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
#html_theme_path = []
# The name for this set of Sphinx documents.
# "<project> v<release> documentation" by default.
#html_title = u'fpm v1.6.3'
# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
#html_logo = None
# The name of an image file (relative to this directory) to use as a favicon of
# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
#html_favicon = None
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
# directly to the root of the documentation.
#html_extra_path = []
# If not None, a 'Last updated on:' timestamp is inserted at every page
# bottom, using the given strftime format.
# The empty string is equivalent to '%b %d, %Y'.
#html_last_updated_fmt = None
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
#html_additional_pages = {}
# If false, no module index is generated.
#html_domain_indices = True
# If false, no index is generated.
#html_use_index = True
# If true, the index is split into individual pages for each letter.
#html_split_index = False
# If true, links to the reST sources are added to the pages.
#html_show_sourcelink = True
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
#html_show_sphinx = True
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
#html_show_copyright = True
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
#html_use_opensearch = ''
# This is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = None
# Language to be used for generating the HTML full-text search index.
# Sphinx supports the following languages:
# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja'
# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr', 'zh'
#html_search_language = 'en'
# A dictionary with options for the search language support, empty by default.
# 'ja' uses this config value.
# 'zh' user can custom change `jieba` dictionary path.
#html_search_options = {'type': 'default'}
# The name of a javascript file (relative to the configuration directory) that
# implements a search results scorer. If empty, the default will be used.
#html_search_scorer = 'scorer.js'
# Output file base name for HTML help builder.
htmlhelp_basename = 'fpmdoc'
# -- Options for LaTeX output ---------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#'preamble': '',
# Latex figure (float) alignment
#'figure_align': 'htbp',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'fpm.tex', u'fpm Documentation',
u'Jordan Sissel', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
# the title page.
#latex_logo = None
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#latex_use_parts = False
# If true, show page references after internal links.
#latex_show_pagerefs = False
# If true, show URL addresses after external links.
#latex_show_urls = False
# Documents to append as an appendix to all manuals.
#latex_appendices = []
# If false, no module index is generated.
#latex_domain_indices = True
# -- Options for manual page output ---------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'fpm', u'fpm Documentation',
[author], 1)
]
# If true, show URL addresses after external links.
#man_show_urls = False
# -- Options for Texinfo output -------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'fpm', u'fpm Documentation',
author, 'fpm', 'One line description of project.',
'Miscellaneous'),
]
# Documents to append as an appendix to all manuals.
#texinfo_appendices = []
# If false, no module index is generated.
#texinfo_domain_indices = True
# How to display URL addresses: 'footnote', 'no', or 'inline'.
#texinfo_show_urls = 'footnote'
# If true, do not generate a @detailmenu in the "Top" node's menu.
#texinfo_no_detailmenu = False

106
docs/contributing.rst Normal file
View File

@ -0,0 +1,106 @@
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.
.. _Code of Conduct: https://github.com/jordansissel/fpm/blob/master/CODE_OF_CONDUCT.md
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 (jls@semicomplete.com)
* Have an idea or a feature request? File a ticket on `github`_, or email the `mailing list`_, or email me personally (jls@semicomplete.com) 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`_.
.. _mailing list: https://groups.google.com/group/fpm-users
.. _github: https://github.com/jordansissel/fpm
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 git@github.com:yourusername/fpm.git
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:
...
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 || apt install libarchive-tools
yum install bsdtar
You also need these tools:
apt-get install lintian cpanminus
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.
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.
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).
.. _docker: https://docs.docker.com/engine/install/
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.

70
docs/docker.rst Normal file
View File

@ -0,0 +1,70 @@
FPM and Docker
==============
Because fpm depends on so many underlying system tools, docker can
alleviate the need to install them locally.
An end user may use a docker container in lieu of installing
locally. And a developer can use docker to run the test suite.
Running FPM inside docker
-------------------------
First, build a container will all the dependencies::
make docker-release-everything
Now, run it as you would the fpm command. Note that you will have to
mount your source directly into the docker volume::
docker run -v $(pwd):/src fpm --help
As a full example::
mkdir /tmp/fpm-test
mkdir /tmp/fpm-test/files
touch /tmp/fpm-test/files/one
touch /tmp/fpm-test/files/two
docker run -v /tmp/fpm-test/files:/src -v /tmp/fpm-test:/out fpm -s dir -t tar -n example -p /out/out.tar .
tar tf /tmp/fpm-test/out.tar
Depending on your needs, you will have to adjust the volume mounts and
relative paths to fit your particular situation.
Running rpsec inside docker
---------------------------
The Makefile provides some targets for testing. They will build a
docker container with the dependencies, and then invoked `rspec`
inside it. The makefile uses a sentinel file to indicate that the
docker image has been build, and can be reused.
make docker-test-everything
How does this work
------------------
The Dockerfile makes heavy use of multistage
builds. This allows the various output containers to build on the same
earlier stages.
There are two ``base`` images. A ``minimal`` image, which contains
compiled dependencies and ruby. And an ``everything`` image which brings
in scripting systems like ``python`` and ``perl``. These are split to
allow a smaller ``minimal`` image in cases where building scripting
language packages are not needed.
The Dockerfile the argument ``BASE_ENV`` to specify what base image to
use. This can be set to either ``minimal`` or ``everything``. If
unspecified, it defaults to ``everything``
We want to use the same set of base images for both the ``rspec``
testing, as well as the run time containerization. We do this by using
the ``TARGET`` argument to select which container to build.
The makefile encodes this logic with two pattern rules.

View File

@ -0,0 +1,67 @@
#!/usr/bin/env ruby
require_relative "../lib/fpm/command"
flagsort = lambda { |x| x.sub(/^--(?:\[no-\])?/, "") }
if ARGV.length == 0
puts "Command-line Reference"
puts "=========================="
puts
puts "This page documents the command-line flags available in FPM. You can also see this content in your terminal by running ``fpm --help``"
puts
puts "General Options"
puts "---------------"
#FPM::Command.instance_variable_get(:@declared_options).sort_by { |o| flagsort.call(o.switches.first) }.each do |option|
FPM::Command::GENERAL_OPTIONS.sort_by { |o| flagsort.call(o.switches.first) }.each do |option|
text = option.description.gsub("\n", " ")
if option.type == :flag
# it's a flag which means there are no parameters to the option
puts "* ``#{option.switches.first}``"
else
puts "* ``#{option.switches.first} #{option.type}``"
end
if option.switches.length > 1
puts " - Alternate option spellings: ``#{option.switches[1..-1].join(", ")}``"
end
puts " - #{text}"
puts
end
end
FPM::Package.types.sort_by { |k,v| k }.each do |name, type|
next if ARGV.length > 0 && ARGV[0].downcase != name.downcase
options = type.instance_variable_get(:@options)
# Only print the section header if no arguments are given
# -- aka, generate the list of all flags grouped by package type.
if ARGV.length == 0
puts "#{name}"
puts "-" * name.size
puts
end
if options.empty?
puts "This package type has no additional options"
end
options.sort_by { |flag, _| flagsort.call(flag.first) }.each do |flag, param, help, options, block|
if param == :flag
puts "* ``#{flag.first}``"
else
puts "* ``#{flag.first} #{param}``"
end
text = help.sub(/^\([^)]+\) /, "")
puts " - #{text}"
end
puts
end

244
docs/getting-started.rst Normal file
View File

@ -0,0 +1,244 @@
Getting Started
===============
FPM takes your program and builds packages that can be installed easily on various operating systems.
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
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``
* pear package - ``pear``
* perl (cpan) module - ``cpan``
* .deb package - ``deb``
* .rpm package - ``rpm``
* pacman (.pkg.tar.zst) package - ``pacman``
* .pkgin package - ``pkgin``
* package without any files (useful for meta packages) - ``empty``
The target (output package format) 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 .freebsd package (for FreeBSD) - ``freebsd``
* MacOS .pkg files - ``osxpkg``
* Pacman packages (.pkg.tar.zst) (for Arch Linux 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 - ``zip``
* 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.
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 ==
#
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 <you are an amazing person at example dot com>
.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 <you are an amazing person at example dot com>" \
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``
- The ``-p`` option tells FPM what to name the package once it has been created.
- In this case, we name it ``<package name>-<version>-<package rel/iteration>-<architecture>.<file extension>``, 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 (current 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 <you are an amazing person at example dot com>"``
- 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``.
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 <deb/rpm/pacman/solaris/freebsd/osxpkg/tar> <npm-package-name>
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 <deb/rpm/pacman/solaris/freebsd/osxpkg/tar> <gem-name>
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 package the perl Fennec module for Debian::
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.
Configuration file
-------------------
If you are using FPM in to build packages for multiple targets and keep repeating several options (like version, description, 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 <you are an amazing person at example dot com>"
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 :doc:`CLI reference. <cli-reference>`

45
docs/index.rst Normal file
View File

@ -0,0 +1,45 @@
fpm - packaging made simple
===========================
.. 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!
fpm is a tool which lets you easily create packages for Debian, Ubuntu, Fedora, CentOS, RHEL, Arch Linux, FreeBSD, macOS, and more!
fpm isn't a new packaging system, it's a tool to help you make packages for existing systems with less effort. It does this by offering a command-line interface to allow you to create packages easily. Here are some examples using fpm:
* ``fpm -s npm -t deb express`` -- Make a Debian package for the nodejs `express` library
* ``fpm -s cpan -t rpm Fennec`` -- Make an rpm for the perl Fennec module
* ``fpm -s dir -t pacman -n fancy ~/.zshrc`` -- Put your ~/.zshrc into an Arch Linux pacman package named "fancy"
* ``fpm -s python -t freebsd Django`` -- Create a FreeBSD package containing the Python Django library
* ``fpm -s rpm -t deb mysql.rpm`` -- Convert an rpm to deb
This project has a few important principles which guide development:
* Community: If a newbie has a bad time, it's a bug.
* Engineering: Make it work, make it right, then make it fast.
* Capabilities: If it doesn't do a thing today, we can make it do it tomorrow.
`Install fpm <installation.html>`_ and you'll quickly begin making packages for whatever you need!
You can view the changelog `here`_.
Table of Contents
-----------------
.. toctree::
:includehidden:
installation
getting-started
packaging-types
cli-reference
docker
contributing
changelog
.. _here: /changelog.html
.. _the project issue tracker: https://github.com/jordansissel/fpm/issues

70
docs/installation.rst Normal file
View File

@ -0,0 +1,70 @@
Installation
============
FPM is written in ruby and can be installed using `gem`. For some package formats (like rpm and snap), you will need certain packages installed to build them.
Installing FPM
--------------
.. note::
You must have ruby installed on your machine before installing fpm. `Here`_ are instructions to install Ruby on your machine.
.. _Here: https://www.ruby-lang.org/en/documentation/installation/
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.17.0
Now you can go on to `using FPM! <getting-started.html>`_
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 operating system/distribution.
* RPM: rpm/rpm-tools/rpm-build [This dependency might be removed in the future, see `issue #54`_ on github]
* Snap: squashfs/squashfs-tools
.. _issue #54: https://github.com/jordansissel/fpm/issues/54
.. 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 Linux and Arch-based systems (Manjaro, EndeavourOS, etc)::
pacman -S rpm-tools squashfs-tools
On Debian and Debian-based systems (Ubuntu, Linux Mint, Pop!_OS, etc)::
apt-get install squashfs-tools
On Red Hat systems (Fedora 22 or older, CentOS, Rocky Linux, etc)::
yum install rpm-build squashfs-tools
On Fedora 23 or newer::
dnf install rpm-build squashfs-tools
On Oracle Linux 7.x systems::
yum-config-manager --enable ol7_optional_latest
yum install rpm-build squashfs-tools

12
docs/packages/apk.rst Normal file
View File

@ -0,0 +1,12 @@
apk - Alpine package format
===========================
Supported Uses in FPM
---------------------
fpm supports using ``apk`` only as an output type. This means you can create ``apk`` packages from input types like ``deb``, ``dir``, or ``npm``
apk-specific command line flags
-------------------------------
.. include:: cli/apk.rst

View File

@ -0,0 +1,2 @@
This package type has no additional options

View File

@ -0,0 +1,21 @@
* ``--cpan-cpanm-bin CPANM_EXECUTABLE``
- The path to the cpanm executable you wish to run.
* ``--[no-]cpan-cpanm-force``
- Pass the --force parameter to cpanm
* ``--cpan-mirror CPAN_MIRROR``
- The CPAN mirror to use instead of the default.
* ``--[no-]cpan-mirror-only``
- Only use the specified mirror for metadata.
* ``--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
* ``--[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?

77
docs/packages/cli/deb.rst Normal file
View File

@ -0,0 +1,77 @@
* ``--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)
* ``--[no-]deb-auto-config-files``
- Init script and default configuration files will be labeled as configuration files for Debian packages.
* ``--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, zst, none.
* ``--deb-compression-level [0-9]``
- Select a compression level. 0 is none or minimal. 9 is max compression.
* ``--deb-config SCRIPTPATH``
- Add SCRIPTPATH as debconf config file.
* ``--deb-custom-control FILEPATH``
- 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
* ``--[no-]deb-generate-changes``
- Generate PACKAGENAME.changes file.
* ``--deb-group GROUP``
- The group owner of files in this package
* ``--[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
* ``--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
* ``--[no-]deb-maintainerscripts-force-errorchecks``
- Activate errexit shell option according to lintian. https://lintian.debian.org/tags/maintainer-script-ignores-errors.html
* ``--deb-meta-file FILEPATH``
- Add FILEPATH to DEBIAN directory
* ``--[no-]deb-no-default-config-files``
- Do not add all files in /etc as configuration files by default for Debian packages.
* ``--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
* ``--[no-]deb-systemd-auto-start``
- Start service after install or upgrade
* ``--[no-]deb-systemd-enable``
- Enable service on install or upgrade
* ``--deb-systemd-path FILEPATH``
- Relative path to the systemd service directory
* ``--[no-]deb-systemd-restart-after-upgrade``
- Restart service after upgrade
* ``--deb-templates FILEPATH``
- Add FILEPATH as debconf templates file.
* ``--deb-upstart FILEPATH``
- Add FILEPATH as an upstart script
* ``--deb-upstream-changelog FILEPATH``
- Add FILEPATH as upstream changelog
* ``--[no-]deb-use-file-permissions``
- Use existing file permissions when defining ownership and modes
* ``--deb-user USER``
- The owner of files in this package

View File

@ -0,0 +1,2 @@
This package type has no additional options

View File

@ -0,0 +1,2 @@
This package type has no additional options

View File

@ -0,0 +1,5 @@
* ``--freebsd-origin ABI``
- Sets the FreeBSD 'origin' pkg field
* ``--freebsd-osversion VERSION``
- Sets the FreeBSD 'version' pkg field, ie 12 or 13, use '*' for all.

31
docs/packages/cli/gem.rst Normal file
View File

@ -0,0 +1,31 @@
* ``--gem-bin-path DIRECTORY``
- The directory to install gem executables
* ``--gem-disable-dependency gem_name``
- The gem name to remove from dependency list
* ``--[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?
* ``--gem-gem PATH_TO_GEM``
- The path to the 'gem' tool (defaults to 'gem' and searches your $PATH)
* ``--gem-git-branch GIT_BRANCH``
- 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.
* ``--[no-]gem-prerelease``
- Allow prerelease versions of a gem
* ``--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 subdirectory of workdir.
* ``--[no-]gem-version-bins``
- Append the version to the bins

View File

@ -0,0 +1,7 @@
* ``--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.

View File

@ -0,0 +1,11 @@
* ``--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).
* ``--[no-]osxpkg-payload-free``
- Define no payload, assumes use of script options.
* ``--osxpkg-postinstall-action POSTINSTALL_ACTION``
- Post-install action provided in package metadata. Optionally one of 'logout', 'restart', 'shutdown'.

13
docs/packages/cli/p5p.rst Normal file
View File

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

View File

@ -0,0 +1,11 @@
* ``--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.
* ``--[no-]pacman-use-file-permissions``
- Use existing file permissions when defining ownership and modes
* ``--pacman-user USER``
- The owner of files in this package

View File

@ -0,0 +1,15 @@
* ``--pear-bin-dir BIN_DIR``
- Directory to put binaries in
* ``--pear-channel CHANNEL_URL``
- The pear channel url to use instead of the default.
* ``--[no-]pear-channel-update``
- call 'pear channel-update' prior to installation
* ``--pear-data-dir DATA_DIR``
- Specify php dir relative to prefix if differs from pear default (pear/data)
* ``--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)

View File

@ -0,0 +1,2 @@
This package type has no additional options

View File

@ -0,0 +1,7 @@
* ``--pleaserun-chdir CHDIR``
- The working directory used by the service
* ``--pleaserun-name SERVICE_NAME``
- The name of the service you are creating
* ``--pleaserun-user USER``
- The user to use for executing this program.

View File

@ -0,0 +1,2 @@
This package type has no additional options

View File

@ -0,0 +1,41 @@
* ``--python-bin PYTHON_EXECUTABLE``
- The path to the python executable you wish to run.
* ``--[no-]python-dependencies``
- Include requirements defined by the python package as dependencies.
* ``--python-disable-dependency python_package_name``
- The python package name to remove from dependency list
* ``--[no-]python-downcase-dependencies``
- Should the package dependencies be in lowercase?
* ``--[no-]python-downcase-name``
- Should the target package name be in lowercase?
* ``--python-easyinstall EASYINSTALL_EXECUTABLE``
- The path to the easy_install executable tool
* ``--[no-]python-fix-dependencies``
- Should the package dependencies be prefixed?
* ``--[no-]python-fix-name``
- Should the target package name be prefixed?
* ``--python-install-bin BIN_PATH``
- (DEPRECATED, does nothing) The path to where python scripts should be installed to.
* ``--python-install-data DATA_PATH``
- (DEPRECATED, does nothing) 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``
- (DEPRECATED, does nothing) 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()'
* ``--[no-]python-internal-pip``
- Use the pip module within python to install modules - aka 'python -m pip'. This is the recommended usage since Python 3.4 (2014) instead of invoking the 'pip' script
* ``--[no-]python-obey-requirements-txt``
- Use a requirements.txt file in the top-level directory of the python package for dependency detection.
* ``--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``
- (DEPRECATED) 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 option is equivalent to appending 'build_scripts --executable PYTHON_EXECUTABLE' arguments to 'setup.py install' command.
* ``--python-setup-py-arguments setup_py_argument``
- (DEPRECATED) 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

71
docs/packages/cli/rpm.rst Normal file
View File

@ -0,0 +1,71 @@
* ``--rpm-attr ATTRFILE``
- Set the attribute for a file (%attr), e.g. --rpm-attr 750,user1,group1:/some/file
* ``--[no-]rpm-auto-add-directories``
- Auto add directories not part of filesystem
* ``--rpm-auto-add-exclude-directories DIRECTORIES``
- Additional directories ignored by '--rpm-auto-add-directories' flag
* ``--[no-]rpm-autoprov``
- Enable RPM's AutoProv option
* ``--[no-]rpm-autoreq``
- Enable RPM's AutoReq option
* ``--[no-]rpm-autoreqprov``
- Enable RPM's AutoReqProv option
* ``--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``
- Set the group to GROUP in the %files section. Overrides the group when used with use-file-permissions setting.
* ``--[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
* ``--rpm-init FILEPATH``
- Add FILEPATH as an init script
* ``--[no-]rpm-macro-expansion``
- install-time macro expansion in %pre %post %preun %postun scripts (see: https://rpm-software-management.github.io/rpm/manual/scriptlet_expansion.html)
* ``--[no-]rpm-old-perl-dependency-name``
- Use older 'perl' depdency name. Newer Red Hat (and derivatives) use a dependency named 'perl-interpreter'.
* ``--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.
* ``--[no-]rpm-sign``
- Pass --sign 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: https://rpm-software-management.github.io/rpm/manual/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: https://rpm-software-management.github.io/rpm/manual/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: https://rpm-software-management.github.io/rpm/manual/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: https://rpm-software-management.github.io/rpm/manual/triggers.html
* ``--[no-]rpm-use-file-permissions``
- Use existing file permissions when defining ownership and modes.
* ``--rpm-user USER``
- Set the user to USER in the %files section. Overrides the user when used with use-file-permissions setting.
* ``--[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-verifyscript FILE``
- a script to be run on verification

2
docs/packages/cli/sh.rst Normal file
View File

@ -0,0 +1,2 @@
This package type has no additional options

View File

@ -0,0 +1,7 @@
* ``--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.

View File

@ -0,0 +1,5 @@
* ``--solaris-group GROUP``
- Set the group to GROUP in the prototype file.
* ``--solaris-user USER``
- Set the user to USER in the prototype files.

View File

@ -0,0 +1,2 @@
This package type has no additional options

View File

@ -0,0 +1,19 @@
* ``--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.
* ``--[no-]virtualenv-fix-name``
- Should the target package name be prefixed?
* ``--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``
- PyPi Server uri for retrieving packages.
* ``--virtualenv-pypi-extra-url PYPI_EXTRA_URL``
- PyPi extra-index-url for pointing to your priviate PyPi
* ``--[no-]virtualenv-setup-install``
- After building virtualenv run setup.py install useful when building a virtualenv for packages and including their requirements from requirements.txt
* ``--[no-]virtualenv-system-site-packages``
- Give the virtual environment access to the global site-packages

View File

@ -0,0 +1,2 @@
This package type has no additional options

65
docs/packages/cpan.rst Normal file
View File

@ -0,0 +1,65 @@
cpan - Perl packages from CPAN
===============================
Supported Uses in FPM
---------------------
fpm supports using ``cpan`` only as an input type. This means you can convert
``cpan`` input packages to output packages like ``deb``, ``rpm``, and more.
Arguments when used as input type
---------------------------------
Any number of arguments are supported and behave as follows:
* A name to search on MetaCPAN_. If a module is found on MetaCPAN_, it will be downloaded and used when building the package.
* or, a local directory containing a Perl module to build.
.. _MetaCPAN: https://metacpan.org/
Sample Usage
------------
Let's take the `Regexp::Common <https://metacpan.org/pod/Regexp::Common>`_ Perl module and package it as a deb. We can let fpm do the hard work here of finding the module on cpan and downloading it::
% fpm -s cpan -t deb Regexp::Common
Downcasing provides 'perl-Regexp-Common' because deb packages don't work so good with uppercase names {:level=>:warn}
Downcasing provides 'perl-Regexp-Common-Entry' because deb packages don't work so good with uppercase names {:level=>:warn}
Debian tools (dpkg/apt) don't do well with packages that use capital letters in the name. In some cases it will automatically downcase them, in others it will not. It is confusing. Best to not use any capital letters at all. I have downcased the package name for you just to be safe. {:oldname=>"perl-Regexp-Common", :fixedname=>"perl-regexp-common", :level=>:warn}
Debian packaging tools generally labels all files in /etc as config files, as mandated by policy, so fpm defaults to this behavior for deb packages. You can disable this default behavior with --deb-no-default-config-files flag {:level=>:warn}
Created package {:path=>"perl-regexp-common_2017060201_all.deb"}
Fpm did a bunch of nice work for you. First, it searched MetaCPAN_ for Regexp::Common. Then it downloaded the latest version. If you wanted to specify a version, you can use the ``-v`` flag, such as ``-v 2016060201``.
In the example above, a few warning messages appear. Fpm's job is to help you convert packages. In this case, we're converting a Perl module named "Regexp::Common" to a Debian package. In this situation, we need to make sure our Debian package is accepted by Debian's tools! This means fpm will do the following:
* Debian package names appear to all use lowercase names, so fpm does this for you.
* Debian package names also cannot have "::" in the names, so fpm replaces these with a dash "-"
Let's try to use our new package! First, installing it::
% sudo dpkg -i perl-regexp-common_2017060201_all.deb
Selecting previously unselected package perl-regexp-common.
(Reading database ... 81209 files and directories currently installed.)
Preparing to unpack perl-regexp-common_2017060201_all.deb ...
Unpacking perl-regexp-common (2017060201) ...
Setting up perl-regexp-common (2017060201) ...
Processing triggers for man-db (2.9.1-1) ...
And try to use it. Let's ask Regexp::Common for a regular expression that matches real numbers::
% perl -MRegexp::Common -e 'print $RE{num}{real}'
(?:(?i)(?:[-+]?)(?:(?=[.]?[0123456789])(?:[0123456789]*)(?:(?:[.])(?:[0123456789]{0,}))?)(?:(?:[E])(?:(?:[-+]?)(?:[0123456789]+))|))
Nice!
Fun Examples
------------
.. note::
Do you have any examples you want to share that use the ``cpan`` package type? Share your knowledge here: https://github.com/jordansissel/fpm/issues/new
cpan-specific command line flags
--------------------------------
.. include:: cli/cpan.rst

117
docs/packages/deb.rst Normal file
View File

@ -0,0 +1,117 @@
deb - Debian package format
===========================
Supported Uses in FPM
---------------------
fpm supports input and output for Debian package (deb). This means you can read a deb and convert it to a different output type (such as a `dir` or `rpm`). It also means you can create a deb package.
Arguments when used as input type
---------------------------------
For the sample command reading a deb file as input and outputting an rpm package::
fpm -s deb -t rpm file.deb
The argument is used as a file and read as a debian package file.
Sample Usage
------------
Let's create a Debian package of Hashicorp's Terraform. To do this, we'll need to download it and put the files into a Debian package::
# Download Terraform 1.0.10
% wget https://releases.hashicorp.com/terraform/1.0.10/terraform_1.0.10_linux_amd64.zip
The Terraform release .zip file contains a single file, `terraform` itself. You can see the files in this zip by using `unzip -l`::
% unzip -l ~/build/z/terraform_1.0.10_linux_amd64.zip
Archive: /home/jls/build/z/terraform_1.0.10_linux_amd64.zip
Length Date Time Name
--------- ---------- ----- ----
79348596 2021-10-28 07:15 terraform
--------- -------
79348596 1 file
We can use fpm to convert this zip file into a debian package with one step::
% fpm -s zip -t deb --prefix /usr/bin -n terraform -v 1.0.10 terraform_1.0.10_linux_amd64.zip
Created package {:path=>"terraform_1.0.10_amd64.deb"}
Nice! We just converted a zip file into a debian package. Let's talk through the command-line flags here:
* ``-s zip`` tells fpm to use "zip" as the input type. This allows fpm to read zip files.
* ``-t deb`` tells fpm to output a Debian package.
* ``--prefix /usr/bin`` tells fpm to move all files in the .zip file to the /usr/bin file path. In this case, it results in a single file in the path `/usr/bin/terraform`
* ``-n terraform`` names the package "terraform"
* ``-v 1.0.10`` sets the package version. This is useful to package systems when considering whether a given package is an upgrade, downgrade, or already installed.
* Finally, the last argument, `terraform_1.0.10_linux_amd64.zip`. This is given to the fpm to process as a zip file.
You can inspect the package contents with `dpkg --contents terraform_1.0.10_amd64.deb`::
% dpkg --contents terraform_1.0.10_amd64.deb
drwxr-xr-x 0/0 0 2021-11-02 23:33 ./
drwxr-xr-x 0/0 0 2021-11-02 23:33 ./usr/
drwxr-xr-x 0/0 0 2021-11-02 23:33 ./usr/share/
drwxr-xr-x 0/0 0 2021-11-02 23:33 ./usr/share/doc/
drwxr-xr-x 0/0 0 2021-11-02 23:33 ./usr/share/doc/terraform/
-rw-r--r-- 0/0 141 2021-11-02 23:33 ./usr/share/doc/terraform/changelog.gz
drwxr-xr-x 0/0 0 2021-11-02 23:33 ./usr/bin/
-rwxr-xr-x 0/0 79348596 2021-10-28 07:15 ./usr/bin/terraform
The ``changelog.gz`` file is a recommended Debian practice for packaging. FPM will provide a generated changelog for you, by default. You can provide your own with the ``--deb-changelog`` flag.
Lets install our terraform package and try it out::
% sudo apt install ./terraform_1.0.10_amd64.deb
...
% dpkg -l terraform
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-========================-=================-=================-=====================================================
ii terraform 1.0.10 amd64 no description given
% terraform -version
Terraform v1.0.10
on linux_amd64
You may remove the package at any time::
% sudo apt remove terraform
...
Removing terraform (1.0.10) ...
Fun Examples
------------
Hi! The fpm project would love to have any fun examples you have for using this package type. Please consider contributing your ideas by submitting them on the fpm issue tracker: https://github.com/jordansissel/fpm/issues/new
Changing an existing deb
~~~~~~~~~~~~~~~~~~~~~~~~
fpm supports deb as both an input and output type (``-s`` and ``-t`` flags), so you can use this to modify an existing deb.
For example, let's create an deb to use for our example::
% fpm -s empty -t deb -n example
Created package {:path=>"example_1.0_amd64.deb"}
Lets say we made a mistake and want to rename the package::
% fpm -s deb -t deb -n newname example_1.0_amd64.deb
Created package {:path=>"newname_1.0_amd64.deb"}
And maybe the architecture is wrong. fpm defaulted to amd64 (what fpm calls
"native"), and we really want what Debian calls "all"::
% fpm -s deb -t deb -a all newname_1.0_amd64.deb
Created package {:path=>"newname_1.0_all.deb"}
Deb-specific command line flags
-------------------------------
.. include:: cli/deb.rst

80
docs/packages/dir.rst Normal file
View File

@ -0,0 +1,80 @@
dir - Local Files
=================
Supported Uses in FPM
---------------------
fpm supports using ``dir`` as an input type and output type. This means you can use ``dir`` to put files into other package types (like Debian or Red Hat packages). You can also use this as an output type to extract files from packages.
Arguments when used as input type
---------------------------------
Any number of arguments are supported and behave as follows:
1) A path to a local file or directory will be put into the output package as-is with the same path, contents, and metadata (file owner, modification date, etc)
2) A syntax of "localpath=destinationpath" to copy local paths into the output package with the destination path.
The local file paths are modified by the ``--chdir`` flag. The destination file paths are modified by the ``--prefix`` flag.
Sample Usage
------------
For this example, let's look at packaging the Kubernetes tool, ``kubectl``. The installation for ``kubectl`` recommends downloading a pre-compiled binary. Let's do this and then package it into a Debian package.
First, we download the ``kubectl`` binary, according to the kubernetes documentation for kubectl installation on Linux::
# Query the latest version of kubectl and store the value in the 'version' variable
% version="$(curl -L -s https://dl.k8s.io/release/stable.txt)"
# Download the Linux amd64 binary
% curl -LO "https://dl.k8s.io/release/${version}/bin/linux/amd64/kubectl"
# Make it executable
% chmod 755 kubectl
The above shell will find the latest version of ``kubectl`` and download it. We'll use the file and the version number next to make our package::
# Create the package that installs kubectl as /usr/bin/kubectl
% fpm -s dir -t deb -n kubectl -a amd64 -v ${version#v*} kubectl=/usr/bin/kubectl
Created package {:path=>"kubectl_v1.22.3_amd64.deb"}
.. note::
We use ``${version#v*}`` in our shell to set the package version. This is
because Kuberenetes versions have a text that starts with "v" and this is not
valid in Debian packages. This will turn "v1.2.3" into "1.2.3" for our package.
Now we can check our package to make sure it looks the way we want::
% dpkg --contents kubectl_1.22.3_amd64.deb
[ ... output abbreviated for easier reading ... ]
-rw-r--r-- 0/0 46907392 2021-11-05 20:09 ./usr/bin/kubectl
% dpkg --field kubectl_1.22.3_amd64.deb Package Version Architecture
Package: kubectl
Version: 1.22.3
Architecture: amd64
And install it to test things and make sure it's what we wanted::
% sudo dpkg -i kubectl_1.22.3_amd64.deb
Selecting previously unselected package kubectl.
(Reading database ... 58110 files and directories currently installed.)
Preparing to unpack kubectl_1.22.3_amd64.deb ...
Unpacking kubectl (1.22.3) ...
Setting up kubectl (1.22.3) ...
And try to use it::
% which kubectl
/usr/bin/kubectl
% kubectl version
Client Version: version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.3", GitCommit:"c92036820499fedefec0f847e2054d824aea6cd1", GitTreeState:"clean", BuildDate:"2021-10-27T18:41:28Z", GoVersion:"go1.16.9", Compiler:"gc", Platform:"linux/amd64"}
Cool :)
Fun Examples
------------
.. note::
Do you have any examples you want to share that use the ``dir`` package type? Share your knowledge here: https://github.com/jordansissel/fpm/issues/new

50
docs/packages/empty.rst Normal file
View File

@ -0,0 +1,50 @@
empty - A package with no files
===============================
Supported Uses in FPM
---------------------
fpm supports using ``empty`` only as an input type.
Arguments when used as input type
---------------------------------
Extra arguments are ignored for this type. As an example, where with ``fpm -s dir ...`` the arguments are file paths, ``fpm -s empty`` takes no input arguments because there's no file contents to use.
Sample Usage
------------
The ``empty`` package type is great for creating "meta" packages which are used to group dependencies together.
For example, if you want to make it easier to install a collection of developer tools, you could create a single package that depends on all of your desired developer tools.
Let's create a Debian package named 'devtools' which installs the following:
* git
* curl
* nodejs
Here's the fpm command to do this::
% fpm -s empty -t rpm -n devtools -a all -d git -d curl -d nodejs
Created package {:path=>"devtools-1.0-1.noarch.rpm"}
We can check the dependencies on this package::
% rpm -qp devtools-1.0-1.noarch.rpm --requires
curl
git
nodejs
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
And see that there are no files::
% rpm -ql devtools-1.0-1.noarch.rpm
(contains no files)
Fun Examples
------------
Hi! The fpm project would love to have any fun examples you have for using this package type. Please consider contributing your ideas by submitting them on the fpm issue tracker: https://github.com/jordansissel/fpm/issues/new

12
docs/packages/freebsd.rst Normal file
View File

@ -0,0 +1,12 @@
freebsd - FreeBSD pkg
===============================
Supported Uses in FPM
---------------------
fpm supports using ``freebsd`` only as an output type. This means you can create ``freebsd`` packages from input types like ``deb``, ``dir``, or ``npm``
freebsd-specific command line flags
-----------------------------------
.. include:: cli/freebsd.rst

13
docs/packages/gem.rst Normal file
View File

@ -0,0 +1,13 @@
gem - Ruby's rubygem packages
=============================
Supported Uses in FPM
---------------------
fpm supports using ``gem`` only as an input type. This means you can convert
``gem`` input packages to output packages like ``deb``, ``rpm``, and more.
gem-specific command line flags
-------------------------------
.. include:: cli/gem.rst

78
docs/packages/npm.rst Normal file
View File

@ -0,0 +1,78 @@
npm - Packages for NodeJS
===============================
Supported Uses in FPM
---------------------
fpm supports using ``npm`` only as an input type.
Arguments when used as input type
---------------------------------
Any number of arguments are supported and behave as follows:
* ``name@version`` -- a specific named package at the given version.
* ``name`` -- the name of a node package. In this use, the ``--version`` flag is used to pick the version to download. If no version is given, the latest version of the package is downloaded.
Sample Usage
------------
You'll need ``npm`` installed for this example.
Let's turn the ``ascii-art`` npm package into a Debian package. For this example, we'll pick a specific version, 2.8.5::
% fpm --debug -s npm -t deb --depends nodejs ascii-art@2.8.5
Created package {:path=>"node-ascii-art_2.8.5_amd64.deb"}
Fpm uses ``npm`` to download the correct package. Additionally, the package name is given a ``node-`` prefix because this is common in distribution packages to prefix a library with the platform name, such as ``python-foo`` or ``node-foo``.
It also parses the package's ``package.json`` to collect any useful data such as the package name, author, homepage, description, etc::
% dpkg --field node-ascii-art_2.8.5_amd64.deb Package Version Vendor Homepage Description
Package: node-ascii-art
Version: 2.8.5
Vendor: Abbey Hawk Sparrow <@khrome>
Homepage: git://github.com/khrome/ascii-art.git
Description: Ansi codes, figlet fonts, and ascii art. 100% JS
Let's install the package and try to use it::
% sudo apt-get install ./node-ascii-art_2.8.5_amd64.deb
And now we can use this package::
% ascii-art text -F Doom "Hello World"
_ _ _ _ _ _ _ _
| | | | | || | | | | | | | | |
| |_| | ___ | || | ___ | | | | ___ _ __ | | __| |
| _ | / _ \| || | / _ \ | |/\| | / _ \ | '__|| | / _` |
| | | || __/| || || (_) | \ /\ /| (_) || | | || (_| |
\_| |_/ \___||_||_| \___/ \/ \/ \___/ |_| |_| \__,_|
Fpm asked ``npm`` where to install things using ``npm prefix -g``. On my system, this caused the package to install to ``/usr/local/lib/node_modules``. You can change the default prefix with the fpm ``--prefix`` flag or by changing the default global prefix in the ``npm`` tool.
Let's try to invoke ``ascii-art`` from node::
% export NODE_PATH=/usr/local/lib/node_modules
% node
> let art = require("ascii-art")
> art.font("Hello", "Doom", (err, rendered) => console.log(rendered))
_ _ _ _
| | | | | || |
| |_| | ___ | || | ___
| _ | / _ \| || | / _ \
| | | || __/| || || (_) |
\_| |_/ \___||_||_| \___/
Nice :)
Fun Examples
------------
.. note::
Do you have any examples you want to share that use the ``npm`` package type? Share your knowledge here: https://github.com/jordansissel/fpm/issues/new
npm-specific command line flags
-------------------------------
.. include:: cli/npm.rst

15
docs/packages/osxpkg.rst Normal file
View File

@ -0,0 +1,15 @@
osxpkg - Apple macOS and OSX packages
=====================================
Supported Uses in FPM
---------------------
fpm supports input and output for Apple's package files. These files typically
end in ".pkg". This means you can read a ``.pkg`` file and convert it to a different
output type (such as a `dir` or `rpm`). It also means you can create a ``.pkg``
package file.
osxpkg-specific command line flags
----------------------------------
.. include:: cli/osxpkg.rst

15
docs/packages/p5p.rst Normal file
View File

@ -0,0 +1,15 @@
p5p - Oracle Solaris 11 p5p packages
====================================
This package format for the Solaris Image Packaging System (IPS) and should be
useful for OpenSolaris, Solaris 11, and Illumos.
Supported Uses in FPM
---------------------
fpm supports using ``p5p`` only as an output type. This means you can create ``p5p`` packages from input types like ``deb``, ``dir``, or ``npm``
p5p-specific command line flags
-------------------------------
.. include:: cli/p5p.rst

12
docs/packages/pacman.rst Normal file
View File

@ -0,0 +1,12 @@
pacman - Arch Linux package format
==================================
Supported Uses in FPM
---------------------
fpm supports input and output for Arch Linux's package format, pacman. This means you can read a pacman and convert it to a different output type (such as a `dir` or `rpm`). It also means you can create a pacman package.
pacman-specific command line flags
----------------------------------
.. include:: cli/pacman.rst

13
docs/packages/pear.rst Normal file
View File

@ -0,0 +1,13 @@
pear - PHP PEAR Packages
========================
Supported Uses in FPM
---------------------
fpm supports using ``pear`` only as an input type. This means you can convert
``pear`` input packages to output packages like ``deb``, ``rpm``, and more.
pear-specific command line flags
--------------------------------
.. include:: cli/pear.rst

12
docs/packages/pkgin.rst Normal file
View File

@ -0,0 +1,12 @@
pkgin - NetBSD's pkgsrc binary packages
=======================================
Supported Uses in FPM
---------------------
fpm supports using ``pkgin`` only as an output type. This means you can create ``pkgin`` packages from input types like ``deb``, ``dir``, or ``npm``
pkgin-specific command line flags
---------------------------------
.. include:: cli/pkgin.rst

View File

@ -0,0 +1,23 @@
pleaserun - Pleaserun services
==============================
Pleaserun helps generate service definitions for a variety of service manangers
such as systemd and sysv.
When used as an input, fpm will generate a package that include multiple service
definitions, one for each type (systemd, sysv, etc). At package installation, the package
will attempt to detect the best service manager used on the system and will
install only that definition.
You can learn more on the project website: https://github.com/jordansissel/pleaserun#readme
Supported Uses in FPM
---------------------
fpm supports using ``pleaserun`` only as an input type. This means you can convert
``pleaserun`` input packages to output packages like ``deb``, ``rpm``, and more.
pleaserun-specific command line flags
-------------------------------------
.. include:: cli/pleaserun.rst

15
docs/packages/puppet.rst Normal file
View File

@ -0,0 +1,15 @@
puppet - Puppet Manifests (deprecated)
======================================
Note: This package type hasn't been maintained since 2012 and generates puppet
manifests that target Puppet 2.4 or 3.x.
Supported Uses in FPM
---------------------
fpm supports using ``puppet`` only as an output type. This means you can create ``puppet`` packages from input types like ``deb``, ``dir``, or ``npm``
puppet-specific command line flags
----------------------------------
.. include:: cli/puppet.rst

13
docs/packages/python.rst Normal file
View File

@ -0,0 +1,13 @@
python - Python packages, PyPI, etc
===================================
Supported Uses in FPM
---------------------
fpm supports using ``python`` only as an input type. This means you can convert
``python`` input packages to output packages like ``deb``, ``rpm``, and more.
python-specific command line flags
----------------------------------
.. include:: cli/python.rst

81
docs/packages/rpm.rst Normal file
View File

@ -0,0 +1,81 @@
rpm - RedHat Package Manager
============================
rpm is the package format used on RedHat Enterprise (RHEL), Fedora, CentOS, and
a number of other Linux distributions.
You may be familiar with tools such as `dnf` and `yum` for installing packages from repositories. The package files that these tools install are rpms.
Supported Uses in FPM
---------------------
fpm supports input and output for rpms. This means you can read an rpm and convert it to a different output type (such as a `dir` or `deb`). It also means you can write an rpm.
Arguments when used as input type
---------------------------------
For the sample command reading an rpm as input and outputting a debian package::
fpm -s rpm -t deb file.rpm
The the argument is used as a file and read as an rpm.
Sample Usage
------------
Create a package with no files but having dependencies::
% fpm -s empty -t rpm -n example --depends nginx
Created package {:path=>"example-1.0-1.x86_64.rpm"}
We can now inspect the package with rpm's tools if you wish::
% rpm -qp example-1.0-1.x86_64.rpm -i
Name : example
Version : 1.0
Release : 1
Architecture: x86_64
Install Date: (not installed)
Group : default
Size : 0
License : unknown
Signature : (none)
Source RPM : example-1.0-1.src.rpm
Build Date : Wed 20 Oct 2021 09:43:25 PM PDT
Build Host : snickerdoodle.localdomain
Relocations : /
Packager : <jls@snickerdoodle>
Vendor : none
URL : http://example.com/no-uri-given
Summary : no description given
Description :
no description given
Fun Examples
------------
Changing an existing RPM
~~~~~~~~~~~~~~~~~~~~~~~~
fpm supports rpm as both an input and output type (`-s` and `-t` flags), so you can use this to modify an existing rpm.
For example, let's create an rpm to use for our example::
% fpm -s empty -t rpm -n example
Created package {:path=>"example-1.0-1.x86_64.rpm"}
Lets say we made a mistake and want to rename the package::
% fpm -s rpm -t rpm -n newname example-1.0-1.x86_64.rpm
Created package {:path=>"newname-1.0-1.x86_64.rpm"}
And maybe the architecture is wrong. fpm defaulted to x86_64 (what fpm calls
"native"), and we really want what rpm calls "noarch"::
% fpm -s rpm -t rpm -a noarch newname-1.0-1.x86_64.rpm
Created package {:path=>"newname-1.0-1.noarch.rpm"}
RPM-specific command line flags
-------------------------------
.. include:: cli/rpm.rst

24
docs/packages/sh.rst Normal file
View File

@ -0,0 +1,24 @@
sh - Self-managing shell archive
================================
The 'sh' output in fpm will generate a shell script that is, itself, an archive.
The resulting shell script will install the files you provided. You can run the
resulting shell script to see more helpful information.
# Create an example.sh package
% fpm -s empty -t sh -n example
# Get help.
% ./example.sh -h
Supported Uses in FPM
---------------------
fpm supports using ``sh`` only as an output type. This means you can create ``sh`` packages from input types like ``deb``, ``dir``, or ``npm``
sh-specific command line flags
-------------------------------
.. include:: cli/sh.rst

15
docs/packages/snap.rst Normal file
View File

@ -0,0 +1,15 @@
snap - Application package files for Linux
==========================================
You can learn more about ``snap`` itself by visiting the website: https://snapcraft.io/about
Supported Uses in FPM
---------------------
fpm supports input and output for snap packages. This means you can read a snap and convert it to a different output type (such as a `dir` or `rpm`). It also means you can create a snap package.
snap-specific command line flags
--------------------------------
.. include:: cli/snap.rst

19
docs/packages/solaris.rst Normal file
View File

@ -0,0 +1,19 @@
solaris - Solaris SRV4 package format
=====================================
This package format is typically used in older Solaris versions (Solaris 7, 8,
9, and 10). You may also know them by files with a SUNW prefix and may have file names that end in ".pkg".
If you're using Solaris 11, OpenSolaris, or Illumos, you might want to use `the newer package format, p5p`_.
.. _the newer package format, p5p: /packages/p5p.html
Supported Uses in FPM
---------------------
fpm supports using ``solaris`` only as an output type. This means you can create ``solaris`` packages from input types like ``deb``, ``dir``, or ``npm``
solaris-specific command line flags
-----------------------------------
.. include:: cli/solaris.rst

12
docs/packages/tar.rst Normal file
View File

@ -0,0 +1,12 @@
tar - Tape archives aka "tar" files
===================================
Supported Uses in FPM
---------------------
fpm supports input and output for NAME (tar). This means you can read a tar and convert it to a different output type (such as a `dir` or `rpm`). It also means you can create a tar package.
tar-specific command line flags
-------------------------------
.. include:: cli/tar.rst

View File

@ -0,0 +1,13 @@
virtualenv - Python virtualenv
==============================
Supported Uses in FPM
---------------------
fpm supports using ``virtualenv`` only as an input type. This means you can convert
``virtualenv`` input packages to output packages like ``deb``, ``rpm``, and more.
virtualenv-specific command line flags
--------------------------------------
.. include:: cli/virtualenv.rst

12
docs/packages/zip.rst Normal file
View File

@ -0,0 +1,12 @@
zip - Zip files
===============
Supported Uses in FPM
---------------------
fpm supports input and output for zip files. This means you can read a zip and convert it to a different output type (such as a `dir` or `rpm`). It also means you can create a zip package.
zip-specific command line flags
-------------------------------
.. include:: cli/zip.rst

8
docs/packaging-types.rst Normal file
View File

@ -0,0 +1,8 @@
Packaging Types
===============
.. toctree::
:includehidden:
:glob:
packages/*

1
docs/requirements.txt Normal file
View File

@ -0,0 +1 @@
sphinx_rtd_theme

View File

@ -1,16 +0,0 @@
$: << File.join(File.dirname(__FILE__), "..", "..", "lib")
require "fpm"
package = FPM::Package::Gem.new
# the Gem package takes a string name of the package to download/install.
# Example, run this script with 'rails' as an argument and it will convert
# the latest 'rails' gem into rpm.
package.input(ARGV[0])
rpm = package.convert(FPM::Package::RPM)
begin
output = "NAME-VERSION.ARCH.rpm"
rpm.output(rpm.to_s(output))
ensure
rpm.cleanup
end

View File

@ -1,18 +0,0 @@
$: << File.join(File.dirname(__FILE__), "..", "..", "lib")
require "fpm"
package = FPM::Package::Gem.new
ARGV.each do |gem|
name, version = gem.split(/[=]/, 2)
package.version = version # Allow specifying a specific version
package.input(gem)
end
rpm = package.convert(FPM::Package::RPM)
rpm.name = "rubygem-manythings"
rpm.version = "1.0"
begin
output = "NAME-VERSION.ARCH.rpm"
rpm.output(rpm.to_s(output))
ensure
rpm.cleanup
end

View File

@ -1,61 +0,0 @@
#
# feel free to change these to whatever makes sense
#
# debian package we rely on
RUBY_PACKAGE=ruby
# and the executable that comes from it
RUBY_BIN=/usr/bin/ruby
# the version we name the deb
VERSION=1.1.0
# where to get the sauce
GIT_URL=https://github.com/jordansissel/fpm.git
# the tag we checkout to build from
TAG_SPEC=refs/tags/v$(VERSION)
CHECKOUT_DIR=fpm-checkout
BUILD_DIR=build
LIB_DIR=$(BUILD_DIR)/usr/lib/fpm
BIN_DIR=$(BUILD_DIR)/usr/bin
GEM_PATH:=$(shell readlink -f .)/build/gem
FPM_BIN=$(BIN_DIR)/fpm
BUNDLE_BIN=$(GEM_PATH)/bin/bundle
BUNDLE_CMD=$(RUBY_CMD) $(BUNDLE_BIN)
FPM_CMD=$(FPM_BIN)
GEM_CMD=$(RUBY_BIN) -S gem
.PHONY: clean
clean:
rm -rf $(CHECKOUT_DIR)
rm -rf $(BUILD_DIR)
rm -f fpm*.deb
$(CHECKOUT_DIR):
rm -rf $(CHECKOUT_DIR)
git clone $(GIT_URL) $(CHECKOUT_DIR) --depth 1
cd $(CHECKOUT_DIR) && git fetch && git checkout $(TAG_SPEC)
$(BUNDLE_BIN):
$(GEM_CMD) install bundler --install-dir=$(GEM_PATH) --no-ri --no-rdoc
$(FPM_BIN):
mkdir --parents $(BIN_DIR)
# Couldn't think of a nice way to do this, so here is this code turd
echo "#! $(RUBY_BIN)" > $(FPM_BIN)
echo 'load File.dirname($$0) + "/../lib/fpm/bundle/bundler/setup.rb"' >> $(FPM_BIN)
echo 'require "fpm"' >> $(FPM_BIN)
echo 'require "fpm/command"' >> $(FPM_BIN)
echo 'exit(FPM::Command.run || 0)' >> $(FPM_BIN)
chmod +x $(FPM_BIN)
.PHONY: install
install: $(CHECKOUT_DIR) $(BUNDLE_BIN) $(FPM_BIN)
mkdir --parents $(LIB_DIR)
cd $(CHECKOUT_DIR) && GEM_PATH=$(GEM_PATH) $(BUNDLE_CMD) install --without=development --standalone
cd $(CHECKOUT_DIR) && gem build fpm.gemspec
tar -xf $(CHECKOUT_DIR)/fpm*gem -C $(BUILD_DIR)
tar --touch -xf $(BUILD_DIR)/data.tar.gz -C $(LIB_DIR)
cp -r $(CHECKOUT_DIR)/bundle $(LIB_DIR)/bundle
.PHONY: package
package: install
$(FPM_BIN) -s dir -t deb -n fpm -d $(RUBY_PACKAGE) -v $(VERSION) -C $(BUILD_DIR) usr

View File

@ -1,18 +0,0 @@
# About
- build and install dependency on a ruby1.9 of some kind
- does not need root to package
- has its own GEM_DIR to keep its dependencies isolated
- installation does not install any gems in to your ruby environment
- installs in to standard locations /usr/{bin,lib}/fpm
- doesn't depend on having fpm installed for packaging to work
# Dependencies
- build-essential (perhaps more, but basically the standard packages you need
for deb packaging)
- ruby and ruby-dev
# Usage
- $ cd examples/fpm-with-system-ruby && make package

View File

@ -1,35 +0,0 @@
NAME=ruby
VERSION=1.9.2-p180
MAJOR_VERSION=1.9
ARCHITECTURE=x86
TARDIR=$(NAME)-$(VERSION)
TARBALL=$(TARDIR).tar.gz
DOWNLOAD=http://ftp.ruby-lang.org/pub/ruby/$(MAJOR_VERSION)/$(TARBALL)
PREFIX=/opt/fpm
PACKAGE_NAME=fpm
PACKAGE_VERSION=0.2.30
.PHONY: default
default: deb
package: deb
.PHONY: clean
clean:
rm -f $(NAME)-* $(NAME)_* |NAME| true
rm -fr $(TARDIR) || true
rm -fr $(PREFIX) || true
rm -f *.deb
$(TARBALL):
wget "$(DOWNLOAD)"
$(TARDIR): $(TARBALL)
tar -zxf $(TARBALL)
cd $(TARDIR); ./configure --enable-shared=false --prefix=$(PREFIX); make; make install
$(PREFIX)/bin/gem install fpm
.PHONY: deb
deb: $(TARDIR)
$(PREFIX)/bin/fpm -s dir -t deb -v $(PACKAGE_VERSION) -n $(PACKAGE_NAME) -a $(ARCHITECTURE) -C $(PREFIX) .

View File

@ -1,19 +0,0 @@
Notes:
You should have write permission on /opt directory
Dependencies:
$ sudo apt-get install build-essential bison openssl libreadline6 libreadline6-dev zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libxml2-dev libxslt-dev autoconf libc6-dev
Usage:
$ make package
Should make the package. Try installing:
$ sudo dpkg -i fpm-0.2.30.x86.deb
Now try it:
$ /opt/fpm/bin/fpm --help

View File

@ -1,35 +0,0 @@
NAME=jruby
VERSION=1.6.1
DOWNLOAD=http://jruby.org.s3.amazonaws.com/downloads/$(VERSION)/$(TARBALL)
TARBALL=$(NAME)-bin-$(VERSION).tar.gz
TARDIR=$(NAME)-$(VERSION)
PREFIX=/opt/jruby
.PHONY: default
default: deb
package: deb
.PHONY: clean
clean:
rm -f $(NAME)-* $(NAME)_* || true
rm -fr $(TARDIR) || true
rm -f *.deb
rm -f *.rpm
$(TARBALL):
wget "$(DOWNLOAD)"
$(TARDIR): $(TARBALL)
tar -zxf $(TARBALL)
.PHONY: deb
deb: $(TARDIR)
fpm -s dir -t deb -v $(VERSION) -n $(NAME) -d "sun-java6-bin (>> 0)" \
-a all -d "sun-java6-jre (>> 0)" --prefix $(PREFIX) -C $(TARDIR) .
.PHONY: rpm
rpm: $(TARDIR)
fpm -s dir -t rpm -v $(VERSION) -n $(NAME) -d "jdk >= 1.6.0" \
-a all --prefix $(PREFIX) -C $(TARDIR) .

View File

@ -1,17 +0,0 @@
Usage:
make package
Should make the package. Try installing:
sudo dpkg -i jruby-1.6.0.RC2-1.all.deb
Now try it:
% /opt/jruby/bin/jirb
>> require "java"
=> true
>> java.lang.System.out.println("Hello")
Hello
=> nil

View File

@ -1,15 +0,0 @@
NAME=twisted
VERSION=10.2.0
twisted:
easy_install --editable --build-directory . "$(NAME)==$(VERSION)"
usr: twisted
cd twisted; python setup.py bdist
tar -zxf twisted/dist/Twisted-$(VERSION).linux-$(shell uname -m).tar.gz
package: usr
fpm -s dir -t deb -n $(NAME) -v $(VERSION) \
-p python-$(NAME)-VERSION_ARCH.deb -d "python" \
usr

View File

@ -8,7 +8,9 @@ Gem::Specification.new do |spec|
files << "LICENSE"
files << "CONTRIBUTORS"
files << "CHANGELIST"
files << "CHANGELOG.rst"
files = files.reject { |path| path =~ /\.pyc$/ }
spec.name = "fpm"
spec.version = FPM::VERSION
@ -18,46 +20,37 @@ Gem::Specification.new do |spec|
"management without wasting pointless hours debugging bad rpm specs!"
spec.license = "MIT-like"
# For parsing JSON (required for some Python support, etc)
# http://flori.github.com/json/doc/index.html
spec.add_dependency("json", ">= 1.7.7", "< 2.0") # license: Ruby License
spec.required_ruby_version = '>= 1.9.3'
# For logging
# https://github.com/jordansissel/ruby-cabin
spec.add_dependency("cabin", ">= 0.6.0") # license: Apache 2
spec.add_dependency("cabin", ">= 0.9.1") # license: Apache 2
# For backports to older rubies
# https://github.com/marcandre/backports
spec.add_dependency("backports", ">= 2.6.2") # license: MIT
# For reading and writing rpms
spec.add_dependency("arr-pm", "~> 0.0.10") # license: Apache 2
spec.add_dependency("arr-pm", "~> 0.0.11") # license: Apache 2
# For command-line flag support
# https://github.com/mdub/clamp/blob/master/README.markdown
spec.add_dependency("clamp", "~> 1.0.0") # license: MIT
spec.add_dependency("clamp", ">= 1.0.0") # license: MIT
# For starting external processes across various ruby interpreters
spec.add_dependency("childprocess") # license: ???
# For sourcing from pleaserun
spec.add_dependency("pleaserun", "~> 0.0.29") # license: Apache 2
# For calling functions in dynamic libraries
spec.add_dependency("ffi") # license: GPL3/LGPL3
spec.add_dependency("stud")
spec.add_development_dependency("rake", "~> 10") # license: MIT
# In Ruby 3.0, rexml was moved to a bundled gem instead of a default one,
# so I think this needs to be added explicitly?
spec.add_dependency("rexml")
# For creating tar archives (many packages are just tar archives)
spec.add_dependency("archive-tar-minitar") # license: GPL2+
# For creating FreeBSD package archives (xz-compressed tars)
spec.add_dependency("ruby-xz") # license: MIT
# For sourcing from pleaserun
spec.add_dependency("pleaserun", "~> 0.0.24") # license: Apache 2
spec.add_development_dependency("rspec", "~> 3.0.0") # license: MIT (according to wikipedia)
spec.add_development_dependency("rspec", "~> 3.13.0") # license: MIT (according to wikipedia)
spec.add_development_dependency("insist", "~> 1.0.0") # license: Apache 2
spec.add_development_dependency("pry")
spec.add_development_dependency("stud")
spec.add_development_dependency("rake") # For FPM::RakeTask, #1877, #756
spec.files = files
spec.require_paths << "lib"

View File

@ -17,3 +17,5 @@ require "fpm/package/solaris"
require "fpm/package/p5p"
require "fpm/package/pkgin"
require "fpm/package/freebsd"
require "fpm/package/apk"
require "fpm/package/snap"

View File

@ -3,7 +3,6 @@ require "fpm/namespace"
require "fpm/version"
require "fpm/util"
require "clamp"
require "ostruct"
require "fpm"
require "tmpdir" # for Dir.tmpdir
@ -45,13 +44,13 @@ class FPM::Command < Clamp::Command
return lines.join("\n")
end # def help
option "-t", "OUTPUT_TYPE",
option ["-t", "--output-type"], "OUTPUT_TYPE",
"the type of package you want to create (deb, rpm, solaris, etc)",
:attribute_name => :output_type
option "-s", "INPUT_TYPE",
option ["-s", "--input-type"], "INPUT_TYPE",
"the package type to use as input (gem, rpm, python, etc)",
:attribute_name => :input_type
option "-C", "CHDIR",
option ["-C", "--chdir"], "CHDIR",
"Change directory to here before searching for files",
:attribute_name => :chdir
option "--prefix", "PREFIX",
@ -233,13 +232,38 @@ class FPM::Command < Clamp::Command
"copying, downloading, etc. Roughly any scratch space fpm needs to build " \
"your package.", :default => Dir.tmpdir
option "--source-date-epoch-from-changelog", :flag,
"Use release date from changelog as timestamp on generated files to reduce nondeterminism. " \
"Experimental; only implemented for gem so far. ",
:default => false
option "--source-date-epoch-default", "SOURCE_DATE_EPOCH_DEFAULT",
"If no release date otherwise specified, use this value as timestamp on generated files to reduce nondeterminism. " \
"Reproducible build environments such as dpkg-dev and rpmbuild set this via envionment 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 ",
:environment_variable => "SOURCE_DATE_EPOCH"
option "--fpm-options-file", "FPM_OPTIONS_FILE",
"A file that contains additional fpm options. Any fpm flag format is valid in this file. " \
"This can be useful on build servers where you want to use a common configuration or " \
"inject other parameters from a file instead of from a command-line flag.." do |path|
load_options(path)
end
parameter "[ARGS] ...",
"Inputs to the source package type. For the 'dir' type, this is the files" \
" and directories you want to include in the package. For others, like " \
"'gem', it specifies the packages to download and use as the gem input",
:attribute_name => :args
# Keep a copy of the original flags (ones declared above, not by package types)
# This helps when generating the documentation
GENERAL_OPTIONS = @declared_options.clone
FPM::Package.types.each do |name, klass|
# This adds each package's flags to the main command
klass.apply_options(self)
end
@ -256,12 +280,6 @@ class FPM::Command < Clamp::Command
# Execute this command. See Clamp::Command#execute and Clamp's documentation
def execute
# Short-circuit if someone simply runs `fpm --version`
if ARGV == [ "--version" ]
puts FPM::VERSION
return 0
end
logger.level = :warn
logger.level = :info if verbose? # --verbose
logger.level = :debug if debug? # --debug
@ -269,7 +287,6 @@ class FPM::Command < Clamp::Command
logger.level = log_level.to_sym
end
if (stray_flags = args.grep(/^-/); stray_flags.any?)
logger.warn("All flags should be before the first argument " \
"(stray flags found: #{stray_flags}")
@ -284,6 +301,15 @@ class FPM::Command < Clamp::Command
args << "."
end
if !File.exist?(workdir)
logger.fatal("Given --workdir=#{workdir} is not a path that exists.")
raise FPM::Package::InvalidArgument, "The given workdir '#{workdir}' does not exist."
end
if !File.directory?(workdir)
logger.fatal("Given --workdir=#{workdir} must be a directory")
raise FPM::Package::InvalidArgument, "The given workdir '#{workdir}' must be a directory."
end
logger.info("Setting workdir", :workdir => workdir)
ENV["TMP"] = workdir
@ -348,7 +374,7 @@ class FPM::Command < Clamp::Command
# If --inputs was specified, read it as a file.
if !inputs.nil?
if !File.exists?(inputs)
if !File.exist?(inputs)
logger.fatal("File given for --inputs does not exist (#{inputs})")
return 1
end
@ -363,7 +389,7 @@ class FPM::Command < Clamp::Command
# If --exclude-file was specified, read it as a file and append to
# the exclude pattern list.
if !exclude_file.nil?
if !File.exists?(exclude_file)
if !File.exist?(exclude_file)
logger.fatal("File given for --exclude-file does not exist (#{exclude_file})")
return 1
end
@ -387,7 +413,12 @@ class FPM::Command < Clamp::Command
set = proc do |object, attribute|
# if the package's attribute is currently nil *or* the flag setting for this
# attribute is non-default, use the value.
if object.send(attribute).nil? || send(attribute) != send("default_#{attribute}")
# Not all options have a default value, so we assume `nil` if there's no default. (#1543)
# In clamp >= 1.3.0, options without `:default => ..` will not have any # `default_xyz`
# methods generated, so we need to check for the presence of this method first.
default = respond_to?("default_#{attribute}") ? send("default_#{attribute}") : nil
if object.send(attribute).nil? || send(attribute) != default
logger.info("Setting from flags: #{attribute}=#{send(attribute)}")
object.send("#{attribute}=", send(attribute))
end
@ -428,7 +459,7 @@ class FPM::Command < Clamp::Command
# Skip scripts not set
next if path.nil?
if !File.exists?(path)
if !File.exist?(path)
logger.error("No such file (for #{scriptname.to_s}): #{path.inspect}")
script_errors << path
end
@ -514,9 +545,16 @@ class FPM::Command < Clamp::Command
end
end # def execute
def run(*run_args)
def run(run_args)
logger.subscribe(STDOUT)
# Short circuit for a `fpm --version` or `fpm -v` short invocation that
# is the user asking us for the version of fpm.
if run_args == [ "-v" ] || run_args == [ "--version" ]
puts FPM::VERSION
return 0
end
# fpm initialization files, note the order of the following array is
# important, try .fpm in users home directory first and then the current
# directory
@ -557,12 +595,86 @@ class FPM::Command < Clamp::Command
ARGV.unshift(*flags)
ARGV.push(*args)
super(*run_args)
super(run_args)
rescue FPM::Package::InvalidArgument => e
logger.error("Invalid package argument: #{e}")
return 1
end # def run
def load_options(path)
@loaded_files ||= []
if @loaded_files.include?(path)
#logger.error("Options file was already loaded once. Refusing to load a second time.", :path => path)
raise FPM::Package::InvalidArgument, "Options file already loaded once. Refusing to load a second time. Maybe a file tries to load itself? Path: #{path}"
end
if !File.exist?(path)
logger.fatal("Cannot load options from file because the file doesn't exist.", :path => path)
end
if !File.readable?(path)
logger.fatal("Cannot load options from file because the file isn't readable.", :path => path)
end
@loaded_files << path
logger.info("Loading flags from file", :path => path)
# Safety check, abort if the file is huge. Arbitrarily chosen limit is 100kb
stat = File.stat(path)
max = 100 * 1024
if stat.size > max
logger.fatal("Refusing to load options from file because the file seems pretty large.", :path => path, :size => stat.size)
raise FPM::Package::InvalidArgument, "Options file given to --fpm-options-file is seems too large. For safety, fpm is refusing to load this. Path: #{path} - Size: #{stat.size}, maximum allowed size #{max}."
end
File.read(path).split($/).each do |line|
logger.info("Processing flags from file", :path => path, :line => line)
# With apologies for this hack to mdub (Mike Williams, author of Clamp)...
# The following code will read a file and parse the file
# as flags as if they were in same argument position as the given --fpm-options-file option.
args = Shellwords.split(line)
while args.any?
arg = args.shift
# Lookup the Clamp option by its --flag-name or short name like -f
if arg =~ /^-/
# Single-letter options like -a or -z
if single_letter = arg.match(/^(-[A-Za-z0-9])(.*)$/)
option = self.class.find_option(single_letter.match(1))
arg, remainder = single_letter.match(1), single_letter.match(2)
if option.flag?
# Flags aka switches take no arguments, so we push the rest of the 'arg' entry back onto the args list
# For combined letter flags, like `-abc`, we want to consume the
# `-a` and then push `-bc` back to be processed.
# Only do this if there's more flags, like, not for `-a` but yes for `-abc`
args.unshift("-" + remainder) unless remainder.empty?
else
# Single letter options that take arguments, like `-ohello` same as `-o hello`
# For single letter flags with values, like `-ofilename` aka `-o filename`, push the remainder ("filename")
# back onto the args list so that it is consumed when we extract the flag value.
args.unshift(remainder) unless remainder.empty?
end
elsif arg.match(/^--/)
# Lookup the flag by its long --flag-name
option = self.class.find_option(arg)
end
end
# Extract the flag value, if any, from the remaining args list.
value = option.extract_value(arg, args)
# Process the flag into `self`
option.of(self).take(value)
end
end
end
# A simple flag validator
#
# The goal of this class is to ensure the flags and arguments given

View File

@ -3,11 +3,12 @@ require "fpm/util" # local
require "pathname" # stdlib
require "find"
require "tmpdir" # stdlib
require "backports" # gem 'backports'
require "backports/latest"
require "socket" # stdlib, for Socket.gethostname
require "shellwords" # stdlib, for Shellwords.escape
require "erb" # stdlib, for template processing
require "cabin" # gem "cabin"
require "stud/temporary"
# This class is the parent of all packages.
# If you want to implement an FPM package type, you'll inherit from this.
@ -117,7 +118,10 @@ class FPM::Package
def initialize
# Attributes for this specific package
@attributes = {}
@attributes = {
# Default work location
:workdir => ::Dir.tmpdir
}
# Reference
# http://www.debian.org/doc/manuals/maint-guide/first.en.html
@ -174,8 +178,8 @@ class FPM::Package
@directories = []
@attrs = {}
staging_path
build_path
# Dont' initialize staging_path just yet, do it lazily so subclass can get a word in.
end # def initialize
# Get the 'type' for this instance.
@ -249,7 +253,7 @@ class FPM::Package
end # def output
def staging_path(path=nil)
@staging_path ||= ::Dir.mktmpdir("package-#{type}-staging") #, ::Dir.pwd)
@staging_path ||= Stud::Temporary.directory("package-#{type}-staging")
if path.nil?
return @staging_path
@ -259,7 +263,7 @@ class FPM::Package
end # def staging_path
def build_path(path=nil)
@build_path ||= ::Dir.mktmpdir("package-#{type}-build") #, ::Dir.pwd)
@build_path ||= Stud::Temporary.directory("package-#{type}-build")
if path.nil?
return @build_path
@ -311,7 +315,7 @@ class FPM::Package
# the path before returning.
#
# Wrapping Find.find in an Enumerator is required for sane operation in ruby 1.8.7,
# but requires the 'backports' gem (which is used in other places in fpm)
# but requires the 'backports/latest' gem (which is used in other places in fpm)
return Enumerator.new { |y| Find.find(staging_path) { |path| y << path } } \
.select { |path| path != staging_path } \
.select { |path| is_leaf.call(path) } \
@ -326,11 +330,12 @@ class FPM::Package
template_path = File.join(template_dir, path)
template_code = File.read(template_path)
logger.info("Reading template", :path => template_path)
erb = ERB.new(template_code, nil, "-")
erb = erbnew(template_code)
erb.filename = template_path
return erb
end # def template
#######################################
# The following methods are provided to
# easily override particular substitut-
@ -491,13 +496,29 @@ class FPM::Package
return scripts.include?(name)
end # def script?
# write all scripts to .scripts (tar and dir)
def write_scripts
scripts_path = File.join(staging_path, ".scripts")
target_scripts = [:before_install, :after_install, :before_remove, :after_remove]
if target_scripts.any? {|name| script?(name)}
::Dir.mkdir(scripts_path)
target_scripts.each do |name|
next unless script?(name)
out = File.join(scripts_path, name.to_s)
logger.debug('Writing script', :source => name, :target => out)
File.write(out, script(name))
File.chmod(0755, out)
end
end
end
# Get the contents of the script by a given name.
#
# If template_scripts? is set in attributes (often by the --template-scripts
# flag), then apply it as an ERB template.
def script(script_name)
if attributes[:template_scripts?]
erb = ERB.new(scripts[script_name], nil, "-")
erb = erbnew(scripts[script_name])
# TODO(sissel): find the original file name for the file.
erb.filename = "script(#{script_name})"
return erb.result(binding)

View File

@ -3,12 +3,12 @@ require "fpm/namespace"
require "fpm/package"
require "fpm/errors"
require "fpm/util"
require "backports"
require "backports/latest"
require "fileutils"
require "digest"
require 'digest/sha1'
# Support for debian packages (.deb files)
# Support for Alpine packages (.apk files)
#
# This class supports both input and output of packages.
class FPM::Package::APK< FPM::Package
@ -144,9 +144,9 @@ class FPM::Package::APK< FPM::Package
scripts = {}
scripts = register_script('post-install', :after_install, scripts)
scripts = register_script('post-install', :before_install, scripts)
scripts = register_script('post-install', :before_upgrade, scripts)
scripts = register_script('post-install', :after_upgrade, scripts)
scripts = register_script('pre-install', :before_install, scripts)
scripts = register_script('pre-upgrade', :before_upgrade, scripts)
scripts = register_script('post-upgrade', :after_upgrade, scripts)
scripts = register_script('pre-deinstall', :before_remove, scripts)
scripts = register_script('post-deinstall', :after_remove, scripts)
@ -238,7 +238,7 @@ class FPM::Package::APK< FPM::Package
record_length = determine_record_length(record_length)
until(data.length == record_length)
data += file.read(TAR_CHUNK_SIZE)
data << file.read(TAR_CHUNK_SIZE)
end
# Clear ownership fields

View File

@ -3,6 +3,7 @@ require "fpm/package"
require "fpm/util"
require "fileutils"
require "find"
require "pathname"
class FPM::Package::CPAN < FPM::Package
# Flags '--foo' will be accessable as attributes[:npm_foo]
@ -24,6 +25,9 @@ class FPM::Package::CPAN < FPM::Package
option "--test", :flag,
"Run the tests before packaging?", :default => true
option "--verbose", :flag,
"Produce verbose output from cpanm?", :default => false
option "--perl-lib-path", "PERL_LIB_PATH",
"Path of target Perl Libraries"
@ -48,6 +52,7 @@ class FPM::Package::CPAN < FPM::Package
if File.exist?(package)
moduledir = package
result = {}
else
result = search(package)
tarball = download(result, version)
@ -97,10 +102,17 @@ class FPM::Package::CPAN < FPM::Package
self.name = fix_name(metadata["name"])
end
unless metadata["module"].nil?
metadata["module"].each do |m|
self.provides << cap_name(m["name"]) + " = #{self.version}"
end
end
# author is not always set or it may be a string instead of an array
self.vendor = case metadata["author"]
when String; metadata["author"]
when Array; metadata["author"].join(", ")
when NilClass; "No Vendor Or Author Provided"
else
raise FPM::InvalidPackageConfiguration, "Unexpected CPAN 'author' field type: #{metadata["author"].class}. This is a bug."
end if metadata.include?("author")
@ -129,24 +141,36 @@ class FPM::Package::CPAN < FPM::Package
cpanm_flags += ["--mirror", "#{attributes[:cpan_mirror]}"] if !attributes[:cpan_mirror].nil?
cpanm_flags += ["--mirror-only"] if attributes[:cpan_mirror_only?] && !attributes[:cpan_mirror].nil?
cpanm_flags += ["--force"] if attributes[:cpan_cpanm_force?]
cpanm_flags += ["--verbose"] if attributes[:cpan_verbose?]
safesystem(attributes[:cpan_cpanm_bin], *cpanm_flags)
if !attributes[:no_auto_depends?]
unless metadata["requires"].nil?
metadata["requires"].each do |dep_name, version|
found_dependencies = {}
if metadata["requires"]
found_dependencies.merge!(metadata["requires"])
end
if metadata["prereqs"]
if metadata["prereqs"]["runtime"]
if metadata["prereqs"]["runtime"]["requires"]
found_dependencies.merge!(metadata["prereqs"]["runtime"]["requires"])
end
end
end
unless found_dependencies.empty?
found_dependencies.each do |dep_name, version|
# Special case for representing perl core as a version.
if dep_name == "perl"
m = version.to_s.match(/^(\d)\.(\d{3})(\d{3})$/)
if m
version = m[1] + '.' + m[2].sub(/^0*/, '') + '.' + m[3].sub(/^0*/, '')
end
self.dependencies << "#{dep_name} >= #{version}"
next
end
dep = search(dep_name)
if dep.include?("distribution")
name = fix_name(dep["distribution"])
else
name = fix_name(dep_name)
end
name = cap_name(dep_name)
if version.to_s == "0"
# Assume 'Foo = 0' means any version?
@ -154,12 +178,14 @@ class FPM::Package::CPAN < FPM::Package
else
# The 'version' string can be something complex like:
# ">= 0, != 1.0, != 1.2"
# If it is not specified explicitly, require the given
# version or newer, as that is all CPAN itself enforces
if version.is_a?(String)
version.split(/\s*,\s*/).each do |v|
if v =~ /\s*[><=]/
self.dependencies << "#{name} #{v}"
else
self.dependencies << "#{name} = #{v}"
self.dependencies << "#{name} >= #{v}"
end
end
else
@ -220,11 +246,7 @@ class FPM::Package::CPAN < FPM::Package
# Empty install_base to avoid local::lib being used.
"INSTALL_BASE=")
end
if attributes[:cpan_test?]
make = [ "env", "PERL5LIB=#{build_path("cpan/lib/perl5")}", "make" ]
else
make = [ "make" ]
end
make = [ "env", "PERL5LIB=#{build_path("cpan/lib/perl5")}", "make" ]
safesystem(*make)
safesystem(*(make + ["test"])) if attributes[:cpan_test?]
safesystem(*(make + ["DESTDIR=#{staging_path}", "install"]))
@ -246,6 +268,21 @@ class FPM::Package::CPAN < FPM::Package
:path => path.gsub(staging_path, ""))
File.unlink(path)
end
# Remove useless .packlist files and their empty parent folders
# https://github.com/jordansissel/fpm/issues/1179
::Dir.glob(File.join(staging_path, glob_prefix, "**/.packlist")).each do |path|
logger.debug("Removing useless file.",
:path => path.gsub(staging_path, ""))
File.unlink(path)
Pathname.new(path).parent.ascend do |parent|
if ::Dir.entries(parent).sort == ['.', '..'].sort
FileUtils.rmdir parent
else
break
end
end
end
end
@ -268,7 +305,7 @@ class FPM::Package::CPAN < FPM::Package
directory = build_path("module")
::Dir.mkdir(directory)
args = [ "-C", directory, "-zxf", tarball,
"--strip-components", "1" ]
%q{--transform=s,[./]*[^/]*/,,} ]
safesystem("tar", *args)
return directory
end
@ -281,38 +318,35 @@ class FPM::Package::CPAN < FPM::Package
:distribution => distribution,
:version => cpan_version)
# default to latest versionunless we specify one
# default to latest version unless we specify one
if cpan_version.nil?
self.version = metadata["version"]
self.version = "#{metadata["version"]}"
else
if metadata["version"] =~ /^v\d/
self.version = "v#{cpan_version}"
else
self.version = cpan_version
end
self.version = "#{cpan_version}"
end
metacpan_release_url = "http://api.metacpan.org/v0/release/#{author}/#{distribution}-#{self.version}"
# Search metacpan to get download URL for this version of the module
metacpan_search_url = "https://fastapi.metacpan.org/v1/release/_search"
metacpan_search_query = '{"fields":["download_url"],"filter":{"term":{"name":"' + "#{distribution}-#{self.version}" + '"}}}'
begin
release_response = httpfetch(metacpan_release_url)
search_response = httppost(metacpan_search_url,metacpan_search_query)
rescue Net::HTTPServerException => e
logger.error("metacpan release query failed.", :error => e.message,
:url => metacpan_release_url)
:url => metacpan_search_url)
raise FPM::InvalidPackageConfiguration, "metacpan release query failed"
end
data = release_response.body
data = search_response.body
release_metadata = JSON.parse(data)
archive = release_metadata["archive"]
# should probably be basepathed from the url
tarball = File.basename(archive)
download_url = release_metadata['hits']['hits'][0]['fields']['download_url']
download_path = URI.parse(download_url).path
tarball = File.basename(download_path)
url_base = "http://www.cpan.org/"
url_base = "#{attributes[:cpan_mirror]}" if !attributes[:cpan_mirror].nil?
#url = "http://www.cpan.org/CPAN/authors/id/#{author[0,1]}/#{author[0,2]}/#{author}/#{tarball}"
url = "#{url_base}/authors/id/#{author[0,1]}/#{author[0,2]}/#{author}/#{archive}"
url = "#{url_base}#{download_path}"
logger.debug("Fetching perl module", :url => url)
begin
@ -333,7 +367,7 @@ class FPM::Package::CPAN < FPM::Package
def search(package)
logger.info("Asking metacpan about a module", :module => package)
metacpan_url = "http://api.metacpan.org/v0/module/" + package
metacpan_url = "https://fastapi.metacpan.org/v1/module/" + package
begin
response = httpfetch(metacpan_url)
rescue Net::HTTPServerException => e
@ -351,6 +385,10 @@ class FPM::Package::CPAN < FPM::Package
return metadata
end # def metadata
def cap_name(name)
return "perl(" + name.gsub("-", "::") + ")"
end # def cap_name
def fix_name(name)
case name
when "perl"; return "perl"
@ -366,6 +404,7 @@ class FPM::Package::CPAN < FPM::Package
else
http = Net::HTTP.new(uri.host, uri.port)
end
http.use_ssl = uri.scheme == 'https'
response = http.request(Net::HTTP::Get.new(uri.request_uri))
case response
when Net::HTTPSuccess; return response
@ -374,5 +413,22 @@ class FPM::Package::CPAN < FPM::Package
end
end
def httppost(url, body)
uri = URI.parse(url)
if ENV['http_proxy']
proxy = URI.parse(ENV['http_proxy'])
http = Net::HTTP.Proxy(proxy.host,proxy.port,proxy.user,proxy.password).new(uri.host, uri.port)
else
http = Net::HTTP.new(uri.host, uri.port)
end
http.use_ssl = uri.scheme == 'https'
response = http.post(uri.request_uri, body)
case response
when Net::HTTPSuccess; return response
when Net::HTTPRedirection; return httppost(response["location"])
else; response.error!
end
end
public(:input)
end # class FPM::Package::NPM

View File

@ -3,9 +3,14 @@ require "fpm/namespace"
require "fpm/package"
require "fpm/errors"
require "fpm/util"
require "backports"
require "backports/latest"
require "fileutils"
require "digest"
require "zlib"
# For handling conversion
require "fpm/package/cpan"
require "fpm/package/gem"
# Support for debian packages (.deb files)
#
@ -18,10 +23,35 @@ class FPM::Package::Deb < FPM::Package
:after_install => "postinst",
:before_remove => "prerm",
:after_remove => "postrm",
:after_purge => "postrm",
} unless defined?(SCRIPT_MAP)
# The list of supported compression types. Default is gz (gzip)
COMPRESSION_TYPES = [ "gz", "bzip2", "xz" ]
COMPRESSION_TYPES = [ "gz", "bzip2", "xz", "zst", "none" ]
# https://www.debian.org/doc/debian-policy/ch-relationships.html#syntax-of-relationship-fields
# Example value with version relationship: libc6 (>= 2.2.1)
# Example value: libc6
# Package name docs here: https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-source
# Package names (both source and binary, see Package) must consist only of lower case letters (a-z),
# digits (0-9), plus (+) and minus (-) signs, and periods (.).
# They must be at least two characters long and must start with an alphanumeric character.
# Version string docs here: https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-version
# The format is: [epoch:]upstream_version[-debian_revision].
# epoch - This is a single (generally small) unsigned integer
# upstream_version - must contain only alphanumerics 6 and the characters . + - ~
# debian_revision - only alphanumerics and the characters + . ~
VERSION_FIELD_PATTERN = /
(?:(?:[0-9]+):)? # The epoch, an unsigned int
(?:[A-Za-z0-9+~.-]+) # upstream version, probably should not contain dashes?
(?:-[A-Za-z0-9+~.]+)? # debian_revision
/x # Version field pattern
RELATIONSHIP_FIELD_PATTERN = /^
(?<name>[A-z0-9][A-z0-9_.-]+)
(?:\s*\((?<relation>[<>=]+)\s(?<version>#{VERSION_FIELD_PATTERN})\))?
$/x # Relationship field pattern
option "--ignore-iteration-in-dependencies", :flag,
"For '=' (equal) dependencies, allow iterations on the specified " \
@ -43,12 +73,27 @@ class FPM::Package::Deb < FPM::Package
option "--compression", "COMPRESSION", "The compression type to use, must " \
"be one of #{COMPRESSION_TYPES.join(", ")}.", :default => "gz" do |value|
if !COMPRESSION_TYPES.include?(value)
raise ArgumentError, "deb compression value of '#{value}' is invalid. " \
raise FPM::Package::InvalidArgument, "deb compression value of '#{value}' is invalid. " \
"Must be one of #{COMPRESSION_TYPES.join(", ")}"
end
value
end
option "--compression-level", "[0-9]", "Select a compression level. 0 is none or minimal. 9 is max compression.",
# Specify which compression level to use on the compressor backend, when building a package
:default => nil do |value|
valint = value.to_i
# if self.attributes[:deb_compression].nil?
# raise "Can't specify a compression level with compression disabled"
# end
unless value =~ /^\d$/ && valint >= 0 && valint <= 9
raise "Invalid compression level '#{value}'. Valid values are integers between 0 and 9 inclusive."
end
valint
end
option "--dist", "DIST-TAG", "Set the deb distribution.", :default => "unstable"
# Take care about the case when we want custom control file but still use fpm ...
option "--custom-control", "FILEPATH",
"Custom version of the Debian control file." do |control|
@ -74,7 +119,7 @@ class FPM::Package::Deb < FPM::Package
end
option "--priority", "PRIORITY",
"The debian package 'priority' value.", :default => "extra"
"The debian package 'priority' value.", :default => "optional"
option "--use-file-permissions", :flag,
"Use existing file permissions when defining ownership and modes"
@ -87,6 +132,10 @@ class FPM::Package::Deb < FPM::Package
File.expand_path(file)
end
option "--generate-changes", :flag,
"Generate PACKAGENAME.changes file.",
:default => false
option "--upstream-changelog", "FILEPATH", "Add FILEPATH as upstream changelog" do |file|
File.expand_path(file)
end
@ -121,6 +170,18 @@ class FPM::Package::Deb < FPM::Package
next @activated_triggers
end
option "--interest-noawait", "EVENT", "Package is interested in EVENT trigger without awaiting" do |event|
@interested_noawait_triggers ||= []
@interested_noawait_triggers << event
next @interested_noawait_triggers
end
option "--activate-noawait", "EVENT", "Package activates EVENT trigger" do |event|
@activated_noawait_triggers ||= []
@activated_noawait_triggers << event
next @activated_noawait_triggers
end
option "--field", "'FIELD: VALUE'", "Add custom field to the control file" do |fv|
@custom_fields ||= {}
field, value = fv.split(/: */, 2)
@ -158,15 +219,35 @@ class FPM::Package::Deb < FPM::Package
end
option "--systemd", "FILEPATH", "Add FILEPATH as a systemd script",
:multivalued => true do |file|
:multivalued => true do |file|
next File.expand_path(file)
end
option "--systemd-path", "FILEPATH", "Relative path to the systemd service directory",
:default => "lib/systemd/system" do |file|
next file.gsub(/^\/*/, '')
end
option "--systemd-enable", :flag , "Enable service on install or upgrade", :default => false
option "--systemd-auto-start", :flag , "Start service after install or upgrade", :default => false
option "--systemd-restart-after-upgrade", :flag , "Restart service after upgrade", :default => true
option "--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)" do |val|
File.expand_path(val) # Get the full path to the script
end # --after-purge
option "--maintainerscripts-force-errorchecks", :flag ,
"Activate errexit shell option according to lintian. " \
"https://lintian.debian.org/tags/maintainer-script-ignores-errors.html",
:default => false
def initialize(*args)
super(*args)
attributes[:deb_priority] = "extra"
attributes[:deb_priority] = "optional"
end # def initialize
private
@ -193,9 +274,15 @@ class FPM::Package::Deb < FPM::Package
when "x86_64"
# Debian calls x86_64 "amd64"
@architecture = "amd64"
when "aarch64"
# Debian calls aarch64 "arm64"
@architecture = "arm64"
when "noarch"
# Debian calls noarch "all"
@architecture = "all"
when "ppc64le"
# Debian calls ppc64le "ppc64el"
@architecture = "ppc64el"
end
return @architecture
end # def architecture
@ -234,16 +321,56 @@ class FPM::Package::Deb < FPM::Package
return (attributes[:prefix] or "/")
end # def prefix
def version
if @version.kind_of?(String)
if @version.start_with?("v") && @version.gsub(/^v/, "") =~ /^#{VERSION_FIELD_PATTERN}$/
logger.warn("Debian 'Version' field needs to start with a digit. I was provided '#{@version}' which seems like it just has a 'v' prefix to an otherwise-valid Debian version, I'll remove the 'v' for you.")
@version = @version.gsub(/^v/, "")
end
if @version !~ /^#{VERSION_FIELD_PATTERN}$/
raise FPM::InvalidPackageConfiguration, "The version looks invalid for Debian packages. Debian version field must contain only alphanumerics and . (period), + (plus), - (hyphen) or ~ (tilde). I have '#{@version}' which which isn't valid."
end
end
return @version
end
def input(input_path)
extract_info(input_path)
extract_files(input_path)
end # def input
def extract_info(package)
compression = `#{ar_cmd[0]} t #{package}`.split("\n").grep(/control.tar/).first.split(".").last
case compression
when "gz"
controltar = "control.tar.gz"
compression = "-z"
when "bzip2","bz2"
controltar = "control.tar.bz2"
compression = "-j"
when "xz"
controltar = "control.tar.xz"
compression = "-J"
when "zst"
controltar = "control.tar.zst"
compression = "--use-compress-program 'zstd -d'"
when 'tar'
controltar = "control.tar"
compression = ""
when nil
raise FPM::InvalidPackageConfiguration, "Missing control.tar in deb source package #{package}"
else
raise FPM::InvalidPackageConfiguration,
"Unknown compression type '#{compression}' for control.tar in deb source package #{package}"
end
build_path("control").tap do |path|
FileUtils.mkdir(path) if !File.directory?(path)
# unpack the control.tar.{,gz,bz2,xz,zst} from the deb package into staging_path
# Unpack the control tarball
safesystem("ar p #{package} control.tar.gz | tar -zxf - -C #{path}")
safesystem(ar_cmd[0] + " p #{package} #{controltar} | tar #{compression} -xf - -C #{path}")
control = File.read(File.join(path, "control"))
@ -261,7 +388,7 @@ class FPM::Package::Deb < FPM::Package
version_re = /^(?:([0-9]+):)?(.+?)(?:-(.*))?$/
m = version_re.match(parse.call("Version"))
if !m
raise "Unsupported version string '#{parse.call("Version")}'"
raise FPM::InvalidPackageConfiguration, "Unsupported version string '#{parse.call("Version")}'"
end
self.epoch, self.version, self.iteration = m.captures
@ -340,30 +467,42 @@ class FPM::Package::Deb < FPM::Package
def extract_files(package)
# Find out the compression type
compression = `ar t #{package}`.split("\n").grep(/data.tar/).first.split(".").last
compression = `#{ar_cmd[0]} t #{package}`.split("\n").grep(/data.tar/).first.split(".").last
case compression
when "gz"
datatar = "data.tar.gz"
compression = "-z"
when "bzip2"
when "bzip2","bz2"
datatar = "data.tar.bz2"
compression = "-j"
when "xz"
datatar = "data.tar.xz"
compression = "-J"
when "zst"
datatar = "data.tar.zst"
compression = "--use-compress-program 'zstd -d'"
when 'tar'
datatar = "data.tar"
compression = ""
when nil
raise FPM::InvalidPackageConfiguration, "Missing data.tar in deb source package #{package}"
else
raise FPM::InvalidPackageConfiguration,
"Unknown compression type '#{self.attributes[:deb_compression]}' "
"in deb source package #{package}"
"Unknown compression type '#{compression}' for data.tar in deb source package #{package}"
end
# unpack the data.tar.{gz,bz2,xz} from the deb package into staging_path
safesystem("ar p #{package} #{datatar} " \
"| tar #{compression} -xf - -C #{staging_path}")
safesystem(ar_cmd[0] + " p #{package} #{datatar} | tar #{compression} -xf - -C #{staging_path}")
end # def extract_files
def output(output_path)
self.provides = self.provides.collect { |p| fix_provides(p) }
self.provides.each do |provide|
if !valid_provides_field?(provide)
raise FPM::InvalidPackageConfiguration, "Found invalid Provides field values (#{provide.inspect}). This is not valid in a Debian package."
end
end
output_check(output_path)
# Abort if the target path already exists.
@ -387,49 +526,60 @@ class FPM::Package::Deb < FPM::Package
end
end
if attributes[:source_date_epoch].nil? and not attributes[:source_date_epoch_default].nil?
attributes[:source_date_epoch] = attributes[:source_date_epoch_default]
end
if attributes[:source_date_epoch] == "0"
logger.error("Alas, ruby's Zlib::GzipWriter does not support setting an mtime of zero. Aborting.")
raise FPM::InvalidPackageConfiguration, "#{name}: source_date_epoch of 0 not supported."
end
if not attributes[:source_date_epoch].nil? and not ar_cmd_deterministic?
logger.error("Alas, could not find an ar that can handle -D option. Try installing recent gnu binutils. Aborting.")
raise FPM::InvalidPackageConfiguration, "#{name}: ar is insufficient to support source_date_epoch."
end
if not attributes[:source_date_epoch].nil? and not tar_cmd_supports_sort_names_and_set_mtime?
logger.error("Alas, could not find a tar that can set mtime and sort. Try installing recent gnu tar. Aborting.")
raise FPM::InvalidPackageConfiguration, "#{name}: tar is insufficient to support source_date_epoch."
end
attributes[:deb_systemd] = []
attributes.fetch(:deb_systemd_list, []).each do |systemd|
name = File.basename(systemd, ".service")
dest_systemd = staging_path("lib/systemd/system/#{name}.service")
name = File.basename(systemd)
extname = File.extname(name)
name_with_extension = if extname.empty?
"#{name}.service"
elsif [".service", ".timer"].include?(extname)
name
else
raise FPM::InvalidPackageConfiguration, "Invalid systemd unit file extension: #{extname}. Expected .service or .timer, or no extension."
end
dest_systemd = staging_path(File.join(attributes[:deb_systemd_path], "#{name_with_extension}"))
mkdir_p(File.dirname(dest_systemd))
FileUtils.cp(systemd, dest_systemd)
File.chmod(0644, dest_systemd)
# set the attribute with the systemd service name
attributes[:deb_systemd] = name
attributes[:deb_systemd] << name_with_extension
end
if script?(:before_upgrade) or script?(:after_upgrade) or attributes[:deb_systemd]
if script?(:before_upgrade) or script?(:after_upgrade) or attributes[:deb_systemd].any?
puts "Adding action files"
if script?(:before_install) or script?(:before_upgrade)
scripts[:before_install] = template("deb/preinst_upgrade.sh.erb").result(binding)
end
if script?(:before_remove) or attributes[:deb_systemd]
if script?(:before_remove) or not attributes[:deb_systemd].empty?
scripts[:before_remove] = template("deb/prerm_upgrade.sh.erb").result(binding)
end
if script?(:after_install) or script?(:after_upgrade) or attributes[:deb_systemd]
if script?(:after_install) or script?(:after_upgrade) or attributes[:deb_systemd].any?
scripts[:after_install] = template("deb/postinst_upgrade.sh.erb").result(binding)
end
if script?(:after_remove)
scripts[:after_remove] = template("deb/postrm_upgrade.sh.erb").result(binding)
end
end
write_control_tarball
# Tar up the staging_path into data.tar.{compression type}
case self.attributes[:deb_compression]
when "gz", nil
datatar = build_path("data.tar.gz")
compression = "-z"
when "bzip2"
datatar = build_path("data.tar.bz2")
compression = "-j"
when "xz"
datatar = build_path("data.tar.xz")
compression = "-J"
else
raise FPM::InvalidPackageConfiguration,
"Unknown compression type '#{self.attributes[:deb_compression]}'"
if script?(:after_purge)
scripts[:after_purge] = template("deb/postrm_upgrade.sh.erb").result(binding)
end
end
# There are two changelogs that may appear:
@ -442,6 +592,9 @@ class FPM::Package::Deb < FPM::Package
mkdir_p(File.dirname(dest_changelog))
File.new(dest_changelog, "wb", 0644).tap do |changelog|
Zlib::GzipWriter.new(changelog, Zlib::BEST_COMPRESSION).tap do |changelog_gz|
if not attributes[:source_date_epoch].nil?
changelog_gz.mtime = attributes[:source_date_epoch].to_i
end
if attributes[:deb_changelog]
logger.info("Writing user-specified changelog", :source => attributes[:deb_changelog])
File.new(attributes[:deb_changelog]).tap do |fd|
@ -461,6 +614,9 @@ class FPM::Package::Deb < FPM::Package
if attributes[:deb_upstream_changelog]
File.new(dest_upstream_changelog, "wb", 0644).tap do |changelog|
Zlib::GzipWriter.new(changelog, Zlib::BEST_COMPRESSION).tap do |changelog_gz|
if not attributes[:source_date_epoch].nil?
changelog_gz.mtime = attributes[:source_date_epoch].to_i
end
logger.info("Writing user-specified upstream changelog", :source => attributes[:deb_upstream_changelog])
File.new(attributes[:deb_upstream_changelog]).tap do |fd|
chunk = nil
@ -471,7 +627,7 @@ class FPM::Package::Deb < FPM::Package
end # No need to close, GzipWriter#close will close it.
end
if File.exists?(dest_changelog) and not File.exists?(dest_upstream_changelog)
if File.exist?(dest_changelog) and not File.exist?(dest_upstream_changelog)
# see https://www.debian.org/doc/debian-policy/ch-docs.html#s-changelogs
File.rename(dest_changelog, dest_upstream_changelog)
end
@ -494,6 +650,7 @@ class FPM::Package::Deb < FPM::Package
attributes.fetch(:deb_upstart_list, []).each do |upstart|
name = File.basename(upstart, ".upstart")
dest_init = staging_path("etc/init.d/#{name}")
name = "#{name}.conf" if !(name =~ /\.conf$/)
dest_upstart = staging_path("etc/init/#{name}")
mkdir_p(File.dirname(dest_upstart))
@ -501,14 +658,17 @@ class FPM::Package::Deb < FPM::Package
File.chmod(0644, dest_upstart)
# Install an init.d shim that calls upstart
dest_init = staging_path("etc/init.d/#{name}")
mkdir_p(File.dirname(dest_init))
FileUtils.ln_s("/lib/init/upstart-job", dest_init)
end
attributes.fetch(:deb_systemd_list, []).each do |systemd|
name = File.basename(systemd, ".service")
dest_systemd = staging_path("lib/systemd/system/#{name}.service")
name = File.basename(systemd)
extname = File.extname(systemd)
name_with_extension = extname.empty? ? "#{name}.service" : name
dest_systemd = staging_path(File.join(attributes[:deb_systemd_path], "#{name_with_extension}"))
mkdir_p(File.dirname(dest_systemd))
FileUtils.cp(systemd, dest_systemd)
File.chmod(0644, dest_systemd)
@ -520,41 +680,132 @@ class FPM::Package::Deb < FPM::Package
case self.attributes[:deb_compression]
when "gz", nil
datatar = build_path("data.tar.gz")
compression = "-z"
controltar = build_path("control.tar.gz")
compression_flags = ["-z"]
# gnu tar obeys GZIP environment variable with options for gzip; -n = forget original filename and date
compressor_options = {"GZIP" => "-#{self.attributes[:deb_compression_level] || 9}" +
"#{'n' if tar_cmd_supports_sort_names_and_set_mtime? and not attributes[:source_date_epoch].nil?}"}
when "bzip2"
datatar = build_path("data.tar.bz2")
compression = "-j"
controltar = build_path("control.tar.gz")
compression_flags = ["-j"]
compressor_options = {"BZIP" => "-#{self.attributes[:deb_compression_level] || 9}"}
when "xz"
datatar = build_path("data.tar.xz")
compression = "-J"
controltar = build_path("control.tar.xz")
compression_flags = ["-J"]
compressor_options = {"XZ_OPT" => "-#{self.attributes[:deb_compression_level] || 3}"}
when "zst"
datatar = build_path("data.tar.zst")
controltar = build_path("control.tar.zst")
compression_flags = ["--use-compress-program", "zstd"]
compressor_options = {"ZSTD_CLEVEL" => "-#{self.attributes[:deb_compression_level] || 3}"}
when "none"
datatar = build_path("data.tar")
controltar = build_path("control.tar")
compression_flags = []
compressor_options = {}
else
raise FPM::InvalidPackageConfiguration,
"Unknown compression type '#{self.attributes[:deb_compression]}'"
end
args = [ tar_cmd, "-C", staging_path, compression ] + data_tar_flags + [ "-cf", datatar, "." ]
args = [ tar_cmd, "-C", staging_path ] + compression_flags + data_tar_flags + [ "-cf", datatar, "." ]
if tar_cmd_supports_sort_names_and_set_mtime? and not attributes[:source_date_epoch].nil?
# Use gnu tar options to force deterministic file order and timestamp
args += ["--sort=name", ("--mtime=@%s" % attributes[:source_date_epoch])]
end
args.unshift(compressor_options)
safesystem(*args)
# pack up the .deb, which is just an 'ar' archive with 3 files
# the 'debian-binary' file has to be first
File.expand_path(output_path).tap do |output_path|
::Dir.chdir(build_path) do
safesystem("ar", "-qc", output_path, "debian-binary", "control.tar.gz", datatar)
safesystem(*ar_cmd, output_path, "debian-binary", controltar, datatar)
end
end
# if a PACKAGENAME.changes file is to be created
if self.attributes[:deb_generate_changes?]
distribution = self.attributes[:deb_dist]
# gather information about the files to distribute
files = [ output_path ]
changes_files = []
files.each do |path|
changes_files.push({
:name => path,
:size => File.size?(path),
:md5sum => Digest::MD5.file(path).hexdigest,
:sha1sum => Digest::SHA1.file(path).hexdigest,
:sha256sum => Digest::SHA2.file(path).hexdigest,
})
end
# write change infos to .changes file
changes_path = File.basename(output_path, '.deb') + '.changes'
changes_data = template("deb/deb.changes.erb").result(binding)
File.write(changes_path, changes_data)
logger.log("Created changes", :path => changes_path)
end # if deb_generate_changes
end # def output
def converted_from(origin)
self.dependencies = self.dependencies.collect do |dep|
fix_dependency(dep)
end.flatten
# If an invalid depends field was found i.e. /bin.sh then fix_depends will blank it
# Make sure we remove this blank here
self.dependencies = self.dependencies.reject { |p| p.empty? }
self.provides = self.provides.collect do |provides|
fix_provides(provides)
end.flatten
# If an invalid provides field was found i.e. mypackage(arch) then fix_provides will blank it
# Make sure we remove this blank here
self.provides = self.provides.reject { |p| p.empty? }
if origin == FPM::Package::CPAN
# The fpm cpan code presents dependencies and provides fields as perl(ModuleName)
# so we'll need to convert them to something debian supports.
# Replace perl(ModuleName) > 1.0 with Debian-style perl-ModuleName (> 1.0)
perldepfix = lambda do |dep|
m = dep.match(/perl\((?<name>[A-Za-z0-9_:]+)\)\s*(?<op>.*$)/)
if m.nil?
# 'dep' syntax didn't look like 'perl(Name) > 1.0'
dep
else
# Also replace '::' in the perl module name with '-'
modulename = m["name"].gsub("::", "-")
# Fix any upper-casing or other naming concerns Debian has about packages
name = "#{attributes[:cpan_package_name_prefix]}-#{modulename}"
if m["op"].empty?
name
else
# 'dep' syntax was like this (version constraint): perl(Module) > 1.0
"#{name} (#{m["op"]})"
end
end
end
rejects = [ "perl(vars)", "perl(warnings)", "perl(strict)", "perl(Config)" ]
self.dependencies = self.dependencies.reject do |dep|
# Reject non-module Perl dependencies like 'vars' and 'warnings'
rejects.include?(dep)
end.collect(&perldepfix).collect(&method(:fix_dependency))
# Also fix the Provides field 'perl(ModuleName) = version' to be 'perl-modulename (= version)'
self.provides = self.provides.collect(&perldepfix).collect(&method(:fix_provides))
end # if origin == FPM::Packagin::CPAN
if origin == FPM::Package::Deb
changelog_path = staging_path("usr/share/doc/#{name}/changelog.Debian.gz")
if File.exists?(changelog_path)
if File.exist?(changelog_path)
logger.debug("Found a deb changelog file, using it.", :path => changelog_path)
attributes[:deb_changelog] = build_path("deb_changelog")
File.open(attributes[:deb_changelog], "w") do |deb_changelog|
@ -568,7 +819,7 @@ class FPM::Package::Deb < FPM::Package
if origin == FPM::Package::Deb
changelog_path = staging_path("usr/share/doc/#{name}/changelog.gz")
if File.exists?(changelog_path)
if File.exist?(changelog_path)
logger.debug("Found an upstream changelog file, using it.", :path => changelog_path)
attributes[:deb_upstream_changelog] = build_path("deb_upstream_changelog")
File.open(attributes[:deb_upstream_changelog], "w") do |deb_upstream_changelog|
@ -579,6 +830,19 @@ class FPM::Package::Deb < FPM::Package
File.unlink(changelog_path)
end
end
if origin == FPM::Package::Gem
# fpm's gem input will have provides as "rubygem-name = version"
# and we need to convert this to Debian-style "rubygem-name (= version)"
self.provides = self.provides.collect do |provides|
m = /^(#{attributes[:gem_package_name_prefix]})-([^\s]+)\s*=\s*(.*)$/.match(provides)
if m
"#{m[1]}-#{m[2]} (= #{m[3]})"
else
provides
end
end
end
end # def converted_from
def debianize_op(op)
@ -601,6 +865,18 @@ class FPM::Package::Deb < FPM::Package
end
end
if dep.start_with?("/")
logger.warn("Blanking 'dependency' field '#{dep}' because it's invalid")
dep = ""
return dep
end
if dep.include?("rpmlib")
logger.warn("Blanking 'dependency' field '#{dep}' because it's invalid")
dep = ""
return dep
end
name_re = /^[^ \(]+/
name = dep[name_re]
if name =~ /[A-Z]/
@ -620,8 +896,13 @@ class FPM::Package::Deb < FPM::Package
name, version = dep.gsub(/[()~>]/, "").split(/ +/)[0..1]
nextversion = version.split(".").collect { |v| v.to_i }
l = nextversion.length
nextversion[l-2] += 1
nextversion[l-1] = 0
if l > 1
nextversion[l-2] += 1
nextversion[l-1] = 0
else
# Single component versions ~> 1
nextversion[l-1] += 1
end
nextversion = nextversion.join(".")
return ["#{name} (>= #{version})", "#{name} (<< #{nextversion})"]
elsif (m = dep.match(/(\S+)\s+\(!= (.+)\)/))
@ -648,6 +929,32 @@ class FPM::Package::Deb < FPM::Package
end
end # def fix_dependency
def valid_provides_field?(text)
m = RELATIONSHIP_FIELD_PATTERN.match(text)
if m.nil?
logger.error("Invalid relationship field for debian package: #{text}")
return false
end
# Per Debian Policy manual, https://www.debian.org/doc/debian-policy/ch-relationships.html#syntax-of-relationship-fields
# >> The relations allowed are <<, <=, =, >= and >> for strictly earlier, earlier or equal,
# >> exactly equal, later or equal and strictly later, respectively. The exception is the
# >> Provides field, for which only = is allowed
if m["relation"] == "=" || m["relation"] == nil
return true
end
return false
end
def valid_relationship_field?(text)
m = RELATIONSHIP_FIELD_PATTERN.match(text)
if m.nil?
logger.error("Invalid relationship field for debian package: #{text}")
return false
end
return true
end
def fix_provides(provides)
name_re = /^[^ \(]+/
name = provides[name_re]
@ -662,6 +969,16 @@ class FPM::Package::Deb < FPM::Package
"debs don't like underscores")
provides = provides.gsub("_", "-")
end
if provides.include?("(") and !provides.include?("(=")
logger.warn("Blanking 'provides' field '#{provides}' because it's invalid")
provides = ""
end
if m = provides.match(/^([A-Za-z0-9_-]+)\s*=\s*(\d+.*$)/)
logger.warn("Replacing 'provides' entry #{provides} with syntax 'name (= version)'")
provides = "#{m[1]} (= #{m[2]})"
end
return provides.rstrip
end
@ -687,12 +1004,42 @@ class FPM::Package::Deb < FPM::Package
write_triggers # write trigger config to 'triggers' file
write_md5sums # write the md5sums file
# Tar up the staging_path into control.tar.{compression type}
case self.attributes[:deb_compression]
when "gz", "bzip2", nil
controltar = "control.tar.gz"
compression_flags = ["-z"]
# gnu tar obeys GZIP environment variable with options for gzip; -n = forget original filename and date
compressor_options = {"GZIP" => "-#{self.attributes[:deb_compression_level] || 9}" +
"#{'n' if tar_cmd_supports_sort_names_and_set_mtime? and not attributes[:source_date_epoch].nil?}"}
when "xz"
controltar = "control.tar.xz"
compression_flags = ["-J"]
compressor_options = {"XZ_OPT" => "-#{self.attributes[:deb_compression_level] || 3}"}
when "zst"
controltar = "control.tar.zst"
compression_flags = ["--use-compress-program", "zstd"]
compressor_options = {"ZSTD_CLEVEL" => "-#{self.attributes[:deb_compression_level] || 3}"}
when "none"
controltar = "control.tar"
compression_flags = []
compressor_options = {}
else
raise FPM::InvalidPackageConfiguration,
"Unknown compression type '#{self.attributes[:deb_compression]}'"
end
# Make the control.tar.gz
build_path("control.tar.gz").tap do |controltar|
build_path(controltar).tap do |controltar|
logger.info("Creating", :path => controltar, :from => control_path)
args = [ tar_cmd, "-C", control_path, "-zcf", controltar,
args = [ tar_cmd, "-C", control_path ] + compression_flags + [ "-cf", controltar,
"--owner=0", "--group=0", "--numeric-owner", "." ]
if tar_cmd_supports_sort_names_and_set_mtime? and not attributes[:source_date_epoch].nil?
# Force deterministic file order and timestamp
args += ["--sort=name", ("--mtime=@%s" % attributes[:source_date_epoch])]
end
args.unshift(compressor_options)
safesystem(*args)
end
@ -774,7 +1121,7 @@ class FPM::Package::Deb < FPM::Package
etcfiles = []
# Add everything in /etc
begin
if !attributes[:deb_no_default_config_files?]
if !attributes[:deb_no_default_config_files?] && File.exist?(staging_path("/etc"))
logger.warn("Debian packaging tools generally labels all files in /etc as config files, " \
"as mandated by policy, so fpm defaults to this behavior for deb packages. " \
"You can disable this default behavior with --deb-no-default-config-files flag")
@ -789,11 +1136,26 @@ class FPM::Package::Deb < FPM::Package
# scan all conf file paths for files and add them
config_files.each do |path|
logger.debug("Checking if #{path} exists")
cfe = File.exist?("#{path}")
logger.debug("Check result #{cfe}")
begin
add_path(path, allconfigs)
rescue Errno::ENOENT
raise FPM::InvalidPackageConfiguration,
"Error trying to use '#{path}' as a config file in the package. Does it exist?"
if !cfe
raise FPM::InvalidPackageConfiguration,
"Error trying to use '#{path}' as a config file in the package. Does it exist?"
else
dcl = File.join(staging_path, path)
if !File.exist?("#{dcl}")
logger.debug("Adding config file #{path} to Staging area #{staging_path}")
FileUtils.mkdir_p(File.dirname(dcl))
FileUtils.cp_r path, dcl
add_path(path, allconfigs)
else
logger.debug("Config file aready exists in staging area.")
end
end
end
end
@ -849,7 +1211,7 @@ class FPM::Package::Deb < FPM::Package
if attributes[:deb_templates]
FileUtils.cp(attributes[:deb_templates], control_path("templates"))
File.chmod(0755, control_path("templates"))
File.chmod(0644, control_path("templates"))
end
end # def write_debconf
@ -865,7 +1227,10 @@ class FPM::Package::Deb < FPM::Package
def write_triggers
lines = [['interest', :deb_interest],
['activate', :deb_activate]].map { |label, attr|
['activate', :deb_activate],
['interest-noawait', :deb_interest_noawait],
['activate-noawait', :deb_activate_noawait],
].map { |label, attr|
(attributes[attr] || []).map { |e| "#{label} #{e}\n" }
}.flatten.join('')
@ -931,5 +1296,5 @@ class FPM::Package::Deb < FPM::Package
return data_tar_flags
end # def data_tar_flags
public(:input, :output, :architecture, :name, :prefix, :converted_from, :to_s, :data_tar_flags)
public(:input, :output, :architecture, :name, :prefix, :version, :converted_from, :to_s, :data_tar_flags)
end # class FPM::Target::Deb

View File

@ -1,6 +1,6 @@
require "fpm/package"
require "fpm/util"
require "backports"
require "backports/latest"
require "fileutils"
require "find"
require "socket"
@ -43,7 +43,7 @@ class FPM::Package::Dir < FPM::Package
# This mapping should work the same way 'rsync -a' does
# Meaning 'rsync -a source dest'
# and 'source=dest' in fpm work the same as the above rsync
if path =~ /.=./ && !File.exists?(chdir == '.' ? path : File.join(chdir, path))
if path =~ /.=./ && !File.exist?(chdir == '.' ? path : File.join(chdir, path))
origin, destination = path.split("=", 2)
if File.directory?(origin) && origin[-1,1] == "/"
@ -83,8 +83,8 @@ class FPM::Package::Dir < FPM::Package
# can include license data from themselves (rpms, gems, etc),
# but to make sure a simple dir -> rpm works without having
# to specify a license.
self.license = "unknown"
self.vendor = [ENV["USER"], Socket.gethostname].join("@")
self.license ||= "unknown"
self.vendor ||= [ENV["USER"], Socket.gethostname].join("@")
ensure
# Clean up any logger context we added.
logger.remove("method")
@ -101,18 +101,7 @@ class FPM::Package::Dir < FPM::Package
end
# Write the scripts, too.
scripts_path = File.join(output_path, ".scripts")
::Dir.mkdir(scripts_path)
[:before_install, :after_install, :before_remove, :after_remove].each do |name|
next unless script?(name)
out = File.join(scripts_path, name.to_s)
logger.debug("Writing script", :source => name, :target => out)
File.write(out, script(name))
require "pry"
binding.pry
File.chmod(0755, out)
end
write_scripts
ensure
logger.remove("method")
end # def output
@ -147,14 +136,20 @@ class FPM::Package::Dir < FPM::Package
# For single file copies, permit file destinations
fileinfo = File.lstat(source)
if fileinfo.file? && !File.directory?(destination)
destination_is_directory = File.directory?(destination)
if fileinfo.file? && !destination_is_directory
if destination[-1,1] == "/"
copy(source, File.join(destination, source))
else
copy(source, destination)
end
elsif fileinfo.symlink?
copy(source, File.join(destination, source))
# Treat them same as files
if destination[-1,1] == "/"
copy(source, File.join(destination, source))
else
copy(source, destination)
end
else
# Copy all files from 'path' into staging_path
Find.find(source) do |path|
@ -202,10 +197,6 @@ class FPM::Package::Dir < FPM::Package
else
# Otherwise try copying the file.
begin
logger.debug("Linking", :source => source, :destination => destination)
File.link(source, destination)
rescue Errno::ENOENT, Errno::EXDEV, Errno::EPERM
# Hardlink attempt failed, copy it instead
logger.debug("Copying", :source => source, :destination => destination)
copy_entry(source, destination)
rescue Errno::EEXIST

View File

@ -1,9 +1,21 @@
require "fpm/package"
require "backports"
require "backports/latest"
# Empty Package type. For strict/meta/virtual package creation
class FPM::Package::Empty < FPM::Package
def initialize(*args)
super(*args)
# Override FPM::Package's default "native" architecture value
# This feels like the right default because an empty package has no
# architecture-specific files, and in most cases an empty package should be
# installable anywhere.
#
# https://github.com/jordansissel/fpm/issues/1846
@architecture = "all"
end
def output(output_path)
logger.warn("Your package has gone into the void.")
end

View File

@ -1,4 +1,4 @@
require "backports" # gem backports
require "backports/latest" # gem backports/latest
require "fpm/package"
require "fpm/util"
require "digest"
@ -12,27 +12,15 @@ class FPM::Package::FreeBSD < FPM::Package
:after_remove => "post-deinstall",
} unless defined?(SCRIPT_MAP)
def self.default_abi
abi_name = %x{uname -s}.chomp
abi_version = %x{uname -r}.chomp.split(".")[0]
abi_arch = %x{uname -m}.chomp
[abi_name, abi_version, abi_arch].join(":")
end
option "--abi", "ABI",
"Sets the FreeBSD abi pkg field to specify binary compatibility.",
:default => default_abi
option "--origin", "ABI",
"Sets the FreeBSD 'origin' pkg field",
:default => "fpm/<name>"
option "--osversion", "VERSION",
"Sets the FreeBSD 'version' pkg field, ie 12 or 13, use '*' for all.",
:default => "13"
def output(output_path)
# See https://github.com/jordansissel/fpm/issues/1090
# require xz later, because this triggers a load of liblzma.so.5 that is
# unavailable on older CentOS/RH distros.
require "xz"
output_check(output_path)
# Build the packaging metadata files.
@ -58,7 +46,7 @@ class FPM::Package::FreeBSD < FPM::Package
pkg_version = (iteration and (iteration.to_i > 0)) ? "#{version}-#{iteration}" : "#{version}"
pkgdata = {
"abi" => attributes[:freebsd_abi],
"arch" => architecture,
"name" => name,
"version" => pkg_version,
"comment" => description,
@ -92,24 +80,52 @@ class FPM::Package::FreeBSD < FPM::Package
file.write(pkgdata.to_json + "\n")
end
# Create the .txz package archive from the files in staging_path.
File.open(output_path, "wb") do |file|
XZ::StreamWriter.new(file) do |xz|
FPM::Util::TarWriter.new(xz) do |tar|
# The manifests must come first for pkg.
add_path(tar, "+COMPACT_MANIFEST",
File.join(staging_path, "+COMPACT_MANIFEST"))
add_path(tar, "+MANIFEST",
File.join(staging_path, "+MANIFEST"))
checksums.keys.each do |path|
add_path(tar, "/" + path, File.join(staging_path, path))
end
end
end
file_list = File.new(build_path("file_list"), "w")
files.each do |i|
file_list.puts(i)
end
file_list.close
# Create the .txz package archive from the files in staging_path.
# We use --files-from here to keep the tar entries from having `./` as the prefix.
# This is done as a best effor to mimic what FreeBSD packages do, having everything at the top-level as
# file names, like "+MANIFEST" instead of "./+MANIFEST"
safesystem("tar", "-Jcf", output_path, "-C", staging_path, "--files-from", build_path("file_list"), "--transform", 's|^\([^+]\)|/\1|')
end # def output
# Handle architecture naming conversion:
# <osname>:<osversion>:<arch>
def architecture
osname = 'FreeBSD'
arch = case @architecture
when nil, 'native'
%x{getconf LONG_BIT}.chomp # 'native' is current arch
when 'arm64'
'arm64'
when 'aarch64'
'arm64'
when 'amd64'
'amd64'
when 'x86_64'
'amd64'
when 'i386'
'i386'
when 'i686'
'i386'
when 'any'
'*'
when 'all'
'*'
when 'noarch'
'*'
else
%x{getconf LONG_BIT}.chomp # default to native, the current arch
end
return [osname, attributes[:freebsd_osversion], arch].join(':')
end
def add_path(tar, tar_path, path)
stat = File.lstat(path)
if stat.directory?

View File

@ -30,6 +30,9 @@ class FPM::Package::Gem < FPM::Package
option "--gem", "PATH_TO_GEM",
"The path to the 'gem' tool (defaults to 'gem' and searches " \
"your $PATH)", :default => "gem"
option "--shebang", "SHEBANG",
"Replace the shebang in the executables in the bin path with a " \
"custom string", :default => nil
option "--fix-name", :flag, "Should the target package name be prefixed?",
:default => true
option "--fix-dependencies", :flag, "Should the package dependencies be " \
@ -41,9 +44,36 @@ class FPM::Package::Gem < FPM::Package
option "--disable-dependency", "gem_name",
"The gem name to remove from dependency list",
:multivalued => true, :attribute_name => :gem_disable_dependencies
option "--embed-dependencies", :flag, "Should the gem dependencies " \
"be installed?", :default => false
option "--version-bins", :flag, "Append the version to the bins", :default => false
option "--stagingdir", "STAGINGDIR",
"The directory where fpm installs the gem temporarily before conversion. " \
"Normally a random subdirectory of workdir."
option "--git-repo", "GIT_REPO",
"Use this git repo address as the source of the gem instead of " \
"rubygems.org.", :default => nil
option "--git-branch", "GIT_BRANCH",
"When using a git repo as the source of the gem instead of " \
"rubygems.org, use this git branch.",
:default => nil
# Override parent method
def staging_path(path=nil)
@gem_staging_path ||= attributes[:gem_stagingdir] || Stud::Temporary.directory("package-#{type}-staging")
@staging_path = @gem_staging_path
if path.nil?
return @staging_path
else
return File.join(@staging_path, path)
end
end # def staging_path
def input(gem)
# 'arg' is the name of the rubygem we should unpack.
path_to_gem = download_if_necessary(gem, version)
@ -70,20 +100,32 @@ class FPM::Package::Gem < FPM::Package
logger.info("Trying to download", :gem => gem_name, :version => gem_version)
gem_fetch = [ "#{attributes[:gem_gem]}", "fetch", gem_name]
gem_fetch += ["--prerelease"] if attributes[:gem_prerelease?]
gem_fetch += ["--version", gem_version] if gem_version
download_dir = build_path(gem_name)
FileUtils.mkdir(download_dir) unless File.directory?(download_dir)
::Dir.chdir(download_dir) do |dir|
logger.debug("Downloading in directory #{dir}")
safesystem(*gem_fetch)
end
if attributes[:gem_git_repo]
logger.debug("Git cloning in directory #{download_dir}")
safesystem("git", "-C", download_dir, "clone", attributes[:gem_git_repo], ".")
if attributes[:gem_git_branch]
safesystem("git", "-C", download_dir, "checkout", attributes[:gem_git_branch])
end
gem_files = ::Dir.glob(File.join(download_dir, "*.gem"))
gem_build = [ "#{attributes[:gem_gem]}", "build", "#{download_dir}/#{gem_name}.gemspec"]
::Dir.chdir(download_dir) do |dir|
logger.debug("Building in directory #{dir}")
safesystem(*gem_build)
end
gem_files = ::Dir.glob(File.join(download_dir, "*.gem"))
else
gem_fetch = [ "#{attributes[:gem_gem]}", "fetch", gem_name]
gem_fetch += ["--prerelease"] if attributes[:gem_prerelease?]
gem_fetch += ["--version", gem_version] if gem_version
::Dir.chdir(download_dir) do |dir|
logger.debug("Downloading in directory #{dir}")
safesystem(*gem_fetch)
end
gem_files = ::Dir.glob(File.join(download_dir, "*.gem"))
end
if gem_files.length != 1
raise "Unexpected number of gem files in #{download_dir}, #{gem_files.length} should be 1"
@ -92,9 +134,19 @@ class FPM::Package::Gem < FPM::Package
return gem_files.first
end # def download
GEMSPEC_YAML_CLASSES = [ ::Gem::Specification, ::Gem::Version, Time, ::Gem::Dependency, ::Gem::Requirement, Symbol ]
def load_package_info(gem_path)
spec = YAML.load(%x{#{attributes[:gem_gem]} specification #{gem_path} --yaml})
# TODO(sissel): Maybe we should check if `safe_load` method exists instead of this version check?
if ::Gem::Version.new(RUBY_VERSION) >= ::Gem::Version.new("3.1.0")
# Ruby 3.1.0 switched to a Psych/YAML version that defaults to "safe" loading
# and unfortunately `gem specification --yaml` emits YAML that requires
# class loaders to process correctly
spec = YAML.load(%x{#{attributes[:gem_gem]} specification #{gem_path} --yaml},
:permitted_classes => GEMSPEC_YAML_CLASSES)
else
# Older versions of ruby call this method YAML.safe_load
spec = YAML.safe_load(%x{#{attributes[:gem_gem]} specification #{gem_path} --yaml}, GEMSPEC_YAML_CLASSES)
end
if !attributes[:gem_package_prefix].nil?
attributes[:gem_package_name_prefix] = attributes[:gem_package_prefix]
@ -141,7 +193,7 @@ class FPM::Package::Gem < FPM::Package
# composing multiple packages, it's best to explicitly include it in the provides list.
self.provides << "#{self.name} = #{self.version}"
if !attributes[:no_auto_depends?]
if !attributes[:no_auto_depends?] && !attributes[:gem_embed_dependencies?]
spec.runtime_dependencies.map do |dep|
# rubygems 1.3.5 doesn't have 'Gem::Dependency#requirement'
if dep.respond_to?(:requirement)
@ -177,8 +229,18 @@ class FPM::Package::Gem < FPM::Package
::FileUtils.mkdir_p(installdir)
# TODO(sissel): Allow setting gem tool path
args = [attributes[:gem_gem], "install", "--quiet", "--no-ri", "--no-rdoc",
"--no-user-install", "--install-dir", installdir, "--ignore-dependencies"]
args = [attributes[:gem_gem], "install", "--quiet", "--no-user-install", "--install-dir", installdir]
if ::Gem::VERSION =~ /^[012]\./
args += [ "--no-ri", "--no-rdoc" ]
else
# Rubygems 3.0.0 changed --no-ri to --no-document
args += [ "--no-document" ]
end
if !attributes[:gem_embed_dependencies?]
args += ["--ignore-dependencies"]
end
if attributes[:gem_env_shebang?]
args += ["-E"]
end
@ -196,6 +258,22 @@ class FPM::Package::Gem < FPM::Package
args << gem_path
safesystem(*args)
# Replace the shebangs in the executables
if attributes[:gem_shebang]
::Dir.entries(bin_path).each do |file_name|
# exclude . and ..
next if ['.', '..'].include?(file_name)
# exclude everything which is not a file
file_path = File.join(bin_path, file_name)
next unless File.ftype(file_path) == 'file'
# replace shebang in files if there is one
file = File.read(file_path)
if file.gsub!(/\A#!.*$/, "#!#{attributes[:gem_shebang]}")
File.open(file_path, 'w'){|f| f << file}
end
end
end
# Delete bin_path if it's empty, and any empty parents (#612)
# Above, we mkdir_p bin_path because rubygems aborts if the parent
# directory doesn't exist, for example:
@ -212,6 +290,21 @@ class FPM::Package::Gem < FPM::Package
FileUtils.mv("#{bin_path}/#{bin}", "#{bin_path}/#{bin}-#{self.version}")
end
end
if attributes[:source_date_epoch_from_changelog?]
detect_source_date_from_changelog(installdir)
end
# Remove generated Makefile and gem_make.out files, if any; they
# are not needed, and may contain generated paths that cause
# different output on successive runs.
Find.find(installdir) do |path|
if path =~ /.*(gem_make.out|Makefile|mkmf.log)$/
logger.info("Removing no longer needed file %s to reduce nondeterminism" % path)
File.unlink(path)
end
end
end # def install_to_staging
# Sanitize package name.
@ -220,5 +313,75 @@ class FPM::Package::Gem < FPM::Package
def fix_name(name)
return [attributes[:gem_package_name_prefix], name].join("-")
end # def fix_name
# Regular expression to accept a gem changelog line, and store date & version, if any, in named capture groups.
# Supports formats suggested by http://keepachangelog.com and https://github.com/tech-angels/vandamme
# as well as other similar formats that actually occur in the wild.
# Build it in pieces for readability, and allow version and date in either order.
# Whenever you change this, add a row to the test case in spec/fpm/package/gem_spec.rb.
# Don't even try to handle dates that lack four-digit years.
# Building blocks:
P_RE_LEADIN = '^[#=]{0,3}\s?'
P_RE_VERSION_ = '[\w\.-]+\.[\w\.-]+[a-zA-Z0-9]'
P_RE_SEPARATOR = '\s[-=/(]?\s?'
P_RE_DATE1 = '\d{4}-\d{2}-\d{2}'
P_RE_DATE2 = '\w+ \d{1,2}(?:st|nd|rd|th)?,\s\d{4}'
P_RE_DATE3 = '\w+\s+\w+\s+\d{1,2},\s\d{4}'
P_RE_DATE = "(?<date>#{P_RE_DATE1}|#{P_RE_DATE2}|#{P_RE_DATE3})"
P_RE_URL = '\(https?:[-\w/.%]*\)' # In parens, per markdown
P_RE_GTMAGIC = '\[\]' # github magic version diff, per chandler
P_RE_VERSION = "\\[?(?:Version |v)?(?<version>#{P_RE_VERSION_})\\]?(?:#{P_RE_URL}|#{P_RE_GTMAGIC})?"
# The final RE's:
P_RE_VERSION_DATE = "#{P_RE_LEADIN}#{P_RE_VERSION}#{P_RE_SEPARATOR}#{P_RE_DATE}"
P_RE_DATE_VERSION = "#{P_RE_LEADIN}#{P_RE_DATE}#{P_RE_SEPARATOR}#{P_RE_VERSION}"
# Detect release date, if found, store in attributes[:source_date_epoch]
def detect_source_date_from_changelog(installdir)
name = self.name.sub("rubygem-", "") + "-" + self.version
changelog = nil
datestr = nil
r1 = Regexp.new(P_RE_VERSION_DATE)
r2 = Regexp.new(P_RE_DATE_VERSION)
# Changelog doesn't have a standard name, so check all common variations
# Sort this list using LANG=C, i.e. caps first
[
"CHANGELIST",
"CHANGELOG", "CHANGELOG.asciidoc", "CHANGELOG.md", "CHANGELOG.rdoc", "CHANGELOG.rst", "CHANGELOG.txt",
"CHANGES", "CHANGES.md", "CHANGES.txt",
"ChangeLog", "ChangeLog.md", "ChangeLog.txt",
"Changelog", "Changelog.md", "Changelog.txt",
"changelog", "changelog.md", "changelog.txt",
].each do |changelogname|
path = File.join(installdir, "gems", name, changelogname)
if File.exist?(path)
changelog = path
File.open path do |file|
file.each_line do |line|
if line =~ /#{self.version}/
[r1, r2].each do |r|
if r.match(line)
datestr = $~[:date]
break
end
end
end
end
end
end
end
if datestr
date = Date.parse(datestr)
sec = date.strftime("%s")
attributes[:source_date_epoch] = sec
logger.debug("Gem %s has changelog date %s, setting source_date_epoch to %s" % [name, datestr, sec])
elsif changelog
logger.debug("Gem %s changelog %s did not have recognizable date for release %s" % [name, changelog, self.version])
else
logger.debug("Gem %s did not have changelog with recognized name" % [name])
# FIXME: check rubygems.org?
end
end # detect_source_date_from_changelog
public(:input, :output)
end # class FPM::Package::Gem

View File

@ -4,7 +4,6 @@ require "fileutils"
require "fpm/package/dir"
require 'tempfile' # stdlib
require 'pathname' # stdlib
require 'rexml/document' # stdlib
# Use an OS X pkg built with pkgbuild.
#
@ -103,6 +102,7 @@ class FPM::Package::OSXpkg < FPM::Package
# Extract name and version from PackageInfo XML
def extract_info(package)
require 'rexml/document'
build_path("expand").tap do |path|
doc = REXML::Document.new File.open(File.join(path, "PackageInfo"))
pkginfo_elem = doc.elements["pkg-info"]
@ -148,6 +148,11 @@ class FPM::Package::OSXpkg < FPM::Package
write_scripts
args += ["--scripts", scripts_path]
end
if attributes[:prefix]
args += ["--install-location", attributes[:prefix]]
end
args << output_path
safesystem("pkgbuild", *args)

View File

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
require "fpm/package"
require "fpm/util"
require "backports"
require "backports/latest"
require "fileutils"
require "find"
@ -18,10 +18,10 @@ class FPM::Package::Pacman < FPM::Package
option "--group", "GROUP", "The group owner of files in this package", :default => 'root'
# The list of supported compression types. Default is xz (LZMA2)
COMPRESSION_TYPES = [ "gz", "bzip2", "xz", "none" ]
COMPRESSION_TYPES = [ "gz", "bzip2", "xz", "zstd", "none" ]
option "--compression", "COMPRESSION", "The compression type to use, must " \
"be one of #{COMPRESSION_TYPES.join(", ")}.", :default => "xz" do |value|
"be one of #{COMPRESSION_TYPES.join(", ")}.", :default => "zstd" do |value|
if !COMPRESSION_TYPES.include?(value)
raise ArgumentError, "Pacman compression value of '#{value}' is invalid. " \
"Must be one of #{COMPRESSION_TYPES.join(", ")}"
@ -37,11 +37,15 @@ class FPM::Package::Pacman < FPM::Package
def architecture
case @architecture
when nil
return %x{uname -m}.chomp # default to current arch
when "amd64" # debian and pacman disagree on architecture names
return "x86_64"
return %x{uname -m}.chomp # default to current arch
when "amd64" # Debian uses amd64
return "x86_64" # Arch Linux uses x86_64
when "arm64" # Debian uses arm64
return "aarch64" # Arch Linux ARM uses aarch64
when "armhf" # Debian uses armhf
return "arm7hf" # Arch Linux ARM uses arm7hf
when "native"
return %x{uname -m}.chomp # 'native' is current arch
return %x{uname -m}.chomp # 'native' is the current arch
when "all", "any", "noarch"
return "any"
else
@ -58,7 +62,7 @@ class FPM::Package::Pacman < FPM::Package
end # def config_files
def dependencies
bogus_regex = /[^\sA-Za-z0-9><=-]/
bogus_regex = /[^\sA-Za-z0-9><=+._@-]/
# Actually modifies depencies if they are not right
bogus_dependencies = @dependencies.grep bogus_regex
if bogus_dependencies.any?
@ -209,31 +213,39 @@ class FPM::Package::Pacman < FPM::Package
def compression_option
case self.attributes[:pacman_compression]
when nil, "xz"
return "--xz"
when nil, "zstd"
return "--zstd"
when "none"
return ""
when "gz"
return "-z"
when "xz"
return "--xz"
when "bzip2"
return "-j"
when "zstd"
return "--zstd"
else
return "--xz"
return "--zstd"
end
end
def compression_ending
case self.attributes[:pacman_compression]
when nil, "xz"
return ".xz"
when nil, "zstd"
return ".zst"
when "none"
return ""
when "gz"
return ".gz"
when "xz"
return ".xz"
when "bzip2"
return ".bz2"
when "zstd"
return ".zst"
else
return ".xz"
return ".zst"
end
end
@ -245,7 +257,11 @@ class FPM::Package::Pacman < FPM::Package
Find.find(staging_path) do |path|
src = path.gsub(/^#{staging_path}/, '')
dst = build_path(src)
copy_entry(path, dst, preserve=true, remove_destination=true)
begin
copy_entry(path, dst, preserve=true, remove_destination=true)
rescue
copy_entry(path, dst, preserve=false, remove_destination=true)
end
copy_metadata(path, dst)
end

Some files were not shown because too many files have changed in this diff Show More