--- app-i18n/man-pages-pl/man-pages-pl-20070628.ebuild +++ app-i18n/man-pages-pl/man-pages-pl-20070628.ebuild @@ -9,16 +9,26 @@ LICENSE="GPL-2" SLOT="0" KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" -IUSE="" +IUSE="unicode" RDEPEND="" -DEPEND="" +DEPEND="unicode? ( virtual/libiconv )" -S=${WORKDIR}/pl_PL +S="${WORKDIR}/pl_PL" src_unpack() { unpack ${A} - cd ${S} + cd "${S}" + + if use unicode ; then + elog "Converting manual pages from ISO-8859-2 to UTF-8" + for x in $(find man* -type f) ; do + if [[ $(file -b ${x}) == "troff or preprocessor input text" ]] ; then + mv ${x} ${x}.ISO-8859-2 + iconv -f ISO-8859-2 -t UTF-8 -o ${x} ${x}.ISO-8859-2 || die "iconv ${x} failed" + fi + done + fi # missing manpages sed -i -e '/\tpasswd.1/ d' man1/Makefile.am