summaryrefslogtreecommitdiff
blob: c4d757461c6ace68454d72b40422b0c285ed04f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-i18n/manpages-ja/manpages-ja-20041115.ebuild,v 1.6 2005/07/05 18:19:14 killerfox Exp $

IUSE=""

MY_P="man-pages-ja-${PV}"
GENTOO_MAN_P="portage-${P}"

DESCRIPTION="A collection of manual pages translated into Japanese"
HOMEPAGE="http://www.linux.or.jp/JM/ http://www.gentoo.gr.jp/jpmain/translation.xml"
SRC_URI="http://www.linux.or.jp/JM/${MY_P}.tar.gz
	http://dev.gentoo.org/~hattya/distfiles/${GENTOO_MAN_P}.tar.gz"

LICENSE="GPL-2"
KEYWORDS="~alpha amd64 hppa ~ia64 ~mips ppc sparc x86"
SLOT="0"
S="${WORKDIR}/${MY_P}"

DEPEND="!>=sys-apps/groff-1.19
	=sys-apps/groff-1.18*
	sys-apps/man"

pkg_setup() {

	if ! groff -v -Tnippon >/dev/null 2>&1 ; then
		ewarn
		ewarn "You need to compile groff with multilingual support."
		ewarn "Please recompile sys-apps/groff with USE=\"cjk\"."
		ewarn
		die "groff m17n support disabled."
	fi

}

src_compile() {

	return

}

src_install() {

	local x y z

	for x in $(grep '^[^#].*' script/pkgs.list | cut -f1 | sort); do
		for y in $(ls -d manual/$x/man* 2>/dev/null); do
			jmandir=$(echo $y | cut -d/ -f3)

			einfo "$(printf "install %-20s  /usr/share/man/ja/$jmandir" $x:)"

			insinto /usr/share/man/ja/$jmandir
			doins $y/*
		done
	done

	cd ${WORKDIR}/${GENTOO_MAN_P}

	for x in *; do
		if [ -d "$x" ]; then
			for z in $(for y in $x/*.[1-9]; do echo ${y##*.}; done | sort | uniq); do
				einfo "$(printf "install %-20s  /usr/share/man/ja/man$z" $x:)"

				insinto /usr/share/man/ja/man$z
				doins $x/*.$z
			done
		fi
	done

	newdoc ChangeLog ChangeLog.GentooJP
	cd -

	dodoc ChangeLog INSTALL README

}

pkg_postinst() {

	einfo
	einfo "You need to set appropriate LANG and PAGER variables to use"
	einfo "Japanese manpages."
	einfo "e.g."
	einfo "\tLANG=\"ja_JP.eucJP\""
	einfo "\tPAGER=\"jless\""
	einfo "\tJLESSCHARSET=\"ja\""
	einfo "\texport LANG PAGER JLESSCHARSET"
	einfo "or"
	einfo "\tLANG=\"ja_JP.eucJP\""
	einfo "\tPAGER=\"lv -c\""
	einfo "\texport LANG PAGER"
	einfo

}