1 |
# Copyright 1999-2011 Gentoo Foundation |
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
# $Header: /var/cvsroot/gentoo-x86/dev-perl/mogilefs-server/mogilefs-server-2.53.ebuild,v 1.1 2011/08/12 19:43:22 robbat2 Exp $ |
4 |
|
5 |
EAPI=2 |
6 |
MODULE_AUTHOR="DORMANDO" |
7 |
MY_PN=MogileFS-Server |
8 |
MY_P="${MY_PN}-${PV}" |
9 |
MODULE_A="${MY_P}.tar.gz" |
10 |
S="${WORKDIR}/${MY_P}" |
11 |
inherit perl-module |
12 |
|
13 |
DESCRIPTION="Server for the MogileFS distributed file system" |
14 |
HOMEPAGE="http://www.danga.com/mogilefs/" |
15 |
|
16 |
IUSE="mysql sqlite postgres" |
17 |
|
18 |
SLOT="0" |
19 |
LICENSE="|| ( Artistic GPL-2 )" |
20 |
KEYWORDS="~amd64 ~ppc ~x86" |
21 |
|
22 |
# Upstream site recommends this, |
23 |
# but it breaks Perlbal |
24 |
# dev-perl/Perlbal-XS-HTTPHeaders |
25 |
RDEPEND="dev-perl/Net-Netmask |
26 |
>=dev-perl/Danga-Socket-1.61 |
27 |
>=dev-perl/Sys-Syscall-0.22 |
28 |
>=dev-perl/Perlbal-1.790 |
29 |
dev-perl/IO-AIO |
30 |
dev-perl/libwww-perl |
31 |
>=dev-perl/MogileFS-Client-1.14 |
32 |
>=dev-perl/MogileFS-Utils-2.20 |
33 |
dev-perl/Cache-Memcached |
34 |
mysql? ( dev-perl/DBD-mysql ) |
35 |
postgres? ( dev-perl/DBD-Pg ) |
36 |
sqlite? ( dev-perl/DBD-SQLite )" |
37 |
DEPEND="${RDEPEND}" |
38 |
mydoc="CHANGES TODO" |
39 |
|
40 |
# You need a local MySQL or Postgresql server for this |
41 |
#SRC_TEST="do" |
42 |
|
43 |
#PATCHES=( ) |
44 |
|
45 |
MOGILE_USER="mogile" |
46 |
|
47 |
pkg_setup() { |
48 |
# Warning! It is important that the uid is constant over Gentoo machines |
49 |
# As mogilefs may be used with non-local block devices that move! |
50 |
enewuser ${MOGILE_USER} 460 -1 -1 |
51 |
} |
52 |
|
53 |
src_prepare() { |
54 |
for f in Makefile.PL MANIFEST ; do |
55 |
if [ -f "${S}"/${f}.orig ]; then |
56 |
cp -f "${S}"/${f}{.orig,} |
57 |
else |
58 |
cp -f "${S}"/${f}{,.orig} |
59 |
fi |
60 |
done |
61 |
# If we are not in a cutting edge Git source, we would prefer to not install |
62 |
# duplicates of these. |
63 |
sed -i -e '/directory.*mogdeps/d' "${S}"/Makefile.PL |
64 |
sed -i -e '/^lib\/mogdeps/d' "${S}"/MANIFEST |
65 |
mv -f "${S}/lib/mogdeps" "${S}" |
66 |
} |
67 |
|
68 |
src_compile() { |
69 |
export MOGILE_NO_BUILTIN_DEPS=1 |
70 |
perl-module_src_compile || die "perl-module_src_compile failed" |
71 |
} |
72 |
|
73 |
src_install() { |
74 |
export MOGILE_NO_BUILTIN_DEPS=1 |
75 |
perl-module_src_install || die "perl-module_src_install failed" |
76 |
cd "${S}" |
77 |
|
78 |
newconfd "${FILESDIR}"/mogilefsd-conf.d-2.16 mogilefsd |
79 |
newinitd "${FILESDIR}"/mogilefsd-init.d-2.16 mogilefsd |
80 |
|
81 |
newconfd "${FILESDIR}"/mogstored-conf.d-2.30 mogstored |
82 |
newinitd "${FILESDIR}"/mogstored-init.d-2.50 mogstored |
83 |
|
84 |
newinitd "${FILESDIR}"/mogautomount-init.d-2.50 mogautomount |
85 |
|
86 |
diropts -m 700 -o ${MOGILE_USER} |
87 |
keepdir /var/run/mogile |
88 |
keepdir /var/mogdata |
89 |
diropts -m 755 -o root |
90 |
|
91 |
dodir /etc/mogilefs |
92 |
insinto /etc/mogilefs |
93 |
insopts -m 600 -o root -g ${MOGILE_USER} |
94 |
newins "${FILESDIR}"/mogilefsd.conf-2.30 mogilefsd.conf |
95 |
newins "${FILESDIR}"/mogstored.conf-2.16 mogstored.conf |
96 |
} |
97 |
|
98 |
pkg_postinst() { |
99 |
chmod 640 "${ROOT}"/etc/mogilefs/{mogilefsd,mogstored}.conf |
100 |
chown root:${MOGILE_USER} "${ROOT}"/etc/mogilefs/{mogilefsd,mogstored}.conf |
101 |
} |