--- mplayer-9999.ebuild 2010-01-03 00:53:58.000000000 +0300 +++ mplayer-9999.p04-docs.ebuild 2010-01-03 00:54:47.000000000 +0300 @@ -637,7 +637,26 @@ src_compile() { base_src_compile emake || die "Failed to build MPlayer!" - use doc && make -C DOCS/xml html-chunked + # Install only user-requested docs if they're available. + use doc && { + if [[ -z $LINGUAS ]] + then + make -C DOCS/xml html-chunked || die "Failed to generate html docs" + else + # select available languages from $LINGUAS + LINGUAS=${LINGUAS/zh/zh_CN} + local a1=( cs de en es fr hu it pl ru zh_CN ) + local a2=( $LINGUAS ) + for (( i=0; i<${#a1[*]}; i++ )); do + for (( j=0; j<${#a1[*]}; j++ )); do + [[ ${a1[i]} == ${a2[j]} ]] && { + make -C DOCS/xml html-chunked-${a2[j]} || + die "Failed to generate html docs for ${a2[j]}" + } + done + done + fi + } } src_install() { @@ -668,6 +687,7 @@ dodoc DOCS/tech/mirrors/* || die if use doc; then + docinto html/ dohtml -r "${S}"/DOCS/HTML/* || die fi