1 # Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
2 # Contributor: Niels Abspoel <aboe76 (at) Gmail.com>
8 pkgdesc='Ruby interface to the PostgreSQL RDBMS'
9 url='https://github.com/ged/ruby-pg'
11 license=('custom:BSDL')
12 depends=('glibc' 'ruby' 'ruby-rspec-core' 'postgresql-libs')
13 makedepends=('git' 'ruby-rdoc')
14 options=('!emptydirs')
15 _commit='5855e7c199cdb0bee764f2f75e304eb2daa3aca7'
16 source=("$pkgname::git+$url.git#commit=$_commit")
22 git describe --tags | sed 's/^v//'
28 sed 's|"ChangeLog".freeze, ||' -i ${_gemname}.gemspec
29 sed 's|"lib/pg/deprecated_constants.rb".freeze, ||' -i ${_gemname}.gemspec
30 sed "s|^ s.version = .*$| s.version = '${pkgver}'|" -i ${_gemname}.gemspec
36 gem build "$_gemname.gemspec"
42 local _gemdir="$(ruby -e'puts Gem.default_dir')"
47 --ignore-dependencies \
50 --install-dir "$pkgdir/$_gemdir" \
51 --bindir "$pkgdir/usr/bin" \
52 "$_gemname-$pkgver.gem"
54 # delete unnecessary files & folders
57 -name "page-Makefile.ri" -delete \
58 -o -name 'gem_make.out' -delete \
59 -o -name 'mkmf.log' -delete
61 cd "gems/$_gemname-$pkgver"
62 find . -type f -name ".*" -delete
63 rm -vrf .github certs sample misc spec ext POSTGRES Manifest.txt Rakefile* Gemfile "$_gemname.gemspec"
65 # generate reproducible documentation
66 install -vd "$pkgdir/$_gemdir/doc/$_gemname-$pkgver"
67 cd "$pkgdir/$_gemdir/gems/$_gemname-$pkgver"
70 --output "$pkgdir$_gemdir/doc/$_gemname-$pkgver/ri" \
72 # delete unnecessary rdoc metadata file
73 rm -f "$pkgdir$_gemdir/doc/$_gemname-$pkgver/ri/created.rid"
76 install -vd "$pkgdir/usr/share/doc/$pkgname"
77 mv *.rdoc "$pkgdir/usr/share/doc/$pkgname"
80 install -vd "$pkgdir/usr/share/licenses/$pkgname"
81 mv LICENSE BSDL "$pkgdir/usr/share/licenses/$pkgname"