dev-python/repoze-lru: keyworded 0.7-r1 for ia64, bug #717946
[gentoo.git] / dev-perl / MogileFS-Server / MogileFS-Server-2.720.0-r1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 DIST_AUTHOR=DORMANDO
7 DIST_VERSION=${PV%0.0}
8 inherit user perl-module
9
10 DESCRIPTION="Server for the MogileFS distributed file system"
11 HOMEPAGE="http://www.danga.com/mogilefs/ https://metacpan.org/release/MogileFS-Server"
12
13 IUSE="mysql +sqlite test postgres"
14 RESTRICT="!test? ( test )"
15 REQUIRED_USE="test? ( sqlite ) || ( mysql sqlite postgres )"
16
17 SLOT="0"
18 LICENSE="|| ( Artistic GPL-2 )"
19 KEYWORDS="~amd64 ~ppc ~x86"
20
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
28                 >=dev-perl/IO-AIO-4
29                 dev-perl/libwww-perl
30                 >=dev-perl/MogileFS-Client-1.170.0
31                 >=dev-perl/MogileFS-Utils-2.280.0
32                 dev-perl/Cache-Memcached
33                 dev-perl/DBI
34                 mysql? ( dev-perl/DBD-mysql )
35                 postgres? ( dev-perl/DBD-Pg )
36                 sqlite? ( dev-perl/DBD-SQLite )"
37 DEPEND="${RDEPEND}"
38
39 PATCHES=(
40         "${FILESDIR}/${PN}-2.720.0-gentoo-init-conf.patch"
41 )
42 DIST_TEST="never verbose"
43
44 MOGILE_USER="mogile"
45
46 pkg_setup() {
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
50 }
51
52 src_install() {
53         perl-module_src_install || die "perl-module_src_install failed"
54         cd "${S}"
55
56         newconfd "${S}"/gentoo/conf.d/mogilefsd mogilefsd
57         newinitd "${S}"/gentoo/init.d/mogilefsd mogilefsd
58
59         newconfd "${S}"/gentoo/conf.d/mogstored mogstored
60         newinitd "${S}"/gentoo/init.d/mogstored mogstored
61
62         newinitd "${S}"/gentoo/init.d/mogautomount mogautomount
63
64         diropts -m 700 -o ${MOGILE_USER}
65         keepdir /var/mogdata
66
67         diropts -m 755 -o root
68         dodir /etc/mogilefs
69
70         insinto /etc/mogilefs
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
74 }
75
76 pkg_postinst() {
77         chmod 640 "${ROOT}"/etc/mogilefs/{mogilefsd,mogstored}.conf
78         chown root:${MOGILE_USER} "${ROOT}"/etc/mogilefs/{mogilefsd,mogstored}.conf
79 }
80
81 src_test() {
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"
84         #perl-module_src_test
85         make -j1 test TEST_VERBOSE=1 MOGTEST_DBUSER=${MOGTEST_DBUSER} MOGTEST_DBNAME=${MOGTEST_DBNAME} MOGTEST_DBTYPE=${MOGTEST_DBTYPE} TMPDIR="${TMPDIR}"
86 }