clean up package.mask
[gentoo-china-overlay.git] / eclass / fortune-zh.eclass
blobaf2ee477bed1abb033a0ed3fada24ea8ce69c660
1 # Copyright 1999-2008 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
6 # Original Author: Zhang Le
7 # Purpose: compile and install chinese fortune, regenerate fortune-zh.conf
10 inherit eutils
12 ECLASS="fortune-zh"
13 EXPORT_FUNCTIONS src_compile src_install pkg_postinst pkg_postrm
15 HOMEPAGE="http://code.google.com/p/chinese-fortune/"
16 SRC_URI="http://chinese-fortune.googlecode.com/files/${P}.tar.bz2"
17 RESTRICT="mirror"
19 LICENSE="GPL-2"
20 SLOT="0"
21 KEYWORDS="alpha amd64 arm hppa ia64 m68k mips ppc ppc64 s390 sh sparc x86 ~x86-fbsd"
22 IUSE=""
24 DEPEND="games-misc/fortune-mod-zh
25 app-i18n/zh-autoconvert"
27 CONF="/etc/fortune-zh.conf"
28 NAME="${PN/fortune-mod-/}"
30 fortune-zh_src_compile() {
31 emake $NAME.dat
34 fortune-zh_src_install() {
35 insinto /usr/share/fortune
36 doins $NAME $NAME.dat
37 dosym $NAME /usr/share/fortune/$NAME.u8
41 fortune-zh_pkg_postinst() {
42 einfo "Adding ${NAME} to $CONF"
43 echo ${NAME} >> $CONF
44 chmod 644 $CONF
47 fortune-zh_pkg_postrm() {
48 einfo "Removing ${NAME} from $CONF"
49 sed -i -e "/${NAME}/d" $CONF
50 chmod 644 $CONF