upgpkg: wordpress 6.2.1-1
[ArchLinux/community.git] / ruby-websocket-driver / trunk / PKGBUILD
blob42a396fe257222e6820604d340c0815439a75dc5
1 # Maintainer: Andreas 'Segaja' Schleifer <segaja at archlinux dot org>
3 _gemname='websocket-driver'
4 pkgname="ruby-${_gemname}"
5 pkgver=0.7.5
6 pkgrel=2
7 pkgdesc='WebSocket protocol handler with pluggable I/O'
8 arch=('x86_64')
9 url='https://github.com/faye/websocket-driver-ruby'
10 license=('Apache')
11 options=(!emptydirs)
12 depends=('ruby' 'ruby-websocket-extensions')
13 makedepends=('ruby-rake' 'ruby-rake-compiler')
14 checkdepends=('ruby-bundler' 'ruby-eventmachine' 'ruby-permessage_deflate' 'ruby-rspec')
15 source=("${url}/archive/${pkgver}/${pkgname}-${pkgver}.tar.gz")
16 sha512sums=('538c78cd39507fb6cddeaa6196f0e2bbb89d7293f062d9b0231b6c6988a46b718c91b69a50b4cbf5b227067e6ed4ee89c61759bf340fc3e483c4af97052d42f9')
18 prepare() {
19   cd "${_gemname}-ruby-${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}-ruby-${pkgver}"
28   rake gem
31 check() {
32   cd "${_gemname}-ruby-${pkgver}"
34   bundle exec rspec
37 package() {
38   cd "${_gemname}-ruby-${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')"
44   gem install --ignore-dependencies --no-user-install -i "${pkgdir}/${_gemdir}" -n "${pkgdir}/usr/bin" "pkg/${_gemname}-${pkgver}.gem"
46   rm "${pkgdir}/${_gemdir}/cache/${_gemname}-${pkgver}.gem" \
47       "${pkgdir}/${_gemdir}/gems/${_gemname}-${pkgver}/ext/websocket-driver/Makefile" \
48       "${pkgdir}/${_gemdir}/extensions/${_platform}/${_extension_api_version}/${_gemname}-${pkgver}/gem_make.out"
49   rm -rf "${pkgdir}/${_gemdir}/doc/${_gemname}-${pkgver}/ri/ext/"
51   install -Dm 644 CHANGELOG.md CODE_OF_CONDUCT.md README.md --target-directory "${pkgdir}/usr/share/doc/${pkgname}"