1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
8 inherit user perl-module
10 DESCRIPTION="Server for the MogileFS distributed file system"
11 HOMEPAGE="http://www.danga.com/mogilefs/ https://metacpan.org/release/MogileFS-Server"
13 IUSE="mysql +sqlite test postgres"
14 RESTRICT="!test? ( test )"
15 REQUIRED_USE="test? ( sqlite ) || ( mysql sqlite postgres )"
18 LICENSE="|| ( Artistic GPL-2 )"
19 KEYWORDS="~amd64 ~ppc ~x86"
21 # Upstream site recommends this,
22 # but it breaks Perlbal
23 # dev-perl/Perlbal-XS-HTTPHeaders
24 RDEPEND="dev-perl/Net-Netmask
25 >=dev-perl/Danga-Socket-1.610.0
26 >=dev-perl/Sys-Syscall-0.220.0
27 >=dev-perl/Perlbal-1.790
30 >=dev-perl/MogileFS-Client-1.170.0
31 >=dev-perl/MogileFS-Utils-2.280.0
32 dev-perl/Cache-Memcached
34 mysql? ( dev-perl/DBD-mysql )
35 postgres? ( dev-perl/DBD-Pg )
36 sqlite? ( dev-perl/DBD-SQLite )"
40 "${FILESDIR}/${PN}-2.720.0-gentoo-init-conf.patch"
42 DIST_TEST="never verbose"
47 # Warning! It is important that the uid is constant over Gentoo machines
48 # As mogilefs may be used with non-local block devices that move!
49 enewuser ${MOGILE_USER} 460 -1 -1
53 perl-module_src_install || die "perl-module_src_install failed"
56 newconfd "${S}"/gentoo/conf.d/mogilefsd mogilefsd
57 newinitd "${S}"/gentoo/init.d/mogilefsd mogilefsd
59 newconfd "${S}"/gentoo/conf.d/mogstored mogstored
60 newinitd "${S}"/gentoo/init.d/mogstored mogstored
62 newinitd "${S}"/gentoo/init.d/mogautomount mogautomount
64 diropts -m 700 -o ${MOGILE_USER}
67 diropts -m 755 -o root
71 insopts -m 600 -o root -g ${MOGILE_USER}
72 newins "${S}"/gentoo/conf/mogilefsd.conf mogilefsd.conf
73 newins "${S}"/gentoo/conf/mogstored.conf mogstored.conf
77 chmod 640 "${ROOT}"/etc/mogilefs/{mogilefsd,mogstored}.conf
78 chown root:${MOGILE_USER} "${ROOT}"/etc/mogilefs/{mogilefsd,mogstored}.conf
82 # these need to be in the env and the makeopts
83 export MOGTEST_DBUSER=mogile MOGTEST_DBNAME=tmp_mogiletest MOGTEST_DBTYPE=SQLite TMPDIR="${T}/mogile"
85 make -j1 test TEST_VERBOSE=1 MOGTEST_DBUSER=${MOGTEST_DBUSER} MOGTEST_DBNAME=${MOGTEST_DBNAME} MOGTEST_DBTYPE=${MOGTEST_DBTYPE} TMPDIR="${TMPDIR}"