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
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.
When building Debian packages with debhelper, files in `/etc` are
automatically marked as configuration files (this is done since
compatibility level 3 which was introduced in 2000). Therefore, packages
built with fpm may come as a surprise since they don't do that. A user
can still add `--config-files /etc` but they have to know that (usually
after a valuable modification has been erased).
This change add `/etc` to the list of configuration files for Debian
unless fpm is invoked with `--deb-no-config-files`.
Closes: #873
This was accomlished with this sed invocation (OSX):
sed -Ei "" -e 's/ +$//' {lib,spec}/**/*.rb
(It would be `-r` instead of `-E` on systems with GNU sed)
Anyway. I did this because I'm frustrated folks unintentionally submit
patches with tons of whitespace changes done automatically by their
editor and without confirmation. The whitespace changes make `git blame`
lie, and it also makes doing the code review more difficult. While
Github is capable of showing a code diff that ignores whitespace (via
`?w=1`), that view does not permit commenting on the code change.
This makes use of shared examples, rspec's expect (instead of my
insist), and cleans up some longer tests that had complex 'it' blocks
into before/let/it.
lintian expects the package name to ends with ".deb". Also, rspec
disallows the use of a let variable in an `after(:context)` hook. Also
fix the name of instance variable `@staging_path`.
* Resolve any ruby warnings (ruby -wc)
* Use expect().to(...) instead of insist { ... }
* Avoid `:all` in hooks
* Use `let` instead of instance variables
* Use Stud::Temporary instead of Tempfile
Switched to using `ar p ... | tar -zx` instead. Test passes on OSX.
I also took this as an opportunity to update the style to use rspec a
bit better. Using `let` and avoiding `before :all` and such.
There are still 4 test failures:
* rspec ./spec/fpm/package/rpm_spec.rb:297 # FPM::Package::RPM#output package attributes should have the correct 'after_target_uninstall' trigger script
* rspec ./spec/fpm/package/rpm_spec.rb:288 # FPM::Package::RPM#output package attributes should have the correct 'before_uninstall' trigger script
* rspec ./spec/fpm/package/rpm_spec.rb:279 # FPM::Package::RPM#output package attributes should have the correct 'after_install' trigger script
* rspec ./spec/fpm/package/rpm_spec.rb:270 # FPM::Package::RPM#output package attributes should have the correct 'before_install' trigger script
Added test coverage to ensure a broken symlink doesn't throw a ENOENT
error. The test was written first, and failed, but now passes with the
fix to the dir package.
Fixes#658
Supported log levels: error, warn, info, debug.
--verbose is the same as --log=info
--debug is the same as --log=debug
--log=warn is the default
Requested by mattgreenrocks on irc.
When --rpm-dist is specified, pass the dist tag to rpmbuild and
correctly name the file to ensure packages can be built with a
specific distribution in mind.