annotate sys-cluster/zookeeper/zookeeper-3.3.1.ebuild @ 254:c9d209e62e25

new ebuild for s9y 1.5.5
author Dirk Olmes <dirk@xanthippe.ping.de>
date Thu, 27 Jan 2011 11:40:12 +0100
parents a3c4bfaac1be
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
228
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
1 # Copyright 1999-2010 Gentoo Foundation
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
2 # Distributed under the terms of the GNU General Public License v2
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
3 # $Header: $
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
4
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
5 EAPI="2"
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
6
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
7 inherit eutils java-utils-2
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
8
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
9 MY_PN="${PN/apache-/}"
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
10 MY_P="${MY_PN}-${PV}"
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
11
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
12 DESCRIPTION="ZooKeeper is a high-performance coordination service for
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
13 distributed applications."
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
14 HOMEPAGE="http://hadoop.apache.org/"
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
15 SRC_URI="mirror://apache/hadoop/${MY_PN}/${MY_P}/${MY_P}.tar.gz"
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
16
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
17 LICENSE="Apache-2.0"
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
18 SLOT="0"
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
19 KEYWORDS="~amd64 ~x86"
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
20 RESTRICT="mirror binchecks"
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
21 IUSE=""
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
22
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
23 DEPEND=""
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
24 RDEPEND=">=virtual/jre-1.6"
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
25
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
26 S="${WORKDIR}/${MY_P}"
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
27 INSTALL_DIR=/opt/"${PN}"
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
28 DATA_DIR=/var/db/"${PN}"
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
29 export CONFIG_PROTECT="${CONFIG_PROTECT} ${INSTALL_DIR}/conf"
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
30
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
31 src_install() {
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
32 dodir "${DATA_DIR}"
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
33 sed "s:^dataDir=.*:dataDir=${DATA_DIR}:" conf/zoo_sample.cfg > conf/zoo.cfg || die "sed failed"
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
34
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
35 dodir "${INSTALL_DIR}"
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
36 mv "${S}"/* "${D}${INSTALL_DIR}" || die "install failed"
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
37
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
38 # env file
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
39 cat > 99"${PN}" <<-EOF
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
40 PATH=${INSTALL_DIR}/bin
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
41 CONFIG_PROTECT=${INSTALL_DIR}/conf
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
42 EOF
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
43 doenvd 99"${PN}" || die "doenvd failed"
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
44
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
45 cat > "${PN}" <<-EOF
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
46 #!/sbin/runscript
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
47
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
48 opts="start stop restart"
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
49
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
50 start() {
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
51 ${INSTALL_DIR}/bin/zkServer.sh start > /dev/null
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
52 }
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
53
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
54 stop() {
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
55 ${INSTALL_DIR}/bin/zkServer.sh stop
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
56 }
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
57
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
58 restart() {
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
59 ${INSTALL_DIR}/bin/zkServer.sh restart > /dev/null
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
60 }
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
61
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
62 status() {
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
63 ${INSTALL_DIR}/bin/zkServer.sh status
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
64 }
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
65 EOF
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
66 doinitd "${PN}" || die "doinitd failed"
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
67 }
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
68
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
69 pkg_postinst() {
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
70 elog "For info on configuration see http://hadoop.apache.org/${MY_PN}/docs/r${PV}"
a3c4bfaac1be initial import of zookeeper
holger
parents:
diff changeset
71 }