Closed aussielunix closed 8 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
@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
@aussielunix That's because I did not write any documentation yet... :disappointed:
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.
I've created a recipes example wiki page and added the Facts.platform helper method. https://github.com/bernd/fpm-cookery/wiki/Recipe-Examples
@joshuatobin Awesome, thank you! :+1:
@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 ?