bernd / fpm-recipes

My collection of fpm-cookery recipes.
145 stars 44 forks source link

graylog2-server - how to handle ubuntu vs debian packages ? #20

Closed aussielunix closed 8 years ago

aussielunix commented 11 years ago

@joschi @smarchive Thanks for the contributions to graylog2 packaging. When packaging up Graylog2 I have stuck to a few rough guidelines.

I have normally kept a pre.rb in here too for building pre/rc packages.

You happy if I push a couple of changes to the graylog2-server recipe that removes some of your changes to bring the DEBs back to the rough guidelines mentioned above ?

Your Debian specific changes can be add back in but I am not sure how to approach this just yet. Any ideas welcome. @bernd ?

bernd commented 11 years ago

You could use FPM::Cookery::Facts.platform to execute OS specific actions in the install and build methods.

def install
  case Facts.platform
  when :ubuntu
    etc('init').install_p workdir('graylog2-server.upstart'), 'graylog2-server.conf'  
  when :debian
    etc('init.d').install_p workdir('graylog2-server.initd'), 'graylog2-server'
    etc('default').install_p workdir('graylog2-server.confd'), 'graylog2-server'
  end
end
aussielunix commented 11 years ago

@bernd This is awesome. I totally missed this featured was available. Thanks. I shall do some refactoring and push new recipe tomorrow night @joschi @smarchive

bernd commented 11 years ago

@aussielunix That's because I did not write any documentation yet... :disappointed:

joschi commented 11 years ago

Cool, thanks for taking care of this!

There are also "native" package specs for graylog2-server and graylog2-web which are working quite well. Maybe it would make sense to share some files (like Upstart or init scripts, example configurations, dependencies) with them.

joshuatobin commented 11 years ago

I've created a recipes example wiki page and added the Facts.platform helper method. https://github.com/bernd/fpm-cookery/wiki/Recipe-Examples

bernd commented 11 years ago

@joshuatobin Awesome, thank you! :+1: