New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add FreeBSD support #1073

Merged
merged 8 commits into from Mar 2, 2016

Conversation

Projects
None yet
6 participants
@amdprophet
Contributor

amdprophet commented Mar 1, 2016

Based on PR #870.

This PR backports symlink capabilities from TarWriter which eliminates the need to rely on the minitar gem. I'm not sure if there's a better place for the backported code to exist but this code appears to be functional.

This PR also implements checksums using SHA256 instead of SHA1 (as per the pkg spec) and now supports pre/post install/rm scripts.

@amdprophet amdprophet force-pushed the amdprophet:add_freebsd branch from eb1a5dc to 3397e8b Mar 1, 2016

@jordansissel

This comment has been minimized.

Owner

jordansissel commented Mar 2, 2016

I don't have any freebsd boxes, but this seems OK to me. I'm content to let the community play with it sooner than later. <3

@jordansissel

This comment has been minimized.

Owner

jordansissel commented Mar 2, 2016

@amdprophet you want this merged now? or do you need more feedback?

@amdprophet

This comment has been minimized.

Contributor

amdprophet commented Mar 2, 2016

@jordansissel merge away :)

On Wed, Mar 2, 2016, 7:13 AM Jordan Sissel notifications@github.com wrote:

@amdprophet https://github.com/amdprophet you want this merged now? or
do you need more feedback?


Reply to this email directly or view it on GitHub
#1073 (comment).

jordansissel added a commit that referenced this pull request Mar 2, 2016

@jordansissel jordansissel merged commit b405bae into jordansissel:master Mar 2, 2016

@amdprophet amdprophet deleted the amdprophet:add_freebsd branch Mar 2, 2016

@dch

This comment has been minimized.

dch commented Mar 2, 2016

Thanks so much for this! @jordansissel is it possible to tag a release of fpm soon? This would be a good reason to add fpm itself to FreeBSD ports tree, and get cracking on using this.

@jordansissel

This comment has been minimized.

Owner

jordansissel commented Mar 2, 2016

@dch That's on my todo list, however, I am reluctant to release a new version of fpm with tests failing, and some tests are currently failing :\

Maybe I can do a release with a caveat that some tests are failing and hope for the best?

@dch

This comment has been minimized.

dch commented Mar 4, 2016

OK that makes sense. How about I look at porting this using a git sha reference, that will be enough to start with.

@jordansissel

This comment has been minimized.

Owner

jordansissel commented Mar 8, 2016

This PR uses refinements which are not available on Ruby 1.9.x or older. Before fpm gets a new release, this probably needs to get fixed, maybe.

@jordansissel

This comment has been minimized.

Owner

jordansissel commented Mar 8, 2016

I will try doing a release that requires Ruby 2.0.0 (available for 3 years now) and see how people react.

@shaddi

This comment has been minimized.

shaddi commented Mar 8, 2016

Convenient timing! I just cloned the fpm repo and ran into an issue (on Ubuntu 14.04, the last LTS release) with this.

shasan@mcgrupp:~/playpen/fpm$ make
rm -rf .yardoc
sh notify-failure.sh rspec
/home/shasan/playpen/fpm_tests/fpm/lib/fpm/package/freebsd.rb:139:in `<module:TarWriterAddSymlink>': undefined method `refine' for TarWriterAddSymlink:Module (NoMethodError)
    from /home/shasan/playpen/fpm_tests/fpm/lib/fpm/package/freebsd.rb:138:in `<top (required)>'
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /var/lib/gems/1.9.1/gems/backports-3.6.8/lib/backports/std_lib.rb:9:in `require_with_backports'
    from /home/shasan/playpen/fpm_tests/fpm/lib/fpm.rb:19:in `<top (required)>'
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /home/shasan/playpen/fpm_tests/fpm/spec/fpm/command_spec.rb:3:in `<top (required)>'
    from /var/lib/gems/1.9.1/gems/rspec-core-3.0.4/lib/rspec/core/configuration.rb:1058:in `load'
    from /var/lib/gems/1.9.1/gems/rspec-core-3.0.4/lib/rspec/core/configuration.rb:1058:in `block in load_spec_files'
    from /var/lib/gems/1.9.1/gems/rspec-core-3.0.4/lib/rspec/core/configuration.rb:1058:in `each'
    from /var/lib/gems/1.9.1/gems/rspec-core-3.0.4/lib/rspec/core/configuration.rb:1058:in `load_spec_files'
    from /var/lib/gems/1.9.1/gems/rspec-core-3.0.4/lib/rspec/core/runner.rb:97:in `setup'
    from /var/lib/gems/1.9.1/gems/rspec-core-3.0.4/lib/rspec/core/runner.rb:85:in `run'
    from /var/lib/gems/1.9.1/gems/rspec-core-3.0.4/lib/rspec/core/runner.rb:70:in `run'
    from /var/lib/gems/1.9.1/gems/rspec-core-3.0.4/lib/rspec/core/runner.rb:38:in `invoke'
    from /var/lib/gems/1.9.1/gems/rspec-core-3.0.4/exe/rspec:4:in `<top (required)>'
    from /usr/local/bin/rspec:23:in `load'
    from /usr/local/bin/rspec:23:in `<main>'
make: *** [test] Error 1

This is after a git clone of the repo then a bundle install from the top level as described in the README. I realized after digging into this a bit (totally new to Ruby) that 'refine' was introduced in ruby 2.0, and the ruby version shipped in 14.04 LTS is ruby 1.9.3. While there is a ruby2.0 package available in the Ubuntu repos, it doesn't set itself up as the default interpreter for ruby on the system. Unfortunately, it looks like the Ubuntu team isn't planning to fix this issue (https://bugs.launchpad.net/ubuntu/+source/ruby2.0/+bug/1310292), so LTS users are stuck with ruby 1.9.3 unless they manually fix the symlinks.

Anyway, this isn't really an fpm issue, it's an Ubuntu one, and I'm fully supportive in general of using language features that have been around for 3+ years. Just consider this one reaction to a release that will require ruby 2.0.0. :-)

@jordansissel

This comment has been minimized.

Owner

jordansissel commented Mar 8, 2016

@shaddi hah, nice timing ;)

I'll open a separate ticket for tracking Ruby 1.9 issues.

@jordansissel

This comment has been minimized.

Owner

jordansissel commented Mar 8, 2016

@shaddi opened #1075 for this.

@shaddi

This comment has been minimized.

shaddi commented Mar 8, 2016

Awesome, thanks!

@samriang

This comment has been minimized.

samriang commented Mar 15, 2016

@shaddi I'm stuck with this issue too. Did you solve it on Ubuntu 14 lts?

@shaddi

This comment has been minimized.

shaddi commented Mar 16, 2016

Nope, I just rolled back to before this was merged. Our org is probably going to move to 16.04LTS going forward, so hopefully this is not an issue there.

@ptomulik

This comment has been minimized.

Contributor

ptomulik commented Apr 11, 2016

I've proposed "corefines" to fix this issue, see #1088 and/or #1087.

jordansissel added a commit that referenced this pull request Jun 20, 2016

@ccoupe ccoupe referenced this pull request Sep 8, 2017

Open

Update or clone for freebsd #2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment