Last active
January 2, 2016 10:28
-
-
Save Sharpie/8289867 to your computer and use it in GitHub Desktop.
Use fpm-cookery to build packages with UTF-8 descriptions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'https://rubygems.org' | |
gem 'fpm' | |
gem 'fpm-cookery' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task :default => :build | |
directory 'bin' | |
file 'bin/fpm-cook' do | |
Kernel.system 'bundle', 'install', '--binstubs', '--path=vendor' | |
end | |
task :build => 'bin/fpm-cook' do | |
Kernel.system 'bin/fpm-cook', 'package', '-t', 'deb', 'recipe.rb' | |
Kernel.system 'bin/fpm-cook', 'package', '-t', 'rpm', 'recipe.rb' | |
puts 'Packages built. Results are in the pkg directory' | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: UTF-8 | |
class MoreCowbell < FPM::Cookery::Recipe | |
source '', :with => :noop | |
name 'more-cowbell' | |
license 'MIT' | |
version '1.0.0' | |
revision 0 | |
arch 'noarch' | |
description 'Apologies to Blue Öyster Cult.' | |
def build | |
File.open(workdir('more_cowbell'), 'w') do |f| | |
f.write <<-EOF | |
#!/bin/bash | |
echo "This node NEEDS more cowbell!" | |
EOF | |
end | |
`chmod +x #{workdir('more_cowbell')}` | |
end | |
def install | |
destdir('bin').install workdir('more_cowbell') | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment