Date: Tuesday, August 3, 2021 @ 08:39:57 Author: bastelfreak Revision: 993472
add ruby-puppet_forge Added: ruby-puppet_forge/ ruby-puppet_forge/repos/ ruby-puppet_forge/trunk/ ruby-puppet_forge/trunk/PKGBUILD ----------+ PKGBUILD | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) Added: ruby-puppet_forge/trunk/PKGBUILD =================================================================== --- ruby-puppet_forge/trunk/PKGBUILD (rev 0) +++ ruby-puppet_forge/trunk/PKGBUILD 2021-08-03 08:39:57 UTC (rev 993472) @@ -0,0 +1,54 @@ +# Maintainer: Tim Meusel <t...@bastelfreak.de> +# Contributor: Mario Finelli <mario at finel dot li> + +_gemname='puppet_forge' +pkgname="ruby-${_gemname}" +pkgver=3.0.0 +pkgrel=1 +pkgdesc='Ruby client for the Puppet Forge API. Access and manipulate the Puppet Forge API from Ruby.' +arch=('any') +url='https://github.com/puppetlabs/forge-ruby' +license=('Apache') +makedepends=('ruby-rdoc' 'ruby-bundler') +checkdepends=('ruby-rspec') +depends=('ruby' 'ruby-faraday' 'ruby-faraday-middleware' 'ruby-gettext-setup' 'ruby-semantic_puppet' 'ruby-minitar') +source=("${url}/archive/v${pkgver}/${pkgname}-v${pkgver}.tar.gz") +options=("!emptydirs") +sha512sums=('4aac58abdec5883c17cbf36a42a5317219693463325132da657efd267bd3f42fe8535cdc6a9ab07ff77410a5052c55cbf7d53b4341dda476c7a443afaa5d6f27') + +# update the gemspec to allow newer versions of rake +# remove deprecated options from the gemspec +prepare() { + cd "forge-ruby-${pkgver}" + sed --in-place 's|~>|>=|g' "${_gemname}.gemspec" + # We don't download a git archive, so this won't work + sed --in-place 's|spec.files .*|spec.files = `find`.split("\\n")|' "${_gemname}.gemspec" + # Allow latest ruby-faraday version + sed --in-place 's/spec.add_runtime_dependency "faraday",.*/spec.add_runtime_dependency "faraday"/' "${_gemname}.gemspec" + sed --in-place 's/spec.add_runtime_dependency "faraday_middleware",.*/spec.add_runtime_dependency "faraday_middleware"/' "${_gemname}.gemspec" + # Drop dev dependencies; they only create package dependency circles + sed --in-place '/add_development_dependency/d' "${_gemname}.gemspec" +} + +build() { + cd "forge-ruby-${pkgver}" + gem build "${_gemname}.gemspec" +} + +check() { + cd "forge-ruby-${pkgver}" + rspec +} + +package() { + cd "forge-ruby-${pkgver}" + local _gemdir="$(gem env gemdir)" + gem install --verbose --ignore-dependencies --no-user-install --install-dir "${pkgdir}/${_gemdir}" --bindir "${pkgdir}/usr/bin" "${_gemname}-${pkgver}.gem" + + install -Dm 644 LICENSE.txt -t "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" + install -Dm 644 README.md CHANGELOG.md -t "${pkgdir}/usr/share/doc/${pkgname}/" + + rm -rf "${pkgdir}/${_gemdir}/cache" +} + +# vim: ts=2 sw=2 et: