eselect-php-0.9.2.ebuild 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit systemd
  5. DESCRIPTION="PHP eselect module"
  6. HOMEPAGE="https://gitweb.gentoo.org/proj/eselect-php.git/"
  7. SRC_URI="https://dev.gentoo.org/~mjo/distfiles/${P}.tar.xz"
  8. LICENSE="GPL-2"
  9. SLOT="0"
  10. KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
  11. IUSE="fpm apache2"
  12. # The "DirectoryIndex" line in 70_mod_php.conf requires mod_dir.
  13. RDEPEND="app-admin/eselect
  14. apache2? ( www-servers/apache[apache2_modules_dir] )"
  15. src_configure(){
  16. # We expect localstatedir to be "var"ish, not "var/lib"ish, because
  17. # that's what PHP upstream expects. See for example the FPM
  18. # configuration where they put logs in @localstatedir@/log.
  19. econf --localstatedir="${EPREFIX}"/var $(use_enable apache2)
  20. }
  21. src_install() {
  22. default
  23. # This can be removed after a while...
  24. if use apache2 ; then
  25. insinto /etc/apache2/modules.d
  26. newins "${FILESDIR}/70_mod_php5.backcompat.conf" 70_mod_php5.conf
  27. fi
  28. if use fpm ; then
  29. newinitd "doc/php-fpm.example.init" "php-fpm"
  30. newconfd "doc/php-fpm.example.conf" "php-fpm"
  31. systemd_dotmpfilesd "${FILESDIR}/php-fpm.conf"
  32. exeinto /usr/libexec
  33. doexe "${FILESDIR}/php-fpm-launcher"
  34. fi
  35. }
  36. pkg_postinst() {
  37. if use apache2 ; then
  38. elog
  39. elog "If you are upgrading, be warned that our mod_php configuration"
  40. elog "file has changed! You should now define -DPHP for the apache2"
  41. elog "daemon, and inspect the new 70_mod_php.conf which has been"
  42. elog "installed. Module loading involves eselect as of this version."
  43. elog
  44. elog "You must run eselect at least once to choose your apache2 target"
  45. elog "before the new configuration will work. Afterwards, and after you"
  46. elog "have reviewed your new configuration, you are advised to remove"
  47. elog "the obsolete 70_mod_php5.conf file."
  48. elog
  49. fi
  50. }