1 # Maintainer: Andreas 'Segaja' Schleifer <segaja at archlinux dot org>
3 _gemname='memory_profiler'
4 pkgname="ruby-${_gemname}"
7 pkgdesc='Memory profiling routines for Ruby'
9 url='https://github.com/SamSaffron/memory_profiler'
12 options=('!emptydirs')
13 source=("${url}/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz")
14 sha512sums=('88f1d51517bdfb75012fa685d44df7bb3ffcef0cf081c3b131b6b2957f92af063a5c57d168e45decf98d51c39e54cafae9f0f26f3d1b3f231828fb8dcb843137')
17 cd "${_gemname}-${pkgver}"
19 # update gemspec/Gemfile to allow newer version of the dependencies
20 sed --in-place --regexp-extended 's|~>|>=|g' "${_gemname}.gemspec"
24 cd "${_gemname}-${pkgver}"
26 gem build "${_gemname}.gemspec"
28 local _gemdir="$(gem env gemdir)"
33 --ignore-dependencies \
35 --install-dir "tmp_install/${_gemdir}" \
36 --bindir "tmp_install/usr/bin" \
37 "${_gemname}-${pkgver}.gem"
39 # remove unrepreducible files
40 rm --force --recursive --verbose \
41 "tmp_install/${_gemdir}/cache/" \
42 "tmp_install/${_gemdir}/gems/${_gemname}-${pkgver}/vendor/" \
43 "tmp_install/${_gemdir}/doc/${_gemname}-${pkgver}/ri/ext/"
45 find "tmp_install/${_gemdir}/gems/" \
52 -iname "gem.build_complete" -o \
57 find "tmp_install/${_gemdir}/extensions/" \
60 -iname "mkmf.log" -o \
61 -iname "gem_make.out" \
67 cd "${_gemname}-${pkgver}"
69 local _gemdir="$(gem env gemdir)"
71 GEM_HOME="tmp_install/${_gemdir}" rake test
75 cd "${_gemname}-${pkgver}"
77 cp --archive --verbose tmp_install/* "${pkgdir}"
79 install --verbose -D --mode=0644 LICENSE.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
80 install --verbose -D --mode=0644 *.md --target-directory "${pkgdir}/usr/share/doc/${pkgname}"