1 # Maintainer: Anatol Pomozov
2 # Maintainer: Andreas 'Segaja' Schleifer <segaja at archlinux dot org>
5 pkgname="ruby-${_gemname}"
8 pkgdesc='Alternative GNU Readline or Editline implementation by pure Ruby.'
10 url="https://github.com/ruby/${_gemname}"
13 checkdepends=('ruby-rake')
14 options=('!emptydirs')
15 source=("${url}/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz")
16 sha512sums=('d17fcd082134ca03877e1e3fb93d9f8581e788d4d95982118ae11fd69dccec4e28f0520bc52755c68b00e01399515dc1d415bb7cdd441f3c3c82f8554bfa44d7')
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 gem build "${_gemname}.gemspec"
32 cd "${_gemname}-${pkgver}"
38 cd "${_gemname}-${pkgver}"
40 local _gemdir="$(gem env gemdir)"
41 local _platform="$(gem env platform | cut -d':' -f2)"
42 local _extension_api_version="$(ruby -e 'puts Gem.extension_api_version')"
47 --ignore-dependencies \
49 --install-dir "${pkgdir}/${_gemdir}" \
50 --bindir "${pkgdir}/usr/bin" \
51 "${_gemname}-${pkgver}.gem"
53 install --verbose --directory --mode=0755 \
54 "${pkgdir}/usr/lib/ruby/${_extension_api_version}/${_platform}" \
55 "${pkgdir}${_gemdir}/specifications/default"
57 mv --verbose "${pkgdir}${_gemdir}/specifications/${_gemname}-${pkgver}.gemspec" "${pkgdir}${_gemdir}/specifications/default/${_gemname}-${pkgver}.gemspec"
58 mv --verbose "${pkgdir}${_gemdir}/gems/${_gemname}-${pkgver}/lib/${_gemname}.rb" "${pkgdir}/usr/lib/ruby/${_extension_api_version}/${_gemname}.rb"
59 mv --verbose "${pkgdir}${_gemdir}/gems/${_gemname}-${pkgver}/lib/${_gemname}" "${pkgdir}/usr/lib/ruby/${_extension_api_version}/${_gemname}"
61 # remove unrepreducible files
62 rm --force --recursive --verbose \
63 "${pkgdir}${_gemdir}/cache/" \
64 "${pkgdir}${_gemdir}/build_info/" \
65 "${pkgdir}${_gemdir}/extensions/" \
66 "${pkgdir}${_gemdir}/gems/" \
67 "${pkgdir}${_gemdir}/plugins/" \
68 "${pkgdir}${_gemdir}/doc/${_gemname}-${pkgver}/ri/ext/"
70 install --verbose -D --mode=0644 BSDL COPYING --target-directory "${pkgdir}/usr/share/licenses/${pkgname}"
71 install --verbose -D --mode=0644 *.md --target-directory "${pkgdir}/usr/share/doc/${pkgname}"