Created
January 19, 2015 09:03
-
-
Save ruckuus/72d80474f0cdee48b922 to your computer and use it in GitHub Desktop.
Build RPM from rpm.yml
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
#!/usr/bin/env ruby | |
require 'fileutils' | |
require 'yaml' | |
m = YAML.load_file('rpm.yml') | |
m.each do |appname, data| | |
data.each do |d| | |
name = d["name"] | |
version = d["version"] | |
iteration = d["build"] | |
source = d["src"] | |
install_dir = d["dest"] | |
install_script = d["install_script"] | |
remove_script = d["remove_script"] | |
rpm_dir = "rpms" | |
description = d["description"] | |
FileUtils.mkdir_p(rpm_dir) | |
# Execute FPM | |
`fpm --verbose --rpm-os linux \ | |
-s dir -t rpm -C #{source} \ | |
--name #{name} --version #{version} --iteration #{iteration} \ | |
--prefix #{install_dir} \ | |
--after-install #{install_script} \ | |
--after-remove #{remove_script} \ | |
--description \"#{description}\" .` | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment