puppetserver-2.7.1.ebuild 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit multilib systemd user
  5. DESCRIPTION="Puppet Server is the next-generation application for managing Puppet agents."
  6. HOMEPAGE="http://docs.puppetlabs.com/puppetserver/"
  7. SRC_URI="https://downloads.puppetlabs.com/puppet/${P}.tar.gz"
  8. LICENSE="Apache-2.0"
  9. SLOT="0"
  10. IUSE="puppetdb"
  11. # will need the same keywords as puppet
  12. KEYWORDS="amd64 x86"
  13. RDEPEND+="
  14. >=virtual/jdk-1.7.0
  15. app-admin/puppet-agent[puppetdb?]"
  16. DEPEND+=""
  17. pkg_setup() {
  18. enewgroup puppet
  19. enewuser puppet -1 -1 /opt/puppetlabs/server/data/puppetserver "puppet"
  20. }
  21. src_prepare() {
  22. sed -i 's/sysconfig\/puppetserver/systemd\/system\/puppetserver\.service\.d\/gentoo\.conf/g' ext/redhat/puppetserver.service || die
  23. sed -i 's/sysconfig\/puppetserver/systemd\/system\/puppetserver\.service\.d\/gentoo\.conf/g' ext/bin/puppetserver || die
  24. sed -i 's/sysconfig\/puppetserver/systemd\/system\/puppetserver\.service\.d\/gentoo\.conf/g' install.sh || die
  25. sed -i 's/var\/run/run/g' ext/config/conf.d/puppetserver.conf || die
  26. sed -i 's/var\/run/run/g' ext/redhat/puppetserver.service || die
  27. sed -i 's/var\/run/run/g' install.sh || die
  28. default
  29. }
  30. src_compile() {
  31. einfo "not compiling"
  32. }
  33. src_install() {
  34. insinto /opt/puppetlabs/server/apps/puppetserver
  35. insopts -m0774
  36. doins ext/ezbake-functions.sh
  37. insopts -m0644
  38. doins ext/ezbake.manifest
  39. doins puppet-server-release.jar
  40. insinto /etc/puppetlabs/puppetserver
  41. doins ext/config/logback.xml
  42. doins ext/config/request-logging.xml
  43. insinto /etc/puppetlabs/puppetserver/services.d
  44. doins ext/system-config/services.d/bootstrap.cfg
  45. doins ext/config/services.d/ca.cfg
  46. insinto /etc/puppetlabs/puppetserver/conf.d
  47. doins ext/config/conf.d/puppetserver.conf
  48. doins ext/config/conf.d/auth.conf
  49. doins ext/config/conf.d/global.conf
  50. doins ext/config/conf.d/web-routes.conf
  51. doins ext/config/conf.d/webserver.conf
  52. insopts -m0755
  53. insinto /opt/puppetlabs/server/apps/puppetserver/scripts
  54. doins install.sh
  55. insinto /opt/puppetlabs/server/apps/puppetserver/cli/apps
  56. doins ext/cli/irb
  57. doins ext/cli/foreground
  58. doins ext/cli/gem
  59. doins ext/cli/ruby
  60. doins ext/cli/reload
  61. doins ext/cli/start
  62. doins ext/cli/stop
  63. insinto /opt/puppetlabs/server/apps/puppetserver/bin
  64. doins ext/bin/puppetserver
  65. insopts -m0644
  66. dodir /opt/puppetlabs/server/bin
  67. dosym ../apps/puppetserver/bin/puppetserver /opt/puppetlabs/server/bin/puppetserver
  68. dodir /opt/puppetlabs/bin
  69. dosym ../server/apps/puppetserver/bin/puppetserver /opt/puppetlabs/bin/puppetserver
  70. dosym /opt/puppetlabs/server/apps/puppetserver/bin/puppetserver /usr/bin/puppetserver
  71. dodir /opt/puppetlabs/server/apps/puppetserver/config/services.d
  72. # other sys stuff
  73. dodir /etc/puppetlabs/code
  74. # needed for systemd
  75. dodir /var/log/puppetlabs/puppetserver
  76. dodir /etc/puppetlabs/puppet/ssl
  77. fowners -R puppet:puppet /etc/puppetlabs/puppet/ssl
  78. fperms -R 771 /etc/puppetlabs/puppet/ssl
  79. # init type tasks
  80. newconfd ext/default puppetserver
  81. newinitd "${FILESDIR}/puppetserver.initd" puppetserver
  82. # systemd type things
  83. insinto /etc/systemd/system/puppetserver.service.d/
  84. newins ext/default gentoo.conf
  85. systemd_dounit ext/redhat/puppetserver.service
  86. # misc
  87. insinto /etc/logrotate.d
  88. newins ext/puppetserver.logrotate.conf puppetserver
  89. # cleanup
  90. dodir /opt/puppetlabs/server/data/puppetserver/jruby-gems
  91. fowners -R puppet:puppet /opt/puppetlabs/server/data
  92. fperms -R 775 /opt/puppetlabs/server/data/puppetserver
  93. fperms -R 700 /var/log/puppetlabs/puppetserver
  94. }
  95. pkg_postinst() {
  96. elog "to install you may want to run the following:"
  97. elog
  98. elog "puppet config set --section master vardir /opt/puppetlabs/server/data/puppetserver"
  99. elog "puppet config set --section master logdir /var/log/puppetlabs/puppetserver"
  100. elog "puppet config set --section master rundir /run/puppetlabs/puppetserver"
  101. elog "puppet config set --section master pidfile /run/puppetlabs/puppetserver/puppetserver.pid"
  102. elog "puppet config set --section master codedir /etc/puppetlabs/code"
  103. }