Skip to content

Instantly share code, notes, and snippets.

@suawekk
Created March 26, 2013 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save suawekk/5245691 to your computer and use it in GitHub Desktop.
Save suawekk/5245691 to your computer and use it in GitHub Desktop.
Fixed PKGBUILD for puppet (should compile under ruby 2.0.0)
# Puppet: Installer: Arch
# Maintainer : Greg Sutcliffe <puppet-aur (at) emeraldreverie (dot) org>
# Contributor: Hyacinthe Cartiaux <hyacinthe (dot) cartiaux (at) free (dot) fr>
# Contributor: Thomas S Hatch <thatch45 (at) Gmail (dot) com>
# Contributor: Xavion <Xavion (dot) 0 (at) Gmail (dot) com>
# Contributor: Miah Johnson <miah (at) chia-pet dot org>
# Contributor: Dave Simons <miouhpi (at) Gmail (dot) com>
# Contributor: Niels Abspoel <aboe76 (at) Gmail (dot) com>
# RC style, reserved for later use
#pkgname=puppet
#_rc=2
#_pkgver=3.1.1
#pkgver=${_pkgver}_rc${_rc}
pkgname=puppet
_gemname=puppet
pkgver=3.1.1
pkgrel=1
pkgdesc="A system for automating system administration tasks."
arch=("any")
url="http://puppetlabs.com/projects/puppet/"
license=("APACHE")
depends=("ruby" "ruby-shadow" "ruby-facter" "ruby-hiera" "ruby-hiera-json" "ruby-json_pure" "logrotate")
makedepends=('which')
backup=("etc/puppet/puppet.conf")
options=(emptydirs)
provides=("puppet" "vim-puppet" "ruby-hiera-puppet")
conflicts=("puppet3" "ruby-puppet" "vim-puppet")
install="puppet.install"
source=(
"http://gems.rubyforge.org/gems/${_gemname}-${pkgver}.gem"
"puppet"
"puppetmaster")
md5sums=('c2192ca1412cefa72e5c9c1226eabff1'
'59dbf39e251bc4877e7604a5876c642d'
'4c507c580cb28d7a5adc9ea6b3626657')
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" \
--no-ri --no-rdoc -n "$pkgdir/usr/bin" "$_gemname-${pkgver}.gem"
# Set up vim and emacs
install -Dp -m0644 "$pkgdir$_gemdir"/gems/$_gemname-$pkgver/ext/vim/ftdetect/puppet.vim $pkgdir/usr/share/vim/vimfiles/ftdetect/puppet.vim
install -Dp -m0644 "$pkgdir$_gemdir"/gems/$_gemname-$pkgver/ext/vim/syntax/puppet.vim $pkgdir/usr/share/vim/vimfiles/syntax/puppet.vim
install -Dp -m0644 "$pkgdir$_gemdir"/gems/$_gemname-$pkgver/ext/emacs/puppet-mode.el $pkgdir/usr/share/emacs/site-lisp/puppet-mode.el
install -Dp -m0644 "$pkgdir$_gemdir"/gems/$_gemname-$pkgver/ext/emacs/puppet-mode-init.el $pkgdir/usr/share/emacs/site-lisp/site-start.d/puppet-mode-init.el
# Configuration and rc scripts
install -Dm 644 "$pkgdir$_gemdir"/gems/$_gemname-$pkgver/ext/redhat/puppet.conf $pkgdir/etc/puppet/puppet.conf
install -Dm 644 "$pkgdir$_gemdir"/gems/$_gemname-$pkgver/conf/fileserver.conf $pkgdir/etc/puppet/fileserver.conf
install -Dm 644 "$pkgdir$_gemdir"/gems/$_gemname-$pkgver/conf/auth.conf $pkgdir/etc/puppet/auth.conf
install -Dm 644 "$pkgdir$_gemdir"/gems/$_gemname-$pkgver/conf/tagmail.conf $pkgdir/etc/puppet/tagmail.conf
install -Dm 644 "$pkgdir$_gemdir"/gems/$_gemname-$pkgver/ext/redhat/puppet.conf $pkgdir/etc/puppet/puppet.conf
# Setup tmpfiles.d config
install -d $pkgdir/etc/tmpfiles.d
echo "D /var/run/puppet 0755 puppet puppet -" > $pkgdir/etc/tmpfiles.d/puppet.conf
# Logrotate
install -Dm 644 "$pkgdir$_gemdir"/gems/$_gemname-$pkgver/ext/redhat/logrotate $pkgdir/etc/logrotate.d/puppet
# Configuration for hiera / symlink is there to use hiera within puppet.
ln -snf /etc/hiera.yaml ${pkgdir}/etc/puppet/hiera.yaml
# Systemd files
install -Dm 644 "$pkgdir$_gemdir"/gems/$_gemname-$pkgver/ext/systemd/puppetagent.service $pkgdir/usr/lib/systemd/system/puppet.service
install -Dm 644 "$pkgdir$_gemdir"/gems/$_gemname-$pkgver/ext/systemd/puppetmaster.service $pkgdir/usr/lib/systemd/system/puppetmaster.service
# Create puppet homedir and hieradir
install -d $pkgdir/var/lib/puppet
install -d $pkgdir/var/lib/hiera
# Init Scripts
install -D $srcdir/puppet $pkgdir/etc/rc.d/puppet
install -D $srcdir/puppetmaster $pkgdir/etc/rc.d/puppetmaster
# Compress and install man pages
install -d $pkgdir/usr/share/man
mv $pkgdir/usr/lib/ruby/gems/2.0.0/gems/$_gemname-$pkgver/man/* $pkgdir/usr/share/man
gzip -9 -q -r $pkgdir/usr/share/man
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment