archrelease: copy trunk to community-any
[ArchLinux/community.git] / ruby-permessage_deflate / trunk / PKGBUILD
blob591896ed5a8066cf5ede3ff3eff13baf5ce68909
1 # Maintainer: Andreas 'Segaja' Schleifer <segaja at archlinux dot org>
3 _gemname='permessage_deflate'
4 pkgname="ruby-${_gemname}"
5 pkgver=0.1.4
6 pkgrel=1
7 pkgdesc='Per-message DEFLATE compression extension for WebSocket connections'
8 arch=('any')
9 url='https://github.com/faye/permessage-deflate-ruby'
10 license=('Apache')
11 options=(!emptydirs)
12 depends=('ruby')
13 checkdepends=('ruby-bundler' 'ruby-rspec')
14 source=("${url}/archive/${pkgver}/${pkgname}-${pkgver}.tar.gz")
15 sha512sums=('9e8e9af7cf7d13d05420ebe773e1bef4212174d82d87f9e4a2cac96dee197666cff60ffbc3f0744d3dbd2ae59b07a90bbbffa513632aafb38a0ba2b01ec6e471')
17 prepare() {
18   cd "${_gemname/_/-}-ruby-${pkgver}"
20   # update gemspec/Gemfile to allow newer version of the dependencies
21   sed --in-place --regexp-extended 's|~>|>=|g' "${_gemname}.gemspec"
24 build() {
25   cd "${_gemname/_/-}-ruby-${pkgver}"
27   gem build "${_gemname}.gemspec"
30 check() {
31   cd "${_gemname/_/-}-ruby-${pkgver}"
33   bundle exec rspec
36 package() {
37   cd "${_gemname/_/-}-ruby-${pkgver}"
39   local _gemdir="$(gem env gemdir)"
41   gem install --ignore-dependencies --no-user-install -i "${pkgdir}/${_gemdir}" -n "${pkgdir}/usr/bin" "${_gemname}-${pkgver}.gem"
43   rm "${pkgdir}/${_gemdir}/cache/${_gemname}-${pkgver}.gem"
45   install -Dm 644 LICENSE.md "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
46   install -Dm 644 CHANGELOG.md CODE_OF_CONDUCT.md README.md --target-directory "${pkgdir}/usr/share/doc/${pkgname}"