upgpkg: ufw 0.36.2-1
[ArchLinux/community.git] / ruby-erubi / repos / community-any / PKGBUILD
blobacfd4f2a26a0356fc45af92731848acbb5d4e3b6
1 # Maintainer: Andreas 'Segaja' Schleifer <segaja at archlinux dot org>
3 _gemname='erubi'
4 pkgname="ruby-${_gemname}"
5 pkgver=1.11.0
6 pkgrel=1
7 pkgdesc='Small ERB Implementation'
8 arch=('any')
9 url="https://github.com/jeremyevans/erubi"
10 license=('MIT')
11 depends=('ruby')
12 makedepends=('ruby-rake' 'ruby-rdoc')
13 checkdepends=('ruby-minitest' 'ruby-minitest-global_expectations')
14 options=(!emptydirs)
15 source=("${url}/archive/${pkgver}/${pkgname}-${pkgver}.tar.gz")
16 sha512sums=('6e1a044a8468b6cd0262e4058a45415b9a4e1f230bbd7256956d5416674feb4af6a1dea290733a3dbaeab92394625664a1e61cbe36e7278e1e030c6a9b16d692')
18 prepare() {
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"
25 build() {
26   cd "${_gemname}-${pkgver}"
28   gem build "${_gemname}.gemspec"
31 check() {
32   cd "${_gemname}-${pkgver}"
34   rake spec
37 package() {
38   cd "${_gemname}-${pkgver}"
40   local _gemdir="$(gem env gemdir)"
42   gem install --ignore-dependencies --no-user-install --install-dir "${pkgdir}/${_gemdir}" --bindir "${pkgdir}/usr/bin" "${_gemname}-${pkgver}.gem"
44   # remove unrepreducible files
45   rm --force --recursive --verbose \
46     "${pkgdir}/${_gemdir}/cache/" \
47     "${pkgdir}/${_gemdir}/gems/${_gemname}-${pkgver}/vendor/" \
48     "${pkgdir}/${_gemdir}/doc/${_gemname}-${pkgver}/ri/ext/"
50   find "${pkgdir}/${_gemdir}/gems/" \
51     -type f \
52     \( \
53       -iname "*.o" -o \
54       -iname "*.c" -o \
55       -iname "*.so" -o \
56       -iname "*.time" -o \
57       -iname "gem.build_complete" -o \
58       -iname "Makefile" \
59     \) \
60     -delete
62   find "${pkgdir}/${_gemdir}/extensions/" \
63     -type f \
64     \( \
65       -iname "mkmf.log" -o \
66       -iname "gem_make.out" \
67     \) \
68     -delete
70   install -Dm 644 MIT-LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
71   install -Dm 644 CHANGELOG README.rdoc --target-directory "${pkgdir}/usr/share/doc/${pkgname}"