arch-pkgs/ruby-listen/PKGBUILD
2022-01-14 01:02:27 +00:00

46 lines
1.3 KiB
Bash

# Maintainer: George Rawlinson <grawlinson@archlinux.org>
_gemname=listen
pkgname=ruby-$_gemname
pkgver=3.7.1
pkgrel=1
pkgdesc="Listens to file modifications and notifies you about the changes"
arch=('any')
url="https://github.com/guard/listen"
license=('MIT')
depends=(
'ruby'
'ruby-rb-fsevent'
'ruby-rb-inotify'
)
options=('!emptydirs')
source=("https://rubygems.org/downloads/$_gemname-$pkgver.gem")
noextract=("$_gemname-$pkgver.gem")
sha512sums=('902324850d022086ced8aa0759638a3d909c717ea8045af276f1a2e27128796c5fbe0b4b7e57aee76362cbeac3401101eaf68d9cc173364507811f7934c8e606')
b2sums=('04583e3c5063efab36af15f2d3e180e0b38ec246417277dfaf60230bd98ebe88deaec42a90cd436a94dd1269525a4b509bdaba76db3847d6a3fcc3acbb9febd2')
package() {
local _gemdir="$(ruby -e'puts Gem.default_dir')"
gem install \
--ignore-dependencies \
--no-user-install \
--no-document \
--install-dir "$pkgdir/$_gemdir" \
--bindir "$pkgdir/usr/bin" \
"$_gemname-$pkgver.gem"
# delete cache
cd "$pkgdir/$_gemdir"
rm -vrf cache
cd "gems/$_gemname-$pkgver"
# move documentation
install -vd "$pkgdir/usr/share/doc/$pkgname"
mv -vt "$pkgdir/usr/share/doc/$pkgname" *.md
# move license
install -vd "$pkgdir/usr/share/licenses/$pkgname"
mv -vt "$pkgdir/usr/share/licenses/$pkgname" LICENSE.txt
}