The previous commit eats too much whitespace after the section headers
(`%pre`, `%post` etc.). There should remain a newline.
Correct versions (for `%pre`):
```
%pre
ugrade () {
```
and
```
%pre -e
upgrade() {
```
Without this patch, we get these (wrong):
```
%pre ugrade () {
```
and
```
%pre -e upgrade() {
```
(exact number of spaces can be different, but should not be relevant)
Fixes#1750
Signed-off-by: Jo Vandeginste <Jo.Vandeginste@kuleuven.be>
The previous method using :if actually hides the test entirely from the run.
Now an rspec run will correctly(I hope?) show any skipped tests. The
goal is to remind me that sometimes my dev environment is missing
important tooling needed to fully test fpm.
Also: Skip pacman tests if bsdtar and zstd programs are missing.
For #1795
This replaces another library which uses ffi with an implementation
that doesn't need ffi.
I am not certain this is an exact replacement, but for my casual tests,
comparing .txz files generated before/after this commit, things seem ok.
This would benefit from real freebsd testing, though.
This removes fpm's direct use of FFI and removes `ffi` as a direct
dependency. For #1795
Cases:
* A unix socket.
* A named pipe
* A charDev should now fail (like /dev/tty)
* A blockDev should now fail (like /dev/sda1)
NOTE: In this change, chardev and blockdev support have been removed.
These "copies" previously were just calling `mknod` with identical
mode, basically copying the `mode` from stat(2) to mknod(2).
Exceptions are now thrown for chardev and blockdev.
Test cases:
# Try to package a named pipe.
% mkfifo /tmp/z.pipe
% bundle exec bin/fpm -s dir -t rpm -n example /tmp/z.pipe
Created package {:path=>"example-1.0-1.x86_64.rpm"}
% rpm -qlvp example-1.0-1.x86_64.rpm
prw-rw-r-- 1 root root 0 Jun 17 22:40 /tmp/z.pipe
# Create the unix socket
% nc -lU /tmp/z.sock
# Package it into an rpm
% bin/fpm -s dir -t rpm -n example /tmp/z.sock |& less
{:timestamp=>"2021-06-17T22:33:27.780347-0700", :message=>"Created package", :path=>"example-1.0-1.x86_64.rpm"}
# Verify the file is of socket type ('s' at beginning of file mode
% rpm -qlvp example-1.0-1.x86_64.rpm
srwxrwxr-x 1 root root 0 Jun 17 22:33 /tmp/z.sock
The childprocess library uses `ffi`. Historically, installing ffi has
brought challenges for fpm users. This change is an attempt to use
ruby standard methods to replace ChildProcess.
For #1795
Previously, rexml was included standard in Ruby. However, in 3.0.0, ruby
moved this library to be a "bundled gem", per the release notes:
https://www.ruby-lang.org/en/news/2020/12/25/ruby-3-0-0-released/
> The following default gems are now bundled gems.
> * rexml
Tested on Ruby 2.7.0 and 3.0.1 w/ bundler and it works.
```
% (rbenv shell 3.0.1; bundle install; bundle exec bin/fpm -s empty -t empty -n example)
% (rbenv shell 2.7.0; bundle install; bundle exec bin/fpm -s empty -t empty -n example)
```
Fixes#1793
If gem had a version constraint with just major version (e.g., ~>1),
the Debian packages were generated with wrong zero upper limit
(e.g., >= 1 and << 0). This results in unresolvable dependencies.
Signed-off-by: Vlastimil Holer <vholer@opennebula.io>
ffi 1.13 requires Ruby 2.3, which is not supplied by many still-supported distros (e.g Centos/RHEL 7), 1.12.X works there, so restrict to that.
Addresses #1708
instead of a space-separated argument string
Tested with this command:
bundle exec bin/fpm --debug -s python -t deb --python-pip =pip django
And verified that safesystem() to invoke pip is given a list.
Mentioned this here:
https://github.com/jordansissel/fpm/pull/1737#discussion_r560474705
https://github.com/jordansissel/fpm/issues/1675
The value can be a number from 0 to 9 inclusive. The default mirrors
the current behavior of 9. If the --rpm-compression value is set to
"none", this value is ignored.
Setting the value to 5 sped up RPM creation on my RPM from 9 to
3 minutes.
repo that was added and enabling the ol7_optional_latest repo instead.
This ensures that fully supported packages are installed, including
the ruby-devel package.
This also corrects the product name.
Signed-off-by: Avi Miller <avi.miller@oracle.com>