Compare commits
320 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
e69cdca562 | |
|
|
5b9d922c84 | |
|
|
93eaefd383 | |
|
|
4cf32c5bc7 | |
|
|
6115fe4c44 | |
|
|
781108fbf6 | |
|
|
9c78876415 | |
|
|
a066c4447d | |
|
|
e42a069c4f | |
|
|
829b897456 | |
|
|
08e663916d | |
|
|
e15d2c3a1f | |
|
|
249d3b997f | |
|
|
bdbe351796 | |
|
|
45f78973e7 | |
|
|
db535710f7 | |
|
|
6bf2885139 | |
|
|
644e538311 | |
|
|
9c415246f2 | |
|
|
e8cd0920d7 | |
|
|
22d44e1c49 | |
|
|
ef63628054 | |
|
|
e0c3a1fc1a | |
|
|
e1113c24e0 | |
|
|
290fe0741c | |
|
|
b69b7e5787 | |
|
|
feecdfe87b | |
|
|
de7a214bf5 | |
|
|
c6069f5584 | |
|
|
583f7e4ba0 | |
|
|
aa55aaca93 | |
|
|
23e7e0f554 | |
|
|
dd58d6714e | |
|
|
c76917a4e1 | |
|
|
17bc375e0b | |
|
|
42808ab943 | |
|
|
8e54e5ca49 | |
|
|
8b24206e19 | |
|
|
f0e5b8abc0 | |
|
|
b328c15ff6 | |
|
|
010093698a | |
|
|
002b42e98e | |
|
|
bc75218f37 | |
|
|
fcee26e979 | |
|
|
9a77831902 | |
|
|
873bff3820 | |
|
|
1c3cfe741e | |
|
|
6025469d52 | |
|
|
fdfc384e71 | |
|
|
82ddba7a8c | |
|
|
7cc4aa7509 | |
|
|
207bd73577 | |
|
|
7ef007ef5f | |
|
|
3f044a426f | |
|
|
4beb98f193 | |
|
|
2c301c733d | |
|
|
b10350b913 | |
|
|
93ac15729b | |
|
|
08dc21b8f1 | |
|
|
f817f7a5da | |
|
|
f714f4b4f1 | |
|
|
28fea4c930 | |
|
|
b2f2fc6624 | |
|
|
e7e7449815 | |
|
|
862a6863cd | |
|
|
858d1c1419 | |
|
|
98cc060ede | |
|
|
512f4a9eb3 | |
|
|
8acb2f51d7 | |
|
|
468f455862 | |
|
|
e6b83c4788 | |
|
|
13a3c6992e | |
|
|
572cf390a7 | |
|
|
d30e641bb8 | |
|
|
ad4402f3bf | |
|
|
c326b39d95 | |
|
|
e66a359a10 | |
|
|
c028e71206 | |
|
|
0fb0d26152 | |
|
|
b852c59b02 | |
|
|
790f53c766 | |
|
|
d81a1ad1ac | |
|
|
fd06d93533 | |
|
|
e94f56c01e | |
|
|
843c729b16 | |
|
|
18e04a70e1 | |
|
|
e7903804af | |
|
|
6957220642 | |
|
|
bf0aa55655 | |
|
|
5092c5f659 | |
|
|
5960c8c4a7 | |
|
|
eb56972540 | |
|
|
20aa78c72c | |
|
|
ae8205261a | |
|
|
0cba81fbe4 | |
|
|
9d3d96a93d | |
|
|
86be3cc802 | |
|
|
13228bf566 | |
|
|
d0884e8903 | |
|
|
3b2b258020 | |
|
|
847ded9eba | |
|
|
c9d749a3a7 | |
|
|
49093c3533 | |
|
|
e0edc7e559 | |
|
|
b085edc49c | |
|
|
ad6b18a0aa | |
|
|
066b9b561a | |
|
|
18233c334d | |
|
|
d0c139aea4 | |
|
|
31506109ff | |
|
|
f898ef8232 | |
|
|
c9a5cb4628 | |
|
|
ada6012b5b | |
|
|
db06af3c03 | |
|
|
dcbe0425db | |
|
|
df26ed08f7 | |
|
|
906cf8054a | |
|
|
fdd5e559ac | |
|
|
10c8471179 | |
|
|
42f2660a58 | |
|
|
d8bc03a63c | |
|
|
15aaf1cfce | |
|
|
601cfda057 | |
|
|
88c1e6ab0a | |
|
|
72ccedc45d | |
|
|
5b104bccf0 | |
|
|
3ba61bc0bd | |
|
|
8a6460d0d3 | |
|
|
b0ca926d49 | |
|
|
3653f1a10c | |
|
|
63d4ac8dfc | |
|
|
ad2b1a8966 | |
|
|
d9ba0b4545 | |
|
|
56a97c43be | |
|
|
cd7a6855d3 | |
|
|
c6b85be6a2 | |
|
|
ce8fd6cb64 | |
|
|
16c7e280a7 | |
|
|
7d6b5cd58c | |
|
|
ec82bc649b | |
|
|
110419b695 | |
|
|
11175cc47f | |
|
|
c8d364b0ab | |
|
|
3fcaefb9fd | |
|
|
d16b531a2f | |
|
|
6c87589f32 | |
|
|
72b2f26ad3 | |
|
|
bfb192c417 | |
|
|
f168571abf | |
|
|
409a3b27df | |
|
|
788387c0d2 | |
|
|
37f56269c3 | |
|
|
c40f6818f8 | |
|
|
9b32d9a116 | |
|
|
40795d4d85 | |
|
|
7881705985 | |
|
|
5d2b4854d3 | |
|
|
7f4718f9c2 | |
|
|
82284c7a4b | |
|
|
60b4bd30b3 | |
|
|
377fcaf871 | |
|
|
2943d82581 | |
|
|
f5d07520b7 | |
|
|
0dfe21bab7 | |
|
|
b2ba5c4a59 | |
|
|
521d030420 | |
|
|
106828fc12 | |
|
|
0c84173de0 | |
|
|
9b9a1b365f | |
|
|
eb5370d16e | |
|
|
92886d922d | |
|
|
9aa1c1cb64 | |
|
|
7a1302d1e8 | |
|
|
53f669219c | |
|
|
20e754adfb | |
|
|
d819e59a80 | |
|
|
021fc45047 | |
|
|
121989e0a0 | |
|
|
bba3114075 | |
|
|
329b4758a6 | |
|
|
5b8e9fc334 | |
|
|
23c5790ec4 | |
|
|
d5985a5571 | |
|
|
f722c4b3f5 | |
|
|
8437e50fe0 | |
|
|
d43a017736 | |
|
|
c1930fc465 | |
|
|
7b57e92ec4 | |
|
|
9e3f75b628 | |
|
|
309e6b3c18 | |
|
|
052656b480 | |
|
|
809c726944 | |
|
|
d69e648ce0 | |
|
|
62f1418e4a | |
|
|
e1ef157dc3 | |
|
|
db9db670c3 | |
|
|
58ddeda91b | |
|
|
11646b943f | |
|
|
13621c9722 | |
|
|
c6baaf9427 | |
|
|
9efd56c54a | |
|
|
3540cfeb4b | |
|
|
cb24061992 | |
|
|
d6a77bff2a | |
|
|
e8fb21d725 | |
|
|
aecf23801d | |
|
|
c83461caf7 | |
|
|
3e7ba8656b | |
|
|
285c13554f | |
|
|
5bd26ad011 | |
|
|
c4c0b32cfc | |
|
|
97dfed35ae | |
|
|
60de482c2c | |
|
|
48200286c1 | |
|
|
5995c7ac34 | |
|
|
4f51caf8fc | |
|
|
1a980dd3e7 | |
|
|
16f1b4357f | |
|
|
c7e7b18731 | |
|
|
63fdb94347 | |
|
|
0a8bccc511 | |
|
|
2ccf61c01f | |
|
|
720e140d78 | |
|
|
cdf110d730 | |
|
|
2834bb5816 | |
|
|
9fd97d747c | |
|
|
37525ca4b0 | |
|
|
3bb5e99f2a | |
|
|
99c5fcb485 | |
|
|
55f9613c0d | |
|
|
864e41c880 | |
|
|
01b67d747f | |
|
|
541550a74d | |
|
|
60bf90ae3c | |
|
|
dbd8bafb5d | |
|
|
e96dc2729a | |
|
|
4eed9d671b | |
|
|
bf9bcc8e2a | |
|
|
82580bb8e7 | |
|
|
13dde8304e | |
|
|
057a60387f | |
|
|
067f4ccfd0 | |
|
|
2b6e70b6fa | |
|
|
ab4eb18b5f | |
|
|
3965a0fd31 | |
|
|
18c5adcd19 | |
|
|
e3b3f9d8e3 | |
|
|
3e42ff462c | |
|
|
72a925b048 | |
|
|
2a6facbcce | |
|
|
cc0a4e7369 | |
|
|
d69ed14bd8 | |
|
|
d005508e18 | |
|
|
106d7b21e3 | |
|
|
d50f756d0e | |
|
|
c795ed7ef4 | |
|
|
feb53faa14 | |
|
|
292073fc35 | |
|
|
073e4e7b74 | |
|
|
cd7e428d9f | |
|
|
73804ded35 | |
|
|
50ca2bfd05 | |
|
|
3db202a52f | |
|
|
9a16e43e4e | |
|
|
6735f9df69 | |
|
|
b2dd4dadb6 | |
|
|
922d4c5d4f | |
|
|
ca3477b67b | |
|
|
66a4dea525 | |
|
|
6b4b61a3f8 | |
|
|
90d131b075 | |
|
|
204fb1b1ff | |
|
|
c9487a30c0 | |
|
|
7d7b184d63 | |
|
|
e05790fa92 | |
|
|
945ba5b4b0 | |
|
|
b1e956e071 | |
|
|
8a40cd1db7 | |
|
|
cc7610f434 | |
|
|
304619416b | |
|
|
d9ddb21de4 | |
|
|
83b4ad9d65 | |
|
|
d7b466787d | |
|
|
e066e632ed | |
|
|
823b3947fc | |
|
|
a7626cb99b | |
|
|
1c1ff7dc19 | |
|
|
6628f175ff | |
|
|
69cb62ddce | |
|
|
fbbb80fd53 | |
|
|
3895fccec9 | |
|
|
b269c81ebe | |
|
|
62fcf8c230 | |
|
|
e8be82ebdc | |
|
|
82ad8c6c2f | |
|
|
b2c21dd285 | |
|
|
4ff6fd7b91 | |
|
|
b8fc631327 | |
|
|
51067be1a5 | |
|
|
57fb023ee2 | |
|
|
7a4372eaa0 | |
|
|
29c9c13156 | |
|
|
93e73c7ad5 | |
|
|
591c0694d1 | |
|
|
625ad4bb1b | |
|
|
5e4e30ce0e | |
|
|
8d8428db04 | |
|
|
c1c82a45c4 | |
|
|
40dc09925a | |
|
|
294f6180cf | |
|
|
1f2f950581 | |
|
|
900d7560f4 | |
|
|
8f6f285271 | |
|
|
ca02692bcb | |
|
|
0d67ab9e3e | |
|
|
446b49c7c4 | |
|
|
bf54a505ed | |
|
|
2b70a025f4 | |
|
|
880e5512da | |
|
|
fa0d15d581 |
|
|
@ -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
|
||||
|
|
@ -42,3 +42,6 @@ Gemfile.lock
|
|||
|
||||
docs/_build
|
||||
docs/.work
|
||||
|
||||
.docker-test-everything
|
||||
.docker-test-minimal
|
||||
|
|
|
|||
|
|
@ -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
|
||||
42
.travis.yml
42
.travis.yml
|
|
@ -1,42 +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
|
||||
- 2.3.1
|
||||
- 2.2.5
|
||||
- 2.3.3
|
||||
- 2.4.0
|
||||
matrix:
|
||||
exclude:
|
||||
- os: osx
|
||||
rvm: 1.9.3
|
||||
- os: osx
|
||||
rvm: 2.0.0
|
||||
before_install:
|
||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update && brew bundle; 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 virtualenv || pip install --user virtualenv ; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then which virtualenv-tools || pip install --user virtualenv virtualenv-tools ; fi
|
||||
- virtualenv ${HOME}/.venv
|
||||
script: source ${HOME}/.venv/bin/activate && PATH=${PATH}:${HOME}/.local/bin bundle exec rspec
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- bsdtar
|
||||
- rpm
|
||||
- lintian
|
||||
- python-setuptools
|
||||
- python-pip
|
||||
139
CHANGELOG.rst
139
CHANGELOG.rst
|
|
@ -1,6 +1,134 @@
|
|||
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)
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
|
|
@ -13,7 +141,7 @@ Release Notes and Change Log
|
|||
* 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.
|
||||
|
|
@ -25,6 +153,7 @@ Release Notes and Change Log
|
|||
* 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
|
||||
|
|
@ -40,7 +169,7 @@ Release Notes and Change Log
|
|||
* 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ó.
|
||||
|
|
@ -69,9 +198,9 @@ Release Notes and Change Log
|
|||
* 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:: http://fpm.readthedocs.io/en/latest/source/dir.html#path-mapping
|
||||
.. _Deterministic output:: http://fpm.readthedocs.io/en/latest/source/gem.html
|
||||
.. _reproducible_builds: https://reproducible-builds.org/
|
||||
.. _path mapping: source/dir.html#path-mapping
|
||||
.. _Deterministic output: source/gem.html
|
||||
|
||||
1.9.0 (July 28, 2017)
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ Project maintainers who do not follow or enforce the Code of Conduct in good fai
|
|||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
|
||||
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]: http://contributor-covenant.org
|
||||
[version]: http://contributor-covenant.org/version/1/4/
|
||||
[homepage]: https://contributor-covenant.org
|
||||
[version]: https://contributor-covenant.org/version/1/4/
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ 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
|
||||
|
|
|
|||
121
Dockerfile
121
Dockerfile
|
|
@ -1,16 +1,107 @@
|
|||
#
|
||||
# To build this Docker image: docker build -t fpm .
|
||||
#
|
||||
# To run this Docker container interactively: docker run -it fpm
|
||||
#
|
||||
FROM alpine:3.7
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
RUN apk add --no-cache \
|
||||
ruby \
|
||||
ruby-dev \
|
||||
gcc \
|
||||
libffi-dev \
|
||||
make \
|
||||
libc-dev \
|
||||
rpm \
|
||||
&& gem install --no-ri --no-rdoc fpm
|
||||
# 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}
|
||||
|
|
|
|||
2
LICENSE
2
LICENSE
|
|
@ -1,6 +1,6 @@
|
|||
(This is an MIT-style license)
|
||||
|
||||
Copyright (c) 2011-2017 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
|
||||
|
|
|
|||
19
Makefile
19
Makefile
|
|
@ -52,3 +52,22 @@ clean:
|
|||
|
||||
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 .
|
||||
|
||||
|
|
|
|||
53
NOTES.md
53
NOTES.md
|
|
@ -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.
|
||||
12
README.rst
12
README.rst
|
|
@ -1,7 +1,7 @@
|
|||
fpm
|
||||
===
|
||||
|
||||
|Build| |Chat| |Gem|
|
||||
|Gem|
|
||||
|
||||
The goal of fpm is to make it easy and quick to build packages such as rpms,
|
||||
debs, OSX packages, etc.
|
||||
|
|
@ -23,7 +23,7 @@ You can find out how to use fpm in the `documentation`_.
|
|||
|
||||
You can learn how to install fpm on your platform in the `installation guide`_.
|
||||
|
||||
.. _installation guide: http://fpm.readthedocs.io/en/latest/installing.html
|
||||
.. _installation guide: https://fpm.readthedocs.io/en/latest/installation.html
|
||||
|
||||
Project Principles
|
||||
------------------
|
||||
|
|
@ -41,10 +41,10 @@ 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
|
||||
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, a job switches have me flipping between Ubuntu and CentOS. These use
|
||||
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.
|
||||
|
|
@ -97,9 +97,5 @@ Targets:
|
|||
|
||||
.. include: docs/contributing
|
||||
|
||||
.. |Build| image:: https://img.shields.io/travis/jordansissel/fpm.svg
|
||||
:target: https://travis-ci.org/jordansissel/fpm
|
||||
.. |Chat| image:: https://img.shields.io/badge/irc-%23fpm%20on%20freenode-brightgreen.svg
|
||||
:target: https://webchat.freenode.net/?channels=fpm
|
||||
.. |Gem| image:: https://img.shields.io/gem/v/fpm.svg
|
||||
:target: https://rubygems.org/gems/fpm
|
||||
|
|
|
|||
|
|
@ -1,9 +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 python-pip
|
||||
RUN pip install Sphinx==1.4
|
||||
RUN pip install sphinx_rtd_theme
|
||||
RUN pip install alabaster
|
||||
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"]
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@ 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)
|
||||
|
||||
|
|
@ -15,11 +17,31 @@ changelog_links.rst: ../CHANGELOG.rst Makefile
|
|||
| 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: changelog_links.rst | docker-prep
|
||||
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'
|
||||
|
|
|
|||
|
|
@ -215,3 +215,7 @@ 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)
|
||||
|
||||
|
|
|
|||
|
|
@ -37,10 +37,12 @@
|
|||
.. _#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
|
||||
|
|
@ -67,38 +69,187 @@
|
|||
.. _#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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
12
docs/conf.py
12
docs/conf.py
|
|
@ -28,7 +28,9 @@ import os
|
|||
# Add any Sphinx extension module names here, as strings. They can be
|
||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||
# ones.
|
||||
extensions = []
|
||||
extensions = [
|
||||
'sphinx_rtd_theme'
|
||||
]
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ['_templates']
|
||||
|
|
@ -46,7 +48,7 @@ master_doc = 'index'
|
|||
|
||||
# General information about the project.
|
||||
project = u'fpm - packaging made simple'
|
||||
copyright = u'2016, Jordan Sissel'
|
||||
copyright = u'2025, Jordan Sissel and contributors'
|
||||
author = u'Jordan Sissel'
|
||||
|
||||
# The version info for the project you're documenting, acts as replacement for
|
||||
|
|
@ -54,16 +56,16 @@ author = u'Jordan Sissel'
|
|||
# built documents.
|
||||
#
|
||||
# The short X.Y version.
|
||||
version = u'1.9'
|
||||
version = u'1.17'
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = u'1.9.0'
|
||||
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 = None
|
||||
language = "en"
|
||||
|
||||
# There are two options for replacing |today|: either, you set today to some
|
||||
# non-false value, then it is used:
|
||||
|
|
|
|||
|
|
@ -1,33 +1,21 @@
|
|||
Want to contribute? Or need help?
|
||||
================================
|
||||
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.
|
||||
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 :)
|
||||
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.
|
||||
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`_.
|
||||
* 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
|
||||
|
|
@ -35,12 +23,12 @@ That said, some points to get started:
|
|||
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).
|
||||
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:
|
||||
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
|
||||
|
||||
|
|
@ -51,13 +39,13 @@ 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:
|
||||
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.
|
||||
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:
|
||||
when it lists the FPM gem:
|
||||
|
||||
...
|
||||
Using json (1.8.1)
|
||||
|
|
@ -68,18 +56,23 @@ when it lists the fpm gem:
|
|||
If your system doesn't have `bsdtar` by default, make sure to install it or some
|
||||
tests will fail:
|
||||
|
||||
apt-get install bsdtar
|
||||
apt-get install bsdtar || apt install libarchive-tools
|
||||
|
||||
yum install bsdtar
|
||||
|
||||
Next, run make in root of the fpm repo. If there are any problems (such as
|
||||
|
||||
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
|
||||
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
|
||||
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.
|
||||
|
||||
|
|
@ -93,4 +86,21 @@ you have the standalone command line tools separate from Xcode:
|
|||
|
||||
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.
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
@ -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
|
||||
|
|
@ -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>`
|
||||
|
|
@ -2,23 +2,44 @@ fpm - packaging made simple
|
|||
===========================
|
||||
|
||||
.. note::
|
||||
The documentation here is a work-in-progress. If you want to contribute new
|
||||
docs or report problems, I invite you to do so on `the project issue tracker`_.
|
||||
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`_.
|
||||
|
||||
.. _the project issue tracker: https://github.com/jordansissel/fpm/issues
|
||||
Welcome to the fpm documentation!
|
||||
|
||||
.. include:: ../README.rst
|
||||
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::
|
||||
:maxdepth: 2
|
||||
:includehidden:
|
||||
:includehidden:
|
||||
|
||||
intro
|
||||
installing
|
||||
use-cases
|
||||
packages
|
||||
contributing
|
||||
changelog
|
||||
installation
|
||||
getting-started
|
||||
packaging-types
|
||||
cli-reference
|
||||
docker
|
||||
contributing
|
||||
changelog
|
||||
|
||||
.. _here: /changelog.html
|
||||
|
||||
.. _the project issue tracker: https://github.com/jordansissel/fpm/issues
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -1,91 +0,0 @@
|
|||
Installation
|
||||
============
|
||||
|
||||
FPM requires a few things before you can use it. This document will show you
|
||||
how to install all the necessary things :)
|
||||
|
||||
Depending on what you want to do with FPM, you might need some extra things installed (like tooling to build rpms, or solaris packages, or something else), but for now, let's just get ruby so we can start using fpm!
|
||||
|
||||
Installing things FPM needs
|
||||
--------------
|
||||
|
||||
.. warning::
|
||||
This section may be imperfect due to the inconsistencies across OS vendors
|
||||
|
||||
fpm is written in Ruby, you'll need to provide Ruby. Some operating systems,
|
||||
like OSX, come with Ruby already, but some do not. Depending on your operating system, you might need to run the following commands:
|
||||
|
||||
On OSX/macOS::
|
||||
|
||||
brew install gnu-tar
|
||||
|
||||
On Red Hat systems (Fedora 22 or older, CentOS, etc)::
|
||||
|
||||
yum install ruby-devel gcc make rpm-build rubygems
|
||||
|
||||
On Fedora 23 or newer::
|
||||
|
||||
dnf install ruby-devel gcc make rpm-build libffi-devel
|
||||
|
||||
On Debian-derived systems (Debian, Ubuntu, etc)::
|
||||
|
||||
apt-get install ruby ruby-dev rubygems build-essential
|
||||
|
||||
Installing FPM
|
||||
--------------
|
||||
|
||||
You can install fpm with the `gem` tool::
|
||||
|
||||
gem install --no-ri --no-rdoc fpm
|
||||
|
||||
.. note::
|
||||
`gem` is a command provided by a the Ruby packaging system called `rubygems`_. This allows you to install, and later upgrade, fpm.
|
||||
|
||||
.. _rubygems: https://en.wikipedia.org/wiki/RubyGems
|
||||
|
||||
You should see output that looks like this::
|
||||
|
||||
% gem install --no-ri --no-rdoc fpm
|
||||
Fetching: cabin-0.9.0.gem (100%)
|
||||
Successfully installed cabin-0.9.0
|
||||
Fetching: backports-3.6.8.gem (100%)
|
||||
Successfully installed backports-3.6.8
|
||||
Fetching: arr-pm-0.0.10.gem (100%)
|
||||
Successfully installed arr-pm-0.0.10
|
||||
Fetching: clamp-1.0.1.gem (100%)
|
||||
Successfully installed clamp-1.0.1
|
||||
Fetching: ffi-1.9.14.gem (100%)
|
||||
Building native extensions. This could take a while...
|
||||
Successfully installed ffi-1.9.14
|
||||
Fetching: childprocess-0.5.9.gem (100%)
|
||||
Successfully installed childprocess-0.5.9
|
||||
Fetching: archive-tar-minitar-0.5.2.gem (100%)
|
||||
Successfully installed archive-tar-minitar-0.5.2
|
||||
Fetching: io-like-0.3.0.gem (100%)
|
||||
Successfully installed io-like-0.3.0
|
||||
Fetching: ruby-xz-0.2.3.gem (100%)
|
||||
Successfully installed ruby-xz-0.2.3
|
||||
Fetching: dotenv-2.1.1.gem (100%)
|
||||
Successfully installed dotenv-2.1.1
|
||||
Fetching: insist-1.0.0.gem (100%)
|
||||
Successfully installed insist-1.0.0
|
||||
Fetching: mustache-0.99.8.gem (100%)
|
||||
Successfully installed mustache-0.99.8
|
||||
Fetching: stud-0.0.22.gem (100%)
|
||||
Successfully installed stud-0.0.22
|
||||
Fetching: pleaserun-0.0.27.gem (100%)
|
||||
Successfully installed pleaserun-0.0.27
|
||||
Fetching: fpm-1.6.3.gem (100%)
|
||||
Successfully installed fpm-1.6.3
|
||||
15 gems installed
|
||||
|
||||
Now you should be ready to use 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.6.3
|
||||
|
|
@ -1,61 +0,0 @@
|
|||
What is FPM?
|
||||
===================
|
||||
|
||||
fpm is a command-line program designed to help you build packages.
|
||||
|
||||
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), see
|
||||
the `full list`_.
|
||||
|
||||
.. _full list: https://fpm.readthedocs.io/en/latest/packages.html
|
||||
|
||||
"Target type" is what your output package form should be. Most common are "rpm"
|
||||
and "deb" but others exist (solaris, etc)
|
||||
|
||||
You have a few options for learning to run FPM:
|
||||
|
||||
1. If you're impatient, just scan through `fpm --help`; you'll need various
|
||||
options, and we try to make them well-documented. Quick learning is
|
||||
totally welcome, and if you run into issues, you are welcome to ask
|
||||
questions in #fpm on freenode irc or on fpm-users@googlegroups.com!
|
||||
2. `The documentation`_ 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!
|
||||
|
||||
.. _The documentation: http://fpm.readthedocs.io/en/latest/intro.html
|
||||
|
||||
To give you an idea of what fpm can do, here's a few use cases:
|
||||
|
||||
Take a directory and turn it into an RPM::
|
||||
fpm -s dir -t rpm ...
|
||||
|
||||
Convert a .deb into an rpm::
|
||||
fpm -s deb -t rpm ...
|
||||
|
||||
Convert a rubygem into a deb package::
|
||||
fpm -s gem -t deb ...
|
||||
|
||||
Convert a .tar.gz into an OSX .pkg file::
|
||||
fpm -s tar -t osxpkg
|
||||
|
||||
Convert a .zip into an rpm::
|
||||
fpm -s zip -t rpm ...
|
||||
|
||||
Change properties of an existing rpm::
|
||||
fpm -s rpm -t rpm
|
||||
|
||||
Create an deb that automatically installs a service::
|
||||
fpm -s pleaserun -t deb
|
||||
|
||||
Below is a 10-minute video demonstrating fpm's simplicity of use:
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<iframe width="560" height="315" src="https://www.youtube.com/embed/Jf89-2gWwiI" frameborder="0" allowfullscreen></iframe>
|
||||
|
||||
|
||||
Now that you've seen a bit of what fpm can do, it's time to :doc:`install fpm <installing>`.
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
Packages
|
||||
======
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
sources
|
||||
targets
|
||||
|
||||
|
|
@ -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
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
This package type has no additional options
|
||||
|
||||
|
|
@ -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?
|
||||
|
||||
|
|
@ -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
|
||||
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
This package type has no additional options
|
||||
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
This package type has no additional options
|
||||
|
||||
|
|
@ -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.
|
||||
|
||||
|
|
@ -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
|
||||
|
||||
|
|
@ -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.
|
||||
|
||||
|
|
@ -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'.
|
||||
|
||||
|
|
@ -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)
|
||||
|
||||
|
|
@ -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
|
||||
|
||||
|
|
@ -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)
|
||||
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
This package type has no additional options
|
||||
|
||||
|
|
@ -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.
|
||||
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
This package type has no additional options
|
||||
|
||||
|
|
@ -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
|
||||
|
||||
|
|
@ -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
|
||||
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
This package type has no additional options
|
||||
|
||||
|
|
@ -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.
|
||||
|
||||
|
|
@ -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.
|
||||
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
This package type has no additional options
|
||||
|
||||
|
|
@ -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
|
||||
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
This package type has no additional options
|
||||
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
Packaging Types
|
||||
===============
|
||||
|
||||
.. toctree::
|
||||
:includehidden:
|
||||
:glob:
|
||||
|
||||
packages/*
|
||||
|
|
@ -0,0 +1 @@
|
|||
sphinx_rtd_theme
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
`dir` - Directories
|
||||
===================
|
||||
|
||||
Synopsis::
|
||||
|
||||
fpm -s dir [other flags] path1 [path2 ...]
|
||||
|
||||
The 'dir' source will package up one or more directories for you.
|
||||
|
||||
Path mapping
|
||||
------------
|
||||
|
||||
.. note::
|
||||
Path mapping was added in fpm version 0.4.40
|
||||
|
||||
Some times you want to take a path and copy it into a package but under a different location. fpm can use the `=` directive to mark that::
|
||||
|
||||
fpm [...] -s dir ./example/foo=/usr/bin
|
||||
|
||||
This will put the file `foo` in the /usr/bin directory inside the package.
|
||||
|
||||
A simple example of this can be shown with redis. Redis has a config file
|
||||
(redis.conf) and an executable (redis-server). Let's put the executable in
|
||||
/usr/bin and the config file in /etc/redis::
|
||||
|
||||
% ls src/redis-server redis.conf
|
||||
src/redis-server
|
||||
redis.conf
|
||||
|
||||
# install src/redis-server into /usr/bin/
|
||||
# install redis.conf into /etc/redis/
|
||||
% fpm -s dir -t deb -n redis --config-files /etc/redis/redis.conf -v 2.6.10 \
|
||||
src/redis-server=/usr/bin/ \
|
||||
redis.conf=/etc/redis/
|
||||
Created deb package {:path=>"redis_2.6.10_amd64.deb"}
|
||||
|
||||
% dpkg -c redis_2.6.10_amd64.deb
|
||||
drwx------ jls/jls 0 2013-07-11 23:49 ./
|
||||
drwxrwxr-x jls/jls 0 2013-07-11 23:49 ./etc/
|
||||
drwxrwxr-x jls/jls 0 2013-07-11 23:49 ./etc/redis/
|
||||
-rw-rw-r-- jls/jls 24475 2013-02-11 04:24 ./etc/redis/redis.conf
|
||||
drwxrwxr-x jls/jls 0 2013-07-11 23:49 ./usr/
|
||||
drwxrwxr-x jls/jls 0 2013-07-11 23:49 ./usr/bin/
|
||||
-rwxrwxr-x jls/jls 3566152 2013-02-14 11:19 ./usr/bin/redis-server
|
||||
|
||||
# Did the conffiles setting work? Yep!
|
||||
% dpkg-deb -e redis_2.6.10_amd64.deb .
|
||||
% cat conffiles
|
||||
/etc/redis/redis.conf
|
||||
|
||||
Voila!
|
||||
|
||||
|
|
@ -1,236 +0,0 @@
|
|||
`gem` - RubyGems
|
||||
================
|
||||
|
||||
Simplest invocation
|
||||
-------------------
|
||||
|
||||
Here's a command that will fetch the latest `json` gem and convert it to a .deb package::
|
||||
|
||||
% cd /tmp
|
||||
% fpm -s gem -t deb json
|
||||
...
|
||||
Created /tmp/rubygem-json-1.4.6-1.amd64.deb
|
||||
|
||||
This will download the latest 'json' rubygem from rubygems.org and convert it
|
||||
to a .deb. It will create a package named 'rubygem-json-VERSION_ARCH.deb' with
|
||||
appropriate version/arch in place.
|
||||
|
||||
Check the package::
|
||||
|
||||
% dpkg --info rubygem-json-1.4.6-1.amd64.deb
|
||||
new debian package, version 2.0.
|
||||
size 1004040 bytes: control archive= 335 bytes.
|
||||
275 bytes, 10 lines control
|
||||
5 bytes, 1 lines md5sums
|
||||
Package: rubygem-json
|
||||
Version: 1.4.6-1
|
||||
Architecture: amd64
|
||||
Maintainer: Florian Frank
|
||||
Standards-Version: 3.9.1
|
||||
Section: Languages/Development/Ruby
|
||||
Priority: extra
|
||||
Homepage: http://flori.github.com/json
|
||||
Description: JSON Implementation for Ruby
|
||||
JSON Implementation for Ruby
|
||||
|
||||
From the above, you can see that fpm automatically picked the package name,
|
||||
version, maintainer, section, homepage, and description all from the rubygem
|
||||
itself. Nothing for you to worry about :)
|
||||
|
||||
Specifying a version
|
||||
--------------------
|
||||
|
||||
You can ask for a specific version with '-v <VERSION>'. It will also handle
|
||||
dependencies. How about an older gem like rails 2.2.2::
|
||||
|
||||
% fpm -s gem -t deb -v 2.2.2 rails
|
||||
Trying to download rails (version=2.2.2)
|
||||
...
|
||||
Created .../rubygem-rails-2.2.2-1.amd64.deb
|
||||
|
||||
Now observe the package created:
|
||||
|
||||
% dpkg --info ./rubygem-rails-2.2.2-1.amd64.deb
|
||||
new debian package, version 2.0.
|
||||
size 2452008 bytes: control archive= 445 bytes.
|
||||
575 bytes, 11 lines control
|
||||
6 bytes, 1 lines md5sums
|
||||
Package: rubygem-rails
|
||||
Version: 2.2.2-1
|
||||
Architecture: amd64
|
||||
Maintainer: David Heinemeier Hansson
|
||||
Depends: rubygem-rake (>= 0.8.3), rubygem-activesupport (= 2.2.2),
|
||||
rubygem-activerecord (= 2.2.2), rubygem-actionpack (= 2.2.2),
|
||||
rubygem-actionmailer (= 2.2.2), rubygem-activeresource (= 2.2.2)
|
||||
Standards-Version: 3.9.1
|
||||
Section: Languages/Development/Ruby
|
||||
Priority: extra
|
||||
Homepage: http://www.rubyonrails.org
|
||||
Description: Web-application framework with template engine, control-flow layer, and ORM.
|
||||
Web-application framework with template engine, control-flow layer, and ORM.
|
||||
|
||||
Noticei how the `Depends` entry for this debian package lists all the dependencies that `rails` has?
|
||||
|
||||
Let's see what the package installs::
|
||||
|
||||
% dpkg -c ./rubygem-rails-2.2.2-1.amd64.deb
|
||||
...
|
||||
drwxr-xr-x root/root 0 2011-01-20 17:00 ./usr/lib/ruby/gems/1.8/gems/rails-2.2.2/
|
||||
drwxr-xr-x root/root 0 2011-01-20 17:00 ./usr/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/
|
||||
-rw-r--r-- root/root 3639 2011-01-20 17:00 ./usr/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/source_annotation_extractor.rb
|
||||
-rw-r--r-- root/root 198 2011-01-20 17:00 ./usr/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/performance_test_help.rb
|
||||
drwxr-xr-x root/root 0 2011-01-20 17:00 ./usr/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/tasks/
|
||||
-rw-r--r-- root/root 204 2011-01-20 17:00 ./usr/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/tasks/log.rake
|
||||
-rw-r--r-- root/root 2695 2011-01-20 17:00 ./usr/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/tasks/gems.rake
|
||||
-rw-r--r-- root/root 4858 2011-01-20 17:00 ./usr/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/tasks/testing.rake
|
||||
-rw-r--r-- root/root 17727 2011-01-20 17:00 ./usr/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/tasks/databases.rake
|
||||
|
||||
Packaging individual dependencies
|
||||
---------------------------------
|
||||
|
||||
A frequently-asked question is how to get a rubygem and all its dependencies
|
||||
converted. Let's take a look.
|
||||
|
||||
First we'll have to download the gem and its deps. The easiest way to do this
|
||||
is to stage the installation in a temporary directory, like this::
|
||||
|
||||
% mkdir /tmp/gems
|
||||
% gem install --no-ri --no-rdoc --install-dir /tmp/gems cucumber
|
||||
<output trimmed>
|
||||
|
||||
Successfully installed json-1.4.6
|
||||
Successfully installed gherkin-2.3.3
|
||||
Successfully installed term-ansicolor-1.0.5
|
||||
Successfully installed builder-3.0.0
|
||||
Successfully installed diff-lcs-1.1.2
|
||||
Successfully installed cucumber-0.10.0
|
||||
6 gems installed
|
||||
|
||||
Now you've got everything cucumber requires to run (just as a normal 'gem
|
||||
install' would.)
|
||||
|
||||
`gem` saves gems to the cache directory in the gem install dir, so check it out::
|
||||
|
||||
% ls /tmp/gems/cache
|
||||
builder-3.0.0.gem diff-lcs-1.1.2.gem json-1.4.6.gem
|
||||
cucumber-0.10.0.gem gherkin-2.3.3.gem term-ansicolor-1.0.5.gem
|
||||
|
||||
(by the way, under normal installation situations, gem would keep the cache in
|
||||
a location like /usr/lib/ruby/gems/1.8/cache, see 'gem env | grep INSTALL')
|
||||
|
||||
Let's convert all these gems to debs (output trimmed for sanity)::
|
||||
|
||||
% find /tmp/gems/cache -name '*.gem' | xargs -rn1 fpm -d ruby -d rubygems --prefix $(gem environment gemdir) -s gem -t deb
|
||||
...
|
||||
Created /tmp/gems/rubygem-json-1.4.6-1.amd64.deb
|
||||
...
|
||||
Created /tmp/gems/rubygem-builder-3.0.0-1.amd64.deb
|
||||
...
|
||||
Created /tmp/gems/rubygem-gherkin-2.3.3-1.amd64.deb
|
||||
...
|
||||
Created /tmp/gems/rubygem-diff-lcs-1.1.2-1.amd64.deb
|
||||
...
|
||||
Created /tmp/gems/rubygem-term-ansicolor-1.0.5-1.amd64.deb
|
||||
...
|
||||
Created /tmp/gems/rubygem-cucumber-0.10.0-1.amd64.deb
|
||||
|
||||
% ls *.deb
|
||||
rubygem-builder-3.0.0-1.amd64.deb rubygem-gherkin-2.3.3-1.amd64.deb
|
||||
rubygem-cucumber-0.10.0-1.amd64.deb rubygem-json-1.4.6-1.amd64.deb
|
||||
rubygem-diff-lcs-1.1.2-1.amd64.deb rubygem-term-ansicolor-1.0.5-1.amd64.deb
|
||||
|
||||
Nice, eh? Now, let's show what happens after these packages are installed::
|
||||
|
||||
# Show it's not install yet:
|
||||
% gem list cucumber
|
||||
|
||||
*** LOCAL GEMS ***
|
||||
|
||||
|
||||
# Now install the .deb packages:
|
||||
% sudo dpkg -i rubygem-builder-3.0.0-1.amd64.deb \
|
||||
rubygem-cucumber-0.10.0-1.amd64.deb rubygem-diff-lcs-1.1.2-1.amd64.deb \
|
||||
rubygem-gherkin-2.3.3-1.amd64.deb rubygem-json-1.4.6-1.amd64.deb \
|
||||
rubygem-term-ansicolor-1.0.5-1.amd64.deb
|
||||
...
|
||||
Setting up rubygem-builder (3.0.0-1) ...
|
||||
Setting up rubygem-diff-lcs (1.1.2-1) ...
|
||||
Setting up rubygem-json (1.4.6-1) ...
|
||||
Setting up rubygem-term-ansicolor (1.0.5-1) ...
|
||||
Setting up rubygem-gherkin (2.3.3-1) ...
|
||||
Setting up rubygem-cucumber (0.10.0-1) ...
|
||||
|
||||
# Is it installed?
|
||||
% gem list cucumber
|
||||
|
||||
*** LOCAL GEMS ***
|
||||
|
||||
cucumber (0.10.0)
|
||||
|
||||
# Does it work?
|
||||
% dpkg -L rubygem-cucumber | grep bin
|
||||
/usr/lib/ruby/gems/1.8/gems/cucumber-0.10.0/bin
|
||||
/usr/lib/ruby/gems/1.8/gems/cucumber-0.10.0/bin/cucumber
|
||||
/usr/lib/ruby/gems/1.8/bin
|
||||
/usr/lib/ruby/gems/1.8/bin/cucumber
|
||||
|
||||
% /usr/lib/ruby/gems/1.8/bin/cucumber --help
|
||||
Usage: cucumber [options] [ [FILE|DIR|URL][:LINE[:LINE]*] ]+
|
||||
...
|
||||
|
||||
|
||||
You can put these .deb files in your apt repo (assuming you have a local apt
|
||||
repo, right?) and easily install them with 'apt-get' like: 'apt-get install
|
||||
rubygem-cucumber' and expect dependencies to work nicely.
|
||||
|
||||
Deterministic output
|
||||
--------------------
|
||||
|
||||
If convert a gem to a deb twice, you'll get different output even though the inputs didn't change:
|
||||
|
||||
% fpm -s gem -t deb json
|
||||
% mkdir run1; mv *.deb run1
|
||||
% sleep 1
|
||||
% fpm -s gem -t deb json
|
||||
% mkdir run2; mv *.deb run2
|
||||
% cmp run1/*.deb run2/*.deb
|
||||
run1/rubygem-json_2.1.0_amd64.deb run2/rubygem-json_2.1.0_amd64.deb differ: byte 124, line 4
|
||||
|
||||
This can be a pain if you're uploading packages to an apt repository
|
||||
which refuses reuploads that differ in content, or if you're trying
|
||||
to verify that packages have not been infected.
|
||||
There are several sources of nondeterminism; use 'diffoscope run1/*.deb run2/*.deb' if you
|
||||
want the gory details. See http://reproducible-builds.org for the whole story.
|
||||
|
||||
To remove nondeterminism due to differing timestamps,
|
||||
use the option --source-date-epoch-from-changelog; that will use the timestamp from
|
||||
the gem's changelog.
|
||||
|
||||
In case the gem doesn't have a standard changelog (and most don't, alas),
|
||||
use --source-date-epoch-default to set a default integer Unix timestamp.
|
||||
(This will also be read from the environment variable SOURCE_DATE_EPOCH if set.)
|
||||
|
||||
Gems that include native extensions may have nondeterministic output
|
||||
because of how the extensions get built (at least until fpm and
|
||||
compilers finish implementing the reproducible-builds.org
|
||||
recommendations). If this happens, use the option --gem-stagingdir=/tmp/foo.
|
||||
|
||||
For instance, picking the timestamp 1234 seconds after the Unix epoch:
|
||||
|
||||
% fpm -s gem -t deb --source-date-epoch-default=1234 --gem-stagingdir=/tmp/foo json
|
||||
% mkdir run1; mv *.deb run1
|
||||
% sleep 1
|
||||
% fpm -s gem -t deb --source-date-epoch-default=1234 --gem-stagingdir=/tmp/foo json
|
||||
% mkdir run2; mv *.deb run2
|
||||
% cmp run1/*.deb run2/*.deb
|
||||
% dpkg-deb -c run1/*.deb
|
||||
...
|
||||
-rw-rw-r-- 0/0 17572 1969-12-31 16:20 ./var/lib/gems/2.3.0/gems/json-2.1.0/CHANGES.md
|
||||
% date --date @1234
|
||||
Wed Dec 31 16:20:34 PST 1969
|
||||
|
||||
If after using those three options, the files are still different,
|
||||
you may have found a bug; we might not have plugged all the sources
|
||||
of nondeterminism yet. As of this writing, these options are only
|
||||
implemented for reading gems and writing debs, and only verified
|
||||
to produce identical output when run twice on the same Linux system.
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
`cpan` - Perl packages
|
||||
======================
|
||||
|
||||
A basic example:
|
||||
|
||||
`fpm -t deb -s cpan Fennec`
|
||||
|
||||
The above 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:
|
||||
|
||||
1. That your local Perl lib path will be the target Perl lib path
|
||||
2. That you want the package name to be prefixed with the word perl
|
||||
3. That the dependencies from CPAN are valid and that the naming scheme for those dependencies are prefixed with perl
|
||||
|
||||
If you wish to avoid any of those issues you can try:
|
||||
|
||||
`fpm -t deb -s cpan --cpan-perl-lib-path /usr/share/perl5 Fennec`
|
||||
|
||||
This 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
|
||||
|
||||
`fpm -t deb -s cpan --cpan-package-name-prefix fubar Fennec`
|
||||
This will replace the perl default prefix with fubar. The resulting package will be named in the scheme of fubar-fennec-2.10.deb
|
||||
|
||||
`fpm -t -deb -s cpan --no-depends Fennec`
|
||||
This will remove omit dependencies from being added to the package metadata.
|
||||
|
||||
A full list of available options for CPAN are listed here::
|
||||
|
||||
--cpan-perl-bin PERL_EXECUTABLE (cpan only) The path to the perl executable you wish to run. (default: "perl")
|
||||
--cpan-cpanm-bin CPANM_EXECUTABLE (cpan only) The path to the cpanm executable you wish to run. (default: "cpanm")
|
||||
--cpan-mirror CPAN_MIRROR (cpan only) The CPAN mirror to use instead of the default.
|
||||
--[no-]cpan-mirror-only (cpan only) Only use the specified mirror for metadata. (default: false)
|
||||
--cpan-package-name-prefix NAME_PREFIX (cpan only) Name to prefix the package name with. (default: "perl")
|
||||
--[no-]cpan-test (cpan only) Run the tests before packaging? (default: true)
|
||||
--cpan-perl-lib-path PERL_LIB_PATH (cpan only) Path of target Perl Libraries
|
||||
--[no-]cpan-sandbox-non-core (cpan only) Sandbox all non-core modules, even if they're already installed (default: true)
|
||||
--[no-]cpan-cpanm-force (cpan only) Pass the --force parameter to cpanm (default: false)
|
||||
|
|
@ -1,117 +0,0 @@
|
|||
`pleaserun` - Please, run!
|
||||
===================
|
||||
|
||||
Synopsis::
|
||||
|
||||
fpm -s pleaserun [other flags] program [args...]
|
||||
|
||||
The `pleaserun` source uses the pleaserun_ project to help you build a package
|
||||
that installs a service.
|
||||
|
||||
.. _pleaserun: http://github.com/jordansissel/pleaserun
|
||||
|
||||
`pleaserun` supports the following service managers:
|
||||
|
||||
* sysv, /etc/init.d/whatever
|
||||
* upstart
|
||||
* systemd
|
||||
* runit
|
||||
* launchd (OS X)
|
||||
|
||||
Automatic Platform Detection
|
||||
----------------------------
|
||||
|
||||
Targeting multiple platforms with a single package is hard. What init system is used? Can you predict?
|
||||
|
||||
fpm+pleaserun can detect this at installation-time!
|
||||
|
||||
One Package for All Platforms
|
||||
-----------------------------
|
||||
|
||||
The following is an example which creates an rpm that makes `redis` service
|
||||
available::
|
||||
|
||||
fpm -s pleaserun -t rpm -n redis-service /usr/bin/redis-server
|
||||
|
||||
The output looks like this::
|
||||
|
||||
Created package {:path=>"redis-service-1.0-1.x86_64.rpm"}
|
||||
|
||||
.. note::
|
||||
Your package will detect the service platform (systemd, upstart, etc) automatically upon installation :)
|
||||
|
||||
Let's see what happens when I install this on Fedora 25 (which uses systemd)::
|
||||
|
||||
% sudo rpm -i redis-service-1.0-1.x86_64.rpm
|
||||
Platform systemd (default) detected. Installing service.
|
||||
To start this service, use: systemctl start redis-server
|
||||
|
||||
And checking on our service::
|
||||
|
||||
% systemctl status redis-server
|
||||
● redis-server.service - redis-server
|
||||
Loaded: loaded (/etc/systemd/system/redis-server.service; disabled; vendor pr
|
||||
Active: inactive (dead)
|
||||
|
||||
(It is inactive and disabled because fpm does not start it by default)
|
||||
|
||||
As you can see in the above example, `fpm` added an after-install script which
|
||||
detects the service manager during installation. In this case, `systemd` was
|
||||
detected.
|
||||
|
||||
The above example shows installing on Fedora 25, which uses systemd. You can use this same rpm package on CentOS 6, which uses upstart, and it will still work::
|
||||
|
||||
% sudo rpm -i redis-service-1.0-1.x86_64.rpm
|
||||
Platform upstart (0.6.5) detected. Installing service.
|
||||
To start this service, use: initctl start redis-server
|
||||
|
||||
And checking on our service::
|
||||
|
||||
% initctl status redis-server
|
||||
redis-server stop/waiting
|
||||
|
||||
Hurray! We now have a single rpm that installs this `redis-service` service on
|
||||
most systems.
|
||||
|
||||
Questions You May Have
|
||||
----------------------
|
||||
|
||||
How does the package know whether to use systemd, upstart, sysv, or something else?
|
||||
|
||||
fpm creates a package that `does a platform check`_ when the `package is installed`_
|
||||
|
||||
.. _does a platform check: https://github.com/jordansissel/fpm/blob/master/templates/pleaserun/install.sh#L101-L113
|
||||
.. _package is installed: https://github.com/jordansissel/fpm/blob/master/templates/pleaserun/scripts/after-install.sh
|
||||
|
||||
Does this mean I need ruby and pleaserun installed on the target system?
|
||||
|
||||
Fortunately, no! fpm creates a package that consists only of the install scripts and the service files. The install scripts are written in bourne shell `/bin/sh`.
|
||||
|
||||
Here's an example::
|
||||
|
||||
% fpm -s pleaserun -t rpm -n example /usr/bin/example
|
||||
% rpm -qlp example-1.0-1.x86_64.rpm
|
||||
/usr/share/pleaserun/example/generate-cleanup.sh
|
||||
/usr/share/pleaserun/example/install-path.sh
|
||||
/usr/share/pleaserun/example/install.sh
|
||||
/usr/share/pleaserun/example/launchd/10.9/files/Library/LaunchDaemons/example.plist
|
||||
/usr/share/pleaserun/example/launchd/10.9/install_actions.sh
|
||||
/usr/share/pleaserun/example/systemd/default/files/etc/default/example
|
||||
/usr/share/pleaserun/example/systemd/default/files/etc/systemd/system/example.service
|
||||
/usr/share/pleaserun/example/systemd/default/install_actions.sh
|
||||
/usr/share/pleaserun/example/sysv/lsb-3.1/files/etc/default/example
|
||||
/usr/share/pleaserun/example/sysv/lsb-3.1/files/etc/init.d/example
|
||||
/usr/share/pleaserun/example/upstart/0.6.5/files/etc/default/example
|
||||
/usr/share/pleaserun/example/upstart/0.6.5/files/etc/init/example.conf
|
||||
/usr/share/pleaserun/example/upstart/1.5/files/etc/default/example
|
||||
/usr/share/pleaserun/example/upstart/1.5/files/etc/init/example.conf
|
||||
|
||||
The package includes service definitions for your specific service that can
|
||||
target systemd, a few versions of upstart, launchd, and sysv.
|
||||
|
||||
Upon install, the `install.sh` script is run which detects the correct service
|
||||
definition to install.
|
||||
|
||||
Does the package clean up after itself when I remove it?
|
||||
|
||||
It should. When installing, the package generates a manifest of what service files were installed, and it uses that manifest to clean up when the package is uninstalled or removed.
|
||||
|
|
@ -1,105 +0,0 @@
|
|||
`python` - Python packages
|
||||
==========================
|
||||
|
||||
Minimal example
|
||||
---------------
|
||||
|
||||
Here's a simple example to download the `pyramid` python package and convert it to an rpm::
|
||||
|
||||
% fpm -s python -t rpm pyramid
|
||||
Trying to download pyramid (using easy_install)
|
||||
Searching for pyramid
|
||||
Reading http://pypi.python.org/simple/pyramid/
|
||||
Reading http://docs.pylonshq.com
|
||||
Reading http://docs.pylonsproject.org
|
||||
Best match: pyramid 1.0
|
||||
...
|
||||
Created /home/jls/python-pyramid-1.0.noarch.rpm
|
||||
|
||||
This will download the latest 'pyramid' python module using easy_install and
|
||||
convert it to an rpm. It will create a package named
|
||||
'python-pyramid-VERSION_ARCH.rpm' with appropriate version/arch in place.
|
||||
|
||||
Check the package::
|
||||
|
||||
% rpm -qip python-pyramid-1.0.noarch.rpm
|
||||
Name : python-pyramid Relocations: (not relocatable)
|
||||
Version : 1.0 Vendor: (none)
|
||||
Release : 1 Build Date: Mon 16 May 2011 06:41:16 PM PDT
|
||||
Install Date: (not installed) Build Host: snack.home
|
||||
Group : default Source RPM: python-pyramid-1.0-1.src.rpm
|
||||
Size : 2766900 License: BSD-derived (http://www.repoze.org/LICENSE.txt)
|
||||
Signature : (none)
|
||||
URL : http://docs.pylonsproject.org
|
||||
Summary : The Pyramid web application framework, a Pylons project
|
||||
Description :
|
||||
The Pyramid web application framework, a Pylons project
|
||||
|
||||
From the above, you can see that fpm automatically picked the package name,
|
||||
version, maintainer, homepage, and description all from the python package
|
||||
itself. Nothing for you to worry about :)
|
||||
|
||||
Looking at the dependencies::
|
||||
|
||||
% rpm -qRp python-pyramid-1.0.noarch.rpm
|
||||
python-Chameleon >= 1.2.3
|
||||
python-Mako >= 0.3.6
|
||||
python-Paste > 1.7
|
||||
python-PasteDeploy >= 0
|
||||
python-PasteScript >= 0
|
||||
python-WebOb >= 1.0
|
||||
python-repoze.lru >= 0
|
||||
python-setuptools >= 0
|
||||
python-zope.component >= 3.6.0
|
||||
python-zope.configuration >= 0
|
||||
python-zope.deprecation >= 0
|
||||
python-zope.interface >= 3.5.1
|
||||
python-venusian >= 0.5
|
||||
python-translationstring >= 0
|
||||
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
|
||||
rpmlib(CompressedFileNames) <= 3.0.4-1
|
||||
|
||||
Packaging for multiple pythons
|
||||
-------------------------------
|
||||
|
||||
Some systems package python with packages named 'python24' and 'python26' etc.
|
||||
|
||||
You can build packages like this with fpm using the `--python-package-name-prefix` flag::
|
||||
|
||||
% ruby bin/fpm -s python -t rpm --python-package-name-prefix python26 pyramid
|
||||
...
|
||||
Created /home/jls/projects/fpm/python26-pyramid-1.0.noarch.rpm
|
||||
|
||||
% rpm -qRp python26-pyramid-1.0.noarch.rpm
|
||||
python26-Chameleon >= 1.2.3
|
||||
python26-Mako >= 0.3.6
|
||||
python26-Paste > 1.7
|
||||
python26-PasteDeploy >= 0
|
||||
<remainder of output trimmed... you get the idea>
|
||||
|
||||
You can ask for a specific version with '-v <VERSION>'. It will also handle
|
||||
dependencies. Here's an example converting an older package like pysqlite version 2.5.6::
|
||||
|
||||
% fpm -s python -t rpm --python-package-name-prefix python26 -v 2.5.6 'pysqlite'
|
||||
Trying to download pysqlite (using easy_install)
|
||||
Searching for pysqlite==2.5.6
|
||||
Reading http://pypi.python.org/simple/pysqlite/
|
||||
Reading http://pysqlite.googlecode.com/
|
||||
< ... output cut ... >
|
||||
Created /home/jls/projects/fpm/python26-pysqlite-2.5.6.x86_64.rpm
|
||||
|
||||
Local python sources
|
||||
--------------------
|
||||
|
||||
If you are the developer of a python package, or you already have the local
|
||||
package downloaded and unpacked.
|
||||
|
||||
In this scenario, you can tell fpm to use the `setup.py`::
|
||||
|
||||
% ls pyramid/setup.py
|
||||
pyramid/setup.py
|
||||
|
||||
% fpm -s python -t rpm pyramid/setup.py
|
||||
...
|
||||
Created /tmp/python-pyramid-1.0.noarch.rpm
|
||||
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
`rpm` - RPM Packages
|
||||
====================
|
||||
|
||||
Synopsis::
|
||||
|
||||
fpm -s rpm [other options] path-to-rpm
|
||||
|
||||
Using 'rpm' as a source lets you treat an existing package as a source for
|
||||
building a
|
||||
new one. This can be useful for converting packages between formats or
|
||||
for "editing" upstream packages.
|
||||
|
||||
Strip out docs under `/usr/share/doc`::
|
||||
|
||||
fpm -t rpm -s rpm --exclude /usr/share/doc ruby-2.0.0.x86_64.rpm`
|
||||
|
||||
Rename a package and assign different version::
|
||||
|
||||
fpm -t rpm -s rpm --name myruby --version $(date +%S) ruby-2.0.0.x86_64.rpm
|
||||
|
||||
Convert an rpm in to a deb::
|
||||
|
||||
fpm -t deb -s rpm fpm-1.63.x86_64.rpm
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
`virtualenv` - Python virtual environments
|
||||
==========================================
|
||||
|
||||
Synopsis::
|
||||
|
||||
fpm -s virtualenv [other options] EGG_SPEC|requirements.txt
|
||||
|
||||
FPM has support for building packages that provide a python virtualenv from a
|
||||
single egg or from a `requirements.txt` file. This lets you bundle up a set of
|
||||
python dependencies separate from system python that you can then distribute.
|
||||
|
||||
.. note::
|
||||
`virtualenv` support requires that you have `virtualenv` and the
|
||||
`virtualenv-tools` binary on your path. This can usually be achieved with
|
||||
`pip install virtualenv virtualenv-tools`.
|
||||
|
||||
Example uses:
|
||||
=============
|
||||
|
||||
Build an rpm package for ansible::
|
||||
|
||||
fpm -s virtualenv -t rpm ansible
|
||||
yum install virtualenv-ansible*.rpm
|
||||
which ansible # /usr/share/python/ansible/bin/ansible
|
||||
|
||||
Create a debian package for your project's python dependencies under `/opt`::
|
||||
|
||||
echo 'glade' >> requirements.txt
|
||||
echo 'paramiko' >> requirements.txt
|
||||
echo 'SQLAlchemy' >> requirements.txt
|
||||
fpm -s virtualenv -t deb --name myapp-python-libs \
|
||||
--prefix /opt/myapp/virtualenv requirements.txt
|
||||
|
||||
Create a debian package from a version 0.9 of an egg kept in your internal
|
||||
pypi repository, along with it's external dependencies::
|
||||
|
||||
fpm -s virtualenv -t deb \
|
||||
--virtualenv-pypi-extra-url=https://office-pypi.lan/ \
|
||||
proprietary-magic=0.9
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
Sources
|
||||
=========
|
||||
|
||||
Sources are the things you input to fpm.
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
:glob:
|
||||
|
||||
source/*
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
Targets
|
||||
===============
|
||||
|
||||
Targets are the output of fpm.
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
:glob:
|
||||
|
||||
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
Use Cases
|
||||
=========
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
:glob:
|
||||
|
||||
use-cases/*
|
||||
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
Jenkins: Single-file package
|
||||
===================
|
||||
|
||||
For this example, you'll learn how to package hudson/jenkins which is a
|
||||
single-file download.
|
||||
|
||||
We'll use `make` to script the download, but `make` isn't required if you don't want it.
|
||||
|
||||
Makefile::
|
||||
|
||||
NAME=jenkins
|
||||
VERSION=2.80
|
||||
|
||||
.PHONY: package
|
||||
package:
|
||||
rm -f jenkins.war
|
||||
wget https://updates.jenkins-ci.org/download/war/$(VERSION)/jenkins.war
|
||||
fpm -s dir -t deb -n $(NAME) -v $(VERSION) --prefix /opt/jenkins jenkins.war
|
||||
|
||||
.. note:: You'll need `wget` for this Makefile to work.
|
||||
|
||||
Running it::
|
||||
|
||||
% make
|
||||
rm -f jenkins.war
|
||||
wget https://updates.jenkins-ci.org/download/war/2.80/jenkins.war
|
||||
--2017-09-27 14:29:55-- https://updates.jenkins-ci.org/download/war/2.80/jenkins.war
|
||||
Resolving updates.jenkins-ci.org (updates.jenkins-ci.org)... 52.202.51.185
|
||||
Connecting to updates.jenkins-ci.org (updates.jenkins-ci.org)|52.202.51.185|:443... connected.
|
||||
HTTP request sent, awaiting response... 302 Found
|
||||
Location: http://mirrors.jenkins-ci.org/war/2.80/jenkins.war [following]
|
||||
--2017-09-27 14:29:56-- http://mirrors.jenkins-ci.org/war/2.80/jenkins.war
|
||||
Resolving mirrors.jenkins-ci.org (mirrors.jenkins-ci.org)... 52.202.51.185
|
||||
Connecting to mirrors.jenkins-ci.org (mirrors.jenkins-ci.org)|52.202.51.185|:80... connected.
|
||||
HTTP request sent, awaiting response... 302 Found
|
||||
Location: http://ftp-nyc.osuosl.org/pub/jenkins/war/2.80/jenkins.war [following]
|
||||
--2017-09-27 14:29:56-- http://ftp-nyc.osuosl.org/pub/jenkins/war/2.80/jenkins.war
|
||||
Resolving ftp-nyc.osuosl.org (ftp-nyc.osuosl.org)... 64.50.233.100, 2600:3404:200:237::2
|
||||
Connecting to ftp-nyc.osuosl.org (ftp-nyc.osuosl.org)|64.50.233.100|:80... connected.
|
||||
HTTP request sent, awaiting response... 200 OK
|
||||
Length: 73094442 (70M) [application/x-java-archive]
|
||||
Saving to: ‘jenkins.war’
|
||||
|
||||
100%[=======================================================================================================>] 73,094,442 7.71MB/s in 11s
|
||||
|
||||
2017-09-27 14:30:07 (6.07 MB/s) - ‘jenkins.war’ saved [73094442/73094442]
|
||||
|
||||
% fpm -s dir -t deb -n jenkins -v 1.396 --prefix /opt/jenkins -d "sun-java6-jre (> 0)" jenkins.war
|
||||
Created .../jenkins-1.396-1.amd64.deb
|
||||
|
||||
Delicious.
|
||||
|
|
@ -1,75 +0,0 @@
|
|||
nodejs and multiple packages
|
||||
=====================================================
|
||||
|
||||
This example requires your `make install` support setting DESTDIR or otherwise
|
||||
allow you to install to a specific target directory.
|
||||
|
||||
Consider building nodejs. Sometimes you want to produce multiple packages from
|
||||
a single project. In this case, building three separate packages: nodejs, nodejs-dev, and nodejs-doc.
|
||||
|
||||
Package up the nodejs runtime
|
||||
-----------------------------
|
||||
|
||||
Normal build steps::
|
||||
|
||||
# Normal build steps.
|
||||
% wget http://nodejs.org/dist/v0.6.0/node-v0.6.0.tar.gz
|
||||
% tar -zxf node-v0.6.0.tar.gz
|
||||
% cd node-v0.6.0
|
||||
% ./configure --prefix=/usr
|
||||
% make
|
||||
|
||||
Now install it to a temporary directory::
|
||||
|
||||
# Install to a separate directory for capture.
|
||||
% mkdir /tmp/installdir
|
||||
% make install DESTDIR=/tmp/installdir
|
||||
|
||||
Now make the 'nodejs' package::
|
||||
|
||||
# Create a nodejs deb with only bin and lib directories:
|
||||
# The 'VERSION' and 'ARCH' strings are automatically filled in for you
|
||||
# based on the other arguments given.
|
||||
% fpm -s dir -t deb -n nodejs -v 0.6.0 -C /tmp/installdir \
|
||||
-p nodejs_VERSION_ARCH.deb \
|
||||
-d "libssl0.9.8 > 0" \
|
||||
-d "libstdc++6 >= 4.4.3" \
|
||||
usr/bin usr/lib
|
||||
|
||||
Install the package, test it out::
|
||||
|
||||
# 'fpm' just produced us a nodejs deb:
|
||||
% file nodejs_0.6.0-1_amd64.deb
|
||||
nodejs_0.6.0-1_amd64.deb: Debian binary package (format 2.0)
|
||||
% sudo dpkg -i nodejs_0.6.0-1_amd64.deb
|
||||
|
||||
% /usr/bin/node --version
|
||||
v0.6.0
|
||||
|
||||
Package up the manpages (create nodejs-doc)
|
||||
-------------------------------------------
|
||||
Now, create a package for the node manpage::
|
||||
|
||||
# Create a package of the node manpage
|
||||
% fpm -s dir -t deb -p nodejs-doc_VERSION_ARCH.deb -n nodejs-doc -v 0.6.0 -C /tmp/installdir usr/share/man
|
||||
|
||||
Look in the nodejs-doc package::
|
||||
|
||||
% dpkg -c nodejs-doc_0.6.0-1_amd64.deb| grep node.1
|
||||
-rw-r--r-- root/root 945 2011-01-02 18:35 usr/share/man/man1/node.1
|
||||
|
||||
Package up the headers (create nodejs-dev)
|
||||
------------------------------------------
|
||||
Lastly, package the headers for development::
|
||||
|
||||
Package up the headers via::
|
||||
|
||||
% fpm -s dir -t deb -p nodejs-dev_VERSION_ARCH.deb -n nodejs-dev -v 0.6.0 -C /tmp/installdir usr/include
|
||||
% dpkg -c nodejs-dev_0.6.0-1_amd64.deb | grep -F .h
|
||||
-rw-r--r-- root/root 14359 2011-01-02 18:33 usr/include/node/eio.h
|
||||
-rw-r--r-- root/root 1118 2011-01-02 18:33 usr/include/node/node_version.h
|
||||
-rw-r--r-- root/root 25318 2011-01-02 18:33 usr/include/node/ev.h
|
||||
...
|
||||
|
||||
Yay!
|
||||
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
#!/usr/bin/env ruby
|
||||
$: << File.join(File.dirname(__FILE__), "..", "..", "lib")
|
||||
|
||||
# This example uses the API to create a package from local files
|
||||
# it also creates necessary init-scripts and systemd files so our executable can be used as a service
|
||||
|
||||
require "fpm"
|
||||
require "tmpdir"
|
||||
require "fpm/package/pleaserun"
|
||||
|
||||
# enable logging
|
||||
FPM::Util.send :module_function, :logger
|
||||
FPM::Util.logger.level = :info
|
||||
FPM::Util.logger.subscribe STDERR
|
||||
|
||||
package = FPM::Package::Dir.new
|
||||
|
||||
# Set some attributes
|
||||
package.name = "my-service"
|
||||
package.version = "1.0"
|
||||
|
||||
# Add a script to run after install (should be in the current directory):
|
||||
package.scripts[:after_install] = 'my_after_install_script.sh'
|
||||
|
||||
# Example for adding special attributes
|
||||
package.attributes[:deb_group] = "super-useful"
|
||||
package.attributes[:rpm_group] = "super-useful"
|
||||
|
||||
# Add our files (should be in the current directory):
|
||||
package.input("my-executable=/usr/bin/")
|
||||
package.input("my-library.so=/usr/lib/")
|
||||
|
||||
# Now, add our init-scripts, systemd services, and so on:
|
||||
pleaserun = package.convert(FPM::Package::PleaseRun)
|
||||
pleaserun.input ["/usr/bin/my-executable", "--foo-from", "bar"]
|
||||
|
||||
# Create two output packages!
|
||||
output_packages = []
|
||||
output_packages << pleaserun.convert(FPM::Package::RPM)
|
||||
output_packages << pleaserun.convert(FPM::Package::Deb)
|
||||
|
||||
# and write them both.
|
||||
begin
|
||||
output_packages.each do |output_package|
|
||||
output = output_package.to_s
|
||||
output_package.output(output)
|
||||
|
||||
puts "successfully created #{output}"
|
||||
end
|
||||
ensure
|
||||
# defer cleanup until the end
|
||||
output_packages.each {|p| p.cleanup}
|
||||
end
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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) .
|
||||
|
|
@ -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
|
||||
|
|
@ -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) .
|
||||
|
||||
|
|
@ -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
|
||||
|
||||
|
|
@ -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
|
||||
|
||||
29
fpm.gemspec
29
fpm.gemspec
|
|
@ -22,45 +22,36 @@ Gem::Specification.new do |spec|
|
|||
|
||||
spec.required_ruby_version = '>= 1.9.3'
|
||||
|
||||
# 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
|
||||
|
||||
# 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
|
||||
|
||||
# For starting external processes across various ruby interpreters
|
||||
spec.add_dependency("childprocess") # license: ???
|
||||
|
||||
# For calling functions in dynamic libraries
|
||||
spec.add_dependency("ffi") # license: GPL3/LGPL3
|
||||
|
||||
spec.add_development_dependency("rake", "~> 10") # license: MIT
|
||||
|
||||
# For creating FreeBSD package archives (xz-compressed tars)
|
||||
spec.add_dependency("ruby-xz", "~> 0.2.3") # license: MIT
|
||||
spec.add_dependency("clamp", ">= 1.0.0") # license: MIT
|
||||
|
||||
# For sourcing from pleaserun
|
||||
spec.add_dependency("pleaserun", "~> 0.0.29") # license: Apache 2
|
||||
|
||||
spec.add_dependency("stud")
|
||||
|
||||
spec.add_development_dependency("rspec", "~> 3.0.0") # license: MIT (according to wikipedia)
|
||||
# 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")
|
||||
|
||||
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("rake") # For FPM::RakeTask, #1877, #756
|
||||
|
||||
spec.files = files
|
||||
spec.require_paths << "lib"
|
||||
spec.bindir = "bin"
|
||||
|
|
|
|||
|
|
@ -18,3 +18,4 @@ require "fpm/package/p5p"
|
|||
require "fpm/package/pkgin"
|
||||
require "fpm/package/freebsd"
|
||||
require "fpm/package/apk"
|
||||
require "fpm/package/snap"
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ require "fpm/namespace"
|
|||
require "fpm/version"
|
||||
require "fpm/util"
|
||||
require "clamp"
|
||||
require "ostruct"
|
||||
require "fpm"
|
||||
require "tmpdir" # for Dir.tmpdir
|
||||
|
||||
|
|
@ -247,13 +246,24 @@ class FPM::Command < Clamp::Command
|
|||
"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
|
||||
|
||||
|
|
@ -291,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
|
||||
|
||||
|
|
@ -355,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
|
||||
|
|
@ -370,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
|
||||
|
|
@ -394,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
|
||||
|
|
@ -435,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
|
||||
|
|
@ -571,12 +595,86 @@ class FPM::Command < Clamp::Command
|
|||
|
||||
ARGV.unshift(*flags)
|
||||
ARGV.push(*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
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue