1
0
mirror of https://github.com/jordansissel/fpm synced 2025-04-29 14:58:00 +02:00
Commit Graph

152 Commits

Author SHA1 Message Date
Jordan Sissel
d9ba0b4545 Remove 'json' gem dependency.
The original `json` gem dependency was added in the original fpm.gemspec
because, at the time, Ruby 1.8.7 was common and required an external
`json` dependency for parsing JSON.

Later, Ruby releases since 1.9.1 have bundled `json`[1].

Therefore, it feels safe to remove this dependency. As a bonus, the
rubygems `json` gem places requirements on the minimum version of Ruby.
At this time, the latest `json` gem requires Ruby >= 2.3.

If the `json` gem dependency is removed, fpm will still retain the
ability to process JSON while lowering the minimum required Ruby version
to Ruby 1.9.x -- It's not perfect, but it's a start! :)

[1] https://docs.ruby-lang.org/en/2.3.0/NEWS-1_9_1.html

The idea for this change change came originally from a discussion
with @edolnx in #1949

Fixes #1741, #1264, #1949
2022-11-02 21:49:17 -07:00
Jordan Sissel
3fcaefb9fd Remove git gem dependency.
Folks are reporting that fpm cannot be installed easily (or at all) on
older systems because a transitive dependency(1) rejects ruby versions
older than 2.6.

(1) rubygem git depends on addressable which depends on public_suffix

Since the `git` dependency is only used in the `gem` source when
using a git repo as a installation source, and that usage seems pretty
simple -- clone a repo, checkout a branch, etc -- it feels safe to
remove this dependency while still keeping the same functionality.

Fixes #1923
2022-10-26 14:48:12 -07:00
Jordan Sissel
92886d922d Restore development_dependency on rake
A prior commit removed `rake` as a development dependency on the
assumption that nothing in fpm's development process actually required
the use of `rake`.

However, I had forgotten about #756 (year 2014) which adds FPM::RakeTask
and some test coverage. FPM::RakeTask was added to allow folks to more
easily invoke FPM from within a Rake task.

At this time, I see no reason to remove FPM::RakeTask. Further, because
`rake` is typically (in my experience) used only in development
environments. Therefore, I believe the right solution is to restore
`rake` as a development_dependency in order to allow the test suite to
pass. For users of FPM::RakeTask, I would assume (hopefully correctly!)
that they already have `rake` installed as a dependency in their own
project, so the `fpm` gem has no need to specify `rake` as a general-use
dependency.

When studying newer versions of Rake, I found:
* Rake v13 requires Ruby 2.2 or newer.
* Rake v12.xx and older are flagged as having security vulnerabilities.

In order to minimize chaos, this commit adds an unversioned dependency
on rake. This is to help fpm service more versions of Ruby and resist
efforts by any dependency to dictate which version of Ruby is used.

This reverts db9db670c39a84dccc92123eed4413bf09d89bc5.

Fixes #1877
2022-02-23 18:04:51 -08:00
Jordan Sissel
db9db670c3 Remove rake development_dependency. I don't think Rake is used for fpm development ;) 2021-11-09 16:34:27 -08: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
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
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
Richard Grainger
1c1ff7dc19 [Fixes #1557] Allow git repo as gem source 2019-03-25 22:13:29 -07:00
Ry Biesemeyer
29c9c13156 relax json dependency
rubies >= 2.5 ship with JSON 2.x, so allowing bundler to resolve to newer
implementations eliminates conflicts with dependency trees that include JSON
2.x.

Breaking changes for JSON 2.x include removed support for older rubies [1],
so specifying in this manner ensures that older rubies can find 1.x, while
newer ones can resolve to 2.x

[1]: https://github.com/flori/json/blob/master/CHANGES.md#2015-09-11-200

Resolves: https://github.com/jordansissel/fpm/issues/1599
2019-02-07 09:37:23 -08:00
harbottle
625ad4bb1b Less strict pinning for childprocess #1592 2019-02-03 14:54:21 -08:00
Jordan Sissel
c1c82a45c4
Pin childprocess 0.9.0 to work around #1592 (#1593) 2019-01-30 10:29:29 -08:00
Marat Sharafutdinov
2ecfc640a2 Fix ruby-xz version 2018-05-21 14:53:42 -07:00
Marc-Andre Lafortune
bfcc2b7d5e Specify minimal required ruby version 2017-12-15 23:53:38 -08:00
Jordan Sissel
100a825796 Version bump for a newer pleaserun 2017-07-28 14:59:15 -07:00
Jordan Sissel
42b7c5acd3 - Version bump.
- This version adds solaris package support. Thanks to Ben Rockwood for
  donating a Joyent Solaris instance so I could work on this.
2017-07-21 10:24:13 -07:00
Elan Ruusamäe
fa31f84058 spec: stud is runtime dependency (#1354) 2017-07-20 13:05:44 -07:00
Diego Martins
488863b321 remove archive-tar-minitar as a dependency (#1355) 2017-06-20 14:33:24 -07:00
Jordan Sissel
051c4db507 Pin archive-tar-minitar to work around https://github.com/halostatue/minitar/issues/23 2017-02-05 01:45:32 -08:00
Jordan Sissel
16401efae9 Version bump to 1.7.0 2016-11-28 15:45:54 -08:00
Jordan Sissel
b0367de0a2 Don't include 'pyc' (python bytecode) files in the fpm gem package. Will prevent #1191 from happening again. 2016-09-15 10:33:28 -07:00
Matt Hoffman
c05bf2b111 prevents json dependency from creeping to version 2.0
json 2.0.1 was published today and requires ruby's version
to be greater than 2.0.
2016-07-01 11:47:13 -04:00
Jordan Sissel
e2b1ca3d04 Update dependency on pleaserun 2016-05-23 14:03:50 -07:00
Jordan Sissel
6881690bfc Work-in-progress adding a pleaserun source for fpm.
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
2016-05-13 20:10:11 -07:00
Paweł Tomulik
74a2ede8c4 workaround rubygems issue #1608 and remove dependency of corefines 2016-05-10 18:24:05 +02:00
Paweł Tomulik
89cb138486 use corefines for backward compatiblity with ruby 1.9.3 2016-04-07 21:57:02 +02:00
Pete Fritchman
cd531449ea initial support for building freebsd/pkgng packages 2016-03-01 15:23:44 -08:00
Jordan Sissel
0829c4e72e Merge pull request #756 from pstengel/feature/rake
Add RakeTask
2015-11-07 12:07:07 -08:00
Elan Ruusamäe
ccfda0d5be rspec tests use .reject
and .reject seems to came from insist 0.0.6
but work with 1.0.0 as well
2015-08-25 15:49:03 +03:00
Paul Stengel
ae112bf56e Refactor for Ruby 1.8.7 and add spec 2015-05-16 15:32:38 -04:00
Jordan Sissel
f1cc07963f Bump arr-pm version for a small bugfix in RPM::File#config_files 2015-04-13 23:00:24 -07:00
Jordan Sissel
d3e72d36f5 Use rspec 3.0.0
Ran transpec on spec/ directory for automatic and delicious upgrades.

Also removed minitest dependency since fpm doesn't use it.
2014-06-19 05:32:11 +00:00
Jordan Sissel
3066626db0 Remove ftw; not used anymore. (#675) 2014-04-22 21:55:01 -07:00
Jordan Sissel
ec44dedca4 Upgrade arr-pm to 0.0.9; fixes a race condition in RPM file reading
This only affected the tests, best I can tell, but would have only
caused problems for using '-s rpm' (rpm input).
2014-02-05 06:53:05 +00:00
Pranay Kanwar
d51ce699e4 Handle copying of special files (pipe, socket, etc.) 2013-08-02 01:41:44 +05:30
Jordan Sissel
a2255aa218 - duplicate license info (#493) 2013-07-17 13:26:12 -07:00
Jordan Sissel
a5cb2286b6 - Add path mapping
Behavior
    * some/file=/some/path
      Result: /some/path
    * some/directory=/some/path
      Result: /some/path/directory/...
- drop dependency on Rush
2013-07-11 22:23:29 -07:00
Tray Torrance
f05a82e47d Allow JSON >= 1.7.7 to be used with FPM 2013-06-21 14:46:07 -07:00
Mike Williams
d0711e61dd Relax dependency on Clamp.
This allows other gems using Clamp to be mixed into the same Gemfile
as fpm.
2013-05-22 10:53:45 +10:00
Jordan Sissel
55bf290333 - relax requirement 2013-05-14 16:01:50 -07:00
Tray Torrance
7ec2739dbd Switch from Open4 to ChildProcess - Fixes #268 2013-05-11 14:42:54 -07:00
Jordan Sissel
695aa90cd4 I use pry a lot. 2013-04-30 17:56:40 -07:00
Jordan Sissel
4f9e459141 - new version of clamp is out, EXCELLENT. 2013-04-30 17:14:51 -07:00
Jordan Sissel
47d50ade00 - add ftw for http fetches 2013-04-30 00:25:25 -07:00
Pranay Kanwar
94e17efbff Add minitest to spec, fix rspec test breakage 2013-03-22 08:44:21 +00:00
Jordan Sissel
a6c8dc80b4 - new arr-pm because ruby 2. 2013-03-20 20:11:22 -07:00
Matt Blair
f5e2c070af remove fpm-npm ref in gemspec so the gem builds. 2013-02-11 08:54:26 -05:00
Ronald Holshausen
f50aae98a5 change the dependancy on json gem from a hard =1.6.6 to a softer >=1.6.6 2013-01-24 15:36:30 +11:00