summaryrefslogtreecommitdiff
blob: 90f45add3d87fd2f2fb12022fc75273f62451ac9 (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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-tex/hlatex/hlatex-0.991.ebuild,v 1.10 2008/02/04 20:42:56 grobian Exp $

inherit latex-package

DESCRIPTION="HLaTeX is a LaTeX package to use Hangul with LaTeX."
HOMEPAGE="http://ftp.ktug.or.kr/mirrors/HLaTeX/hlatex.html"
#SRC_URI="ftp://ftp.dante.de/tex-archive/languages/korean/HLaTeX.tar.gz ftp://ftp.dante.de/tex-archive/fonts/korean/HLaTeX.tar.gz"
SRC_URI="mirror://gentoo/${P}.tar.gz
	mirror://gentoo/${P}-gentoo.tar.gz"
LICENSE="GPL-2"

SLOT="0"
KEYWORDS="x86 ppc alpha ~amd64"
IUSE=""

add_line() {

	FILE=$1
	STRING=$2

	if [ ! -e "${FILE}" ]
	then
		return
	fi

	if [ -z "`grep "^${STRING}$" ${FILE}`" ]
	then
		echo "${STRING}" >>	 ${FILE}
	fi

}

del_line() {

	FILE=$1
	STRING=$2

	if [ ! -e "${FILE}" ]
	then
		return
	fi

	cp ${FILE} ${FILE}.temp
	CMD=`echo "/^${STRING}$/d"`
	sed -e "${CMD}" ${FILE}.temp > ${FILE}
	rm ${FILE}.temp

}

src_install() {

	dodir ${TEXMF}/dvipdfm/uhc
	cp -pPR uhc-dvipdfm.map ${D}${TEXMF}/dvipdfm/uhc

	dodir ${TEXMF}/pdftex/uhc
	cp -pPR uhc-pdftex.map ${D}${TEXMF}/pdftex/uhc

	cd ${S}/HLaTeX

	dodir ${TEXMF}/tex/latex/hlatex
	cp -pPR hfont.tex hangul.sty hfont.sty josa.tab hfont.cfg \
		uhc/latex/* moonttf/*.fd moonttf/moonttf.sty \
		${D}${TEXMF}/tex/latex/hlatex

	dodir ${TEXMF}/omega/latex/hlatex
	cp -pPR uhc/lambda/*.tex uhc/lambda/*.fd ${D}${TEXMF}/omega/latex/hlatex

	dodir ${TEXMF}/omega/otp/hlatex
	cp -pPR uhc/lambda/ksx1001.otp ${D}${TEXMF}/omega/otp/hlatex

	dodir ${TEXMF}/omega/ocp/hlatex
	cp -pPR uhc/lambda/ksx1001.ocp ${D}${TEXMF}/omega/ocp/hlatex

	dodir ${TEXMF}/bibtex/bst/misc
	cp -pPR contrib/halpha.bst ${D}${TEXMF}/bibtex/bst/misc

	dodir ${TEXMF}/makeindex
	cp -pPR contrib/hind.ist contrib/hglo.ist ${D}${TEXMF}/makeindex

	dodir ${TEXMF}/dvips/config
	cp -pPR uhc/config/uhc-down.map ${D}${TEXMF}/dvips/config

	dodoc changelog.ks hlatex-en.html hlatex-ko.html hlatex.html \
		hlguide.bib hlguide.tex news.099 readme.eng \
	docinto doc
	dodoc doc/*

	cd ${S}/Fonts

	for i in *
	do
		gunzip -c $i | tar xvf -
		rm $i
	done

	dodir ${TEXMF}/fonts
	cp -pPR * ${D}${TEXMF}/fonts

}

pkg_postinst() {

	add_line "${TEXMF}/pdftex/config/pdftex.cfg" "map +uhc-pdftex.map"
	add_line "${TEXMF}/dvips/config/config.ps" "p +uhc-down.map"
	add_line "${TEXMF}/dvipdfm/config/config" "f uhc-dvipdfm.map"

	texhash

}

pkg_postrm() {

	del_line "${TEXMF}/dvips/config/config.ps" "p +uhc-down.map"
	del_line "${TEXMF}/pdftex/config/pdftex.cfg" "map +uhc-pdftex.map"
	del_line "${TEXMF}/dvipdfm/config/config" "f uhc-dvipdfm.map"

	texhash

}