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