1 # Maintainer: Tim Meusel <tim@bastelfreak.de>
2 # Contributor: Mario Finelli <mario at finel dot li>
4 _gemname='puppet_forge'
5 pkgname="ruby-${_gemname}"
8 pkgdesc='Ruby client for the Puppet Forge API. Access and manipulate the Puppet Forge API from Ruby.'
10 url='https://github.com/puppetlabs/forge-ruby'
12 makedepends=('ruby-rdoc' 'ruby-bundler')
13 checkdepends=('ruby-rspec')
14 depends=('ruby' 'ruby-faraday' 'ruby-faraday-middleware' 'ruby-semantic_puppet' 'ruby-minitar')
15 source=("${url}/archive/v${pkgver}/${pkgname}-v${pkgver}.tar.gz")
16 options=("!emptydirs")
17 sha512sums=('bf780be153b33cb2df739edd5ac6ac58f44db216e68db9fd511ed5e56c80982738e0ea491127dcadae0d53ec0b10e4de1686dd817608d3733d168e4b8a36306a')
19 # update the gemspec to allow newer versions of rake
20 # remove deprecated options from the gemspec
22 cd "forge-ruby-${pkgver}"
23 sed --in-place 's|~>|>=|g' "${_gemname}.gemspec"
24 # We don't download a git archive, so this won't work
25 sed --in-place 's|spec.files .*|spec.files = `find`.split("\\n")|' "${_gemname}.gemspec"
26 # Allow latest ruby-faraday version
27 sed --in-place 's/spec.add_runtime_dependency "faraday",.*/spec.add_runtime_dependency "faraday"/' "${_gemname}.gemspec"
28 sed --in-place 's/spec.add_runtime_dependency "faraday_middleware",.*/spec.add_runtime_dependency "faraday_middleware"/' "${_gemname}.gemspec"
29 # Drop dev dependencies; they only create package dependency circles
30 sed --in-place '/add_development_dependency/d' "${_gemname}.gemspec"
34 cd "forge-ruby-${pkgver}"
35 gem build "${_gemname}.gemspec"
39 cd "forge-ruby-${pkgver}"
44 cd "forge-ruby-${pkgver}"
45 local _gemdir="$(gem env gemdir)"
46 gem install --verbose --ignore-dependencies --no-user-install --install-dir "${pkgdir}/${_gemdir}" --bindir "${pkgdir}/usr/bin" "${_gemname}-${pkgver}.gem"
48 install -Dm 644 LICENSE.txt -t "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
49 install -Dm 644 README.md CHANGELOG.md -t "${pkgdir}/usr/share/doc/${pkgname}/"
51 rm -rf "${pkgdir}/${_gemdir}/cache"