linux-docs-4.1.12.ebuild 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. # Copyright 1999-2014 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit toolchain-funcs
  5. MY_P=linux-${PV}
  6. S=${WORKDIR}/${MY_P}
  7. DESCRIPTION="Developer documentation generated from the Linux kernel"
  8. HOMEPAGE="https://www.kernel.org/"
  9. SRC_URI="mirror://kernel/linux/kernel/v4.x/${MY_P}.tar.xz"
  10. LICENSE="GPL-2"
  11. SLOT="0"
  12. KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
  13. IUSE="html"
  14. DEPEND="app-text/docbook-sgml-utils
  15. app-text/xmlto
  16. sys-apps/sed
  17. ~app-text/docbook-xml-dtd-4.1.2"
  18. RDEPEND=""
  19. src_prepare() {
  20. sed -i \
  21. -e "s:db2:docbook2:g" \
  22. -e "s:/usr/local/man:${D}/usr/share/man:g" \
  23. "${S}"/Documentation/DocBook/Makefile
  24. # fix for parallel build as per bug #248337
  25. sed -i \
  26. -e "s:\$(Q)\$(MAKE) \$(build)=Documentation\/DocBook \$@:+\$(Q)\$(MAKE) \$(build)=Documentation\/DocBook \$@:" \
  27. "${S}"/Makefile
  28. }
  29. src_compile() {
  30. local ARCH=$(tc-arch-kernel)
  31. unset KBUILD_OUTPUT
  32. emake mandocs || die "make mandocs failed"
  33. if use html; then
  34. emake htmldocs || die "make htmldocs failed"
  35. fi
  36. }
  37. src_install() {
  38. local file
  39. local ARCH=$(tc-arch-kernel)
  40. unset KBUILD_OUTPUT
  41. make installmandocs || die "make installmandocs failed"
  42. if use html; then
  43. # There is no subdirectory named "index"
  44. dohtml Documentation/DocBook/index.html
  45. rm Documentation/DocBook/index.html
  46. for file in Documentation/DocBook/*.html; do
  47. dohtml -r ${file/\.html/}
  48. done
  49. fi
  50. }