Long term, we'll probably have a "smart" post-install that will choose
the correct service (systemd, etc) to install based on the platform
doing the installation, not the platform creating the package :)
Adds dependencies on pleaserun and upgrades clamp to suit.
Example using the defaults in pleaserun:
# Create a package called 'example-service' that installs a service named 'example'
% bin/fpm -s pleaserun -t rpm -n example-service --pleaserun-name example =logger hello world
No platform selected. Autodetecting... {:platform=>"systemd", :version=>"default", :level=>:warn}
Writing file {:destination=>"/tmp/package-pleaserun-staging20160513-12576-1ozurnf/lib/systemd/system/example.service"}
Writing install actions. You will want to run this script to properly activate your service on the target host {:path=>"/tmp/package-pleaserun-staging20160513-12576-1ozurnf/install_actions.sh"}
Created package {:path=>"example-service-1.0-1.x86_64.rpm"}
# ^^ The above service will execute "logger hello world"
# What's in our rpm?
% rpm -qlp example-service-1.0-1.x86_64.rpm
/lib/systemd/system/example.service
# What about any post-install steps?
% rpm -qp example-service-1.0-1.x86_64.rpm --scripts
postinstall scriptlet (using /bin/sh):
systemctl --system daemon-reload
# Install it.
% sudo rpm -ivh example-service-1.0-1.x86_64.rpm
# Start it.
% sudo systemctl start example
# Check the logs!
% sudo tail -n1 /var/log/messages
May 13 03:32:55 localhost root: hello world
Example choosing 'sysv' as the platform:
% bin/fpm -s pleaserun -t rpm -n example-service --pleaserun-platform sysv --pleaserun-name example =logger hello world
Writing file
{:destination=>"/tmp/package-pleaserun-staging20160513-13675-xae6xd/etc/init.d/example"}
Writing file
{:destination=>"/tmp/package-pleaserun-staging20160513-13675-xae6xd/etc/default/example"}
Created package {:path=>"example-service-1.0-1.x86_64.rpm"}
% rpm -qlp example-service-1.0-1.x86_64.rpm
/etc/default/example
/etc/init.d/example
r/tZjUvfFQyPo32u2OazeNrIGhKmi8Gk8CLrvJj9XOB7ulKXs/gi4mptwR4+kX9h
eo53lTrOP4IRuBzEm71l+AzPrg55G5ACJULg61KXJI7PK/93bDj0SDOO/h/SLCKL
wrrpZkyA1nw5t7n0j7Dbp6jw9kaTZcLxiyGc0UPdug6F6FlNF0YT5fc4sKmZz3/x
rreaL0wEyjUlEXBe+yxjSYpybusx8huQ8TkvDCsTzgNzKFH9a0zoCc2ERXhU2UIn
6W6w/0W+dBz1nmwC3TExBGpMFTyx2rzmFGQjsUsanXD/5IxLzYc7fqsrQ4nuvv8=
=iw78
-----END PGP SIGNATURE-----
Rake task should not exit if successful
Exiting after fpm success means that further rake tasks fail to execute,
and Rake simply exits. Instead, only abort if the fpm exits non-zero
ig0GxqsSuCj6tSzaXEaL6D0kDqqfilydBKDJ5R/eycf1Vd6U1l1ttR7Gsuhl5KSm
SID7LuRO+DkfNXayH7LApq+++kx8d4ucuL5trcWISdtbOLc71Ppvf4Rv2X61xQpv
A1TbJGks2yiUfDrm7XLJtIOClRAbE18K2VdJ/f891P5rwPdLcfAfJgbb9lxqcJHo
vsoYxIef+hIsgczQr+WnAQQVRCpSNy6LAox706uk8BBjeGLpkardZnhlGiUnQ/t1
UWOzWm3prHO2O7nhCcQDjfBQj/d3m9XtR0Knv5fnyEUJrAYgpDUbTeGQ0R5iIoo=
=WpBr
-----END PGP SIGNATURE-----
Add fpm namespace require for rake task
The rake task class needs to require the fpm namespace in order
to be included elsewhere.