summaryrefslogtreecommitdiffstats
path: root/glusterfs.spec.in
diff options
context:
space:
mode:
Diffstat (limited to 'glusterfs.spec.in')
-rw-r--r--glusterfs.spec.in54
1 files changed, 52 insertions, 2 deletions
diff --git a/glusterfs.spec.in b/glusterfs.spec.in
index b6aa44bbf3a..d5395d2348c 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
@@ -580,6 +600,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
@@ -639,6 +660,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
@@ -707,6 +729,7 @@ export CFLAGS
%{?_without_georeplication} \
%{?_without_ocf} \
%{?_without_rdma} \
+ %{?_without_server} \
%{?_without_syslog} \
%{?_without_tiering} \
%{?_with_ipv6default} \
@@ -736,9 +759,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 )
@@ -785,12 +810,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} )
@@ -808,6 +835,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
@@ -826,12 +854,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}
@@ -873,6 +904,7 @@ exit 0
%post libs
/sbin/ldconfig
+%if ( 0%{!?_without_server:1} )
%post server
# Legacy server
%systemd_post glusterd
@@ -944,6 +976,7 @@ else
rm -f %{_rundir}/glusterd.socket
fi
exit 0
+%endif
##-----------------------------------------------------------------------------
## All %%pre should be placed here and keep them sorted
@@ -967,6 +1000,7 @@ fi
exit 0
%endif
+%if ( 0%{!?_without_server:1} )
%preun server
if [ $1 -eq 0 ]; then
if [ -f %glusterfsd_svcfile ]; then
@@ -985,6 +1019,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
@@ -1003,12 +1038,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
@@ -1016,15 +1053,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}
@@ -1069,8 +1110,9 @@ 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
+
%dir %attr(0775,gluster,gluster) %{_rundir}/gluster
-%if 0%{?_tmpfilesdir:1}
+%if 0%{?_tmpfilesdir:1} && 0%{!?_without_server:1}
%{_tmpfilesdir}/gluster.conf
%endif
@@ -1089,10 +1131,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
@@ -1154,7 +1198,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
@@ -1235,6 +1279,7 @@ exit 0
%{_prefix}/lib/ocf/resource.d/glusterfs
%endif
+%if ( 0%{!?_without_server:1} )
%files server
%doc extras/clear_xattrs.sh
# sysconf
@@ -1385,6 +1430,8 @@ exit 0
%if ( 0%{?_with_firewalld:1} )
%{_prefix}/lib/firewalld/services/glusterfs.xml
%endif
+# end of server files
+%endif
# Events
%if ( 0%{!?_without_events:1} )
@@ -1406,6 +1453,9 @@ exit 0
%endif
%changelog
+* Thu Feb 21 2018 Niels de Vos <ndevos@redhat.com>
+- Add '--without server' option to facilitate el6 builds (#1547635)
+
* Thu Jan 18 2018 Kaleb S. KEITHLEY <kkeithle@redhat.com>
- Fedora 28 glibc has removed rpc headers and rpcgen, use libtirpc