1 |
commit: d26b8b1ed6938af622c6041fdda3a98b518448e7 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Jan 8 10:07:23 2012 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Jan 8 10:07:23 2012 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=dev/mgorny.git;a=commit;h=d26b8b1e |
7 |
|
8 |
Fix passing temporary --docdir to packages. |
9 |
|
10 |
Rather install in the actual docdir, and move forth and back whenever |
11 |
necessary. |
12 |
|
13 |
--- |
14 |
eclass/autotools-utils.eclass | 39 +++++++++++++++++++++------------------ |
15 |
1 files changed, 21 insertions(+), 18 deletions(-) |
16 |
|
17 |
diff --git a/eclass/autotools-utils.eclass b/eclass/autotools-utils.eclass |
18 |
index 1b19ed2..fcdf219 100644 |
19 |
--- a/eclass/autotools-utils.eclass |
20 |
+++ b/eclass/autotools-utils.eclass |
21 |
@@ -392,9 +392,11 @@ autotools-utils_src_configure() { |
22 |
[[ -z ${myeconfargs+1} || $(declare -p myeconfargs) == 'declare -a'* ]] \ |
23 |
|| die 'autotools-utils.eclass: myeconfargs has to be an array.' |
24 |
|
25 |
+ [[ ${EAPI} == 2 ]] && ! use prefix && EPREFIX= |
26 |
+ |
27 |
# Common args |
28 |
local econfargs=( |
29 |
- --docdir=/temporary-docdir |
30 |
+ --docdir="${EPREFIX}/usr/share/doc/${PF}" |
31 |
) |
32 |
|
33 |
# Handle static-libs found in IUSE, disable them by default |
34 |
@@ -443,6 +445,24 @@ autotools-utils_src_install() { |
35 |
emake DESTDIR="${D}" "$@" install || die "emake install failed" |
36 |
popd > /dev/null |
37 |
|
38 |
+ # Move docs installed by autotools (in EAPI < 4). |
39 |
+ if [[ -d ${D}${EPREFIX}/usr/share/doc/${PF} ]]; then |
40 |
+ if [[ ${EAPI} == [23] ]]; then |
41 |
+ mkdir "${T}"/temp-docdir |
42 |
+ mv "${D}${EPREFIX}"/usr/share/doc/${PF}/* "${T}"/temp-docdir/ \ |
43 |
+ || die "moving docs to tempdir failed" |
44 |
+ |
45 |
+ local f |
46 |
+ for f in "${T}"/temp-docdir/*; do |
47 |
+ [[ -d ${f} ]] \ |
48 |
+ && die "directories in docdir require at least EAPI 4" |
49 |
+ done |
50 |
+ |
51 |
+ dodoc "${T}"/temp-docdir/* || die "docdir dodoc failed" |
52 |
+ rm -r "${T}"/temp-docdir || die |
53 |
+ fi |
54 |
+ fi |
55 |
+ |
56 |
# XXX: support installing them from builddir as well? |
57 |
if [[ ${DOCS} ]]; then |
58 |
dodoc "${DOCS[@]}" || die "dodoc failed" |
59 |
@@ -460,23 +480,6 @@ autotools-utils_src_install() { |
60 |
dohtml -r "${HTML_DOCS[@]}" || die "dohtml failed" |
61 |
fi |
62 |
|
63 |
- # Move docs installed by autotools. |
64 |
- if [[ -d ${D}/temporary-docdir ]]; then |
65 |
- if [[ ${EAPI} = 4 ]]; then |
66 |
- dodoc -r "${D}"/temporary-docdir/* || die "docdir dodoc failed" |
67 |
- else |
68 |
- local f |
69 |
- for f in "${D}"/temporary-docdir/*; do |
70 |
- [[ -d ${f} ]] \ |
71 |
- && die "directories in docdir require at least EAPI 4" |
72 |
- done |
73 |
- |
74 |
- dodoc "${D}"/temporary-docdir/* || die "docdir dodoc failed" |
75 |
- fi |
76 |
- |
77 |
- rm -r "${D}"/temporary-docdir |
78 |
- fi |
79 |
- |
80 |
# Remove libtool files and unnecessary static libs |
81 |
remove_libtool_files |
82 |
} |