archrelease: copy trunk to community-any
[ArchLinux/community.git] / ruby-puppet_forge / trunk / PKGBUILD
blob3c0934ef5c395a504443f2dc5d10e86de97701ef
1 # Maintainer: Tim Meusel <tim@bastelfreak.de>
2 # Contributor: Mario Finelli <mario at finel dot li>
4 _gemname='puppet_forge'
5 pkgname="ruby-${_gemname}"
6 pkgver=3.2.0
7 pkgrel=1
8 pkgdesc='Ruby client for the Puppet Forge API. Access and manipulate the Puppet Forge API from Ruby.'
9 arch=('any')
10 url='https://github.com/puppetlabs/forge-ruby'
11 license=('Apache')
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
21 prepare() {
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"
33 build() {
34   cd "forge-ruby-${pkgver}"
35   gem build "${_gemname}.gemspec"
38 check() {
39   cd "forge-ruby-${pkgver}"
40   rspec
43 package() {
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"
54 # vim: ts=2 sw=2 et: