summaryrefslogtreecommitdiff
path: root/app-admin/puppet
diff options
context:
space:
mode:
Diffstat (limited to 'app-admin/puppet')
-rw-r--r--app-admin/puppet/Manifest29
-rw-r--r--app-admin/puppet/files/43e2c935252b995134ce353e5e6312cf77aea480.patch329
-rw-r--r--app-admin/puppet/files/50puppet-mode-gentoo.el6
-rw-r--r--app-admin/puppet/files/puppet-fix-tests-4.7.0.patch18
-rw-r--r--app-admin/puppet/files/puppet-systemd.patch10
-rw-r--r--app-admin/puppet/files/puppet.init40
-rw-r--r--app-admin/puppet/files/puppet.init-4.x29
-rw-r--r--app-admin/puppet/files/puppet.init-r124
-rw-r--r--app-admin/puppet/files/puppetmaster.confd18
-rw-r--r--app-admin/puppet/files/puppetmaster.init37
-rw-r--r--app-admin/puppet/files/puppetmaster.init-4.x37
-rw-r--r--app-admin/puppet/files/puppetmaster.init-r130
-rw-r--r--app-admin/puppet/files/tmpfiles.d1
-rw-r--r--app-admin/puppet/metadata.xml36
-rw-r--r--app-admin/puppet/puppet-3.8.7-r1.ebuild196
-rw-r--r--app-admin/puppet/puppet-4.10.1.ebuild184
-rw-r--r--app-admin/puppet/puppet-4.10.6-r1.ebuild194
-rw-r--r--app-admin/puppet/puppet-4.10.6.ebuild192
-rw-r--r--app-admin/puppet/puppet-4.10.8.ebuild194
-rw-r--r--app-admin/puppet/puppet-4.8.1.ebuild177
-rw-r--r--app-admin/puppet/puppet-5.1.0-r1.ebuild144
-rw-r--r--app-admin/puppet/puppet-5.1.0.ebuild144
22 files changed, 2069 insertions, 0 deletions
diff --git a/app-admin/puppet/Manifest b/app-admin/puppet/Manifest
new file mode 100644
index 000000000000..dd9b86ebd180
--- /dev/null
+++ b/app-admin/puppet/Manifest
@@ -0,0 +1,29 @@
+AUX 43e2c935252b995134ce353e5e6312cf77aea480.patch 13618 SHA256 3e9b90dcec65bbc74b9d9fb42caddfc2604ae08fc2a6b0c390eb5fac1dbc9249 SHA512 65b303c957a29bb5782a2b849944fba029dea3a533c25d4c17830391b5e4963fef304c0be876f5e7892b1a0eb4da16390d4ab1e39f459c05ecbb7100c9c0a9ca WHIRLPOOL 428438d32e7225e7b89098dcd3d72e884783bce7ef53ca7485c4a2dfbd72cf0bfe6a27b93b67088519c59236f8c4dedb5fabb20729bd1406129e1777b67d11ee
+AUX 50puppet-mode-gentoo.el 217 SHA256 e70f8d26e2523d2d118a4944d11540807b48f59d75d878e6fa6aac606ece9a91 SHA512 3fbe7045df9ac9d30520020d4df454a03f02989bbcaa4bae0c632f86f6e6d3fd2eeb3bed84d864077c2b85b65586406525fa621a262ec363f53d714a093f6d1a WHIRLPOOL 60d02a9b70d418cb453d08c17fbeb1133a6ddd924ba18565e30f7c655f5abeebf71af6f17797d3045483ae8775c905efdc11396f4f9829ab2c6b95fbafc2584f
+AUX puppet-fix-tests-4.7.0.patch 1102 SHA256 d974f75a8b3ec0f71f4834db5cac674164bf127ff579ce6ad166e065a5c10117 SHA512 81485af1a218b5616195ed80b3fc963c42d56265477be9a636c0e915a18771ff93e12cdbded45ce90da17ce72be4ea4881b5ad8e9d5a997be271df3cd2e8a2c8 WHIRLPOOL a97bc23c6b427413308fa0b4381ac017288e6f30ff9db187b89f07af9fb9acfbec938b0ae623d1dac860d8846aabcaeefde4674287dc5b8fbcc9d6748394229c
+AUX puppet-systemd.patch 481 SHA256 779e66ea3c09d9cb2a0600592df6c5ca246fba08c87b5eaf004e47b131a6f988 SHA512 08bb997cedea378efa4614e4b2ff04acdd68cdc376fde422677b64dc56b8256ecf7221210c20529bb5a9a49fa8c92f67667c7acd6ac64b665e79639318a3df97 WHIRLPOOL 2bd4000ef90ffa3c2915619c4c10d0f702ea8c86d291591531e16979015460d41fe2172268183bb75516a711dba6a8918a95f0fa74d1cf71ab63574b14a3a759
+AUX puppet.init 917 SHA256 a598aeacec8b1e71489f00cef1b6b603288a310ec8a9c27937c4cc7f0fd0701c SHA512 6bd2e1c21abaa5149b853f1732a6bb84335a8b4ae4129db52da463597691fd983d347bc04aad69724034d37f953f50c6aa5316d517b9efed2414db8e3d94d7bf WHIRLPOOL 5b12d2d4b7188dde335588ff350e86f461f14808fc55b93bc525b61754c045f7dcbe1aadf6feb6b85b61de186eee97bbe9421113086d7522dfe331476109ee66
+AUX puppet.init-4.x 764 SHA256 c354e4707158b237f76ef2d507cc86b928d8db44d24b612f900c427caa137084 SHA512 170100981c7e24284a12a208cede1a73afbaeab73315fd15a7337d416825c6d26a29ee272244d39764ad4086bc6a6f99cdc56ed6a600282d6ff9ed74794bfaf8 WHIRLPOOL ac390e37325a17d3abaea064331b100b19f28eb660526f493f4e3fe18a62a55f1fcd6d81f30de1e4721020f88def4c1bf507bcd540fb8b3a69d423ce67c9742d
+AUX puppet.init-r1 610 SHA256 288eb3d1e6bf0ab47aebb85da327e18354d5b8bba46e86d7670cc520db20638e SHA512 c1f3040f6ed07933bbf261ba5d3f7574fa500ebdc5b6f71eb15f02f71e355384175fbf8a5411d1be9b6a379b6fe3d74ca9d4ec164b6b4632eaa8878595573125 WHIRLPOOL 2bad8def65b5c2157a973b902c2a59d2e9ed401ce9f5f92fa8d9b7543cb5d9049508a0a159aea65cc016b49f320757d2d0ba458a83547f97bc8eca9f83a76926
+AUX puppetmaster.confd 640 SHA256 2245ae58a702618504257b690fd9b82b3562e7eaaa0d4ef2a96f918996249e8b SHA512 deb4004dd8448c503099a0cdfcbbfa8e2efed5dc088539bbce5c9db4337f2910b625598402b72db42d68a0a9b6d3570c18fb314f3c9406fa67f946c38c9bf44d WHIRLPOOL d0d14ac957978d59ee6b57b53d8d2e4f00a78ac2fc9d5c279457e326fcd08c30c3ad0f884f05580a4e80a00ba02af7496469eed96a91245b2bf3141494c56058
+AUX puppetmaster.init 1090 SHA256 b1d7efb06110e2d2a2ae21d851d2105cd5fb6830e2277df744772756248e51c2 SHA512 cb8b63aecee163c680449edfa63f9070582d3c1c924e3692dc7c18a7f84e166e9e4d88abae44d6e828eb3d4ab57b0d3a1f64e3a69453fa30d5559e4ae1716975 WHIRLPOOL 7405854be09ae905f74259a7cac0fe80df09622a1025e397e715cd68e36499f41afc168033c7567ed225bf3ffb5954bbc27e83716bd0b7f364862514f83b9a22
+AUX puppetmaster.init-4.x 1108 SHA256 28ad17b7ea6b74481c3ae65fcea9015b585abf576eee87dd4595d0c1309988a6 SHA512 e177109d90f5954e7cd1968db1d0e0d0e2c6e98bc4d53d0ae0a816d181e304e1b7555f65d8807b98df9f0f8cf7ebafc9d8cca9c32574fb7127c4b480d23b5cc6 WHIRLPOOL a1cae317b8e1af1c2f5e6baec5da1698b52e654143e04e6bfd6f467cb9bd78472b86beb020acd7e34ca1f7d67f34d58ef001ad02efb934c64c41218c07d2c0df
+AUX puppetmaster.init-r1 921 SHA256 b5504a04d02e788ea789faab466419e3c4ec0284ec0b65b53ab6af37c62d23a7 SHA512 cb73ee391fc493648504af8eee2595af102ed9dcd9043f4316fb93749b37d0492e28f0082fc43bb8266357d1c298246e75f3d8b99d195dd169e3a5761f06fbba WHIRLPOOL 887dca8a6e0cf5de720a7371a51f7ab6ba4143c7fdad789cb765a4744074e0dcbde8375c7024b78ec84892921a1843fba8659f474cc6071d07c9c3a3a4d93f54
+AUX tmpfiles.d 39 SHA256 bc0c1f0aa01e1df559fa6e0b8bb686a8fc83b1272bcf4f6671fbb2a9b48aaa6f SHA512 2dfec45e6f762ce0431d55b1a826e707e970defacbe050df838b66b347e7423eac78a35248c74908e7b52fa84cde5129ce3f562f64dac357f0368a3bc0b719a1 WHIRLPOOL 5dc356a6ae94e262cb0a0bdbc120351bce40e81ac79e6a5122c6eff3022ddfd53724f9230c7553dcbd4648f640c4a912baf300ea5b2cb22fa7100b33de4f4909
+DIST puppet-3.8.7.tar.gz 2650247 SHA256 50460a3dd8d25118e25eb01178d09743dabc01cd185f6b2cc723bae21ff023c2 SHA512 f86568d4f33c8c18da270e089e1274ce2e3c705c116b078531bb66656f0bbb9a2fc95effbb8bf5355a082d4f32ce5b44e7f6e316937164aa0d71dd47e654c618 WHIRLPOOL 6e3b754f9e6f40c6037652dc7d746e616871a653640e2a91ab7dd3e70b4240c0b377d0f79c543ca95c5d661046c6431e30f263e0f18998cac0ca3089a4634273
+DIST puppet-4.10.1.tar.gz 2954351 SHA256 271738d2b5aaec8faafd543076ac0d9012fcd6051bccd2f70a66cd479362c605 SHA512 d232f062b93485f7eea8abb9c5420462e313e6050e7335159f051f7c7af86338c006ae4edc09e0e1370784ee7b076911ca563a4cfc6a1f2afc7179bed08d2032 WHIRLPOOL 1a5b8c3fc87fdb4e23196cc13ad46c963cdb6314cfc0e4d3a6d44adad4545289cf41886c6150ee14fcd0d30d9b29f32987c6e31a7c39077a2c53aac7147c69dd
+DIST puppet-4.10.6.tar.gz 2977099 SHA256 19250a3659339961953d48d71aa5951d52bcee3bac0a1e2f45042aa82fcf358a SHA512 f983005d161bbd5fb81dfd15a32cb0ae2417557bd4faa1a62d2fb10fffa55c91ea29c1577785af9642a2878c78405ab99c7e6ee4268fcedcc107c07a0a5bfdd1 WHIRLPOOL 4619f7e89a02560f2c6bd1194b1f50699348fcddf5889628884c807deb0afd9b530883d280db20086a787052d2456ef61b2eef84854e95724562f1a0225b2640
+DIST puppet-4.10.8.tar.gz 2979824 SHA256 2a11f9230f2b681173107fcfe6574dc38d8061c7d369fa88525dfb652fb7f198 SHA512 9f3384702dd4938e1e00aeceb0745b760de32000e0dd59d5b846d1120a46026499176a51d0409e3a0ae414efc0872854c204d1941385695a4c57c209fbd1f28d WHIRLPOOL 06ed0f915786e6d0c5698a8bebfb68628d96b236b667ec44c994c043949cb4a47c8d42b2fbe8391178f38862fe816237d28501b4e39a6326d74ef2d62eb438eb
+DIST puppet-4.8.1.tar.gz 2873371 SHA256 8b3ee6b60639e2a2839ad7403fab8f8ecc390a93e6e47b03f1b053aa262bcf17 SHA512 9ecde04c68874652b501e779764bb3227d226564e80f06c2c15bd982620529ec55f8e11911bcf68db994ee98287746761752538aa5aeee474ddf37f21976e2d1 WHIRLPOOL d3a4b0b4b15dceb75cb3f161b73843af53f5d21121ba1fb06fdae422ec458f62f5fa47d0f5c7bfb96e3e9b04eb62c4c1e1a97f7131101e4f6f4ff952127c0685
+DIST puppet-5.1.0.tar.gz 2734018 SHA256 ceb8059704d2e79c1f9147716b596261e1c6c38da3313a2283def777ecf9193c SHA512 07019f40c5b7f18243f13abb899c2ff2ea4b135895ab98c13da3df50f8e720e2759f8eb39e349ff04286da7de504cffea3df8acf9711e8591b25001a2a3f9c15 WHIRLPOOL a5e4e44c68a503307b01729546121a03a0271bc68f8db139e7d52981f9ce9f6db4e24b18a252633794e7de1c7aceb6d833c817a291099081b31190060bb59d50
+EBUILD puppet-3.8.7-r1.ebuild 5301 SHA256 62c457fdbe347a1237427fbcca093e205e8aa5f0a0a82d848015efce50bde0ae SHA512 f098685cae0f9e2a77da1e8b82fb2d1c28fa0d28214449e628ac1f3a02b4c07c53eedd000b4ac94154d8ecb2e899fac61d0660fad6cc780f5944349a513f84ba WHIRLPOOL d1b96ec8d9c38baefe15a5b77fa6f18ee0dfd40a030425050bcca09bad8bb9316a4c3815a8c027eae1c4c1a51755a88b67cbbd0351a4ef228e7cf6b539803b0e
+EBUILD puppet-4.10.1.ebuild 4911 SHA256 5027b773b1f78cd11cee723f431c9254d3bcf5a28da47e6866daa6b491355fa9 SHA512 5ea1902e13577a934344565db53ad42face48b08def199f32c2fbb38b2747f7f7e1b52882bce5289894e462431fe39f75c7f63f0271878e732cd2263e52b8eaa WHIRLPOOL f178c02748737602a6f277a29d54a1808f63b0c5cd3aee0c9dc39b2a0dec1c30a5b6093cce9b8cf7a13c52b10f8f1c7c38edb908ac575c0a6587fa86cbda20d2
+EBUILD puppet-4.10.6-r1.ebuild 5573 SHA256 49daf4ffbc0311cb92b30b10219da4b421eb4d3d67958394d5078c3b0e22ddc9 SHA512 3ca9a12e808f70aef8b02975804012a7fbe96484b12ccb0a871a3f79686d71f24eda5342d41ce555aa65a827c645631f3f0e9f943b1ce93d6fe4c60eb910dd84 WHIRLPOOL 01521b31871c76e5de3dffc5bb91fb22a9392977976971e69219ea052499aafb7893988e40e746c12c95025306ce2b10e76d1531fd9f1ef93d750c9e209f8fd3
+EBUILD puppet-4.10.6.ebuild 5529 SHA256 f9a004fbb4a13514101692d29cbf23e96d05c91cd5b77bf47ce68f9c0ea58fff SHA512 1c0728ea0ea361c1c551629349ad36e3191a1279400130e4a5fa067a2b9e9022c0537056e78425c9f49abba905972d5607265e7516c302e4c09360a9f344fa74 WHIRLPOOL b55127045d5778b3daf4fc4bc7b82d57a5668bd382d6b3fd0fa73b1a9320fb60c50acdd096aa371521383cb17259c42b5518c95fc448ea438be6ccd2b44d4474
+EBUILD puppet-4.10.8.ebuild 5566 SHA256 d4810b6e8b5a23d4de3290943ff28ed2c76d7585d566529a0ffb0083970ced2b SHA512 ecbad4f16a4789ee47039279fd5a7247f2600d50e80c8a69b2a1c6c1b8988db7e819ae01eb92660029a08b1f442054a41c53666b10ab084c857bfcc3b230d528 WHIRLPOOL eadcc24108873db026d1294a3b9b293eed5bc0ef609a083bc83f8cb38f3dc0e013e90f08a7cd478c660e32f31299fe37bc123cdd7f1daef61d55f9d1cb052dc9
+EBUILD puppet-4.8.1.ebuild 4732 SHA256 4ee2c0ea64544ba7993687e6405f716f51b6f486bb10f23d4bdad763f968b0a1 SHA512 7dcfecdb30c78d673de700786036b0328588d93175ed419e4b84a5a57f4c76b9c09e59f85c3e14bb24c5a0883b5885b4fb9f6878e604a5a939b0c33ecd398f14 WHIRLPOOL b4811641f59d9663fef5c72f07e4a220608fff5a5c60ab3a594d992b2707795d7975088e260c8a5fcacb1c7381708de8cc19e036bb1ace78b9bf1e9429df5ff2
+EBUILD puppet-5.1.0-r1.ebuild 3818 SHA256 6b8f56ce122a09f24f1752fd18d21d67dbbdc0e2b065a240e42838dec5da153c SHA512 cd1fc1ad13ab691c76bbc814285316fb14867ba606dad3e8900f314470e6bce143c77f920a468f7787a6b48e52352aa12884b84ad952ca0c29d67f954157dad1 WHIRLPOOL 5b41c22e086ca783dc3a33bbe3d20664f808508ebf960847dc0616067e948341b91735867624b7c6eed16364a8c60104d279e7dc364d820007609ab8a7b9d780
+EBUILD puppet-5.1.0.ebuild 3865 SHA256 87a9da9798d6ce26a1135e14b287922d8658852a357f1a56c4ad235094db377c SHA512 6a62c22b405fe4b5ef9df3d8878a8ef401e97e4f62d00a681d95c16502805b8e505be0beb9362c7dff361f722de6bcf322fbcde5d45bef5fe4b0f23212bb99ec WHIRLPOOL 4744be2477265de9abda387530b4b28ec49b47a606019f634cb0465a96d35630936c1472e9ad5468fb7b5220415f02a71701e7a135e340cca6a119e43fc2ad39
+MISC ChangeLog 7719 SHA256 ebfd68981bbfd64b0ff92511b97749e56ab20d4663b4190a4ce89fc458a3a40b SHA512 98f3a66da3959b16036bf32851f8881d1928092c5ce64c02819dd9bf8578a2eb142e8f2ced5a85aa6d5b5cf1f15842e8ac9d6b9a851b2efdcab59eca9f2df1bd WHIRLPOOL 6fb9b83691125722682f433be9c49a75d7ee4e9eccc26ab6d273a379508f830b3ba7bf67a87924b4c0722590003f20530e2d9ddb1d29f2d5a0458d070672cef3
+MISC ChangeLog-2015 37770 SHA256 3183b2d4bab4f43c30b81d32da261e55a0311a0e0f32127fe36e7678a7964670 SHA512 5495eb8a18269cf58f6d8f5e20049da35692ce6e30fe126f65c0c15b77c477206b3dca3e2b61ac165d82ed2fc665775b474cf4bc667d3746aa5d12a58f55c51a WHIRLPOOL c5401b362aa38e38685603c8d0365a06c08f3f4b46533d2242b614133ddbca4c5ebe8897d60109c7c383cd4f5a61f118313e7c949f501e3f80473981ef26498d
+MISC metadata.xml 1514 SHA256 b064512148509253a4e3621c23e9ec3722bb39dd72ed5b1720799faa6625f73b SHA512 3ae8d47ac2a12085ec4adcb43d0428dc0b85fb561bbda39afd01ba7466417a24f9630d37c8461f99ec1aa3eb4f118cab0cb31703f486ab6d3a65798119277c64 WHIRLPOOL 8488598872c70c1d28c302636b4a5b009be8cd0380a814b161500af8db6343bde421d95d1ca4ce8877cfbc1d073b825cbd2a8e90dc2ac170fceb146d0916a400
diff --git a/app-admin/puppet/files/43e2c935252b995134ce353e5e6312cf77aea480.patch b/app-admin/puppet/files/43e2c935252b995134ce353e5e6312cf77aea480.patch
new file mode 100644
index 000000000000..09b345e8bc97
--- /dev/null
+++ b/app-admin/puppet/files/43e2c935252b995134ce353e5e6312cf77aea480.patch
@@ -0,0 +1,329 @@
+diff --git a/lib/puppet/provider/package/portage.rb b/lib/puppet/provider/package/portage.rb
+index 374667c..12160c6 100644
+--- a/lib/puppet/provider/package/portage.rb
++++ b/lib/puppet/provider/package/portage.rb
+@@ -2,14 +2,19 @@
+ require 'fileutils'
+
+ Puppet::Type.type(:package).provide :portage, :parent => Puppet::Provider::Package do
+- desc "Provides packaging support for Gentoo's portage system."
++ desc "Provides packaging support for Gentoo's portage system.
+
+- has_features :versionable, :reinstallable
++ This provider supports the `install_options` and `uninstall_options` attributes, which allows command-line
++ flags to be passed to emerge. These options should be specified as a string (e.g. '--flag'), a hash
++ (e.g. {'--flag' => 'value'}), or an array where each element is either a string or a hash."
++
++ has_features :install_options, :purgeable, :reinstallable, :uninstall_options, :versionable, :virtual_packages
+
+ {
+- :emerge => "/usr/bin/emerge",
+- :eix => "/usr/bin/eix",
+- :update_eix => "/usr/bin/eix-update",
++ :emerge => '/usr/bin/emerge',
++ :eix => '/usr/bin/eix',
++ :qatom_bin => '/usr/bin/qatom',
++ :update_eix => '/usr/bin/eix-update',
+ }.each_pair do |name, path|
+ has_command(name, path) do
+ environment :HOME => '/'
+@@ -24,15 +29,18 @@ def self.instances
+ result_format = self.eix_result_format
+ result_fields = self.eix_result_fields
+
++ limit = self.eix_limit
+ version_format = self.eix_version_format
+ slot_versions_format = self.eix_slot_versions_format
++ installed_versions_format = self.eix_installed_versions_format
++ installable_versions_format = self.eix_install_versions_format
+ begin
+- eix_file = File.directory?("/var/cache/eix") ? "/var/cache/eix/portage.eix" : "/var/cache/eix"
++ eix_file = File.directory?('/var/cache/eix') ? '/var/cache/eix/portage.eix' : '/var/cache/eix'
+ update_eix if !FileUtils.uptodate?(eix_file, %w{/usr/bin/eix /usr/portage/metadata/timestamp})
+
+ search_output = nil
+- Puppet::Util.withenv :LASTVERSION => version_format, :LASTSLOTVERSIONS => slot_versions_format do
+- search_output = eix *(self.eix_search_arguments + ["--installed"])
++ Puppet::Util.withenv :EIX_LIMIT => limit, :LASTVERSION => version_format, :LASTSLOTVERSIONS => slot_versions_format, :INSTALLEDVERSIONS => installed_versions_format, :STABLEVERSIONS => installable_versions_format do
++ search_output = eix *(self.eix_search_arguments + ['--installed'])
+ end
+
+ packages = []
+@@ -57,65 +65,123 @@ def self.instances
+
+ def install
+ should = @resource.should(:ensure)
+- name = package_name
+- unless should == :present or should == :latest
+- # We must install a specific version
+- name = package_atom_with_version(should)
++ cmd = %w{}
++ name = qatom[:category] ? "#{qatom[:category]}/#{qatom[:pn]}" : qatom[:pn]
++ name = qatom[:pfx] + name if qatom[:pfx]
++ name = name + '-' + qatom[:pv] if qatom[:pv]
++ name = name + '-' + qatom[:pr] if qatom[:pr]
++ name = name + qatom[:slot] if qatom[:slot]
++ cmd << '--update' if [:latest].include?(should)
++ cmd += install_options if @resource[:install_options]
++ cmd << name
++ emerge *cmd
++ end
++
++ def uninstall
++ should = @resource.should(:ensure)
++ cmd = %w{--rage-clean}
++ name = qatom[:category] ? "#{qatom[:category]}/#{qatom[:pn]}" : qatom[:pn]
++ name = qatom[:pfx] + name if qatom[:pfx]
++ name = name + '-' + qatom[:pv] if qatom[:pv]
++ name = name + '-' + qatom[:pr] if qatom[:pr]
++ name = name + qatom[:slot] if qatom[:slot]
++ cmd += uninstall_options if @resource[:uninstall_options]
++ cmd << name
++ if [:purged].include?(should)
++ Puppet::Util.withenv :CONFIG_PROTECT => "-*" do
++ emerge *cmd
++ end
++ else
++ emerge *cmd
+ end
+- emerge name
+ end
+
+- # The common package name format.
+- def package_name
+- @resource[:category] ? "#{@resource[:category]}/#{@resource[:name]}" : @resource[:name]
++ def reinstall
++ self.install
+ end
+
+- def package_name_without_slot
+- package_name.sub(self.class.slot_pattern, '')
++ def update
++ self.install
+ end
+
+- def package_slot
+- if match = package_name.match(self.class.slot_pattern)
+- match[1]
++ def qatom
++ output_format = self.qatom_output_format
++ result_format = self.qatom_result_format
++ result_fields = self.qatom_result_fields
++ @atom ||= begin
++ search_output = nil
++ package_info = {}
++ # do the search
++ search_output = qatom_bin *([@resource[:name], '--format', output_format])
++ # verify if the search found anything
++ match = result_format.match(search_output)
++ if match
++ result_fields.zip(match.captures) do |field, value|
++ # some fields can be empty or (null) (if we are not passed a category in the package name for instance)
++ if value == '(null)'
++ package_info[field] = nil
++ elsif !value or value.empty?
++ package_info[field] = nil
++ else
++ package_info[field] = value
++ end
++ end
++ end
++ @atom = package_info
++ rescue Puppet::ExecutionFailure => detail
++ raise Puppet::Error.new(detail)
+ end
+ end
+
+- def package_atom_with_version(version)
+- if slot = package_slot
+- "=#{package_name_without_slot}-#{version}:#{package_slot}"
+- else
+- "=#{package_name}-#{version}"
+- end
++ def qatom_output_format
++ '"[%{CATEGORY}] [%{PN}] [%{PV}] [%[PR]] [%[SLOT]] [%[pfx]] [%[sfx]]"'
+ end
+
+- def uninstall
+- emerge "--unmerge", package_name
++ def qatom_result_format
++ /^\"\[(\S*)\]\s+\[(\S*)\]\s+\[(\S*)\]\s+\[(\S*)\]\s+\[(\S*)\]\s+\[(\S*)\]\s+\[(\S*)\](.*)\"$/
+ end
+
+- def reinstall
+- self.install
++ def qatom_result_fields
++ [:category, :pn, :pv, :pr, :slot, :pfx, :sfx]
+ end
+
+- def update
+- self.install
++ def self.get_sets
++ @sets ||= begin
++ @sets = emerge *(['--list-sets'])
++ end
+ end
+
+ def query
++ limit = self.class.eix_limit
+ result_format = self.class.eix_result_format
+ result_fields = self.class.eix_result_fields
+
+ version_format = self.class.eix_version_format
+ slot_versions_format = self.class.eix_slot_versions_format
+- search_field = package_name_without_slot.count('/') > 0 ? "--category-name" : "--name"
+- search_value = package_name_without_slot
++ installed_versions_format = self.class.eix_installed_versions_format
++ installable_versions_format = self.class.eix_install_versions_format
++ search_field = qatom[:category] ? '--category-name' : '--name'
++ search_value = qatom[:category] ? "#{qatom[:category]}/#{qatom[:pn]}" : qatom[:pn]
++
++ @eix_result ||= begin
++ # package sets
++ package_sets = []
++ self.class.get_sets.each_line do |package_set|
++ package_sets << package_set.to_s.strip
++ end
+
+- begin
+- eix_file = File.directory?("/var/cache/eix") ? "/var/cache/eix/portage.eix" : "/var/cache/eix"
++ if @resource[:name].match(/^@/)
++ if package_sets.include?(@resource[:name][1..-1].to_s)
++ return({:name => "#{@resource[:name]}", :ensure => '9999', :version_available => nil, :installed_versions => nil, :installable_versions => "9999,"})
++ end
++ end
++
++ eix_file = File.directory?('/var/cache/eix') ? '/var/cache/eix/portage.eix' : '/var/cache/eix'
+ update_eix if !FileUtils.uptodate?(eix_file, %w{/usr/bin/eix /usr/portage/metadata/timestamp})
+
+ search_output = nil
+- Puppet::Util.withenv :LASTVERSION => version_format, :LASTSLOTVERSIONS => slot_versions_format do
+- search_output = eix *(self.class.eix_search_arguments + ["--exact",search_field,search_value])
++ Puppet::Util.withenv :EIX_LIMIT => limit, :LASTVERSION => version_format, :LASTSLOTVERSIONS => slot_versions_format, :INSTALLEDVERSIONS => installed_versions_format, :STABLEVERSIONS => installable_versions_format do
++ search_output = eix *(self.class.eix_search_arguments + ['--exact',search_field,search_value])
+ end
+
+ packages = []
+@@ -127,10 +193,19 @@ def query
+ result_fields.zip(match.captures) do |field, value|
+ package[field] = value unless !value or value.empty?
+ end
+- if package_slot
+- package[:version_available] = eix_get_version_for_slot(package[:slot_versions_available], package_slot)
+- package[:ensure] = eix_get_version_for_slot(package[:installed_slots], package_slot)
++ # dev-lang python [3.4.5] [3.5.2] [2.7.12:2.7,3.4.5:3.4] [2.7.12:2.7,3.4.5:3.4,3.5.2:3.5] https://www.python.org/ An interpreted, interactive, object-oriented programming language
++ # version_available is what we CAN install / update to
++ # ensure is what is currently installed
++ # This DOES NOT choose to install/upgrade or not, just provides current info
++ # prefer checking versions to slots as versions are finer grained
++ if qatom[:pv]
++ package[:version_available] = eix_get_version_for_versions(package[:installable_versions], qatom[:pv])
++ package[:ensure] = eix_get_version_for_versions(package[:installed_versions], qatom[:pv])
++ elsif qatom[:slot]
++ package[:version_available] = eix_get_version_for_slot(package[:slot_versions_available], qatom[:slot])
++ package[:ensure] = eix_get_version_for_slot(package[:installed_slots], qatom[:slot])
+ end
++
+ package[:ensure] = package[:ensure] ? package[:ensure] : :absent
+ packages << package
+ end
+@@ -138,10 +213,9 @@ def query
+
+ case packages.size
+ when 0
+- not_found_value = "#{@resource[:category] ? @resource[:category] : "<unspecified category>"}/#{@resource[:name]}"
+- raise Puppet::Error.new("No package found with the specified name [#{not_found_value}]")
++ raise Puppet::Error.new("No package found with the specified name [#{@resource[:name]}]")
+ when 1
+- return packages[0]
++ @eix_result = packages[0]
+ else
+ raise Puppet::Error.new("More than one package with the specified name [#{search_value}], please use the category parameter to disambiguate")
+ end
+@@ -155,39 +229,73 @@ def latest
+ end
+
+ private
++ def eix_get_version_for_versions(versions, target)
++ # [2.7.10-r1,2.7.12,3.4.3-r1,3.4.5,3.5.2] 3.5.2
++ return nil if versions.nil?
++ versions = versions.split(',')
++ # [2.7.10-r1 2.7.12 3.4.3-r1 3.4.5 3.5.2]
++ versions.find { |version| version == target }
++ # 3.5.2
++ end
++
++ private
+ def eix_get_version_for_slot(versions_and_slots, slot)
++ # [2.7.12:2.7 3.4.5:3.4 3.5.2:3.5] 3.5
+ return nil if versions_and_slots.nil?
+- versions_and_slots = versions_and_slots.split(",")
+- versions_and_slots.map! { |version_and_slot| version_and_slot.split(":") }
+- version_for_slot = versions_and_slots.find { |version_and_slot| version_and_slot.last == slot }
++ versions_and_slots = versions_and_slots.split(',')
++ # [2.7.12:2.7 3.4.5:3.4 3.5.2:3.5]
++ versions_and_slots.map! { |version_and_slot| version_and_slot.split(':') }
++ # [2.7.12: 2.7
++ # 3.4.5: 3.4
++ # 3.5.2: 3.5]
++ version_for_slot = versions_and_slots.find { |version_and_slot| version_and_slot.last == slot[1..-1] }
++ # [3.5.2: 3.5]
+ version_for_slot.first if version_for_slot
+- end
+-
+- def self.slot_pattern
+- /:([\w+.\/*=-]+)$/
++ # 3.5.2
+ end
+
+ def self.eix_search_format
+- "'<category> <name> [<installedversions:LASTVERSION>] [<bestversion:LASTVERSION>] [<installedversions:LASTSLOTVERSIONS>] [<bestslotversions:LASTSLOTVERSIONS>] <homepage> <description>\n'"
++ "'<category> <name> [<installedversions:LASTVERSION>] [<bestversion:LASTVERSION>] [<installedversions:LASTSLOTVERSIONS>] [<installedversions:INSTALLEDVERSIONS>] [<availableversions:STABLEVERSIONS>] [<bestslotversions:LASTSLOTVERSIONS>] <homepage> <description>\n'"
+ end
+
+ def self.eix_result_format
+- /^(\S+)\s+(\S+)\s+\[(\S*)\]\s+\[(\S*)\]\s+\[(\S*)\]\s+\[(\S*)\]\s+(\S+)\s+(.*)$/
++ /^(\S+)\s+(\S+)\s+\[(\S*)\]\s+\[(\S*)\]\s+\[(\S*)\]\s+\[(\S*)\]\s+\[(\S*)\]\s+\[(\S*)\]\s+(\S+)\s+(.*)$/
+ end
+
+ def self.eix_result_fields
+- [:category, :name, :ensure, :version_available, :installed_slots, :slot_versions_available, :vendor, :description]
++ # ensure:[3.4.5], version_available:[3.5.2], installed_slots:[2.7.12:2.7,3.4.5:3.4], installable_versions:[2.7.10-r1,2.7.12,3.4.3-r1,3.4.5,3.5.2] slot_versions_available:[2.7.12:2.7,3.4.5:3.4,3.5.2:3.5]
++ [:category, :name, :ensure, :version_available, :installed_slots, :installed_versions, :installable_versions, :slot_versions_available, :vendor, :description]
+ end
+
+ def self.eix_version_format
+- "{last}<version>{}"
++ '{last}<version>{}'
+ end
+
+ def self.eix_slot_versions_format
+- "{!first},{}<version>:<slot>"
++ '{!first},{}<version>:<slot>'
++ end
++
++ def self.eix_installed_versions_format
++ '{!first},{}<version>'
++ end
++
++ def self.eix_install_versions_format
++ '{!first}{!last},{}{}{isstable}<version>{}'
++ end
++
++ def self.eix_limit
++ '0'
+ end
+
+ def self.eix_search_arguments
+- ["--nocolor", "--pure-packages", "--format",self.eix_search_format]
++ ['--nocolor', '--pure-packages', '--format', self.eix_search_format]
++ end
++
++ def install_options
++ join_options(@resource[:install_options])
++ end
++
++ def uninstall_options
++ join_options(@resource[:uninstall_options])
+ end
+ end
diff --git a/app-admin/puppet/files/50puppet-mode-gentoo.el b/app-admin/puppet/files/50puppet-mode-gentoo.el
new file mode 100644
index 000000000000..64c38ae5a31d
--- /dev/null
+++ b/app-admin/puppet/files/50puppet-mode-gentoo.el
@@ -0,0 +1,6 @@
+
+;;; puppet-mode site-lisp configuration
+
+(add-to-list 'load-path "@SITELISP@")
+(autoload 'puppet-mode "puppet-mode" "Major mode for editing puppet manifests")
+(add-to-list 'auto-mode-alist '("\\.pp$" . puppet-mode))
diff --git a/app-admin/puppet/files/puppet-fix-tests-4.7.0.patch b/app-admin/puppet/files/puppet-fix-tests-4.7.0.patch
new file mode 100644
index 000000000000..7d62e0c1f786
--- /dev/null
+++ b/app-admin/puppet/files/puppet-fix-tests-4.7.0.patch
@@ -0,0 +1,18 @@
+--- spec/unit/network/http/api/indirected_routes_spec.rb 2016-10-11 13:24:09.500955469 -0500
++++ spec/unit/network/http/api/indirected_routes_spec.rb.new 2016-10-11 13:24:00.501700977 -0500
+@@ -139,15 +139,6 @@
+ indirection, _, _, _ = handler.uri2indirection("GET", uri_escaped, params)
+ end
+
+- it "should not pass through an environment to check_authorization and fail if the environment is unknown" do
+- handler.expects(:check_authorization).with(anything,
+- anything,
+- Not(has_entry(:environment)))
+- expect(lambda { handler.uri2indirection("GET",
+- "#{master_url_prefix}/node/bar",
+- {:environment => 'bogus'}) }).to raise_error(not_found_error)
+- end
+-
+ it "should not URI unescape the indirection key as passed through to a call to check_authorization" do
+ handler.expects(:check_authorization).with(anything,
+ anything,
diff --git a/app-admin/puppet/files/puppet-systemd.patch b/app-admin/puppet/files/puppet-systemd.patch
new file mode 100644
index 000000000000..72d7d69a2f77
--- /dev/null
+++ b/app-admin/puppet/files/puppet-systemd.patch
@@ -0,0 +1,10 @@
+--- ext/systemd/puppet.service 2017-02-02 18:28:58.000000000 -0600
++++ ext/systemd/puppet.service 2017-03-09 10:56:59.091489324 -0600
+@@ -17,7 +17,7 @@
+ EnvironmentFile=-/etc/sysconfig/puppetagent
+ EnvironmentFile=-/etc/sysconfig/puppet
+ EnvironmentFile=-/etc/default/puppet
+-ExecStart=/opt/puppetlabs/puppet/bin/puppet agent $PUPPET_EXTRA_OPTS --no-daemonize
++ExecStart=/usr/bin/puppet agent $PUPPET_EXTRA_OPTS --no-daemonize
+ ExecReload=/bin/kill -HUP $MAINPID
+ KillMode=process
diff --git a/app-admin/puppet/files/puppet.init b/app-admin/puppet/files/puppet.init
new file mode 100644
index 000000000000..d30367ad3fb2
--- /dev/null
+++ b/app-admin/puppet/files/puppet.init
@@ -0,0 +1,40 @@
+#!/sbin/openrc-run
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+ need localmount net
+ use dns logger puppetmaster netmount nfsmount
+}
+
+checkconfig() {
+ if [ ! -d "${PUPPET_PID_DIR}" ] ; then
+ eerror "Please make sure PUPPET_PID_DIR is defined and points to a existing directory"
+ return 1
+ fi
+
+ return 0
+}
+
+start() {
+ checkconfig || return $?
+
+ local options=""
+ [ -n "${PUPPET_EXTRA_OPTS}" ] && options="${options} ${PUPPET_EXTRA_OPTS}"
+
+ ebegin "Starting puppet"
+ start-stop-daemon --start --quiet \
+ --pidfile "${PUPPET_PID_DIR}/agent.pid" \
+ --exec /usr/bin/puppetd -- ${options}
+ eend $? "Failed to start puppet"
+}
+
+stop() {
+ ebegin "Stopping puppet"
+ start-stop-daemon --stop --quiet \
+ --pidfile "${PUPPET_PID_DIR}/agent.pid"
+ local ret=$?
+ eend ${ret} "Failed to stop puppet"
+ rm -f "${PUPPET_PID_DIR}/agent.pid"
+ return ${ret}
+}
diff --git a/app-admin/puppet/files/puppet.init-4.x b/app-admin/puppet/files/puppet.init-4.x
new file mode 100644
index 000000000000..f7106e6f0294
--- /dev/null
+++ b/app-admin/puppet/files/puppet.init-4.x
@@ -0,0 +1,29 @@
+#!/sbin/openrc-run
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+PUPPET_PID_DIR="${PUPPET_PID_DIR:-/var/run/puppet}"
+
+pidfile="${PUPPET_PID_DIR}/puppet.pid"
+PUPPET_LOG_DIR="/var/log/puppet"
+
+command="/usr/bin/puppet"
+extra_started_commands="reload"
+
+command_args="agent --pidfile ${pidfile} --confdir /etc/puppetlabs/puppet ${PUPPET_EXTRA_OPTS}"
+
+depend() {
+ need localmount
+ use dns logger puppetmaster netmount nfsmount
+}
+
+start_pre() {
+ checkpath --directory --owner puppet:puppet "${PUPPET_PID_DIR}"
+ checkpath --directory --owner puppet:puppet --mode 750 ${PUPPET_LOG_DIR}
+}
+
+reload() {
+ ebegin "Reloading $RC_SVCNAME"
+ start-stop-daemon --signal SIGHUP --pidfile "${pidfile}"
+ eend $?
+}
diff --git a/app-admin/puppet/files/puppet.init-r1 b/app-admin/puppet/files/puppet.init-r1
new file mode 100644
index 000000000000..36398d26fe2b
--- /dev/null
+++ b/app-admin/puppet/files/puppet.init-r1
@@ -0,0 +1,24 @@
+#!/sbin/openrc-run
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+PUPPET_PID_DIR="${PUPPET_PID_DIR:-/var/run/puppet}"
+
+pidfile="${PUPPET_PID_DIR}/puppet.pid"
+PUPPET_LOG_DIR="/var/log/puppet"
+
+extra_started_commands="reload"
+
+command="/usr/bin/puppet"
+
+command_args="agent --pidfile ${pidfile} ${PUPPET_EXTRA_OPTS}"
+
+depend() {
+ need localmount
+ use dns logger puppetmaster netmount nfsmount
+}
+
+start_pre() {
+ checkpath --directory --owner puppet:puppet "${PUPPET_PID_DIR}"
+ checkpath --directory --owner puppet:puppet --mode 750 ${PUPPET_LOG_DIR}
+}
diff --git a/app-admin/puppet/files/puppetmaster.confd b/app-admin/puppet/files/puppetmaster.confd
new file mode 100644
index 000000000000..afecf479a6a1
--- /dev/null
+++ b/app-admin/puppet/files/puppetmaster.confd
@@ -0,0 +1,18 @@
+# Location of PID files
+PUPPETMASTER_PID_DIR="/var/run/puppet"
+
+# Where to log general messages to.
+# Specify syslog to send log messages to the system log.
+#PUPPETMASTER_LOG="syslog"
+
+# You may specify other parameters to the puppetmaster here
+#PUPPETMASTER_EXTRA_OPTS="--noca"
+
+# You may specify an alternate port on which puppetmaster should listen.
+# Default is: 8140
+#PUPPETMASTER_PORT="8140"
+
+# To start multiple servers:
+# # cp /etc/conf.d/puppetmaster /etc/conf.d/puppetmaster.master_8141
+# # ln -s puppetmaster /etc/init.d/puppetmaster.master_8141
+# # ${EDITOR} /etc/conf.d/puppetmaster.master_8141 (set 8141 to PUPPETMASTER_PORT)
diff --git a/app-admin/puppet/files/puppetmaster.init b/app-admin/puppet/files/puppetmaster.init
new file mode 100644
index 000000000000..687003752329
--- /dev/null
+++ b/app-admin/puppet/files/puppetmaster.init
@@ -0,0 +1,37 @@
+#!/sbin/openrc-run
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+if [ "${SVCNAME}" = "puppetmaster" ] ; then
+ PUPPETMASTER_PID="master"
+else
+ PUPPETMASTER_PID="${SVCNAME#*.}"
+fi
+PUPPETMASTER_PID_DIR="${PUPPETMASTER_PID_DIR:-/var/run/puppet}"
+pidfile="${PUPPETMASTER_PID_DIR}/${PUPPETMASTER_PID}.pid"
+PUPPET_LOG_DIR="/var/log/puppet"
+
+command_args="master --pidfile ${pidfile} ${PUPPETMASTER_EXTRA_OPTS}"
+if [ -n "${PUPPETMASTER_PORT}" ] ; then
+ command_args="${command_args} --masterport ${PUPPETMASTER_PORT}"
+fi
+
+command="/usr/bin/puppet"
+extra_started_commands="reload"
+
+depend() {
+ need localmount
+ use dns logger slapd netmount nfsmount
+}
+
+start_pre() {
+ checkpath --directory --owner puppet:puppet "${PUPPETMASTER_PID_DIR}"
+ checkpath --directory --owner puppet:puppet --mode 750 ${PUPPET_LOG_DIR}
+ checkpath --file --owner puppet:puppet --mode 640 "${PUPPET_LOG_DIR}/masterhttp.log"
+}
+
+reload() {
+ ebegin "Reloading ${SVCNAME}"
+ start-stop-daemon --signal HUP --pidfile "${pidfile}"
+ eend $? "Failed to stop ${SVCNAME}"
+}
diff --git a/app-admin/puppet/files/puppetmaster.init-4.x b/app-admin/puppet/files/puppetmaster.init-4.x
new file mode 100644
index 000000000000..286f7e67579a
--- /dev/null
+++ b/app-admin/puppet/files/puppetmaster.init-4.x
@@ -0,0 +1,37 @@
+#!/sbin/openrc-run
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+if [ "${SVCNAME}" = "puppetmaster" ] ; then
+ PUPPETMASTER_PID="master"
+else
+ PUPPETMASTER_PID="${SVCNAME#*.}"
+fi
+PUPPETMASTER_PID_DIR="${PUPPETMASTER_PID_DIR:-/var/run/puppet}"
+pidfile="${PUPPETMASTER_PID_DIR}/${PUPPETMASTER_PID}.pid"
+PUPPET_LOG_DIR="/var/log/puppet"
+
+command_args="master --pidfile ${pidfile} --confdir /etc/puppetlabs/puppet ${PUPPETMASTER_EXTRA_OPTS}"
+if [ -n "${PUPPETMASTER_PORT}" ] ; then
+ command_args="${command_args} --masterport ${PUPPETMASTER_PORT}"
+fi
+
+command="/usr/bin/puppet"
+extra_started_commands="reload"
+
+depend() {
+ need localmount
+ use dns logger slapd netmount nfsmount
+}
+
+start_pre() {
+ checkpath --directory --owner puppet:puppet "${PUPPETMASTER_PID_DIR}"
+ checkpath --directory --owner puppet:puppet --mode 750 ${PUPPET_LOG_DIR}
+ checkpath --file --owner puppet:puppet --mode 640 "${PUPPET_LOG_DIR}/masterhttp.log"
+}
+
+reload() {
+ ebegin "Reloading $RC_SVCNAME"
+ start-stop-daemon --signal SIGHUP --pidfile "${pidfile}"
+ eend $?
+}
diff --git a/app-admin/puppet/files/puppetmaster.init-r1 b/app-admin/puppet/files/puppetmaster.init-r1
new file mode 100644
index 000000000000..22479c5e1a61
--- /dev/null
+++ b/app-admin/puppet/files/puppetmaster.init-r1
@@ -0,0 +1,30 @@
+#!/sbin/openrc-run
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+if [ "${SVCNAME}" = "puppetmaster" ] ; then
+ PUPPETMASTER_PID="master"
+else
+ PUPPETMASTER_PID="${SVCNAME#*.}"
+fi
+PUPPETMASTER_PID_DIR="${PUPPETMASTER_PID_DIR:-/var/run/puppet}"
+pidfile="${PUPPETMASTER_PID_DIR}/${PUPPETMASTER_PID}.pid"
+PUPPET_LOG_DIR="/var/log/puppet"
+
+command_args="master --pidfile ${pidfile} ${PUPPETMASTER_EXTRA_OPTS}"
+if [ -n "${PUPPETMASTER_PORT}" ] ; then
+ command_args="${command_args} --masterport ${PUPPETMASTER_PORT}"
+fi
+
+command="/usr/bin/puppet"
+
+depend() {
+ need localmount
+ use dns logger slapd netmount nfsmount
+}
+
+start_pre() {
+ checkpath --directory --owner puppet:puppet "${PUPPETMASTER_PID_DIR}"
+ checkpath --directory --owner puppet:puppet --mode 750 ${PUPPET_LOG_DIR}
+ checkpath --file --owner puppet:puppet --mode 640 "${PUPPET_LOG_DIR}/masterhttp.log"
+}
diff --git a/app-admin/puppet/files/tmpfiles.d b/app-admin/puppet/files/tmpfiles.d
new file mode 100644
index 000000000000..cd33231df7f7
--- /dev/null
+++ b/app-admin/puppet/files/tmpfiles.d
@@ -0,0 +1 @@
+D /var/run/puppet 0755 puppet puppet -
diff --git a/app-admin/puppet/metadata.xml b/app-admin/puppet/metadata.xml
new file mode 100644
index 000000000000..fcc0764c44d5
--- /dev/null
+++ b/app-admin/puppet/metadata.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>prometheanfire@gentoo.org</email>
+ </maintainer>
+ <maintainer type="project">
+ <email>sysadmin@gentoo.org</email>
+ <name>Gentoo Sysadmin Project</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>ruby@gentoo.org</email>
+ <name>Gentoo Ruby Project</name>
+ </maintainer>
+ <longdescription lang="en">
+ Centralised configuration management for networks
+ Puppet lets you centrally manage every important aspect of your system
+ using a cross-platform specification language that manages all the
+ separate elements normally aggregated in different files, like users,
+ cron jobs, and hosts, along with obviously discrete elements like
+ packages, services, and files.
+
+ Puppet's simple declarative specification language provides powerful
+ classing abilities for drawing out the similarities between hosts while
+ allowing them to be as specific as necessary, and it handles dependency
+ and prerequisite relationships between objects clearly and explicitly.
+ </longdescription>
+ <use>
+<!-- <flag name='puppetdb'>Enable puppetdb support</flag> -->
+ <flag name="augeas">Enable augeas support</flag>
+ <flag name="diff">Enable diff support</flag>
+ <flag name="rrdtool">Enable rrdtool support</flag>
+ <flag name="shadow">Enable shadow support</flag>
+ <flag name="experimental">Add patches for things in testing</flag>
+ </use>
+</pkgmetadata>
diff --git a/app-admin/puppet/puppet-3.8.7-r1.ebuild b/app-admin/puppet/puppet-3.8.7-r1.ebuild
new file mode 100644
index 000000000000..f7e608e5bbfa
--- /dev/null
+++ b/app-admin/puppet/puppet-3.8.7-r1.ebuild
@@ -0,0 +1,196 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+USE_RUBY="ruby21 ruby22 ruby23"
+
+RUBY_FAKEGEM_RECIPE_TEST="rspec"
+
+inherit elisp-common xemacs-elisp-common eutils user ruby-fakegem versionator
+
+DESCRIPTION="A system automation and configuration management software"
+HOMEPAGE="http://puppetlabs.com/"
+SRC_URI="http://downloads.puppetlabs.com/puppet/${P}.tar.gz"
+
+LICENSE="Apache-2.0 GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~hppa ~ppc ~sparc ~x86"
+IUSE="augeas diff doc emacs ldap minimal rrdtool selinux shadow sqlite vim-syntax xemacs"
+
+ruby_add_rdepend "
+ dev-ruby/hiera
+ >=dev-ruby/rgen-0.7.0
+ >=dev-ruby/facter-1.6.2 <dev-ruby/facter-3
+ dev-ruby/json
+ augeas? ( dev-ruby/ruby-augeas )
+ diff? ( dev-ruby/diff-lcs )
+ doc? ( dev-ruby/rdoc )
+ ldap? ( dev-ruby/ruby-ldap )
+ shadow? ( dev-ruby/ruby-shadow )
+ sqlite? ( dev-ruby/sqlite3 )
+ virtual/ruby-ssl"
+
+ruby_add_bdepend "test? ( dev-ruby/mocha )"
+
+DEPEND="${DEPEND}
+ emacs? ( virtual/emacs )
+ xemacs? ( app-editors/xemacs )"
+RDEPEND="${RDEPEND}
+ rrdtool? ( >=net-analyzer/rrdtool-1.2.23[ruby] )
+ selinux? (
+ sys-libs/libselinux[ruby]
+ sec-policy/selinux-puppet
+ )
+ vim-syntax? ( >=app-vim/puppet-syntax-3.0.1 )
+ >=app-portage/eix-0.18.0"
+
+SITEFILE="50${PN}-mode-gentoo.el"
+
+pkg_setup() {
+ enewgroup puppet
+ enewuser puppet -1 -1 /var/lib/puppet puppet
+}
+
+all_ruby_prepare() {
+ # Fix compatibility with ruby22 and later. Psych has been the
+ # default YAML engine since ruby 2.0 and ruby22 and later no longer
+ # define YAML::ENGINE at all.
+ sed -i -e '/YAML_ENGINE =/ s/syck/psych/' lib/puppet/vendor/safe_yaml/lib/safe_yaml.rb
+
+ # Avoid spec that require unpackaged json-schema.
+ rm spec/lib/matchers/json.rb $( grep -Rl matchers/json spec) || die
+
+ # Avoid Rails specs to avoid this dependency and because they
+ # currently fail against Rails 4.1.
+ find spec -type f -name '*rails*' -o -name '*active_record*' | xargs rm || die
+ rm -r spec/unit/rails || die
+ rm spec/unit/parser/collector_spec.rb || die
+
+ # Avoid specs that can only run in the puppet.git repository. This
+ # should be narrowed down to the specific specs.
+ rm spec/integration/parser/compiler_spec.rb spec/integration/parser/future_compiler_spec.rb || die
+
+ # Avoid failing spec that need further investigation.
+ rm spec/unit/module_tool/metadata_spec.rb || die
+}
+
+all_ruby_compile() {
+ if use emacs ; then
+ elisp-compile ext/emacs/puppet-mode.el
+ fi
+
+ if use xemacs ; then
+ # Create a separate version for xemacs to be able to install
+ # emacs and xemacs in parallel.
+ mkdir ext/xemacs
+ cp ext/emacs/* ext/xemacs/
+ xemacs-elisp-compile ext/xemacs/puppet-mode.el
+ fi
+}
+
+each_ruby_install() {
+ each_fakegem_install
+ #${RUBY} install.rb --destdir="${D}" install || die
+}
+
+all_ruby_install() {
+ all_fakegem_install
+
+ #systemd stuffs
+ insinto /usr/lib/systemd/system
+ doins "${WORKDIR}/all/${P}/ext/systemd/puppet.service"
+ insinto /usr/lib/tmpfiles.d
+ newins "${FILESDIR}/tmpfiles.d" "puppet.conf"
+
+ newinitd "${FILESDIR}"/puppet.init-r1 puppet
+
+ # Initial configuration files
+ insinto /etc/puppet
+
+ # Location of log and data files
+ keepdir /var/log/puppet
+ fowners -R puppet:puppet /var/log/puppet
+
+ if use minimal ; then
+ rm "${ED}/etc/puppet/auth.conf"
+ else
+ insinto /usr/lib/systemd/system
+ doins "${WORKDIR}/all/${P}/ext/systemd/puppetmaster.service"
+ newinitd "${FILESDIR}"/puppetmaster.init-r1 puppetmaster
+ newconfd "${FILESDIR}"/puppetmaster.confd puppetmaster
+
+ insinto /etc/puppet
+
+ keepdir /etc/puppet/manifests
+ keepdir /etc/puppet/modules
+
+ keepdir /var/lib/puppet/ssl
+ keepdir /var/lib/puppet/facts
+ keepdir /var/lib/puppet/files
+ fowners -R puppet:puppet /var/lib/puppet
+ fperms 0750 /var/lib/puppet
+ fi
+ fperms 0750 /etc/puppet
+ fowners :puppet /etc/puppet
+
+ if use emacs ; then
+ elisp-install ${PN} ext/emacs/puppet-mode.el*
+ elisp-site-file-install "${FILESDIR}/${SITEFILE}"
+ fi
+
+ if use xemacs ; then
+ xemacs-elisp-install ${PN} ext/xemacs/puppet-mode.el*
+ xemacs-elisp-site-file-install "${FILESDIR}/${SITEFILE}"
+ fi
+
+ if use ldap ; then
+ insinto /etc/openldap/schema; doins ext/ldap/puppet.schema
+ fi
+
+ # ext and examples files
+ for f in $(find ext examples -type f) ; do
+ docinto "$(dirname ${f})"; dodoc "${f}"
+ done
+}
+
+pkg_postinst() {
+ elog
+ elog "Please, *don't* include the --ask option in EMERGE_EXTRA_OPTS as this could"
+ elog "cause puppet to hang while installing packages."
+ elog
+ elog "Portage Puppet module with Gentoo-specific resources:"
+ elog "http://forge.puppetlabs.com/gentoo/portage"
+ elog
+
+ if [ \
+ -f "${EPREFIX}/etc/puppet/puppetd.conf" -o \
+ -f "${EPREFIX}/etc/puppet/puppetmaster.conf" -o \
+ -f "${EPREFIX}/etc/puppet/puppetca.conf" \
+ ] ; then
+ elog
+ elog "Please remove deprecated config files."
+ elog " /etc/puppet/puppetca.conf"
+ elog " /etc/puppet/puppetd.conf"
+ elog " /etc/puppet/puppetmasterd.conf"
+ elog
+ fi
+
+ local v
+ for v in ${REPLACING_VERSIONS}; do
+ if [ "$(get_major_version $v)" = "2" ]; then
+ elog
+ elog "If you're upgrading from 2.x then we strongly suggest you to read:"
+ elog "http://docs.puppetlabs.com/guides/upgrading.html"
+ elog
+ fi
+ done
+
+ use emacs && elisp-site-regen
+ use xemacs && xemacs-elisp-site-regen
+}
+
+pkg_postrm() {
+ use emacs && elisp-site-regen
+ use xemacs && xemacs-elisp-site-regen
+}
diff --git a/app-admin/puppet/puppet-4.10.1.ebuild b/app-admin/puppet/puppet-4.10.1.ebuild
new file mode 100644
index 000000000000..77b1ce4bfcd7
--- /dev/null
+++ b/app-admin/puppet/puppet-4.10.1.ebuild
@@ -0,0 +1,184 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+USE_RUBY="ruby21 ruby22"
+
+RUBY_FAKEGEM_RECIPE_TEST="rspec3"
+
+inherit elisp-common xemacs-elisp-common eutils user ruby-fakegem versionator
+
+DESCRIPTION="A system automation and configuration management software."
+HOMEPAGE="http://puppetlabs.com/"
+SRC_URI="http://downloads.puppetlabs.com/puppet/${P}.tar.gz"
+
+LICENSE="Apache-2.0 GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~hppa ~ppc x86"
+IUSE="augeas diff doc emacs experimental ldap rrdtool selinux shadow sqlite vim-syntax xemacs"
+RESTRICT="test"
+
+ruby_add_rdepend "
+ dev-ruby/hiera
+ >=dev-ruby/rgen-0.6.5
+ dev-ruby/json:=
+ >=dev-ruby/facter-3.0.0
+ augeas? ( dev-ruby/ruby-augeas )
+ diff? ( dev-ruby/diff-lcs )
+ doc? ( dev-ruby/rdoc )
+ ldap? ( dev-ruby/ruby-ldap )
+ shadow? ( dev-ruby/ruby-shadow )
+ sqlite? ( dev-ruby/sqlite3 )
+ virtual/ruby-ssl"
+
+ruby_add_bdepend "
+ test? (
+ dev-ruby/mocha
+ dev-ruby/rack
+ dev-ruby/rspec-its
+ )"
+# this should go in the above lists, but isn't because of test deps not being keyworded
+# dev-ruby/rspec-collection_matchers
+
+DEPEND+=" ${DEPEND}
+ emacs? ( virtual/emacs )
+ xemacs? ( app-editors/xemacs )"
+RDEPEND+=" ${RDEPEND}
+ rrdtool? ( >=net-analyzer/rrdtool-1.2.23[ruby] )
+ selinux? (
+ sys-libs/libselinux[ruby]
+ sec-policy/selinux-puppet
+ )
+ vim-syntax? ( >=app-vim/puppet-syntax-3.0.1 )
+ >=app-portage/eix-0.18.0"
+
+SITEFILE="50${PN}-mode-gentoo.el"
+
+pkg_setup() {
+ enewgroup puppet
+ enewuser puppet -1 -1 /var/lib/puppet puppet
+}
+
+all_ruby_prepare() {
+ # Avoid spec that require unpackaged json-schema.
+ rm spec/lib/matchers/json.rb $( grep -Rl matchers/json spec) || die
+
+ # can't be run within portage.
+ epatch "${FILESDIR}/puppet-fix-tests-4.7.0.patch"
+
+ # fix systemd path
+ epatch "${FILESDIR}/puppet-systemd.patch"
+
+ if use experimental; then
+ epatch "${FILESDIR}/43e2c935252b995134ce353e5e6312cf77aea480.patch"
+ fi
+
+ # Avoid specs that can only run in the puppet.git repository. This
+ # should be narrowed down to the specific specs.
+ rm spec/integration/parser/compiler_spec.rb || die
+
+ # Avoid failing spec that need further investigation.
+ rm spec/unit/module_tool/metadata_spec.rb || die
+}
+
+all_ruby_compile() {
+ if use emacs ; then
+ elisp-compile ext/emacs/puppet-mode.el
+ fi
+
+ if use xemacs ; then
+ # Create a separate version for xemacs to be able to install
+ # emacs and xemacs in parallel.
+ mkdir ext/xemacs
+ cp ext/emacs/* ext/xemacs/
+ xemacs-elisp-compile ext/xemacs/puppet-mode.el
+ fi
+}
+
+each_ruby_install() {
+ each_fakegem_install
+# dosym "/usr/$(get_libdir)/ruby/gems/$(ruby_get_version)/gems/${P}" "/usr/$(get_libdir)/ruby/gems/$(ruby_get_version)/gems/${PN}"
+}
+
+all_ruby_install() {
+ all_fakegem_install
+
+ # systemd stuffs
+ insinto /usr/lib/systemd/system
+ doins "${WORKDIR}/all/${P}/ext/systemd/puppet.service"
+
+ # tmpfiles stuff
+ insinto /usr/lib/tmpfiles.d
+ newins "${FILESDIR}/tmpfiles.d" "puppet.conf"
+
+ # openrc init stuff
+ newinitd "${FILESDIR}"/puppet.init-4.x puppet
+ newinitd "${FILESDIR}"/puppetmaster.init-4.x puppetmaster
+ newconfd "${FILESDIR}"/puppetmaster.confd puppetmaster
+
+ keepdir /etc/puppetlabs/puppet/ssl
+
+ keepdir /var/lib/puppet/facts
+ keepdir /var/lib/puppet/files
+ fowners -R puppet:puppet /var/lib/puppet
+
+ fperms 0750 /var/lib/puppet
+
+ fperms 0750 /etc/puppetlabs
+ fperms 0750 /etc/puppetlabs/puppet
+ fperms 0750 /etc/puppetlabs/puppet/ssl
+ fowners -R :puppet /etc/puppetlabs
+ fowners -R :puppet /var/lib/puppet
+
+ if use emacs ; then
+ elisp-install ${PN} ext/emacs/puppet-mode.el*
+ elisp-site-file-install "${FILESDIR}/${SITEFILE}"
+ fi
+
+ if use xemacs ; then
+ xemacs-elisp-install ${PN} ext/xemacs/puppet-mode.el*
+ xemacs-elisp-site-file-install "${FILESDIR}/${SITEFILE}"
+ fi
+
+ if use ldap ; then
+ insinto /etc/openldap/schema; doins ext/ldap/puppet.schema
+ fi
+
+ # ext and examples files
+ for f in $(find ext examples -type f) ; do
+ docinto "$(dirname ${f})"; dodoc "${f}"
+ done
+}
+
+pkg_postinst() {
+ elog
+ elog "Please, *don't* include the --ask option in EMERGE_EXTRA_OPTS as this could"
+ elog "cause puppet to hang while installing packages."
+ elog
+ elog "Portage Puppet module with Gentoo-specific resources:"
+ elog "http://forge.puppetlabs.com/gentoo/portage"
+ elog
+
+ local v
+ for v in ${REPLACING_VERSIONS}; do
+ if [ "$(get_major_version $v)" = "3" ]; then
+ elog
+ elog "If you're upgrading from 3.x then please move everything in /etc/puppet to"
+ elog "/etc/puppetlabs/puppet"
+ elog "Also, puppet now uses config directories for modules and manifests."
+ elog "See https://docs.puppetlabs.com/puppet/4.0/reference/upgrade_agent.html"
+ elog "and https://docs.puppetlabs.com/puppet/4.0/reference/upgrade_server.html"
+ elog "for more information."
+ elog
+ fi
+ done
+
+ use emacs && elisp-site-regen
+ use xemacs && xemacs-elisp-site-regen
+}
+
+pkg_postrm() {
+ use emacs && elisp-site-regen
+ use xemacs && xemacs-elisp-site-regen
+}
diff --git a/app-admin/puppet/puppet-4.10.6-r1.ebuild b/app-admin/puppet/puppet-4.10.6-r1.ebuild
new file mode 100644
index 000000000000..62e5e757fb54
--- /dev/null
+++ b/app-admin/puppet/puppet-4.10.6-r1.ebuild
@@ -0,0 +1,194 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+USE_RUBY="ruby21 ruby22 ruby23"
+
+#RUBY_FAKEGEM_RECIPE_TEST="rspec3"
+
+RUBY_FAKEGEM_EXTRAINSTALL="locales"
+
+inherit xemacs-elisp-common eutils user ruby-fakegem versionator
+
+DESCRIPTION="A system automation and configuration management software."
+HOMEPAGE="http://puppetlabs.com/"
+SRC_URI="http://downloads.puppetlabs.com/puppet/${P}.tar.gz"
+
+LICENSE="Apache-2.0 GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~hppa ~ppc ~ppc64 ~x86"
+IUSE="augeas diff doc emacs experimental ldap rrdtool selinux shadow sqlite vim-syntax xemacs"
+RESTRICT="test"
+
+ruby_add_rdepend "
+ dev-ruby/hiera
+ >=dev-ruby/rgen-0.6.5
+ dev-ruby/json:=
+ >=dev-ruby/facter-3.0.0
+ augeas? ( dev-ruby/ruby-augeas )
+ diff? ( dev-ruby/diff-lcs )
+ doc? ( dev-ruby/rdoc )
+ ldap? ( dev-ruby/ruby-ldap )
+ shadow? ( dev-ruby/ruby-shadow )
+ sqlite? ( dev-ruby/sqlite3 )
+ virtual/ruby-ssl"
+
+# ruby_add_bdepend "
+# test? (
+# dev-ruby/mocha:0.14
+# =dev-ruby/rack-1*
+# dev-ruby/rspec-its
+# dev-ruby/rspec-collection_matchers
+# >=dev-ruby/vcr-2.9:2
+# >=dev-ruby/webmock-1.24:0
+# )"
+
+DEPEND+=" ${DEPEND}
+ xemacs? ( app-editors/xemacs )"
+RDEPEND+=" ${RDEPEND}
+ rrdtool? ( >=net-analyzer/rrdtool-1.2.23[ruby] )
+ selinux? (
+ sys-libs/libselinux[ruby]
+ sec-policy/selinux-puppet
+ )
+ vim-syntax? ( >=app-vim/puppet-syntax-3.0.1 )
+ >=app-portage/eix-0.18.0"
+PDEPEND="emacs? ( >=app-emacs/puppet-mode-0.3-r1 )"
+
+SITEFILE="50${PN}-mode-gentoo.el"
+
+pkg_setup() {
+ enewgroup puppet
+ enewuser puppet -1 -1 /var/lib/puppet puppet
+}
+
+all_ruby_prepare() {
+ # Avoid spec that require unpackaged json-schema.
+ rm spec/lib/matchers/json.rb $( grep -Rl matchers/json spec) || die
+
+ # can't be run within portage.
+ epatch "${FILESDIR}/puppet-fix-tests-4.7.0.patch"
+
+ # fix systemd path
+ epatch "${FILESDIR}/puppet-systemd.patch"
+
+ if use experimental; then
+ epatch "${FILESDIR}/43e2c935252b995134ce353e5e6312cf77aea480.patch"
+ fi
+
+ # Use working version of mocha
+ sed -i -e '1igem "mocha", "~>0.14.0"; gem "rack", "~>1.0"' spec/spec_helper.rb || die
+
+ # Avoid specs that can only run in the puppet.git repository. This
+ # should be narrowed down to the specific specs.
+ rm spec/integration/parser/compiler_spec.rb || die
+
+ # Avoid failing specs that need further investigation.
+ sed -i -e '/should resolve external facts/,/^ end/ s:^:#:' \
+ spec/integration/indirector/facts/facter_spec.rb || die
+ sed -i -e "/describe 'cfacter'/,/^ end/ s:^:#:" spec/unit/defaults_spec.rb || die
+ rm -f spec/unit/indirector/ldap_spec.rb \
+ spec/unit/parser/functions/create_resources_spec.rb || die
+
+ # Avoid specs that rely on tools from other OSs
+ rm -f spec/unit/provider/package/{dnf,tdnf,yum}_spec.rb \
+ spec/unit/provider/user/directoryservice_spec.rb || die
+
+ # Avoid specs that depend on hiera-eyaml to avoid circular
+ # dependencies
+ rm -f spec/unit/functions/lookup_spec.rb || die
+
+ # Avoid specs that fail due to an unpackaged file
+ sed -i -e '/when loading pp resource types using auto loading/,/^ end/ s:^:#:' spec/unit/pops/loaders/loaders_spec.rb || die
+}
+
+all_ruby_compile() {
+ if use xemacs ; then
+ # Create a separate version for xemacs to be able to install
+ # emacs and xemacs in parallel.
+ mkdir ext/xemacs
+ cp ext/emacs/* ext/xemacs/
+ xemacs-elisp-compile ext/xemacs/puppet-mode.el
+ fi
+}
+
+each_ruby_install() {
+ each_fakegem_install
+# dosym "/usr/$(get_libdir)/ruby/gems/$(ruby_get_version)/gems/${P}" "/usr/$(get_libdir)/ruby/gems/$(ruby_get_version)/gems/${PN}"
+}
+
+all_ruby_install() {
+ all_fakegem_install
+
+ # systemd stuffs
+ insinto /usr/lib/systemd/system
+ doins "${WORKDIR}/all/${P}/ext/systemd/puppet.service"
+
+ # tmpfiles stuff
+ insinto /usr/lib/tmpfiles.d
+ newins "${FILESDIR}/tmpfiles.d" "puppet.conf"
+
+ # openrc init stuff
+ newinitd "${FILESDIR}"/puppet.init-4.x puppet
+ newinitd "${FILESDIR}"/puppetmaster.init-4.x puppetmaster
+ newconfd "${FILESDIR}"/puppetmaster.confd puppetmaster
+
+ keepdir /etc/puppetlabs/puppet/ssl
+
+ keepdir /var/lib/puppet/facts
+ keepdir /var/lib/puppet/files
+ fowners -R puppet:puppet /var/lib/puppet
+
+ fperms 0750 /var/lib/puppet
+
+ fperms 0750 /etc/puppetlabs
+ fperms 0750 /etc/puppetlabs/puppet
+ fperms 0750 /etc/puppetlabs/puppet/ssl
+ fowners -R :puppet /etc/puppetlabs
+ fowners -R :puppet /var/lib/puppet
+
+ if use xemacs ; then
+ xemacs-elisp-install ${PN} ext/xemacs/puppet-mode.el*
+ xemacs-elisp-site-file-install "${FILESDIR}/${SITEFILE}"
+ fi
+
+ if use ldap ; then
+ insinto /etc/openldap/schema; doins ext/ldap/puppet.schema
+ fi
+
+ # ext and examples files
+ for f in $(find ext examples -type f) ; do
+ docinto "$(dirname ${f})"; dodoc "${f}"
+ done
+}
+
+pkg_postinst() {
+ elog
+ elog "Please, *don't* include the --ask option in EMERGE_EXTRA_OPTS as this could"
+ elog "cause puppet to hang while installing packages."
+ elog
+ elog "Portage Puppet module with Gentoo-specific resources:"
+ elog "http://forge.puppetlabs.com/gentoo/portage"
+ elog
+
+ local v
+ for v in ${REPLACING_VERSIONS}; do
+ if [ "$(get_major_version $v)" = "3" ]; then
+ elog
+ elog "If you're upgrading from 3.x then please move everything in /etc/puppet to"
+ elog "/etc/puppetlabs/puppet"
+ elog "Also, puppet now uses config directories for modules and manifests."
+ elog "See https://docs.puppetlabs.com/puppet/4.0/reference/upgrade_agent.html"
+ elog "and https://docs.puppetlabs.com/puppet/4.0/reference/upgrade_server.html"
+ elog "for more information."
+ elog
+ fi
+ done
+
+ use xemacs && xemacs-elisp-site-regen
+}
+
+pkg_postrm() {
+ use xemacs && xemacs-elisp-site-regen
+}
diff --git a/app-admin/puppet/puppet-4.10.6.ebuild b/app-admin/puppet/puppet-4.10.6.ebuild
new file mode 100644
index 000000000000..90ba147596df
--- /dev/null
+++ b/app-admin/puppet/puppet-4.10.6.ebuild
@@ -0,0 +1,192 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+USE_RUBY="ruby21 ruby22 ruby23"
+
+#RUBY_FAKEGEM_RECIPE_TEST="rspec3"
+
+inherit xemacs-elisp-common eutils user ruby-fakegem versionator
+
+DESCRIPTION="A system automation and configuration management software."
+HOMEPAGE="http://puppetlabs.com/"
+SRC_URI="http://downloads.puppetlabs.com/puppet/${P}.tar.gz"
+
+LICENSE="Apache-2.0 GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~hppa ~ppc ~x86"
+IUSE="augeas diff doc emacs experimental ldap rrdtool selinux shadow sqlite vim-syntax xemacs"
+RESTRICT="test"
+
+ruby_add_rdepend "
+ dev-ruby/hiera
+ >=dev-ruby/rgen-0.6.5
+ dev-ruby/json:=
+ >=dev-ruby/facter-3.0.0
+ augeas? ( dev-ruby/ruby-augeas )
+ diff? ( dev-ruby/diff-lcs )
+ doc? ( dev-ruby/rdoc )
+ ldap? ( dev-ruby/ruby-ldap )
+ shadow? ( dev-ruby/ruby-shadow )
+ sqlite? ( dev-ruby/sqlite3 )
+ virtual/ruby-ssl"
+
+# ruby_add_bdepend "
+# test? (
+# dev-ruby/mocha:0.14
+# =dev-ruby/rack-1*
+# dev-ruby/rspec-its
+# dev-ruby/rspec-collection_matchers
+# >=dev-ruby/vcr-2.9:2
+# >=dev-ruby/webmock-1.24:0
+# )"
+
+DEPEND+=" ${DEPEND}
+ xemacs? ( app-editors/xemacs )"
+RDEPEND+=" ${RDEPEND}
+ rrdtool? ( >=net-analyzer/rrdtool-1.2.23[ruby] )
+ selinux? (
+ sys-libs/libselinux[ruby]
+ sec-policy/selinux-puppet
+ )
+ vim-syntax? ( >=app-vim/puppet-syntax-3.0.1 )
+ >=app-portage/eix-0.18.0"
+PDEPEND="emacs? ( >=app-emacs/puppet-mode-0.3-r1 )"
+
+SITEFILE="50${PN}-mode-gentoo.el"
+
+pkg_setup() {
+ enewgroup puppet
+ enewuser puppet -1 -1 /var/lib/puppet puppet
+}
+
+all_ruby_prepare() {
+ # Avoid spec that require unpackaged json-schema.
+ rm spec/lib/matchers/json.rb $( grep -Rl matchers/json spec) || die
+
+ # can't be run within portage.
+ epatch "${FILESDIR}/puppet-fix-tests-4.7.0.patch"
+
+ # fix systemd path
+ epatch "${FILESDIR}/puppet-systemd.patch"
+
+ if use experimental; then
+ epatch "${FILESDIR}/43e2c935252b995134ce353e5e6312cf77aea480.patch"
+ fi
+
+ # Use working version of mocha
+ sed -i -e '1igem "mocha", "~>0.14.0"; gem "rack", "~>1.0"' spec/spec_helper.rb || die
+
+ # Avoid specs that can only run in the puppet.git repository. This
+ # should be narrowed down to the specific specs.
+ rm spec/integration/parser/compiler_spec.rb || die
+
+ # Avoid failing specs that need further investigation.
+ sed -i -e '/should resolve external facts/,/^ end/ s:^:#:' \
+ spec/integration/indirector/facts/facter_spec.rb || die
+ sed -i -e "/describe 'cfacter'/,/^ end/ s:^:#:" spec/unit/defaults_spec.rb || die
+ rm -f spec/unit/indirector/ldap_spec.rb \
+ spec/unit/parser/functions/create_resources_spec.rb || die
+
+ # Avoid specs that rely on tools from other OSs
+ rm -f spec/unit/provider/package/{dnf,tdnf,yum}_spec.rb \
+ spec/unit/provider/user/directoryservice_spec.rb || die
+
+ # Avoid specs that depend on hiera-eyaml to avoid circular
+ # dependencies
+ rm -f spec/unit/functions/lookup_spec.rb || die
+
+ # Avoid specs that fail due to an unpackaged file
+ sed -i -e '/when loading pp resource types using auto loading/,/^ end/ s:^:#:' spec/unit/pops/loaders/loaders_spec.rb || die
+}
+
+all_ruby_compile() {
+ if use xemacs ; then
+ # Create a separate version for xemacs to be able to install
+ # emacs and xemacs in parallel.
+ mkdir ext/xemacs
+ cp ext/emacs/* ext/xemacs/
+ xemacs-elisp-compile ext/xemacs/puppet-mode.el
+ fi
+}
+
+each_ruby_install() {
+ each_fakegem_install
+# dosym "/usr/$(get_libdir)/ruby/gems/$(ruby_get_version)/gems/${P}" "/usr/$(get_libdir)/ruby/gems/$(ruby_get_version)/gems/${PN}"
+}
+
+all_ruby_install() {
+ all_fakegem_install
+
+ # systemd stuffs
+ insinto /usr/lib/systemd/system
+ doins "${WORKDIR}/all/${P}/ext/systemd/puppet.service"
+
+ # tmpfiles stuff
+ insinto /usr/lib/tmpfiles.d
+ newins "${FILESDIR}/tmpfiles.d" "puppet.conf"
+
+ # openrc init stuff
+ newinitd "${FILESDIR}"/puppet.init-4.x puppet
+ newinitd "${FILESDIR}"/puppetmaster.init-4.x puppetmaster
+ newconfd "${FILESDIR}"/puppetmaster.confd puppetmaster
+
+ keepdir /etc/puppetlabs/puppet/ssl
+
+ keepdir /var/lib/puppet/facts
+ keepdir /var/lib/puppet/files
+ fowners -R puppet:puppet /var/lib/puppet
+
+ fperms 0750 /var/lib/puppet
+
+ fperms 0750 /etc/puppetlabs
+ fperms 0750 /etc/puppetlabs/puppet
+ fperms 0750 /etc/puppetlabs/puppet/ssl
+ fowners -R :puppet /etc/puppetlabs
+ fowners -R :puppet /var/lib/puppet
+
+ if use xemacs ; then
+ xemacs-elisp-install ${PN} ext/xemacs/puppet-mode.el*
+ xemacs-elisp-site-file-install "${FILESDIR}/${SITEFILE}"
+ fi
+
+ if use ldap ; then
+ insinto /etc/openldap/schema; doins ext/ldap/puppet.schema
+ fi
+
+ # ext and examples files
+ for f in $(find ext examples -type f) ; do
+ docinto "$(dirname ${f})"; dodoc "${f}"
+ done
+}
+
+pkg_postinst() {
+ elog
+ elog "Please, *don't* include the --ask option in EMERGE_EXTRA_OPTS as this could"
+ elog "cause puppet to hang while installing packages."
+ elog
+ elog "Portage Puppet module with Gentoo-specific resources:"
+ elog "http://forge.puppetlabs.com/gentoo/portage"
+ elog
+
+ local v
+ for v in ${REPLACING_VERSIONS}; do
+ if [ "$(get_major_version $v)" = "3" ]; then
+ elog
+ elog "If you're upgrading from 3.x then please move everything in /etc/puppet to"
+ elog "/etc/puppetlabs/puppet"
+ elog "Also, puppet now uses config directories for modules and manifests."
+ elog "See https://docs.puppetlabs.com/puppet/4.0/reference/upgrade_agent.html"
+ elog "and https://docs.puppetlabs.com/puppet/4.0/reference/upgrade_server.html"
+ elog "for more information."
+ elog
+ fi
+ done
+
+ use xemacs && xemacs-elisp-site-regen
+}
+
+pkg_postrm() {
+ use xemacs && xemacs-elisp-site-regen
+}
diff --git a/app-admin/puppet/puppet-4.10.8.ebuild b/app-admin/puppet/puppet-4.10.8.ebuild
new file mode 100644
index 000000000000..00ed4a2f7ad9
--- /dev/null
+++ b/app-admin/puppet/puppet-4.10.8.ebuild
@@ -0,0 +1,194 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+USE_RUBY="ruby22 ruby23"
+
+#RUBY_FAKEGEM_RECIPE_TEST="rspec3"
+
+RUBY_FAKEGEM_EXTRAINSTALL="locales"
+
+inherit xemacs-elisp-common eutils user ruby-fakegem versionator
+
+DESCRIPTION="A system automation and configuration management software."
+HOMEPAGE="http://puppetlabs.com/"
+SRC_URI="http://downloads.puppetlabs.com/puppet/${P}.tar.gz"
+
+LICENSE="Apache-2.0 GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~hppa ~ppc ~ppc64 ~x86"
+IUSE="augeas diff doc emacs experimental ldap rrdtool selinux shadow sqlite vim-syntax xemacs"
+RESTRICT="test"
+
+ruby_add_rdepend "
+ dev-ruby/hiera
+ >=dev-ruby/rgen-0.6.5
+ dev-ruby/json:=
+ >=dev-ruby/facter-3.0.0
+ augeas? ( dev-ruby/ruby-augeas )
+ diff? ( dev-ruby/diff-lcs )
+ doc? ( dev-ruby/rdoc )
+ ldap? ( dev-ruby/ruby-ldap )
+ shadow? ( dev-ruby/ruby-shadow )
+ sqlite? ( dev-ruby/sqlite3 )
+ virtual/ruby-ssl"
+
+# ruby_add_bdepend "
+# test? (
+# dev-ruby/mocha:0.14
+# =dev-ruby/rack-1*
+# dev-ruby/rspec-its
+# dev-ruby/rspec-collection_matchers
+# >=dev-ruby/vcr-2.9:2
+# >=dev-ruby/webmock-1.24:0
+# )"
+
+DEPEND+=" ${DEPEND}
+ xemacs? ( app-editors/xemacs )"
+RDEPEND+=" ${RDEPEND}
+ rrdtool? ( >=net-analyzer/rrdtool-1.2.23[ruby] )
+ selinux? (
+ sys-libs/libselinux[ruby]
+ sec-policy/selinux-puppet
+ )
+ vim-syntax? ( >=app-vim/puppet-syntax-3.0.1 )
+ >=app-portage/eix-0.18.0"
+PDEPEND="emacs? ( >=app-emacs/puppet-mode-0.3-r1 )"
+
+SITEFILE="50${PN}-mode-gentoo.el"
+
+pkg_setup() {
+ enewgroup puppet
+ enewuser puppet -1 -1 /var/lib/puppet puppet
+}
+
+all_ruby_prepare() {
+ # Avoid spec that require unpackaged json-schema.
+ rm spec/lib/matchers/json.rb $( grep -Rl matchers/json spec) || die
+
+ # can't be run within portage.
+ epatch "${FILESDIR}/puppet-fix-tests-4.7.0.patch"
+
+ # fix systemd path
+ epatch "${FILESDIR}/puppet-systemd.patch"
+
+ if use experimental; then
+ epatch "${FILESDIR}/43e2c935252b995134ce353e5e6312cf77aea480.patch"
+ fi
+
+ # Use working version of mocha
+ sed -i -e '1igem "mocha", "~>0.14.0"; gem "rack", "~>1.0"' spec/spec_helper.rb || die
+
+ # Avoid specs that can only run in the puppet.git repository. This
+ # should be narrowed down to the specific specs.
+ rm spec/integration/parser/compiler_spec.rb || die
+
+ # Avoid failing specs that need further investigation.
+ sed -i -e '/should resolve external facts/,/^ end/ s:^:#:' \
+ spec/integration/indirector/facts/facter_spec.rb || die
+ sed -i -e "/describe 'cfacter'/,/^ end/ s:^:#:" spec/unit/defaults_spec.rb || die
+ rm -f spec/unit/indirector/ldap_spec.rb \
+ spec/unit/parser/functions/create_resources_spec.rb || die
+
+ # Avoid specs that rely on tools from other OSs
+ rm -f spec/unit/provider/package/{dnf,tdnf,yum}_spec.rb \
+ spec/unit/provider/user/directoryservice_spec.rb || die
+
+ # Avoid specs that depend on hiera-eyaml to avoid circular
+ # dependencies
+ rm -f spec/unit/functions/lookup_spec.rb || die
+
+ # Avoid specs that fail due to an unpackaged file
+ sed -i -e '/when loading pp resource types using auto loading/,/^ end/ s:^:#:' spec/unit/pops/loaders/loaders_spec.rb || die
+}
+
+all_ruby_compile() {
+ if use xemacs ; then
+ # Create a separate version for xemacs to be able to install
+ # emacs and xemacs in parallel.
+ mkdir ext/xemacs
+ cp ext/emacs/* ext/xemacs/
+ xemacs-elisp-compile ext/xemacs/puppet-mode.el
+ fi
+}
+
+each_ruby_install() {
+ each_fakegem_install
+# dosym "/usr/$(get_libdir)/ruby/gems/$(ruby_get_version)/gems/${P}" "/usr/$(get_libdir)/ruby/gems/$(ruby_get_version)/gems/${PN}"
+}
+
+all_ruby_install() {
+ all_fakegem_install
+
+ # systemd stuffs
+ insinto /usr/lib/systemd/system
+ doins "${WORKDIR}/all/${P}/ext/systemd/puppet.service"
+
+ # tmpfiles stuff
+ insinto /usr/lib/tmpfiles.d
+ newins "${FILESDIR}/tmpfiles.d" "puppet.conf"
+
+ # openrc init stuff
+ newinitd "${FILESDIR}"/puppet.init-4.x puppet
+ newinitd "${FILESDIR}"/puppetmaster.init-4.x puppetmaster
+ newconfd "${FILESDIR}"/puppetmaster.confd puppetmaster
+
+ keepdir /etc/puppetlabs/puppet/ssl
+
+ keepdir /var/lib/puppet/facts
+ keepdir /var/lib/puppet/files
+ fowners -R puppet:puppet /var/lib/puppet
+
+ fperms 0750 /var/lib/puppet
+
+ fperms 0750 /etc/puppetlabs
+ fperms 0750 /etc/puppetlabs/puppet
+ fperms 0750 /etc/puppetlabs/puppet/ssl
+ fowners -R :puppet /etc/puppetlabs
+ fowners -R :puppet /var/lib/puppet
+
+ if use xemacs ; then
+ xemacs-elisp-install ${PN} ext/xemacs/puppet-mode.el*
+ xemacs-elisp-site-file-install "${FILESDIR}/${SITEFILE}"
+ fi
+
+ if use ldap ; then
+ insinto /etc/openldap/schema; doins ext/ldap/puppet.schema
+ fi
+
+ # ext and examples files
+ for f in $(find ext examples -type f) ; do
+ docinto "$(dirname ${f})"; dodoc "${f}"
+ done
+}
+
+pkg_postinst() {
+ elog
+ elog "Please, *don't* include the --ask option in EMERGE_EXTRA_OPTS as this could"
+ elog "cause puppet to hang while installing packages."
+ elog
+ elog "Portage Puppet module with Gentoo-specific resources:"
+ elog "http://forge.puppetlabs.com/gentoo/portage"
+ elog
+
+ local v
+ for v in ${REPLACING_VERSIONS}; do
+ if [ "$(get_major_version $v)" = "3" ]; then
+ elog
+ elog "If you're upgrading from 3.x then please move everything in /etc/puppet to"
+ elog "/etc/puppetlabs/puppet"
+ elog "Also, puppet now uses config directories for modules and manifests."
+ elog "See https://docs.puppetlabs.com/puppet/4.0/reference/upgrade_agent.html"
+ elog "and https://docs.puppetlabs.com/puppet/4.0/reference/upgrade_server.html"
+ elog "for more information."
+ elog
+ fi
+ done
+
+ use xemacs && xemacs-elisp-site-regen
+}
+
+pkg_postrm() {
+ use xemacs && xemacs-elisp-site-regen
+}
diff --git a/app-admin/puppet/puppet-4.8.1.ebuild b/app-admin/puppet/puppet-4.8.1.ebuild
new file mode 100644
index 000000000000..e2846fe6aefd
--- /dev/null
+++ b/app-admin/puppet/puppet-4.8.1.ebuild
@@ -0,0 +1,177 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+USE_RUBY="ruby21 ruby22"
+
+RUBY_FAKEGEM_RECIPE_TEST="rspec3"
+
+inherit elisp-common xemacs-elisp-common eutils user ruby-fakegem versionator
+
+DESCRIPTION="A system automation and configuration management software."
+HOMEPAGE="http://puppetlabs.com/"
+SRC_URI="http://downloads.puppetlabs.com/puppet/${P}.tar.gz"
+
+LICENSE="Apache-2.0 GPL-2"
+SLOT="0"
+KEYWORDS="amd64 hppa ~ppc ~x86"
+IUSE="augeas diff doc emacs ldap rrdtool selinux shadow sqlite vim-syntax xemacs"
+RESTRICT="test"
+
+ruby_add_rdepend "
+ dev-ruby/hiera
+ >=dev-ruby/rgen-0.6.5
+ dev-ruby/json:=
+ >=dev-ruby/facter-3.0.0
+ augeas? ( dev-ruby/ruby-augeas )
+ diff? ( dev-ruby/diff-lcs )
+ doc? ( dev-ruby/rdoc )
+ ldap? ( dev-ruby/ruby-ldap )
+ shadow? ( dev-ruby/ruby-shadow )
+ sqlite? ( dev-ruby/sqlite3 )
+ virtual/ruby-ssl"
+
+ruby_add_bdepend "
+ test? (
+ dev-ruby/mocha
+ dev-ruby/rack
+ dev-ruby/rspec-its
+ )"
+# this should go in the above lists, but isn't because of test deps not being keyworded
+# dev-ruby/rspec-collection_matchers
+
+DEPEND+=" ${DEPEND}
+ emacs? ( virtual/emacs )
+ xemacs? ( app-editors/xemacs )"
+RDEPEND+=" ${RDEPEND}
+ rrdtool? ( >=net-analyzer/rrdtool-1.2.23[ruby] )
+ selinux? (
+ sys-libs/libselinux[ruby]
+ sec-policy/selinux-puppet
+ )
+ vim-syntax? ( >=app-vim/puppet-syntax-3.0.1 )
+ >=app-portage/eix-0.18.0"
+
+SITEFILE="50${PN}-mode-gentoo.el"
+
+pkg_setup() {
+ enewgroup puppet
+ enewuser puppet -1 -1 /var/lib/puppet puppet
+}
+
+all_ruby_prepare() {
+ # Avoid spec that require unpackaged json-schema.
+ rm spec/lib/matchers/json.rb $( grep -Rl matchers/json spec) || die
+
+ # can't be run within portage.
+ epatch "${FILESDIR}/puppet-fix-tests-4.7.0.patch"
+
+ # Avoid specs that can only run in the puppet.git repository. This
+ # should be narrowed down to the specific specs.
+ rm spec/integration/parser/compiler_spec.rb || die
+
+ # Avoid failing spec that need further investigation.
+ rm spec/unit/module_tool/metadata_spec.rb || die
+}
+
+all_ruby_compile() {
+ if use emacs ; then
+ elisp-compile ext/emacs/puppet-mode.el
+ fi
+
+ if use xemacs ; then
+ # Create a separate version for xemacs to be able to install
+ # emacs and xemacs in parallel.
+ mkdir ext/xemacs
+ cp ext/emacs/* ext/xemacs/
+ xemacs-elisp-compile ext/xemacs/puppet-mode.el
+ fi
+}
+
+each_ruby_install() {
+ each_fakegem_install
+# dosym "/usr/$(get_libdir)/ruby/gems/$(ruby_get_version)/gems/${P}" "/usr/$(get_libdir)/ruby/gems/$(ruby_get_version)/gems/${PN}"
+}
+
+all_ruby_install() {
+ all_fakegem_install
+
+ # systemd stuffs
+ insinto /usr/lib/systemd/system
+ doins "${WORKDIR}/all/${P}/ext/systemd/puppet.service"
+
+ # tmpfiles stuff
+ insinto /usr/lib/tmpfiles.d
+ newins "${FILESDIR}/tmpfiles.d" "puppet.conf"
+
+ # openrc init stuff
+ newinitd "${FILESDIR}"/puppet.init-4.x puppet
+ newinitd "${FILESDIR}"/puppetmaster.init-4.x puppetmaster
+ newconfd "${FILESDIR}"/puppetmaster.confd puppetmaster
+
+ keepdir /etc/puppetlabs/puppet/ssl
+
+ keepdir /var/lib/puppet/facts
+ keepdir /var/lib/puppet/files
+ fowners -R puppet:puppet /var/lib/puppet
+
+ fperms 0750 /var/lib/puppet
+
+ fperms 0750 /etc/puppetlabs
+ fperms 0750 /etc/puppetlabs/puppet
+ fperms 0750 /etc/puppetlabs/puppet/ssl
+ fowners -R :puppet /etc/puppetlabs
+ fowners -R :puppet /var/lib/puppet
+
+ if use emacs ; then
+ elisp-install ${PN} ext/emacs/puppet-mode.el*
+ elisp-site-file-install "${FILESDIR}/${SITEFILE}"
+ fi
+
+ if use xemacs ; then
+ xemacs-elisp-install ${PN} ext/xemacs/puppet-mode.el*
+ xemacs-elisp-site-file-install "${FILESDIR}/${SITEFILE}"
+ fi
+
+ if use ldap ; then
+ insinto /etc/openldap/schema; doins ext/ldap/puppet.schema
+ fi
+
+ # ext and examples files
+ for f in $(find ext examples -type f) ; do
+ docinto "$(dirname ${f})"; dodoc "${f}"
+ done
+}
+
+pkg_postinst() {
+ elog
+ elog "Please, *don't* include the --ask option in EMERGE_EXTRA_OPTS as this could"
+ elog "cause puppet to hang while installing packages."
+ elog
+ elog "Portage Puppet module with Gentoo-specific resources:"
+ elog "http://forge.puppetlabs.com/gentoo/portage"
+ elog
+
+ local v
+ for v in ${REPLACING_VERSIONS}; do
+ if [ "$(get_major_version $v)" = "3" ]; then
+ elog
+ elog "If you're upgrading from 3.x then please move everything in /etc/puppet to"
+ elog "/etc/puppetlabs/puppet"
+ elog "Also, puppet now uses config directories for modules and manifests."
+ elog "See https://docs.puppetlabs.com/puppet/4.0/reference/upgrade_agent.html"
+ elog "and https://docs.puppetlabs.com/puppet/4.0/reference/upgrade_server.html"
+ elog "for more information."
+ elog
+ fi
+ done
+
+ use emacs && elisp-site-regen
+ use xemacs && xemacs-elisp-site-regen
+}
+
+pkg_postrm() {
+ use emacs && elisp-site-regen
+ use xemacs && xemacs-elisp-site-regen
+}
diff --git a/app-admin/puppet/puppet-5.1.0-r1.ebuild b/app-admin/puppet/puppet-5.1.0-r1.ebuild
new file mode 100644
index 000000000000..f74a524361aa
--- /dev/null
+++ b/app-admin/puppet/puppet-5.1.0-r1.ebuild
@@ -0,0 +1,144 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+USE_RUBY="ruby22 ruby23 ruby24"
+
+RUBY_FAKEGEM_RECIPE_TEST="rspec3"
+
+RUBY_FAKEGEM_TASK_DOC="doc:all"
+
+RUBY_FAKEGEM_EXTRAINSTALL="locales"
+
+inherit eutils user ruby-fakegem versionator
+
+DESCRIPTION="A system automation and configuration management software."
+HOMEPAGE="http://puppetlabs.com/"
+SRC_URI="http://downloads.puppetlabs.com/puppet/${P}.tar.gz"
+
+LICENSE="Apache-2.0 GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~hppa ~x86"
+IUSE="augeas diff doc emacs ldap rrdtool selinux shadow sqlite vim-syntax"
+RESTRICT="test"
+
+ruby_add_rdepend "
+ dev-ruby/hiera
+ dev-ruby/json:=
+ >=dev-ruby/facter-3.0.0
+ augeas? ( dev-ruby/ruby-augeas )
+ diff? ( dev-ruby/diff-lcs )
+ doc? ( dev-ruby/rdoc )
+ ldap? ( dev-ruby/ruby-ldap )
+ shadow? ( dev-ruby/ruby-shadow )
+ sqlite? ( dev-ruby/sqlite3 )
+ virtual/ruby-ssl
+ dev-ruby/hocon"
+
+ruby_add_bdepend "
+ doc? ( dev-ruby/yard )
+ test? (
+ dev-ruby/mocha
+ dev-ruby/rack
+ dev-ruby/rspec-its
+ )"
+# this should go in the above lists, but isn't because of test deps not being keyworded
+# dev-ruby/rspec-collection_matchers
+
+RDEPEND+=" ${RDEPEND}
+ rrdtool? ( >=net-analyzer/rrdtool-1.2.23[ruby] )
+ selinux? (
+ sys-libs/libselinux[ruby]
+ sec-policy/selinux-puppet
+ )
+ vim-syntax? ( >=app-vim/puppet-syntax-3.0.1 )
+ >=app-portage/eix-0.18.0"
+PDEPEND="emacs? ( >=app-emacs/puppet-mode-0.3-r1 )"
+
+pkg_setup() {
+ enewgroup puppet
+ enewuser puppet -1 -1 /var/lib/puppet puppet
+}
+
+all_ruby_prepare() {
+ # Avoid spec that require unpackaged json-schema.
+ rm spec/lib/matchers/json.rb $( grep -Rl matchers/json spec) || die
+
+ # can't be run within portage.
+ epatch "${FILESDIR}/puppet-fix-tests-4.7.0.patch"
+
+ # fix systemd path
+ epatch "${FILESDIR}/puppet-systemd.patch"
+
+ # Avoid specs that can only run in the puppet.git repository. This
+ # should be narrowed down to the specific specs.
+ rm spec/integration/parser/compiler_spec.rb || die
+
+ # Avoid failing spec that need further investigation.
+ rm spec/unit/module_tool/metadata_spec.rb || die
+}
+
+each_ruby_install() {
+ each_fakegem_install
+# dosym "/usr/$(get_libdir)/ruby/gems/$(ruby_get_version)/gems/${P}" "/usr/$(get_libdir)/ruby/gems/$(ruby_get_version)/gems/${PN}"
+}
+
+all_ruby_install() {
+ all_fakegem_install
+
+ # systemd stuffs
+ insinto /usr/lib/systemd/system
+ doins "${WORKDIR}/all/${P}/ext/systemd/puppet.service"
+
+ # tmpfiles stuff
+ insinto /usr/lib/tmpfiles.d
+ newins "${FILESDIR}/tmpfiles.d" "puppet.conf"
+
+ # openrc init stuff
+ newinitd "${FILESDIR}"/puppet.init-4.x puppet
+ newinitd "${FILESDIR}"/puppetmaster.init-4.x puppetmaster
+ newconfd "${FILESDIR}"/puppetmaster.confd puppetmaster
+
+ keepdir /etc/puppetlabs/puppet/ssl
+
+ keepdir /var/lib/puppet/facts
+ keepdir /var/lib/puppet/files
+ fowners -R puppet:puppet /var/lib/puppet
+
+ fperms 0750 /var/lib/puppet
+
+ fperms 0750 /etc/puppetlabs
+ fperms 0750 /etc/puppetlabs/puppet
+ fperms 0750 /etc/puppetlabs/puppet/ssl
+ fowners -R :puppet /etc/puppetlabs
+ fowners -R :puppet /var/lib/puppet
+
+ if use ldap ; then
+ insinto /etc/openldap/schema; doins ext/ldap/puppet.schema
+ fi
+
+ # ext and examples files
+ for f in $(find ext examples -type f) ; do
+ docinto "$(dirname ${f})"; dodoc "${f}"
+ done
+}
+
+pkg_postinst() {
+ elog
+ elog "Please, *don't* include the --ask option in EMERGE_EXTRA_OPTS as this could"
+ elog "cause puppet to hang while installing packages."
+ elog
+ elog "Portage Puppet module with Gentoo-specific resources:"
+ elog "http://forge.puppetlabs.com/gentoo/portage"
+ elog
+
+ for v in ${REPLACING_VERSIONS}; do
+ if [ "$(get_major_version $v)" = "4" ]; then
+ elog
+ elog "Please see the following url for the release notes for puppet-5"
+ elog "https://docs.puppet.com/puppet/5.0/release_notes.html#if-youre-upgrading-from-puppet-4x"
+ elog
+ fi
+ done
+}
diff --git a/app-admin/puppet/puppet-5.1.0.ebuild b/app-admin/puppet/puppet-5.1.0.ebuild
new file mode 100644
index 000000000000..42e505f2b7e8
--- /dev/null
+++ b/app-admin/puppet/puppet-5.1.0.ebuild
@@ -0,0 +1,144 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+USE_RUBY="ruby21 ruby22 ruby23"
+# need to get deps up to date for this
+#USE_RUBY="ruby21 ruby22 ruby23 ruby24"
+
+RUBY_FAKEGEM_RECIPE_TEST="rspec3"
+
+RUBY_FAKEGEM_TASK_DOC="doc:all"
+
+inherit eutils user ruby-fakegem versionator
+
+DESCRIPTION="A system automation and configuration management software."
+HOMEPAGE="http://puppetlabs.com/"
+SRC_URI="http://downloads.puppetlabs.com/puppet/${P}.tar.gz"
+
+LICENSE="Apache-2.0 GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~hppa ~ppc ~x86"
+IUSE="augeas diff doc emacs ldap rrdtool selinux shadow sqlite vim-syntax"
+RESTRICT="test"
+
+ruby_add_rdepend "
+ dev-ruby/hiera
+ dev-ruby/json:=
+ >=dev-ruby/facter-3.0.0
+ augeas? ( dev-ruby/ruby-augeas )
+ diff? ( dev-ruby/diff-lcs )
+ doc? ( dev-ruby/rdoc )
+ ldap? ( dev-ruby/ruby-ldap )
+ shadow? ( dev-ruby/ruby-shadow )
+ sqlite? ( dev-ruby/sqlite3 )
+ virtual/ruby-ssl
+ dev-ruby/hocon"
+
+ruby_add_bdepend "
+ doc? ( dev-ruby/yard )
+ test? (
+ dev-ruby/mocha
+ dev-ruby/rack
+ dev-ruby/rspec-its
+ )"
+# this should go in the above lists, but isn't because of test deps not being keyworded
+# dev-ruby/rspec-collection_matchers
+
+RDEPEND+=" ${RDEPEND}
+ rrdtool? ( >=net-analyzer/rrdtool-1.2.23[ruby] )
+ selinux? (
+ sys-libs/libselinux[ruby]
+ sec-policy/selinux-puppet
+ )
+ vim-syntax? ( >=app-vim/puppet-syntax-3.0.1 )
+ >=app-portage/eix-0.18.0"
+PDEPEND="emacs? ( >=app-emacs/puppet-mode-0.3-r1 )"
+
+pkg_setup() {
+ enewgroup puppet
+ enewuser puppet -1 -1 /var/lib/puppet puppet
+}
+
+all_ruby_prepare() {
+ # Avoid spec that require unpackaged json-schema.
+ rm spec/lib/matchers/json.rb $( grep -Rl matchers/json spec) || die
+
+ # can't be run within portage.
+ epatch "${FILESDIR}/puppet-fix-tests-4.7.0.patch"
+
+ # fix systemd path
+ epatch "${FILESDIR}/puppet-systemd.patch"
+
+ # Avoid specs that can only run in the puppet.git repository. This
+ # should be narrowed down to the specific specs.
+ rm spec/integration/parser/compiler_spec.rb || die
+
+ # Avoid failing spec that need further investigation.
+ rm spec/unit/module_tool/metadata_spec.rb || die
+}
+
+each_ruby_install() {
+ each_fakegem_install
+# dosym "/usr/$(get_libdir)/ruby/gems/$(ruby_get_version)/gems/${P}" "/usr/$(get_libdir)/ruby/gems/$(ruby_get_version)/gems/${PN}"
+}
+
+all_ruby_install() {
+ all_fakegem_install
+
+ # systemd stuffs
+ insinto /usr/lib/systemd/system
+ doins "${WORKDIR}/all/${P}/ext/systemd/puppet.service"
+
+ # tmpfiles stuff
+ insinto /usr/lib/tmpfiles.d
+ newins "${FILESDIR}/tmpfiles.d" "puppet.conf"
+
+ # openrc init stuff
+ newinitd "${FILESDIR}"/puppet.init-4.x puppet
+ newinitd "${FILESDIR}"/puppetmaster.init-4.x puppetmaster
+ newconfd "${FILESDIR}"/puppetmaster.confd puppetmaster
+
+ keepdir /etc/puppetlabs/puppet/ssl
+
+ keepdir /var/lib/puppet/facts
+ keepdir /var/lib/puppet/files
+ fowners -R puppet:puppet /var/lib/puppet
+
+ fperms 0750 /var/lib/puppet
+
+ fperms 0750 /etc/puppetlabs
+ fperms 0750 /etc/puppetlabs/puppet
+ fperms 0750 /etc/puppetlabs/puppet/ssl
+ fowners -R :puppet /etc/puppetlabs
+ fowners -R :puppet /var/lib/puppet
+
+ if use ldap ; then
+ insinto /etc/openldap/schema; doins ext/ldap/puppet.schema
+ fi
+
+ # ext and examples files
+ for f in $(find ext examples -type f) ; do
+ docinto "$(dirname ${f})"; dodoc "${f}"
+ done
+}
+
+pkg_postinst() {
+ elog
+ elog "Please, *don't* include the --ask option in EMERGE_EXTRA_OPTS as this could"
+ elog "cause puppet to hang while installing packages."
+ elog
+ elog "Portage Puppet module with Gentoo-specific resources:"
+ elog "http://forge.puppetlabs.com/gentoo/portage"
+ elog
+
+ for v in ${REPLACING_VERSIONS}; do
+ if [ "$(get_major_version $v)" = "4" ]; then
+ elog
+ elog "Please see the following url for the release notes for puppet-5"
+ elog "https://docs.puppet.com/puppet/5.0/release_notes.html#if-youre-upgrading-from-puppet-4x"
+ elog
+ fi
+ done
+}