bernd / fpm-cookery

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

Possibility to define pre/post-(un)install scripts #152

Closed brejoc closed 8 years ago

brejoc commented 8 years ago

Is there a possibility to define pre/post-(un)install scripts? With fpm itself this is possible, but I haven't found an option in fpm-cookery.

beddari commented 8 years ago

Yes, fpm will pick up the files if you put them in buliddir. This is an (abandoned) project that has some example code for how it works https://github.com/andytinycat/puppet-omnibus/blob/master/puppet.rb#L47-L50

Look at the methods at the end for how the files are written.

brejoc commented 8 years ago

So there only needs to be a file named post-install (or pre-uninstall, post-uninstall, pre-install) in the build-dir?

beddari commented 8 years ago

Yep, that should basically be all that is needed.

bernd commented 8 years ago

This already works. See the haproxy recipe for an example.