1 # Maintainer: Andreas 'Segaja' Schleifer <segaja at archlinux dot org>
2 # Contributor: Mario Finelli <mario at finel dot li>
4 _gemname='rubocop-rake'
5 pkgname="ruby-${_gemname}"
8 pkgdesc='A RuboCop plugin for Rake'
10 url="https://github.com/rubocop/${_gemname}"
12 depends=('ruby' 'rubocop')
14 checkdepends=('ruby-parallel' 'ruby-rspec')
15 options=('!emptydirs')
16 source=("${url}/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz")
17 sha512sums=('e98233e5e0e8c4a9e03184db6e71c3c470f6fc301b8031d9bae6bb26f140b2169ae78a3ced35c34defb33b63489acb315b45d145f946aefb671b1edcc459b9c8')
18 b2sums=('902b026a68629df848716a37bf759d30a4d10219955d3bd979413ba9245c8a9af2b0511c9f489f7e5d501df2bf1eb9351868d8955e10cd628fed6405d8088797')
21 cd "${_gemname}-${pkgver}"
23 # update gemspec/Gemfile to allow newer version of the dependencies
24 sed --in-place --regexp-extended 's|~>|>=|g' "${_gemname}.gemspec"
26 # we don't build from a git checkout
27 sed --in-place --regexp-extended 's|git ls-files -z|find . -type f -not -path "*/\.git/*" -print0|' "${_gemname}.gemspec"
31 cd "${_gemname}-${pkgver}"
33 local _gemdir="$(gem env gemdir)"
35 gem build "${_gemname}.gemspec"
40 --ignore-dependencies \
42 --install-dir "tmp_install/${_gemdir}" \
43 --bindir "tmp_install/usr/bin" \
44 "${_gemname}-${pkgver}.gem"
46 # remove unrepreducible files
47 rm --force --recursive --verbose \
48 "tmp_install/${_gemdir}/cache/" \
49 "tmp_install/${_gemdir}/gems/${_gemname}-${pkgver}/vendor/" \
50 "tmp_install/${_gemdir}/doc/${_gemname}-${pkgver}/ri/ext/"
52 find "tmp_install/${_gemdir}/gems/" \
59 -iname "gem.build_complete" -o \
64 find "tmp_install/${_gemdir}/extensions/" \
67 -iname "mkmf.log" -o \
68 -iname "gem_make.out" \
74 cd "${_gemname}-${pkgver}"
76 local _gemdir="$(gem env gemdir)"
78 GEM_HOME="tmp_install/${_gemdir}" rake spec
82 cd "${_gemname}-${pkgver}"
84 cp --archive --verbose tmp_install/* "${pkgdir}"
86 install --verbose -D --mode=0644 LICENSE* --target-directory "${pkgdir}/usr/share/licenses/${pkgname}"
87 install --verbose -D --mode=0644 *.md --target-directory "${pkgdir}/usr/share/doc/${pkgname}"