archrelease: copy trunk to community-any
[ArchLinux/community.git] / ruby-puppet_metadata / trunk / PKGBUILD
blob1d6453005d49162d5920ed99b30880cd7bd0fbe9
1 # Maintainer: Tim Meusel <tim@bastelfreak.de>
3 _gemname='puppet_metadata'
4 pkgname="ruby-${_gemname}"
5 pkgver=1.9.0
6 pkgrel=1
7 pkgdesc='Data structures for the Puppet Metadata'
8 arch=('any')
9 url="https://github.com/voxpupuli/${_gemname}"
10 license=('Apache')
11 depends=('ruby' 'ruby-metadata-json-lint' 'ruby-semantic_puppet')
12 makedepends=('ruby-rdoc' 'ruby-rake' 'ruby-rspec' 'ruby-rspec-its')
13 options=('!emptydirs')
14 source=("${url}/archive/${pkgver}/${_gemname}-${pkgver}.tar.gz")
15 sha512sums=('693e21f2791fe9aa71c61bc1df28986a6e088116e8616595f8e4abb864464c1bf3adea2b40a685b226875961d0a982ddf3444fa3201c94891a38a2627b6f15a8')
17 prepare() {
18   cd "${srcdir}/${_gemname}-${pkgver}"
19   # allow latest dependencies
20   sed --in-place 's|~>|>=|g' "${_gemname}.gemspec"
22   # drop development deps, they only cause dependency issues and aren't required
23   sed --in-place '/add_development_dependency/d' "${_gemname}.gemspec"
26 build() {
27   cd "${srcdir}/${_gemname}-${pkgver}"
28   gem build "${_gemname}.gemspec"
31 check() {
32   cd "${srcdir}/${_gemname}-${pkgver}"
33   rake
36 package() {
37 cd "${srcdir}/${_gemname}-${pkgver}"
38   local _gemdir="$(gem env gemdir)"
39   gem install --verbose --ignore-dependencies --no-user-install --install-dir "${pkgdir}/${_gemdir}" --bindir "${pkgdir}/usr/bin" "${_gemname}-${pkgver}.gem"
41   install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}/"
43   install -Dm 644 README.md HISTORY.md CHANGELOG.md -t "${pkgdir}/usr/share/doc/${pkgname}"
45   rm -rf "${pkgdir}/${_gemdir}/cache"