Gentoo Archives: gentoo-dev

From: Francisco Gimeno <kikov@××××××××××.com>
To: gentoo-dev@g.o
Subject: [gentoo-dev] Making my eclass
Date: Wed, 08 May 2002 10:25:58
Message-Id: 200205081725.56682.kikov@fco-gimeno.com
1 -----BEGIN PGP SIGNED MESSAGE-----
2 Hash: SHA1
3
4 Hi
5
6 I'm making my own eclass to use it for the ebooks file from
7 lidn.sourceforge.net
8 This is the content of my ebook.eclass file
9 - -------------- ebook.eclass
10 1:# Copyright 1999-2000 Gentoo Technologies, Inc.
11 2:# Distributed under the terms of the GNU General Public License, v2 or
12 later
13 3:# Author Francisco Gimeno <kikov@××××××××××.com>
14 4:# The ebook eclass defines some default functions and variables to
15 5:# install ebooks.
16 6:[ -n "$COMPAT" ] && inherit functions
17 7: ECLASS=ebook
18 8:
19 9:HOMEPAGE="http://lidn.sourceforge.net"
20 10:# ebook eclass user guide:
21 11:# -vars
22 12:#
23 13:# EBOOKNAME: the main name of the book ( without versions ), i.e: gtk
24 14:# Required
25 15:# EBOOKVERSION: the version of the book, i.e: 1.2
26 16:# Required
27 17:# SRC: the main file to download. Default: ${EBOOKNAME}-${EBOOKVERSION}
28 18:# EBOOKDESTDIR: directory inside ${DEVHELPROOT}/books/${EBOOKDIR} where is
29 19:# installed the book. By default: ${EBOOKNAME}-${EBOOKVERSION}
30 20:# ( sometimes it is only ${EBOOKNAME} so you will need to modify
31 it )
32 21:# EBOOKSRCDIR: directory where is the unpacked book in html
33 22:# BOOKDEVHELPFILE: book.devhelp is copied with the name
34 23:# ${EBOOKNAME}-${EBOOKVERSION} by default.
35 24:# BOOKDESTDIR: directory to put into the ebook in html. By default:
36 25:# ${EBOOKNAME}-${EBOOKVERSION}.
37 26:# NOVERSION: if it's not empty, then, remove -${EBOOKVERSION} from all
38 27:# vars...
39 28:# DEVHELPROOT: usually usr/share/devhelp
40 29:if [ "${NOVERSION}" = "" ]; then
41 30: _src="${EBOOKNAME}-${EBOOKVERSION}"
42 31:else
43 32: _src="${EBOOKNAME}"
44 33:fi
45 34: _ebookdestdir="${_src}"
46 35: _ebooksrcdir="${_src}"
47 36: _ebookdevhelpfile="${_src}"
48 37:
49 38:if [ "${SRC}" = "" ]; then
50 39: SRC="${_src}"
51 40:fi
52 41:if [ "${SRC_URI}" = "" ]; then
53 42: SRC_URI="http://lidn.sourceforge.net/books_download/${SRC}.tar.gz"
54 43:fi
55 44:
56 45:# Default directory to install de ebook devhelped book
57 46:if [ "${DEVHELPROOT}" = "" ]; then
58 47: DEVHELPROOT="usr/share/devhelp"
59 48:fi
60 49:if [ "${RDEPEND}" = "" ]; then
61 50: RDEPEND=">=dev-util/devhelp-0.3"
62 51:fi
63 52:if [ "${DESCRIPTION}" = "" ]; then
64 53: DESCRIPTION="${P} ebook based in $ECLASS eclass"
65 54:fi
66 55:if [ "${EBOOKDESTDIR}" = "" ]; then
67 56: EBOOKDESTDIR=${_ebookdestdir}
68 57:fi
69 58:if [ "${EBOOKSRCDIR}" = "" ]; then
70 59: EBOOKSRCDIR=${_ebooksrcdir}
71 60:fi
72 61:if [ "${EBOOKDEVHELPFILE}" = "" ]; then
73 62: EBOOKDEVHELPFILE=${_ebookdevhelpfile}
74 63:fi
75 64:
76 65:S=${WORKDIR}/${EBOOKSRCDIR}
77 66:ebook_src_unpack() {
78 67: debug-print-function $FUNCNAME $*
79 68: unpack ${SRC}.tar.gz
80 69:}
81 70:
82 71:ebook_src_install() {
83 72: debug-print-function $FUNCNAME $*
84 73:
85 74: dodir ${DEVHELPROOT}/specs
86 75: dodir ${DEVHELPROOT}/books
87 76: dodir ${DEVHELPROOT}/books/${EBOOKDESTDIR}
88 77: echo EBOOKSRCDIR= ${EBOOKSRCDIR}
89 78: cp ${S}/book.devhelp ${D}${DEVHELPROOT}/specs/${EBOOKDEVHELPFILE}
90 79: cp -R ${S}/book/* ${D}${DEVHELPROOT}/books/${EBOOKDESTDIR}
91 80:}
92 81:
93 82:EXPORT_FUNCTIONS src_unpack src_install
94 - ---------------------
95
96 This is one of the ebook builds files:
97 - --------------------- ebook-gtk-2.0.ebuild
98 # Copyright 1999-2002 Gentoo Technologies, Inc.
99 # Distributed under the terms of the GNU General Public License, v2 or later
100 # Author Francisco Gimeno <kikov@××××××××××.com>
101
102 EBOOKNAME="gtk"
103 EBOOKVERSION="2.0"
104
105 . /usr/portage/eclass/inherit.eclass || die
106 inherit ebook
107 - --------------------
108
109
110 Well... First problem... Homepage and Description is not inherited... When I
111 use search function of emerge, it doesn't display anything. In line 9, I
112 setup the HOMEPAGE var. And in lines 52-54, if not defined, I make a default
113 DESCRIPTION.
114 - ---------------- emerge output
115 root@kikov2 work # emerge search ebook-gtk
116
117 [ Results for search key : ebook-gtk ]
118 [ Applications found : 1 ]
119
120 * app-doc/ebook-gtk
121 Latest version Available: 2.0-r1
122 Latest version Installed: 2.0-r1
123 Homepage:
124 Description:
125
126 - -----------------
127 It doesn't show nothing.
128
129 Am I making something wrong?
130
131 Thx in advance.
132 BR
133
134 KikoV
135 -----BEGIN PGP SIGNATURE-----
136 Version: GnuPG v1.0.7 (GNU/Linux)
137
138 iD8DBQE82UOEAE7Ivj6LuFMRAsvLAJ9Pr97/XgRmg+vFkE0v4o5zCO20egCfc+lh
139 28fhWvF8eHastIqCgZobJ2k=
140 =C6TD
141 -----END PGP SIGNATURE-----