This will generate .changes file for Debian packages. Some Debian
repository management tools use .changes files for importing packages.
The command line option --(no-)deb-generate-changes allows to select to
generate the .changes file, the option --deb-dist allows to set a
distribution (like sid) for the package.
This fixes a bug where rpm output passes an rpm build macro `_tmppath`
that is empty, and on Fedora 27 this causes rpmbuild to fail.
The test suite catches this by making most all RPM specs fail, and with
this change, most of them now pass.
Alpine Linux describes the available control scripts at https://wiki.alpinelinux.org/wiki/Creating_an_Alpine_package.
This patch fixes an issue where `post-install` was registered multiple times, preventing `:after_install`, `:before_install`, `:before_upgrade`, and `:after_upgrade` from running the correct script.
While I am not a ruby programer, I was able to come up with a solution to
the issue I was running into when attempting to create a .deb package when
using the --config-files option.
PR #1253, while fixed the bug where `source.link=dest/source.link`
resulted in `source.link=dest/source.link/source.link` introduced a bug
where `source=dest/` syntax stopped working for symlinks (it is ok for
files). This is now fixed, as the symlink source now behaves the same as
it would with a single file input. Test case testing this behaviour is
also added.
Fixes#1395
PR #1379/#860 introduced a new behavior for --config-files that fetches
config files from the local filesystem. The prior behavior was to
require these files to be provided by the source package (`--source`
flag).
This patch makes a hybrid solution which does, for any given
`--config-files foo` flag:
* does the path `foo` already exist in the staging area? Do nothing.
This means the package source (`-s gem` for example) provided this file.
* or, does the path `foo` exist in the local filesystem? If so, copy it
into the staging area.
* otherwise, consider this to be an error that the --config-files
setting cannot find the file, and fpm will fail with an error.
Previously, if the symlink is included into the package and specified
with
my-sym-link.so=/usr/lib/my-sym-link.so
fpm would create directory, and put the
symlink inside `/usr/lib/my-sym-link.so/my-sym-link.so
which is very surprising and it doesn't follow the same
pattern as file copying is doing.
Fixes#1135
* Add test for copying symlinks
The test explicitly sets `preserve=true` and `remove_destination=true`
to show the currently broken behavior.
* Fix copy_entry for symlinks
The fourth argument to FileUtils.copy_entry is dereference_root to
which the value of remove_destination was passed.
The fix now passes the parameters in the required position.
* Add option --source-date-epoch-default and implement for deb output.
This is the first step towards supporting bit-for-bit identical
output files given identical inputs.
Alas, Apple's ar is not too good at reading gnu ar archives,
so always use ar_cmd to find ar.
* deb: remove lines duplicated in a tragic merge conflict
Probably introduced by 62d0060178 and not removed by 500f0c052f
* Add options --source-date-epoch-from-changelog and --gem-stagingdir to support bit-for-bit reproducible gem -> deb conversion
In those cases where we can get the release date out of the changelog,
use it; otherwise fall back to the value given by SOURCE_DATE_EPOCH aka --source-date-epoch-default.
--gem-stagingdir is a bit of a kludge, only needed because no
compiler supports https://reproducible-builds.org/specs/build-path-prefix-map/ yet.
Could have been global option, but not sure any other package handler
invokes compilers? Could hoist it up later.
Also:
- Defer initializing staging_path so subclasses can sneak in new value
- gem: remove build files
* gem: handle a few more gem changelog variants
* gem: also remove mkmf.log; lets ffi, kgio, raindrops, and ruby-ldap build reproducibly.
* deb: don't expect diffoscope to be installed in /usr/bin. Lets it be found on mac.
* gem: document new options
"pip install" in addition to the --index-url and --extra-index-url
flags, offers the `--find-links` flag, which tells pip to parse
an html index document looking for wheel/egg/source files without
expecting the "simple" pypi layout or to look in a local directory
for package files.
one common use-case for a virtualenv requirements.txt source
is to distribute ones software and the dependencies in one
debian file. unfortunately the current implementation doesn't
get one all the way to that goal. Starting with a local checkout
of a python package (containing one's own software, setup.py and
requirements.txt) fpm can create a package that contains the
software dependencies, but not the software itself.
this commit adds an option to also run the package setup.py
after populating the virtualenv, thus giving a means to
package one's own application *and* the dependencies in
one step
A bug pointed out by #1162 showed that `fpm --version` would fail when
a .fpm file was loaded.
Moving the short `fpm --version` handling to the `run` method lets us do
this check before we load FPMOPTS env or .fpm files.
Updated the tests to only try calling with a lone `-v` or `--version`
flag to verify this works with and without a .fpm file.
Fixes#1162 and #1125. Original work by @drwl!
The flags for chdir, input, and output aren't immediately intuitive
as to what they're short for. This commit adds long versions and a
spec stub for chdir. Resolves#1187.
This removes the --requirements boolean flag in favor of a check that
will automatically assume 'requirements.txt' if the given input argument
is a path with basename (last part of the path) of "requirements.txt".
Long term, we'll probably have a "smart" post-install that will choose
the correct service (systemd, etc) to install based on the platform
doing the installation, not the platform creating the package :)
Adds dependencies on pleaserun and upgrades clamp to suit.
Example using the defaults in pleaserun:
# Create a package called 'example-service' that installs a service named 'example'
% bin/fpm -s pleaserun -t rpm -n example-service --pleaserun-name example =logger hello world
No platform selected. Autodetecting... {:platform=>"systemd", :version=>"default", :level=>:warn}
Writing file {:destination=>"/tmp/package-pleaserun-staging20160513-12576-1ozurnf/lib/systemd/system/example.service"}
Writing install actions. You will want to run this script to properly activate your service on the target host {:path=>"/tmp/package-pleaserun-staging20160513-12576-1ozurnf/install_actions.sh"}
Created package {:path=>"example-service-1.0-1.x86_64.rpm"}
# ^^ The above service will execute "logger hello world"
# What's in our rpm?
% rpm -qlp example-service-1.0-1.x86_64.rpm
/lib/systemd/system/example.service
# What about any post-install steps?
% rpm -qp example-service-1.0-1.x86_64.rpm --scripts
postinstall scriptlet (using /bin/sh):
systemctl --system daemon-reload
# Install it.
% sudo rpm -ivh example-service-1.0-1.x86_64.rpm
# Start it.
% sudo systemctl start example
# Check the logs!
% sudo tail -n1 /var/log/messages
May 13 03:32:55 localhost root: hello world
Example choosing 'sysv' as the platform:
% bin/fpm -s pleaserun -t rpm -n example-service --pleaserun-platform sysv --pleaserun-name example =logger hello world
Writing file
{:destination=>"/tmp/package-pleaserun-staging20160513-13675-xae6xd/etc/init.d/example"}
Writing file
{:destination=>"/tmp/package-pleaserun-staging20160513-13675-xae6xd/etc/default/example"}
Created package {:path=>"example-service-1.0-1.x86_64.rpm"}
% rpm -qlp example-service-1.0-1.x86_64.rpm
/etc/default/example
/etc/init.d/example
r/tZjUvfFQyPo32u2OazeNrIGhKmi8Gk8CLrvJj9XOB7ulKXs/gi4mptwR4+kX9h
eo53lTrOP4IRuBzEm71l+AzPrg55G5ACJULg61KXJI7PK/93bDj0SDOO/h/SLCKL
wrrpZkyA1nw5t7n0j7Dbp6jw9kaTZcLxiyGc0UPdug6F6FlNF0YT5fc4sKmZz3/x
rreaL0wEyjUlEXBe+yxjSYpybusx8huQ8TkvDCsTzgNzKFH9a0zoCc2ERXhU2UIn
6W6w/0W+dBz1nmwC3TExBGpMFTyx2rzmFGQjsUsanXD/5IxLzYc7fqsrQ4nuvv8=
=iw78
-----END PGP SIGNATURE-----
Rake task should not exit if successful
Exiting after fpm success means that further rake tasks fail to execute,
and Rake simply exits. Instead, only abort if the fpm exits non-zero
ig0GxqsSuCj6tSzaXEaL6D0kDqqfilydBKDJ5R/eycf1Vd6U1l1ttR7Gsuhl5KSm
SID7LuRO+DkfNXayH7LApq+++kx8d4ucuL5trcWISdtbOLc71Ppvf4Rv2X61xQpv
A1TbJGks2yiUfDrm7XLJtIOClRAbE18K2VdJ/f891P5rwPdLcfAfJgbb9lxqcJHo
vsoYxIef+hIsgczQr+WnAQQVRCpSNy6LAox706uk8BBjeGLpkardZnhlGiUnQ/t1
UWOzWm3prHO2O7nhCcQDjfBQj/d3m9XtR0Knv5fnyEUJrAYgpDUbTeGQ0R5iIoo=
=WpBr
-----END PGP SIGNATURE-----
Add fpm namespace require for rake task
The rake task class needs to require the fpm namespace in order
to be included elsewhere.
Oh god, sorry, i did'nt see that systemd unit files are handled two times !
(See: https://github.com/jordansissel/fpm/pull/1040)
If i don't replace this path too, unit files are presents 2 times in the debian package, first in /lib/systemd, second in /etc/systemd
Btw, i suspect another bug, that's a strange behaviour, don't you think ?