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 ?
- init-scripts, default and upstart specified as command line option are automatically added as declared debian conf file
- this behavior can be disabled using "--deb-no-auto-config-file"
- reordered the process steps during package generation, thus init-script and config-files options can be used in parallel.
without that fix, you will get an error that the script file can not be found during the processing of the config-files options
All changes are related processing Debian packages and should be backward compatible.
The FreeBSD version of tar doesn't include the options --owner and
--group among others. Instead change to use gnutar as the default.
This adds a dependency of installing
https://freshports.org/archivers/gtar/ for anyone creating packages
under FreeBSD (similar to doing brew install gnu-tar under OSX)
Allow arguments in .fpm files, old behaviour put those arguments in the
middle of the command line, and further options were not recognized.
Fix issue #976
I have been testing this escaping all morning on various combinations of file names. In any single case, the original escaping algorithm works just fine, but in the case you have a file name containing a multitude of glob characters, you can't escape them if the file also contains spaces in the name. In order to escape the glob characters, the file name can't be quoted (or at least that's the case with the version of rpmbuild I have). The result is file not found errors. In the end, the only solution that works consistently with all scenarios I have tested it with, is to replace the spaces with a single glob character match `?`, then escape any other glob characters present in the file name.
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.
Now '-n' (no test) flag passed to cpanm only if attributes[:cpan_test] is false
Also, added '--installdeps' to cpanm_flags because the target module has
already been downloaded manually, and there shouldn't be any need to
download (and possibly test) it again
Closes#853
dependencies.
This is useful for example in the case of a dependency on the python
PyYAML package.
By default, this dependency gets translated to a debian package
dependency on python-pyyaml. That package does not exist on Debian
systems, so a way to override the dependency is needed.
A similar option exists already for gems (--gem-disable-dependency).
This is a fix for finicky packages like unittest2 that pass
non-string parameters for version into setup(). If the JSON module
doesn't know explicitly about the type, it will raise a TypeError.
In this case, we check if the object's class has a __str__ method
defined, and if so, just encode the object as a string.
The md5sums control file must be formatted exactly as it would be
produced by a run of md5sum (MD5, two spaces, file path). Failing to do
so breaks dpkg --verify.
lintian in Ubuntu 14.04 now errors when a file
/usr/share/NAME/changelog.Debian.gz doesn't exist.
In the spirit of respecting lintian's meaningful errors, this commit
fixes that error.
The new behavior is that a changelog file is *always* provided. If the
--deb-changelog flag is not given, then fpm will produce a default one
based on the package being built in hope that it satisfies lintian.
With this commit, the lintian rspec test passes on Ubuntu 14.04.
Fixes#784
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.
If path is a symbolic link and target doesn't exist, we may incorrectly through
file not found exception. This changes fixes the issue by using File.lstat to
stat the path.
For example, if cpan_perl_lib_path is set to "/usr/share/perl5", all
packages created with fpm will contain this file:
/usr/share/perl5/x86_64-linux-gnu-thread-multi/perllocal.pod
The current code only works if cpan_perl_lib_path is undefined.
Also see #443 and #510.
```
--no-depends Do not list any dependencies in this package (default: false)
--no-auto-depends Do not list any dependencies in thispackage automatically (default: false)
```
This can be useful to have requirements for different stages.
Examples:
--rpm-tag 'Requires(post): /usr/sbin/alternatives'
--rpm-tag 'Requires(preun): /usr/sbin/alternatives'
This should help folks who want the old-style gem-rpm conversions
* with this flag, old behavior: rubygem-name
* without flag, default behavior: rubygem(name)
The 'default' behavior has been this behavior since 0.4.23 for most
users.
If you changed the package name prefix via --gem-package-prefix or
--gem-package-name-prefix then this behavior was broken.
It was fixed in #585.
But, I don't want folks relying on old behavior to be screwed
when that behavior mysteriously vanishes! This should be a good
enough work around for now.
Reported by Ryan Doherty via the fpm-users mailing list.
With rpms, if `--architecture` and `--rpm-os` are specified and
different than the host, `--target` would be passed to `rpmbuild` twice,
causing an error.
Example: an OS X host (`uname -s` = "Darwin") with x86_64 architecture
building for `--rpm-os linux` and `--architecture noarch`.
This change only adds `--target` to the `rpmbuild` args once, fixing
this specific error.
Otherwise this can happen:
$ fpm -t deb -s cpan --verbose 'Lingua::JA::Romanize::Japanese'
Asking metacpan about a module {:module=>"Lingua::JA::Romanize::Japanese", :level=>:info}
Downloading perl module {:distribution=>"Lingua-JA-Romanize-Japanese", :version=>nil, :level=>:info}
Setting package name from 'name' {:name=>"Lingua-JA-Romanize-Japanese", :level=>:info}
/usr/lib/ruby/gems/1.9.1/gems/fpm-1.1.0/lib/fpm/package/cpan.rb:86:in `input': undefined method `join' for nil:NilClass (NoMethodError)
from /usr/lib/ruby/gems/1.9.1/gems/fpm-1.1.0/lib/fpm/command.rb:299:in `block in execute'
from /usr/lib/ruby/gems/1.9.1/gems/fpm-1.1.0/lib/fpm/command.rb:298:in `each'
from /usr/lib/ruby/gems/1.9.1/gems/fpm-1.1.0/lib/fpm/command.rb:298:in `execute'
from /usr/lib/ruby/gems/1.9.1/gems/clamp-0.6.3/lib/clamp/command.rb:67:in `run'
from /usr/lib/ruby/gems/1.9.1/gems/fpm-1.1.0/lib/fpm/command.rb:449:in `run'
from /usr/lib/ruby/gems/1.9.1/gems/clamp-0.6.3/lib/clamp/command.rb:125:in `run'
from /usr/lib/ruby/gems/1.9.1/gems/fpm-1.1.0/bin/fpm:8:in `<top (required)>'
from /usr/bin/fpm:23:in `load'
from /usr/bin/fpm:23:in `<main>'
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.
tar flags.
The reason for this is that if we do output, it fails like so;
1) FPM::Package::Deb#tar_flags should set the group for the package's data files
Failure/Error: @package.output(@target)
FPM::Util::ProcessFailed:
tar failed (exit code 2). Full command was:["tar", "-C", "/tmp/package-deb-staging20140423-5427-10uiv96", "-z", "--numeric-owner", "--owner", "0", "--group", "nogroup", "-cf", "/tmp/package-deb-build20140423-5427-19uvbmw/data.tar.gz", "."]
Because 'nogroup' isn't a valid group when tar is run, but we want to check
that 'nogroup' is set in the tar args, not that tar works ;)
This avoids accidentally failing simply because 'simplejson' isn't
available (but 'json' might be, but we aborted too early)
This fixes tests broken by the previous commit.
I forgot safesystem() raises an exception when it fails.
Now, if users have a python that is missing a feature we need in order
to have fpm build a package, you'll get an error like this:
Your python environment is missing json support (either json or simplejson python module). I cannot continue without this. {:error=>#<FPM::Util::ProcessFailed: /bin/bash failed (exit code 1). Full command was:["/bin/bash", "-c", "/opt/my-py24/bin/python -c 'import simplejson'"]>, :python=>"/opt/my-py24/bin/python", :level=>:error}
Process failed: Python (/opt/my-py24/bin/python) is missing simplejson or json modules. {:level=>:error}
This is for #664
This aims to help with #644 where we cannot get python package metadata
without having json and setuptools available from the python program
we are invoking.
Because --version is a valid flag (for setting the package version)
but is also commonly used to ask an application what version it is,
we need a bit of special handling for `fpm --version`:
New result:
% fpm --version
1.1.0
Prior to this patch, `fpm --version` would tell you that you were
missing arguments or flags.
The rpm-use-file-permissions setting asks each file who owns it and what
the mode is. Sometimes you only want the mode, or sometimes the user is
not correct for deployment. Now, specifying --rpm-user will force the
owner to be the given user but still respect the file modes gathered
by --rpm-use-file-permissions.
The intent of this change is:
* --rpm-use-file-permissions still works the same, when alone
* --rpm-user forces the 'user' owner regardless of the above
* --rpm-group forces the 'group' owner regardless of the above
This was identified by https://logstash.jira.com/browse/LOGSTASH-2012