1 # Maintainer: Andreas 'Segaja' Schleifer <segaja at archlinux dot org>
4 pkgname="ruby-${_gemname}"
7 pkgdesc='Support for encoding and decoding binary data using a Base64 representation'
9 url="https://github.com/ruby/${_gemname}"
10 license=('BSD' 'RUBY')
12 checkdepends=('ruby-rake')
13 options=('!emptydirs')
14 source=("${url}/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz")
15 sha512sums=('3ac6dac47deba30002fb19e369fac50c1c3838c7ed8545eff462b7c6402f731d9dd1951f56bb1b2a31bec324c8a28ef94599650129f66bae72dccc72707ff7af')
16 b2sums=('c995292e1abd1e9c28db0cf4c6dbdf9b388062bc4f618c6fcf9404faa6516f5e9689965f63edbd44ca91d4c938be72293b3ad3aad87bed8be0c7a5f064cc83fd')
19 cd "${_gemname}-${pkgver}"
21 # update gemspec/Gemfile to allow newer version of the dependencies
22 sed --in-place --regexp-extended 's|~>|>=|g' "${_gemname}.gemspec"
26 cd "${_gemname}-${pkgver}"
28 local _gemdir="$(gem env gemdir)"
29 local _platform="$(gem env platform | cut -d':' -f2)"
30 local _extension_api_version="$(ruby -e 'puts Gem.extension_api_version')"
32 install --verbose --directory --mode=0755 \
33 "tmp_install_default/gemspec/specifications/gems/${_gemname}-${pkgver}" \
34 "tmp_install/usr/lib/ruby/${_extension_api_version}/${_platform}" \
35 "tmp_install${_gemdir}/specifications/default"
37 gem build "${_gemname}.gemspec"
42 --ignore-dependencies \
44 --install-dir "tmp_install/${_gemdir}" \
45 --bindir "tmp_install/usr/bin" \
46 "${_gemname}-${pkgver}.gem"
52 --ignore-dependencies \
54 --install-dir "tmp_install_default/gemspec" \
55 --bindir "tmp_install_default/usr/bin" \
56 "${_gemname}-${pkgver}.gem"
58 mv --verbose "tmp_install_default/gemspec/specifications/default/${_gemname}-${pkgver}.gemspec" "tmp_install${_gemdir}/specifications/default/${_gemname}-${pkgver}.gemspec"
59 mv --verbose "tmp_install${_gemdir}/gems/${_gemname}-${pkgver}/lib/${_gemname}.rb" "tmp_install/usr/lib/ruby/${_extension_api_version}/${_gemname}.rb"
61 # remove unrepreducible files
62 rm --force --recursive --verbose \
63 "tmp_install${_gemdir}/cache/" \
64 "tmp_install${_gemdir}/build_info/" \
65 "tmp_install${_gemdir}/extensions/" \
66 "tmp_install${_gemdir}/gems/" \
67 "tmp_install${_gemdir}/plugins/" \
68 "tmp_install${_gemdir}/specifications/${_gemname}-${pkgver}.gemspec" \
69 "tmp_install${_gemdir}/doc/${_gemname}-${pkgver}/ri/ext/"
73 cd "${_gemname}-${pkgver}"
75 local _gemdir="$(gem env gemdir)"
77 GEM_HOME="tmp_install/${_gemdir}" rake test
81 cd "${_gemname}-${pkgver}"
83 cp --archive --verbose tmp_install/* "${pkgdir}"
85 install --verbose -D --mode=0644 LICENSE.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
86 install --verbose -D --mode=0644 *.md --target-directory "${pkgdir}/usr/share/doc/${pkgname}"
89 # vim: tabstop=2 shiftwidth=2 expandtab: