1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 PYTHON_COMPAT=( python2_7 )
10 inherit autotools-utils elisp-common eutils multilib python-single-r1 systemd versionator
12 DESCRIPTION="GlusterFS is a powerful network/cluster filesystem"
13 HOMEPAGE="http://www.gluster.org/"
14 SRC_URI="http://download.gluster.org/pub/gluster/${PN}/$(get_version_component_range '1-2')/${PV}/${P}.tar.gz"
16 LICENSE="|| ( GPL-2 LGPL-3+ )"
18 KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
19 IUSE="bd-xlator crypt-xlator debug emacs +fuse +georeplication glupy infiniband qemu-block rsyslog static-libs +syslog systemtap test +tiering vim-syntax +xml"
21 REQUIRED_USE="georeplication? ( ${PYTHON_REQUIRED_USE} )
22 glupy? ( ${PYTHON_REQUIRED_USE} )"
24 # the tests must be run as root
27 # sys-apps/util-linux is required for libuuid
28 RDEPEND="bd-xlator? ( sys-fs/lvm2 )
29 emacs? ( virtual/emacs )
30 fuse? ( >=sys-fs/fuse-2.7.0 )
31 georeplication? ( ${PYTHON_DEPS} )
32 infiniband? ( sys-infiniband/libibverbs:* sys-infiniband/librdmacm:* )
33 qemu-block? ( dev-libs/glib:2 )
34 systemtap? ( dev-util/systemtap )
35 tiering? ( dev-db/sqlite:3 )
36 xml? ( dev-libs/libxml2 )
39 dev-libs/openssl:=[-bindist]
40 dev-libs/userspace-rcu:=
41 || ( sys-libs/glibc sys-libs/argp-standalone )
47 test? ( >=dev-util/cmocka-1.0.1
51 virtual/perl-Test-Harness
56 SITEFILE="50${PN}-mode-gentoo.el"
59 "${FILESDIR}/${PN}-3.4.0-silent_rules.patch"
62 DOCS=( AUTHORS ChangeLog NEWS README.md THANKS )
65 # * The build system will always configure & build argp-standalone but it'll never use it
66 # if the argp.h header is found in the system. Which should be the case with
67 # glibc or if argp-standalone is installed.
70 ( use georeplication || use glupy ) && python-single-r1_pkg_setup
74 # build rpc-transport and xlators only once as shared libs
75 find rpc/rpc-transport xlators -name Makefile.am -print0 \
76 | xargs -0 sed -i -e 's|.*_la_LDFLAGS = .*|\0 -shared|'
78 autotools-utils_src_prepare
83 --disable-dependency-tracking
84 --disable-silent-rules
87 $(use_enable bd-xlator)
88 $(use_enable crypt-xlator)
89 $(use_enable fuse fuse-client)
90 $(use_enable georeplication)
92 $(use_enable infiniband ibverbs)
93 $(use_enable qemu-block)
94 $(use_enable static-libs static)
96 $(use_enable systemtap)
97 $(use_enable test cmocka)
99 $(use_enable xml xml-output)
100 --docdir=/usr/share/doc/${PF}
103 autotools-utils_src_configure
107 autotools-utils_src_compile
109 use emacs && elisp-compile extras/glusterfs-mode.el
113 autotools-utils_src_install
116 "${D}"/etc/glusterfs/glusterfs-{georep-,}logrotate \
117 "${D}"/etc/glusterfs/gluster-rsyslog-*.conf \
118 "${D}"/usr/share/doc/${PF}/glusterfs{-mode.el,.vim} || die "removing false files failed"
120 insinto /etc/logrotate.d
121 newins "${FILESDIR}"/glusterfs.logrotate glusterfs
123 if use rsyslog ; then
124 insinto /etc/rsyslog.d
125 newins extras/gluster-rsyslog-7.2.conf 60-gluster.conf
129 elisp-install ${PN} extras/glusterfs-mode.el*
130 elisp-site-file-install "${FILESDIR}/${SITEFILE}"
133 if use vim-syntax ; then
134 insinto /usr/share/vim/vimfiles/ftdetect; doins "${FILESDIR}"/${PN}.vim
135 insinto /usr/share/vim/vimfiles/syntax; doins extras/${PN}.vim
138 # insert some other tools which might be useful
139 insinto /usr/share/glusterfs/scripts
141 extras/backend-{cleanup,xattr-sanitize}.sh \
142 extras/clear_xattrs.sh \
143 extras/migrate-unify-to-distribute.sh
145 # correct permissions on installed scripts
146 # fperms 0755 /usr/share/glusterfs/scripts/*.sh
147 chmod 0755 "${ED}"/usr/share/glusterfs/scripts/*.sh || die
149 if use georeplication ; then
150 # move the gsync-sync-gfid tool to a binary path
151 # and set a symlink to be compliant with all other distros
152 mv "${ED}"/usr/{share/glusterfs/scripts/gsync-sync-gfid,libexec/glusterfs/} || die
153 dosym ../../../libexec/glusterfs/gsync-sync-gfid /usr/share/glusterfs/scripts/gsync-sync-gfid
156 newinitd "${FILESDIR}/${PN}-r1.initd" glusterfsd
157 newinitd "${FILESDIR}/glusterd-r2.initd" glusterd
158 newconfd "${FILESDIR}/${PN}.confd" glusterfsd
160 keepdir /var/log/${PN}
161 keepdir /var/lib/glusterd
164 rm -rf "${ED}/var/run/" || die
165 use static-libs || find "${ED}"/usr/$(get_libdir)/ -type f -name '*.la' -delete
167 use georeplication && python_fix_shebang "${ED}"
169 # upstream already has a patch ready, to be removed once available, http://review.gluster.org/#/c/9458/
170 echo "d /run/gluster 0755 root root -" > "${T}/gluster.tmpfiles" || die
171 systemd_newtmpfilesd "${T}/gluster.tmpfiles" gluster.conf
175 ./run-tests.sh || die
179 elog "Starting with ${PN}-3.1.0, you can use the glusterd daemon to configure your"
180 elog "volumes dynamically. To do so, simply use the gluster CLI after running:"
181 elog " /etc/init.d/glusterd start"
183 elog "For static configurations, the glusterfsd startup script can be multiplexed."
184 elog "The default startup script uses /etc/conf.d/glusterfsd to configure the"
185 elog "separate service. To create additional instances of the glusterfsd service"
186 elog "simply create a symlink to the glusterfsd startup script."
189 elog " # ln -s glusterfsd /etc/init.d/glusterfsd2"
190 elog " # ${EDITOR} /etc/glusterfs/glusterfsd2.vol"
191 elog "You can now treat glusterfsd2 like any other service"
193 ewarn "You need to use a ntp client to keep the clocks synchronized across all"
194 ewarn "of your servers. Setup a NTP synchronizing service before attempting to"
195 ewarn "run GlusterFS."
198 elog "If you are upgrading from a previous version of ${PN}, please read:"
199 elog " http://www.gluster.org/community/documentation/index.php/Upgrade_to_3.5"
201 use emacs && elisp-site-regen
205 use emacs && elisp-site-regen