Commit Graph

2217 Commits

Author SHA1 Message Date
Jordan Sissel e96dc2729a Version bump 2021-06-19 00:50:47 -07:00
Jordan Sissel 4eed9d671b Move loading of 'git' library nearer to where it's used.
This is necessary because `require "git"` (at time of writing) will
error if the `git` program is not available.

Upstream (ruby git) issue:
https://github.com/ruby-git/ruby-git/issues/311

Related fpm issues: #1748, #1751
2021-06-19 00:44:23 -07:00
Jordan Sissel bf9bcc8e2a Changelog update for #1760 2021-06-19 00:43:13 -07:00
Jordan Sissel 82580bb8e7 Add --deb-compression test coverage for #1760 2021-06-19 00:39:19 -07:00
Philippe Poilbarbe 13dde8304e Replace hardcoded control.tar.gz by name depending on compression (#1759) 2021-06-19 00:38:04 -07:00
Jordan Sissel 057a60387f Add more changelog entries to prep for release 2021-06-19 00:22:52 -07:00
Jo Vandeginste 067f4ccfd0 Add back newlines after sections with macro expansion
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>
2021-06-19 00:16:58 -07:00
Jordan Sissel 2b6e70b6fa Use rspec's skip feature to help show any skipped tests.
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.
2021-06-19 00:09:49 -07:00
Jordan Sissel ab4eb18b5f FreeBSD package: Replace ruby-xz usage with alternative using `tar`
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.
2021-06-19 00:09:49 -07:00
Jordan Sissel 3965a0fd31 Remove childprocess library in the quest to remove ffi.
For #195.
2021-06-19 00:09:49 -07:00
Jordan Sissel 18c5adcd19 Remove the need to invoke mknod using FFI.
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
2021-06-19 00:09:49 -07:00
Jordan Sissel e3b3f9d8e3 Begin replacing ChildProcess with Process.spawn()
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
2021-06-19 00:09:49 -07:00
Jordan Sissel 3e42ff462c Update changelog for changes since v1.12.0. 2021-06-17 20:57:49 -07:00
Jordan Sissel 72a925b048 Ensure an if-then-else doesn't have an empty if block
Issue #1749
2021-06-17 08:30:31 -07:00
Jordan Sissel 2a6facbcce Escape single quotes in file names listed in `%files`
Fixes #1773
2021-06-17 08:21:41 -07:00
Steve Kamerman cc0a4e7369 Fixed Debian platform tag for aarch64/arm64 2021-06-17 07:58:02 -07:00
Zoe O'Connell d69ed14bd8 dir.rst: First example also requires trailing slash 2021-06-17 07:55:22 -07:00
Jordan Sissel d005508e18 Bump version of arr-pm to ensure 0.0.11 is used. That version fixes an issue on Ruby 3.0. #1786 2021-06-17 07:54:38 -07:00
Jordan Sissel 106d7b21e3 Add rexml as dependency
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
2021-06-15 11:53:16 -07:00
Jordan Sissel d50f756d0e Bump version prepare to release. 2021-01-19 15:12:20 -08:00
Andreas Ulm c795ed7ef4 implemented --deb-maintainerscripts-force-errorchecks (#1696)
Switched from always enabling errexit to fpm parameter as result of
discussion in #1696.

Signed-off-by: Andreas Ulm <andreas.ulm@root360.de>
2021-01-19 14:33:01 -08:00
Andreas Ulm feb53faa14 added set -e to debian maintainer scripts #1696
Signed-off-by: Andreas Ulm <andreas.ulm@root360.de>
2021-01-19 14:33:01 -08:00
Vlastimil Holer 292073fc35 deb: Fixes gem pessimistic version constrains for single component versions.
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>
2021-01-19 14:31:27 -08:00
Matt Patterson 073e4e7b74 Pin ffi to 1.12.x, for compatibility with Ruby 2.0
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
2021-01-19 14:22:56 -08:00
Arnar Gauti Ingason cd7e428d9f Prepending pyfpm to PYTHONPATH instead of replacing 2021-01-19 14:16:34 -08:00
Frank Siler 73804ded35 Remove older rubies and add some extra OS tests
This change is cherry-picked from #1717
2021-01-19 13:17:24 -08:00
Chris Hodges 50ca2bfd05 Update virtualenv documentation for Python3
Original `virtualenv-tools` causes issues when building Python3 virtual environments. Previously reported in #1491.
2021-01-19 13:08:17 -08:00
Jose 3db202a52f removed some pritnt statement I added 2021-01-19 13:06:50 -08:00
Jose 9a16e43e4e changed xz for zst 2021-01-19 13:06:50 -08:00
Jose 6735f9df69 intermediate error checking 2021-01-19 13:06:50 -08:00
Jose b2dd4dadb6 syntax error 2021-01-19 13:06:50 -08:00
Jose 922d4c5d4f Copy_entry error prevented pacman from working 2021-01-19 13:06:50 -08:00
Jose ca3477b67b added zstd as standard compressoin 2021-01-19 13:06:50 -08:00
Jose 66a4dea525 added zstd compression, standard for pacman 2021-01-19 13:06:50 -08:00
Jose 6b4b61a3f8 changed backports for backports/latest 2021-01-19 13:06:50 -08:00
Jordan Sissel 90d131b075 Call safesystem() with a list
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
2021-01-19 13:03:27 -08:00
James Logsdon 204fb1b1ff Use head/tail over sed for metadata fetching in sh.erb template 2021-01-19 12:49:18 -08:00
vv-p c9487a30c0 Add trusted-host option for pip 2021-01-19 12:36:59 -08:00
Kenyon Ralph 7d7b184d63 virtualenv.rst: fix heading level
This makes the "Example uses" heading a subsection of the virtualenv section.
2021-01-19 12:21:30 -08:00
Federico Lancerin e05790fa92 Addresses DIR -> DEB error on big directories
Fixes https://github.com/jordansissel/fpm/issues/1739
2021-01-19 12:20:58 -08:00
Cameron Nemo 945ba5b4b0 Update Docker base image to Alpine 3.12
Closes #1534
2021-01-19 12:17:41 -08:00
Jeff Solomon b1e956e071 Add a new --rpm-compression-level option which addresses issue 1675:
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.
2020-03-07 19:54:46 -08:00
Julian Trzeciak 8a40cd1db7 rpm: add option to enable install-time macro expansion in scripts
- spec file sections affected: %pre %post %preun %postun
2020-03-07 19:46:46 -08:00
Jeff Solomon cc7610f434 Issue 1678
fix .deb creation
2020-01-30 12:02:34 -08:00
Avi Miller 304619416b This improves the Oracle Linux install docs by removing the additional
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>
2019-11-19 15:53:29 -08:00
Will H d9ddb21de4 Update outdated "gem install" command
The --no-ri and --no-rdoc switches have now been superseded by --no-document per https://guides.rubygems.org/command-reference/#gem_install
2019-11-19 15:27:41 -08:00
Mike Perham 83b4ad9d65 Use variable instead of hardcoded filename
The code specifies .gz when using non-gzip compression which breaks on recent debian packaging tools. Fixes #1647
2019-11-19 15:27:18 -08:00
c-ameron d7b466787d default to false for deb-systemd starts 2019-03-25 22:15:44 -07:00
c-aamm e066e632ed remove multiple systemd services on uninstall 2019-03-25 22:15:44 -07:00
c-aamm 823b3947fc allow starting of multiple deb systemd services 2019-03-25 22:15:44 -07:00