php-docs-20101029-r1.ebuild 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="4"
  4. DESCRIPTION="HTML documentation for PHP"
  5. HOMEPAGE="http://www.php.net/download-docs.php"
  6. MY_PN="php_manual"
  7. LICENSE="GPL-2"
  8. SLOT="0"
  9. KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd"
  10. IUSE=""
  11. RESTRICT="strip binchecks"
  12. LANGS="en de es fa fr ja pl pt-BR ro tr"
  13. for lang in ${LANGS} ; do
  14. IUSE+=" l10n_${lang}"
  15. SRC_URI+=" l10n_${lang}? ( http://olemarkus.org/~olemarkus/gentoo/${MY_PN}_${lang/-/_}-${PV}.tar.gz )"
  16. done
  17. REQUIRED_USE="|| ( ${IUSE} )"
  18. # Set English to default
  19. IUSE="${IUSE/l10n_en/+l10n_en}"
  20. S=${WORKDIR}
  21. src_unpack() {
  22. for lang in ${LANGS} ; do
  23. if use l10n_${lang} ; then
  24. mkdir ${lang/-/_}
  25. pushd ${lang/-/_} >/dev/null
  26. unpack ${MY_PN}_${lang/-/_}-${PV}.tar.gz \
  27. || die "unpack failed on ${lang}"
  28. popd >/dev/null
  29. fi
  30. done
  31. }
  32. pkg_preinst() {
  33. # remove broken/stale symlink created by previous ebuilds
  34. [[ -L ${EROOT}/usr/share/php-docs ]] && rm -f "${EROOT}"/usr/share/php-docs
  35. }
  36. src_install() {
  37. dodir /usr/share/doc/${PF}
  38. for lang in ${LANGS} ; do
  39. if use l10n_${lang} ; then
  40. ebegin "Installing ${lang} manual, will take a while"
  41. cp -R "${WORKDIR}"/${lang/-/_} "${ED}"/usr/share/doc/${PF} \
  42. || die "cp failed on ${lang}"
  43. eend $?
  44. fi
  45. done
  46. einfo "Creating symlink to PHP manual at /usr/share/php-docs"
  47. dosym /usr/share/doc/${PF} /usr/share/php-docs
  48. }