archrelease: copy trunk to community-any
[ArchLinux/community.git] / ruby-hocon / trunk / PKGBUILD
blob0d35eab38cab289dd8ba659f1882fe16cd2d5640
1 # Maintainer: Tim Meusel <tim@bastelfreak.de>
2 # Contributor: Christian Rebischke <chris.rebischke@archlinux.org>
4 _gemname='hocon'
5 pkgname="ruby-${_gemname}"
6 pkgver=1.3.1
7 pkgrel=4
8 pkgdesc='Ruby support for the HOCON configuration file format'
9 arch=('any')
10 url='https://github.com/puppetlabs/ruby-hocon'
11 license=('Apache')
12 depends=('ruby')
13 makedepends=('ruby-rdoc')
14 checkdepends=('ruby-rspec')
15 source=("${url}/archive/${pkgver}/${pkgname}-${pkgver}.tar.gz")
16 options=("!emptydirs")
17 sha512sums=('c73cfd8d6c77751d1d2a35d85cad2f2eef700a01e8b8de9449c0c9dfefe8d4a80c4a79dd3db8ee4a6d2c3649f26d6780cbe05fe9b067de05ee3711b00faf4255')
19 prepare() {
20   cd "${srcdir}/${pkgname}-${pkgver}"
22   # update the gemspec to allow newer versions of rake
23   sed --in-place 's|~>|>=|g' "${_gemname}.gemspec"
25   # fix wrong license name in gemspec
26   sed --in-place 's/Apache License, v2/Apache-2.0/' "${_gemname}.gemspec"
29 build() {
30   cd "${srcdir}/${pkgname}-${pkgver}"
31   gem build "${_gemname}.gemspec"
34 check() {
35   cd "${srcdir}/${pkgname}-${pkgver}"
36   rspec spec
39 package() {
40   cd "${srcdir}/${pkgname}-${pkgver}"
41   local _gemdir="$(gem env gemdir)"
42   gem install --verbose --ignore-dependencies --no-user-install --install-dir "${pkgdir}/${_gemdir}" --bindir "${pkgdir}/usr/bin" "${_gemname}-${pkgver}.gem"
44   install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}/"
45   install -Dm 644 CHANGELOG.md HISTORY.md README.md -t "${pkgdir}/usr/share/doc/${pkgname}"
47   rm -rf "${pkgdir}/${_gemdir}/cache"
50 # vim: ts=2 sw=2 et: