archrelease: copy trunk to community-any
[ArchLinux/community.git] / ruby-optimist / trunk / PKGBUILD
blob693ec22a04e6f87159f96f79acc802338cc6c961
1 # Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
3 _gemname=optimist
4 pkgname=ruby-${_gemname}
5 pkgver=3.0.1
6 pkgrel=2
7 pkgdesc='Commandline option parser for Ruby that just gets out of your way'
8 url='https://github.com/ManageIQ/optimist'
9 arch=('any')
10 license=('MIT')
11 depends=('ruby')
12 makedepends=('ruby-rdoc' 'ruby-rake' 'ruby-bundler')
13 checkdepends=('ruby-minitest' 'ruby-chronic')
14 options=('!emptydirs')
15 source=(https://github.com/ManageIQ/optimist/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz)
16 sha512sums=('bb91d7bfde9fa58de0c0050ec7edd3d5e4f19ffe07339b1562aa31af96b98d6b60644f727ba9f49489b520b135d473f1d99fc7fffa96d4dc9b50b1103c778ef5')
17 b2sums=('91510cfca18ddc3c64d5ab0666374e9eaa033e350dd34a8e63fd375f0e1641e496a48746558ad4b0417965b0208ca9f555befcd7adc848910a13f0e98cfae6c8')
19 prepare() {
20   cd ${_gemname}-${pkgver}
21   sed -r 's|~>|>=|g' -i ${_gemname}.gemspec
22   sed 's|git ls-files -z|find -print0|' -i ${_gemname}.gemspec
25 build() {
26   cd ${_gemname}-${pkgver}
27   gem build ${_gemname}.gemspec
30 check() {
31   cd ${_gemname}-${pkgver}
32   rake test
35 package() {
36   cd ${_gemname}-${pkgver}
37   local _gemdir="$(gem env gemdir)"
38   gem install --ignore-dependencies --no-user-install -i "${pkgdir}${_gemdir}" \
39     -n "${pkgdir}/usr/bin" ${_gemname}-${pkgver}.gem
40   install -Dm 644 README.md History.txt -t "${pkgdir}/usr/share/doc/${pkgname}"
41   install -Dm 644 README.md -t "${pkgdir}/usr/share/licenses/${pkgname}"
43   cd "${pkgdir}/${_gemdir}"
44   rm "${pkgdir}/${_gemdir}/cache/${_gemname}-${pkgver}.gem"
45   rm -r "${pkgdir}/${_gemdir}/gems/${_gemname}-${pkgver}/test"
48 # vim: ts=2 sw=2 et: