upgpkg: ufw 0.36.2-1
[ArchLinux/community.git] / puppet / trunk / PKGBUILD
blob19eaee414b3fddc11e47a71b12511b422c10f390
1 # Maintainer: Tim Meusel <tim@bastelfreak.de>
2 # Contributor: Christian Rebischke <chris.rebischke@archlinux.org>
3 # Contributor: Jonathan Steel <jsteel at archlinux.org>
4 # Contributor: Greg Sutcliffe <puppet-aur (at) emeraldreverie (dot) org>
5 # Contributor: Hyacinthe Cartiaux <hyacinthe (dot) cartiaux (at) free (dot) fr>
6 # Contributor: Thomas S Hatch <thatch45 (at) Gmail (dot) com>
7 # Contributor: Xavion <Xavion (dot) 0 (at) Gmail (dot) com>
8 # Contributor: Miah Johnson <miah (at) chia-pet dot org>
9 # Contributor: Dave Simons <miouhpi (at) Gmail (dot) com>
10 # Contributor: Niels Abspoel <aboe76 (at) Gmail (dot) com>
12 pkgname=puppet
13 pkgver=7.24.0
14 pkgrel=1
15 pkgdesc='Server automation framework and application'
16 arch=('any')
17 url='https://puppet.com/products/open-source-projects'
18 license=('Apache')
19 depends=(ruby facter ruby-semantic_puppet ruby-augeas ruby-shadow ruby-concurrent ruby-multi_json ruby-puppet-resource_api ruby-deep_merge ruby-fast_gettext hiera ruby-locale ruby-scanf)
20 makedepends=('git' 'rake' 'ruby-rdoc')
21 checkdepends=('ruby-rspec' 'ruby-yard' 'ruby-rspec-its' 'ruby-webmock')
22 backup=('etc/puppetlabs/puppet/auth.conf'
23         'etc/puppetlabs/puppet/puppet.conf'
24         'etc/puppetlabs/puppet/hiera.yaml')
25 install="$pkgname.install"
27 _augeas_commit=22db3b937d9f57f487bb37296bd41c209d69113f
28 _cron_commit=e135dfc40fffb83f0f82534f8ef6d4b886ef186c
29 _host_commit=bd8ace42d6aa46127561b79a920c12d316732dc0
30 _mount_commit=468d108a929172c7fbc180a3a077b0442cc0c858
31 _selinux_commit=c3d25664d99f96ad22a5f359b668bcd55a399d86
32 _sshkeys_commit=e79aedb612ab702c06461b7fb75484064f7ed850
33 _yumrepo_commit=5c77eecfd5751dd93cab90c0f67e5d112e638ab7
34 _zfs_commit=7de49486bcd8e7c5579a7970dea11727c63a4c8b
35 _zone_commit=7880999cdcf15b9a3594b78a06e47399c78baba1
37 source=("https://github.com/puppetlabs/puppet/archive/${pkgver}/puppet-${pkgver}.tar.gz"
38         "augeas_core::git+https://github.com/puppetlabs/puppetlabs-augeas_core#commit=${_augeas_commit}"
39         "cron_core::git+https://github.com/puppetlabs/puppetlabs-cron_core#commit=${_cron_commit}"
40         "host_core::git+https://github.com/puppetlabs/puppetlabs-host_core#commit=${_host_commit}"
41         "mount_core::git+https://github.com/puppetlabs/puppetlabs-mount_core#commit=${_mount_commit}"
42         "selinux_core::git+https://github.com/puppetlabs/puppetlabs-selinux_core#commit=${_selinux_commit}"
43         "sshkeys_core::git+https://github.com/puppetlabs/puppetlabs-sshkeys_core#commit=${_sshkeys_commit}"
44         "yumrepo_core::git+https://github.com/puppetlabs/puppetlabs-yumrepo_core#commit=${_yumrepo_commit}"
45         "zfs_core::git+https://github.com/puppetlabs/puppetlabs-zfs_core#commit=${_zfs_commit}"
46         "zone_core::git+https://github.com/puppetlabs/puppetlabs-zone_core#commit=${_zone_commit}"
47         )
48 sha512sums=('4ba01e0a433b40fbe08933fbfd885e75d5855465ac217a980bce9104b77e65a17aa5b606daddaae1aac4fa14929b307122afde0444b958ef98b075604ffddf1f'
49             'SKIP'
50             'SKIP'
51             'SKIP'
52             'SKIP'
53             'SKIP'
54             'SKIP'
55             'SKIP'
56             'SKIP'
57             'SKIP')
58 conflicts=('puppet5' 'puppet6')
59 provides=('puppet')
61 prepare() {
62   cd "${pkgname}-${pkgver}"
64   # FS#45044: fix file location
65   sed -i 's_/opt/puppetlabs/puppet_/usr_' ext/systemd/puppet.service
68 check() {
69   cd "${pkgname}-${pkgver}"
70   # This breaks right now due to missing dependencies
71   #rake --tasks             # show all tasks
72   #rake commits             # requires a git repo
73   #rake warnings            # requires a git repo
74   #rake spec                # run tests single threaded
75   #rake parallel:spec[8]
78 package() {
79   cd "${pkgname}-${pkgver}"
81   local _gemdir="$(gem env gemdir)"
83   # install the gemspec file
84   # this allows other gems to load puppet as a library (for example puppet-strings)
85   install -Dm644 .gemspec "${pkgdir}/${_gemdir}/specifications/puppet-${pkgver}.gemspec"
87   # generate manpages | this breaks right now..
88   #rake gen_manpages
90   ruby install.rb --destdir="$pkgdir" --sitelibdir="$( ruby -e 'puts RbConfig::CONFIG["vendorlibdir"]' )"
92   install -d "$pkgdir"/usr/lib/{sysusers.d,tmpfiles.d}
94   echo 'u puppet 52 "Puppet" /var/lib/puppet' > "$pkgdir"/usr/lib/sysusers.d/$pkgname.conf
95   echo "d /run/puppetlabs 0755 $pkgname $pkgname -" > "$pkgdir"/usr/lib/tmpfiles.d/$pkgname.conf
97   # systemd
98   install -Dm644 "${srcdir}/$pkgname-${pkgver}/ext/systemd/${pkgname}.service" "${pkgdir}/usr/lib/systemd/system/${pkgname}.service"
100   install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
102   # Match permissions that puppet sets when running
103   install -dm775 "$pkgdir"/var/lib/puppet
104   chmod 750 "$pkgdir"/var/log/puppetlabs/puppet
106   rm -r "$pkgdir"/var/run
108   cd ..
109   install --directory "${pkgdir}/opt/puppetlabs/puppet/vendor_modules/"
110   mv *_core "${pkgdir}/opt/puppetlabs/puppet/vendor_modules/"
111   # Search for unwanted directories and files and delete them
112   find "${pkgdir}/opt/puppetlabs/puppet/vendor_modules/" -type d -name .git -o -name spec -exec rm -rf {} +
113   find "${pkgdir}/opt/puppetlabs/puppet/vendor_modules/" -name '.*' -exec rm -rf {} +
114   find "${pkgdir}/opt/puppetlabs/puppet/vendor_modules/" -type f -name pdk.yaml -delete