fpm/fpm.gemspec

70 lines
2.2 KiB
Ruby
Raw Permalink Normal View History

require File.join(File.dirname(__FILE__), "lib/fpm/version")
2011-01-04 09:25:06 +08:00
Gem::Specification.new do |spec|
files = []
dirs = %w{lib bin templates}
2011-01-04 09:25:06 +08:00
dirs.each do |dir|
files += Dir["#{dir}/**/*"]
end
files << "LICENSE"
files << "CONTRIBUTORS"
2016-11-29 07:45:54 +08:00
files << "CHANGELOG.rst"
files = files.reject { |path| path =~ /\.pyc$/ }
2011-01-04 09:25:06 +08:00
spec.name = "fpm"
spec.version = FPM::VERSION
2011-01-04 09:25:06 +08:00
spec.summary = "fpm - package building and mangling"
2012-03-04 09:50:17 +08:00
spec.description = "Convert directories, rpms, python eggs, rubygems, and " \
"more to rpms, debs, solaris packages and more. Win at package " \
"management without wasting pointless hours debugging bad rpm specs!"
2013-07-18 04:26:12 +08:00
spec.license = "MIT-like"
2017-12-16 11:48:35 +08:00
spec.required_ruby_version = '>= 1.9.3'
# For parsing JSON (required for some Python support, etc)
# http://flori.github.com/json/doc/index.html
spec.add_dependency("json", ">= 1.7.7", "< 3.0") # license: Ruby License
# For logging
# https://github.com/jordansissel/ruby-cabin
spec.add_dependency("cabin", ">= 0.6.0") # license: Apache 2
# For backports to older rubies
# https://github.com/marcandre/backports
2013-05-09 00:29:00 +08:00
spec.add_dependency("backports", ">= 2.6.2") # license: MIT
# For reading and writing rpms
spec.add_dependency("arr-pm", "~> 0.0.11") # license: Apache 2
2012-03-10 03:24:31 +08:00
# For command-line flag support
# https://github.com/mdub/clamp/blob/master/README.markdown
Work-in-progress adding a pleaserun source for fpm. 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
2016-05-13 18:27:26 +08:00
spec.add_dependency("clamp", "~> 1.0.0") # license: MIT
2012-03-10 03:24:31 +08:00
# For sourcing from pleaserun
2017-07-29 05:59:15 +08:00
spec.add_dependency("pleaserun", "~> 0.0.29") # license: Apache 2
Work-in-progress adding a pleaserun source for fpm. 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
2016-05-13 18:27:26 +08:00
# For sourcing from git repos
spec.add_dependency("git", ">= 1.3.0", "< 2.0") # license: MIT
spec.add_dependency("stud")
# In Ruby 3.0, rexml was moved to a bundled gem instead of a default one,
# so I think this needs to be added explicitly?
spec.add_dependency("rexml")
spec.add_development_dependency("rspec", "~> 3.0.0") # license: MIT (according to wikipedia)
spec.add_development_dependency("insist", "~> 1.0.0") # license: Apache 2
2013-05-01 08:56:40 +08:00
spec.add_development_dependency("pry")
2012-03-08 16:03:04 +08:00
2011-01-04 09:25:06 +08:00
spec.files = files
spec.require_paths << "lib"
spec.bindir = "bin"
spec.executables << "fpm"
spec.author = "Jordan Sissel"
spec.email = "jls@semicomplete.com"
spec.homepage = "https://github.com/jordansissel/fpm"
end