summaryrefslogtreecommitdiff
path: root/pcr/ruby-hiera/PKGBUILD
blob: e6ad28c4658adb4657a66b764ed4ec1796619b3b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Contributor (Arch): Jochen Schalanda <jochen+aur@schalanda.name>
# Maintainer : Parabola GNU / Linux-libre Aurelien Desbrieres <aurelien@cwb.io>

_gemname=hiera
pkgname=ruby-$_gemname
pkgver=1.1.1
pkgrel=1
pkgdesc="A pluggable data store for hierarcical data."
arch=(any)
url='http://projects.puppetlabs.com/projects/hiera/'
license=('MIT')
depends=('ruby')
makedepends=('rubygems')
source=(
        "http://gems.rubyforge.org/gems/$_gemname-$pkgver.gem"
        'hiera.yaml')
noextract=($_gemname-$pkgver.gem)

package() {
  cd "$srcdir"
  # _gemdir is defined inside package() because if ruby[gems] is not installed on
  # the system, makepkg will exit with an error when sourcing the PKGBUILD.
  local _gemdir="$(ruby -rubygems -e'puts Gem.default_dir')"

  gem install --no-user-install --ignore-dependencies -i "$pkgdir$_gemdir" \
    -n "$pkgdir/usr/bin" "$_gemname-$pkgver.gem"

  # Create hiera default directory
  install -d $pkgdir/var/lib/hiera

  # Create hiera default configuration
  install -d $pkgdir/etc
  install -m 644 $srcdir/hiera.yaml $pkgdir/etc/
}