summaryrefslogtreecommitdiff
blob: c4377b02da4481d3e62db3ae560b583c43555f57 (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
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-perl/mogilefs-server/mogilefs-server-2.16.ebuild,v 1.2 2007/05/16 11:11:57 robbat2 Exp $

inherit perl-module git

EGIT_REPO_URI=git+ssh://root@172.16.9.6/code/danga/mogilefs
S="${WORKDIR}/server"

DESCRIPTION="Server for the MogileFS distributed file system"
HOMEPAGE="http://www.danga.com/mogilefs/"
#SRC_URI="mirror://cpan/authors/id/B/BR/BRADFITZ/${P}.tar.gz"

IUSE="mysql sqlite postgres"

SLOT="0"
LICENSE="|| ( Artistic GPL-2 )"
KEYWORDS="~amd64 ~ppc ~x86"

# Upstream site recommends this,
# but it breaks Perlbal
# dev-perl/Perlbal-XS-HTTPHeaders
DEPEND="dev-perl/Net-Netmask
		>=dev-perl/Danga-Socket-1.57
		>=dev-perl/Sys-Syscall-0.22
		>=dev-perl/Perlbal-1.57
		dev-perl/IO-AIO
		dev-perl/Gearman-Server
		dev-perl/Gearman-Client-Async
		dev-perl/libwww-perl
		dev-perl/Cache-Memcached
		mysql? ( dev-perl/DBD-mysql )
		sqlite? ( dev-perl/DBD-SQLite )
		postgres? ( dev-perl/DBD-Pg )
		dev-lang/perl"
mydoc="CHANGES TODO"

# You need a local MySQL server for this
#SRC_TEST="do"

MOGILE_USER="mogile"

src_unpack() {
	S="${WORKDIR}" git_src_unpack
}

pkg_setup() {
	# Warning! It is important that the uid is constant over Gentoo machines
	# As mogilefs may be used with non-local block devices that move!
	enewuser ${MOGILE_USER} 460 -1 -1
}

src_install() {
	perl-module_src_install || die "perl-module_src_install failed"
	cd ${S}

	newconfd ${FILESDIR}/mogilefsd-conf.d-2.16 mogilefsd
	newinitd ${FILESDIR}/mogilefsd-init.d-2.16 mogilefsd

	newconfd ${FILESDIR}/mogstored-conf.d-2.16 mogstored
	newinitd ${FILESDIR}/mogstored-init.d-2.16 mogstored

	diropts -m 700 -o ${MOGILE_USER}
	keepdir /var/run/mogile
	keepdir /var/mogdata
	keepdir /mnt/mogilefs
	diropts -m 755 -o root

	dodir /etc/mogilefs
	insinto /etc/mogilefs
	insopts -m 600 -o root -g ${MOGILE_USER}
	newins ${FILESDIR}/mogilefsd.conf-2.16 mogilefsd.conf
	newins ${FILESDIR}/mogstored.conf-2.16 mogstored.conf
}

pkg_postinst() {
	chmod 640 ${ROOT}/etc/mogilefs/{mogilefsd,mogstored}.conf
	chown root:${MOGILE_USER} ${ROOT}/etc/mogilefs/{mogilefsd,mogstored}.conf
}