summaryrefslogtreecommitdiffstats
path: root/glusterfs.spec.in
diff options
context:
space:
mode:
authorNiels de Vos <ndevos@redhat.com>2018-01-31 16:38:34 +0100
committerAmar Tumballi <amarts@redhat.com>2018-02-19 17:38:55 +0000
commit8d9961e63786cf8a9bb9e2f4140ab9a77f1ccbe3 (patch)
treecb85d5508fcd92389e4783ec2cbee0abff36153b /glusterfs.spec.in
parent134c539e79f96691622ed15debaeace2071c6937 (diff)
build: add --without-server option
With Gluster 4.0 we will not provide the server components for EL6 and older. At one point Gluster 4.x will get GlusterD2, which requires Golang tools in the distribution. EL6 does not contain these at the moment. With this change, it is possible to `./configure --without-server` which prevents building glusterd and the xlators for the bricks. Building RPMs can pass `--without server` and the glusterfs-server sub-package will not be created. Change-Id: I97f5ccf9f2c76e60d9af83915fc59fae57ad6d25 BUG: 1074947 Signed-off-by: Niels de Vos <ndevos@redhat.com>
Diffstat (limited to 'glusterfs.spec.in')
-rw-r--r--glusterfs.spec.in55
1 files changed, 53 insertions, 2 deletions
diff --git a/glusterfs.spec.in b/glusterfs.spec.in
index 75e16c59f32..d2e280c98b5 100644
--- a/glusterfs.spec.in
+++ b/glusterfs.spec.in
@@ -85,6 +85,16 @@
%global _without_rdma --disable-ibverbs
%endif
+# server
+# if you wish to build rpms without server components, compile like this
+# rpmbuild -ta @PACKAGE_NAME@-@PACKAGE_VERSION@.tar.gz --without server
+%{?_without_server:%global _without_server --without-server}
+
+# disable server components forcefully as rhel <= 6
+%if ( 0%{?rhel} && 0%{?rhel} <= 6 )
+%global _without_server --without-server
+%endif
+
# syslog
# if you wish to build rpms without syslog logging, compile like this
# rpmbuild -ta @PACKAGE_NAME@-@PACKAGE_VERSION@.tar.gz --without syslog
@@ -132,6 +142,14 @@
%global _without_events --disable-events
%endif
+# without server should also disable some server-only components
+%if 0%{?_without_server:1}
+%global _without_events --disable-events
+%global _without_georeplication --disable-georeplication
+%global _with_gnfs %{nil}
+%global _without_tiering --disable-tiering
+%endif
+
# From https://fedoraproject.org/wiki/Packaging:Python#Macros
%if ( 0%{?rhel} && 0%{?rhel} <= 6 )
%{!?python2_sitelib: %global python2_sitelib %(python2 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
@@ -332,6 +350,7 @@ is in user space and easily manageable.
This package provides the api include files.
+%if ( 0%{!?_without_server:1} )
%package cli
Summary: GlusterFS CLI
Group: Applications/File
@@ -347,6 +366,7 @@ called Translators from GNU Hurd kernel. Much of the code in GlusterFS
is in user space and easily manageable.
This package provides the GlusterFS CLI application and its man page
+%endif
%package devel
Summary: Development Libraries
@@ -574,6 +594,7 @@ Open Cluster Framework (OCF) compliant cluster resource managers,
like Pacemaker.
%endif
+%if ( 0%{!?_without_server:1} )
%package server
Summary: Clustered file-system server
Group: System Environment/Daemons
@@ -633,6 +654,7 @@ called Translators from GNU Hurd kernel. Much of the code in GlusterFS
is in user space and easily manageable.
This package provides the glusterfs server daemon.
+%endif
%package client-xlators
Summary: GlusterFS client-side translators
@@ -701,6 +723,7 @@ export CFLAGS
%{?_without_georeplication} \
%{?_without_ocf} \
%{?_without_rdma} \
+ %{?_without_server} \
%{?_without_syslog} \
%{?_without_tiering} \
%{?_with_ipv6default} \
@@ -730,9 +753,11 @@ install -D -p -m 0644 %{SOURCE1} \
install -D -p -m 0644 %{SOURCE2} \
%{buildroot}%{_sysconfdir}/sysconfig/glusterfsd
%else
+%if ( 0%{!?_without_server:1} )
install -D -p -m 0644 extras/glusterd-sysconfig \
%{buildroot}%{_sysconfdir}/sysconfig/glusterd
%endif
+%endif
%if ( 0%{_for_fedora_koji_builds} )
%if ( 0%{?rhel} && 0%{?rhel} <= 5 )
@@ -779,12 +804,14 @@ rm -f %{buildroot}%{_defaultdocdir}/%{name}/glusterfs-mode.el
rm -f %{buildroot}%{_defaultdocdir}/%{name}/glusterfs.vim
%endif
+%if ( 0%{!?_without_server:1} )
# Create working directory
mkdir -p %{buildroot}%{_sharedstatedir}/glusterd
# Update configuration file to /var/lib working directory
sed -i 's|option working-directory /etc/glusterd|option working-directory %{_sharedstatedir}/glusterd|g' \
%{buildroot}%{_sysconfdir}/glusterfs/glusterd.vol
+%endif
# Install glusterfsd .service or init.d file
%if ( 0%{_for_fedora_koji_builds} )
@@ -802,6 +829,7 @@ install -D -p -m 0644 extras/glusterfs-georep-logrotate \
%{buildroot}%{_sysconfdir}/logrotate.d/glusterfs-georep
%endif
+%if ( 0%{!?_without_server:1} )
# the rest of the ghosts
touch %{buildroot}%{_sharedstatedir}/glusterd/glusterd.info
touch %{buildroot}%{_sharedstatedir}/glusterd/options
@@ -820,12 +848,15 @@ mkdir -p %{buildroot}%{_sharedstatedir}/glusterd/snaps
mkdir -p %{buildroot}%{_sharedstatedir}/glusterd/ss_brick
touch %{buildroot}%{_sharedstatedir}/glusterd/nfs/nfs-server.vol
touch %{buildroot}%{_sharedstatedir}/glusterd/nfs/run/nfs.pid
+%endif
find ./tests ./run-tests.sh -type f | cpio -pd %{buildroot}%{_prefix}/share/glusterfs
## Install bash completion for cli
+%if ( 0%{!?_without_server:1} )
install -p -m 0744 -D extras/command-completion/gluster.bash \
%{buildroot}%{_sysconfdir}/bash_completion.d/gluster
+%endif
%clean
rm -rf %{buildroot}
@@ -867,6 +898,7 @@ exit 0
%post libs
/sbin/ldconfig
+%if ( 0%{!?_without_server:1} )
%post server
# Legacy server
%systemd_post glusterd
@@ -938,6 +970,7 @@ else
rm -f %{_rundir}/glusterd.socket
fi
exit 0
+%endif
##-----------------------------------------------------------------------------
## All %%pre should be placed here and keep them sorted
@@ -961,6 +994,7 @@ fi
exit 0
%endif
+%if ( 0%{!?_without_server:1} )
%preun server
if [ $1 -eq 0 ]; then
if [ -f %glusterfsd_svcfile ]; then
@@ -979,6 +1013,7 @@ if [ $1 -ge 1 ]; then
%systemd_postun_with_restart glusterd
fi
exit 0
+%endif
##-----------------------------------------------------------------------------
## All %%postun should be placed here and keep them sorted
@@ -997,12 +1032,14 @@ exit 0
%postun libs
/sbin/ldconfig
+%if ( 0%{!?_without_server:1} )
%postun server
/sbin/ldconfig
%if (0%{?_with_firewalld:1})
%firewalld_reload
%endif
exit 0
+%endif
##-----------------------------------------------------------------------------
## All %%files should be placed here and keep them grouped
@@ -1010,15 +1047,19 @@ exit 0
%files
%doc ChangeLog COPYING-GPLV2 COPYING-LGPLV3 INSTALL README.md THANKS
%{_mandir}/man8/*gluster*.8*
+%if ( 0%{!?_without_server:1} )
%exclude %{_mandir}/man8/gluster.8*
+%endif
%dir %{_localstatedir}/log/glusterfs
%if ( 0%{!?_without_rdma:1} )
%exclude %{_libdir}/glusterfs/%{version}%{?prereltag}/rpc-transport/rdma*
%endif
+%if 0%{?!_without_server:1}
%dir %{_datadir}/glusterfs
%dir %{_datadir}/glusterfs/scripts
%{_datadir}/glusterfs/scripts/post-upgrade-script-for-quota.sh
%{_datadir}/glusterfs/scripts/pre-upgrade-script-for-quota.sh
+%endif
# xlators that are needed on the client- and on the server-side
%dir %{_libdir}/glusterfs
%dir %{_libdir}/glusterfs/%{version}%{?prereltag}
@@ -1063,10 +1104,12 @@ exit 0
%{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/performance/nl-cache.so
%dir %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/system
%{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/system/posix-acl.so
+%if 0%{?!_without_server:1}
%dir %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/experimental
%{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/experimental/fdl.so
+%endif
%dir %attr(0775,gluster,gluster) %{_rundir}/gluster
-%if 0%{?_tmpfilesdir:1}
+%if 0%{?_tmpfilesdir:1} && 0%{!?_without_server:1}
%{_tmpfilesdir}/gluster.conf
%endif
@@ -1085,10 +1128,12 @@ exit 0
%dir %{_includedir}/glusterfs/api
%{_includedir}/glusterfs/api/*
+%if ( 0%{!?_without_server:1} )
%files cli
%{_sbindir}/gluster
%{_mandir}/man8/gluster.8*
%{_sysconfdir}/bash_completion.d/gluster
+%endif
%files devel
%dir %{_includedir}/glusterfs
@@ -1152,7 +1197,7 @@ exit 0
%endif
%endif
-%if ( 0%{?_with_gnfs:1} )
+%if ( 0%{?_with_gnfs:1} && 0%{!?_without_server:1} )
%files gnfs
%dir %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator
%dir %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/nfs
@@ -1233,6 +1278,7 @@ exit 0
%{_prefix}/lib/ocf/resource.d/glusterfs
%endif
+%if ( 0%{!?_without_server:1} )
%files server
%doc extras/clear_xattrs.sh
# sysconf
@@ -1393,6 +1439,8 @@ exit 0
%{_sbindir}/gf_logdump
%{_sbindir}/gf_recon
+# end of server files
+%endif
# Events
%if ( 0%{!?_without_events:1} )
@@ -1414,6 +1462,9 @@ exit 0
%endif
%changelog
+* Thu Feb 1 2018 Niels de Vos <ndevos@redhat.com>
+- Add '--without server' option to facilitate el6 builds (#1074947)
+
* Wed Jan 24 2018 Kaleb S. KEITHLEY <kkeithle@redhat.com>
- python-ctypes no long exists, now in python stdlib (#1538258)