1 # Maintainer: Andreas 'Segaja' Schleifer <segaja at archlinux dot org>
4 pkgname="ruby-${_gemname}"
7 pkgdesc='Calculates a set of unique abbreviations for a given set of strings'
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=('075b6b32618c58e7af199c00f8753e7efe035ff949ef39cc0fc685166d266fdafe1077520c5e6346e53fd0a09b8c6e3541e5ddd4b3df52ea86fdb7e8d0a8287a')
16 b2sums=('07ab99497aa7414af034aff67f1d6e625c3e7ec1a927670b0e938284102ccea9efb48df33b55ee5746437006e64e60c23ed79b095571560e5860396644d37eeb')
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"
24 # we build based on a tar archive, not a git repo
25 sed --in-place --regexp-extended 's|git ls-files -z|find . -type f -not -path "*/\.git/*" -printf "%P\\\\0"|' "${_gemname}.gemspec"
29 cd "${_gemname}-${pkgver}"
31 local _gemdir="$(gem env gemdir)"
32 local _platform="$(gem env platform | cut -d':' -f2)"
33 local _extension_api_version="$(ruby -e 'puts Gem.extension_api_version')"
35 install --verbose --directory --mode=0755 \
36 "tmp_install_default/gemspec/specifications/gems/${_gemname}-${pkgver}" \
37 "tmp_install/usr/lib/ruby/${_extension_api_version}/${_platform}" \
38 "tmp_install${_gemdir}/specifications/default"
40 gem build "${_gemname}.gemspec"
45 --ignore-dependencies \
47 --install-dir "tmp_install/${_gemdir}" \
48 --bindir "tmp_install/usr/bin" \
49 "${_gemname}-${pkgver}.gem"
55 --ignore-dependencies \
57 --install-dir "tmp_install_default/gemspec" \
58 --bindir "tmp_install_default/usr/bin" \
59 "${_gemname}-${pkgver}.gem"
61 mv --verbose "tmp_install_default/gemspec/specifications/default/${_gemname}-${pkgver}.gemspec" "tmp_install${_gemdir}/specifications/default/${_gemname}-${pkgver}.gemspec"
62 mv --verbose "tmp_install${_gemdir}/gems/${_gemname}-${pkgver}/lib/${_gemname}.rb" "tmp_install/usr/lib/ruby/${_extension_api_version}/${_gemname}.rb"
64 # remove unrepreducible files
65 rm --force --recursive --verbose \
66 "tmp_install${_gemdir}/cache/" \
67 "tmp_install${_gemdir}/build_info/" \
68 "tmp_install${_gemdir}/extensions/" \
69 "tmp_install${_gemdir}/gems/" \
70 "tmp_install${_gemdir}/plugins/" \
71 "tmp_install${_gemdir}/specifications/${_gemname}-${pkgver}.gemspec" \
72 "tmp_install${_gemdir}/doc/${_gemname}-${pkgver}/ri/ext/"
76 cd "${_gemname}-${pkgver}"
78 local _gemdir="$(gem env gemdir)"
80 GEM_HOME="tmp_install/${_gemdir}" rake test
84 cd "${_gemname}-${pkgver}"
86 cp --archive --verbose tmp_install/* "${pkgdir}"
88 install --verbose -D --mode=0644 LICENSE.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
89 install --verbose -D --mode=0644 *.md --target-directory "${pkgdir}/usr/share/doc/${pkgname}"
92 # vim: tabstop=2 shiftwidth=2 expandtab: