bernd / fpm-cookery

A tool for building software packages with fpm.
Other
460 stars 88 forks source link

Import additional facts? #98

Closed dialt0ne closed 9 years ago

dialt0ne commented 9 years ago

Would it be possible to have "operatingsystemmajrelease" available as a fact - maybe "osmajor"?

Some rpm names changed between CentOS 6 and 7 - specifically db4 vs. libdb4. Also systemd vs. upstart, etc. etc.

bernd commented 9 years ago

I just added osrelease and osmajorrelease facts. Will be in the next fpm-cookery release.

Hope that helps! :smiley:

bernd commented 9 years ago

I just release a new version to rubygems.

bborysenko commented 8 years ago

@bernd, could you please provide some example of how to use osmajorrelease with recipe DSL?

bborysenko commented 8 years ago

For the moment, I do something like that but not sure that this is right way

  platforms [:redhat, :centos] do
    case FPM::Cookery::Facts.osmajorrelease
      when '5', '6'
        depends   'shadow-utils', 'initscripts','chkconfig', 'openssl'
      when '7'
        depends   'shadow-utils', 'systemd', 'chkconfig', 'openssl-devel'
    end
    build_depends   'openssl-devel'
  end

Thanks in advance

bernd commented 8 years ago

@bborysenko That's how I use it! :smile: