/[gentoo-alt]/trunk/prefix/eclass/ebook.eclass
Gentoo

Contents of /trunk/prefix/eclass/ebook.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 982 - (show annotations) (download)
Thu Feb 2 04:20:17 2006 UTC (13 years, 2 months ago) by kito
File size: 3126 byte(s)
Initial eclass import from gentoo-x86
1 # Copyright 1999-2004 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/eclass/ebook.eclass,v 1.25 2005/07/11 15:08:06 swegener Exp $
4 #
5 # Author Francisco Gimeno <kikov@fco-gimeno.com>
6 # Mantainer José Alberto Suárez López <bass@gentoo.org>
7 #
8 # Latest changes thanks to Kris Verbeeck
9 # The ebook eclass defines some default functions and variables to
10 # install ebooks.
11
12 HOMEPAGE="http://lidn.sourceforge.net"
13
14 IUSE="kde"
15 SLOT="0"
16 LICENSE="OPL"
17 KEYWORDS="x86 ppc amd64"
18
19 # ebook eclass user guide:
20 # -vars
21 #
22 # EBOOKNAME: the main name of the book ( without versions ), i.e: gtk
23 # Required
24 # EBOOKVERSION: the version of the book, i.e: 1.2
25 # Required
26 # SRC: the main file to download. Default: ${EBOOKNAME}-${EBOOKVERSION}
27 # EBOOKDESTDIR: directory inside ${DEVHELPROOT}/books/${EBOOKDIR} where is
28 # installed the book. By default: ${EBOOKNAME}-${EBOOKVERSION}
29 # ( sometimes it is only ${EBOOKNAME} so you will need to modify it )
30 # EBOOKSRCDIR: directory where is the unpacked book in html
31 # BOOKDEVHELPFILE: book.devhelp is copied with the name
32 # ${EBOOKNAME}-${EBOOKVERSION} by default.
33 # BOOKDESTDIR: directory to put into the ebook in html. By default:
34 # ${EBOOKNAME}-${EBOOKVERSION}.
35 # NOVERSION: if it's not empty, then, remove -${EBOOKVERSION} from all
36 # vars...
37 # DEVHELPROOT: usually usr/share/devhelp
38 # EBOOKFROMDIR: you can set the from dir, usually ${S}.
39
40 if [ "${NOVERSION}" = "" ]; then
41 _src="${EBOOKNAME}-${EBOOKVERSION}"
42 else
43 _src="${EBOOKNAME}"
44 fi
45 _ebookdestdir="${_src}"
46 _ebooksrcdir="${_src}"
47 _ebookdevhelpfile="${_src}"
48
49 if [ "${EBOOKEXT}" = "" ]; then
50 ext="tar.gz"
51 else
52 ext="${EBOOKEXT}"
53 fi
54
55 if [ "${SRC}" = "" ]; then
56 SRC="${_src}"
57 fi
58 if [ "${SRC_URI}" = "" ]; then
59 SRC_URI="http://lidn.sourceforge.net/books_download/${SRC}.${ext}"
60 fi
61
62 # Default directory to install de ebook devhelped book
63 if [ "${DEVHELPROOT}" = "" ]; then
64 DEVHELPROOT="usr/share/devhelp"
65 fi
66 if [ "${RDEPEND}" = "" ]; then
67 RDEPEND="kde? ( dev-util/kdevelop )
68 !kde? ( >=dev-util/devhelp-0.6 )"
69 fi
70 if [ "${DESCRIPTION}" = "" ]; then
71 DESCRIPTION="${P} ebook based on $ECLASS eclass"
72 fi
73 if [ "${EBOOKDESTDIR}" = "" ]; then
74 EBOOKDESTDIR=${_ebookdestdir}
75 fi
76 if [ "${EBOOKSRCDIR}" = "" ]; then
77 EBOOKSRCDIR=${_ebooksrcdir}
78 fi
79 if [ "${EBOOKDEVHELPFILE}" = "" ]; then
80 EBOOKDEVHELPFILE=${_ebookdevhelpfile}".devhelp"
81 fi
82
83 S=${WORKDIR}
84 ebook_src_unpack() {
85 debug-print-function $FUNCNAME $*
86 unpack ${SRC}.${ext}
87 }
88
89 ebook_src_install() {
90 debug-print-function $FUNCNAME $*
91
92 dodir ${DEVHELPROOT}/books
93 dodir ${DEVHELPROOT}/books/${EBOOKDESTDIR}
94 echo EBOOKSRCDIR= ${EBOOKSRCDIR}
95
96 if [ "${EBOOKFROMDIR}" ]; then
97 cp ${S}/${EBOOKFROMDIR}/book.devhelp ${D}${DEVHELPROOT}/books/${EBOOKDESTDIR}/${EBOOKDEVHELPFILE}
98 cp -R ${S}/${EBOOKFROMDIR}/book/* ${D}${DEVHELPROOT}/books/${EBOOKDESTDIR}
99 else
100 cp ${S}/book.devhelp ${D}${DEVHELPROOT}/books/${EBOOKDESTDIR}/${EBOOKDEVHELPFILE}
101 cp -R ${S}/book/* ${D}${DEVHELPROOT}/books/${EBOOKDESTDIR}
102 fi
103 }
104
105 EXPORT_FUNCTIONS src_unpack src_install

  ViewVC Help
Powered by ViewVC 1.1.20