archrelease: copy trunk to community-any
[ArchLinux/community.git] / ruby-falcon / trunk / PKGBUILD
blobe6403c63f9d74a26bf17ff13259c8bbef9d35aa6
1 # Maintainer: Felix Yan <felixonmars@archlinux.org>
3 pkgname=ruby-falcon
4 pkgver=0.42.3
5 pkgrel=2
6 pkgdesc='A fast, asynchronous, rack-compatible web server'
7 arch=(any)
8 url='https://github.com/socketry/falcon'
9 license=(MIT)
10 depends=(ruby-async ruby-async-container ruby-async-http ruby-async-http ruby-async-http-cache
11          ruby-async-io ruby-build-environment ruby-localhost ruby-process-metrics ruby-protocol-rack
12          ruby-samovar)
13 checkdepends=(ruby-async-process ruby-async-rspec ruby-async-websocket ruby-bake ruby-covered
14               ruby-rspec ruby-bake-test ruby-bake-test-external ruby-puma)
15 options=(!emptydirs)
16 source=(https://github.com/socketry/falcon/archive/v$pkgver/$pkgname-$pkgver.tar.gz
17         https://github.com/socketry/falcon/commit/e93d153d53faf42710d7a2890425b6b77e188914.patch)
18 sha256sums=('d43ce8a64d0c95e5d783738142374b11586e51cbe6aea0da3cb6d4be47e2c7d5'
19             '3238b59daf1c7c62a59c0f86188e73745252be962098d7cb67655ca083577113')
21 prepare() {
22   cd falcon-$pkgver
23   # Revert for openssl < 3.0 support
24   patch -Rp1 -i ../e93d153d53faf42710d7a2890425b6b77e188914.patch
25   sed -r -e 's|~>|>=|g' -e '/signing_key/d' -i falcon.gemspec
26   sed -i '/bake-gem/d;/bake-modernize/d;/bake-github-pages/d;/utopia-project/d;/ruby-prof/d' gems.rb
29 build() {
30   local _gemdir="$(gem env gemdir)"
31   cd falcon-$pkgver
32   gem build falcon.gemspec
33   gem install \
34     --local \
35     --verbose \
36     --ignore-dependencies \
37     --no-user-install \
38     --install-dir "tmp_install/$_gemdir" \
39     --bindir "tmp_install/usr/bin" \
40     falcon-$pkgver.gem
41   find "tmp_install/$_gemdir/gems/" \
42     -type f \
43     \( \
44         -iname "*.o" -o \
45         -iname "*.c" -o \
46         -iname "*.so" -o \
47         -iname "*.time" -o \
48         -iname "gem.build_complete" -o \
49         -iname "Makefile" \
50     \) \
51     -delete
52   rm -r tmp_install/$_gemdir/cache
55 check() {
56   local _gemdir="$(gem env gemdir)"
57   cd falcon-$pkgver
58   GEM_HOME="tmp_install/$_gemdir" bake test
61 package() {
62   cd falcon-$pkgver
63   cp -a tmp_install/* "$pkgdir"/
64   install -Dm644 license.md -t "$pkgdir"/usr/share/licenses/$pkgname/