%global _hardened_build 1 %{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}} Name: glusterfs Version: 4.1.5 Release: 3 License: GPLv2 and LGPLv3+ Summary: Aggregating distributed file system URL: http://docs.gluster.org/ Source0: http://download.gluster.org/pub/gluster/%{name}/4.1/%{version}/%{name}-%{version}.tar.gz Patch0: python.patch Patch1: 0001-georep-fix-hard-coded-paths-in-gsyncd.conf.in.patch Source1: glusterd.sysconfig Source2: glusterfsd.sysconfig Source6: load-fuse-modules Source7: glusterfsd.service Source8: glusterfsd.init BuildRequires: systemd bison flex gcc make libtool ncurses-devel readline-devel libattr-devel BuildRequires: libxml2-devel openssl-devel libaio-devel libacl-devel python2-devel git perl BuildRequires: libtirpc-devel rpcgen libuuid-devel sqlite-devel lvm2-devel firewalld BuildRequires: fuse-devel libibverbs-devel BuildRequires: userspace-rcu-devel >= 0.7 BuildRequires: libcmocka-devel >= 1.0.1 BuildRequires: librdmacm-devel >= 1.0.15 Obsoletes: glusterfs-regression-tests hekafs glusterfs-ufo glusterfs-ganesha Obsoletes: %{name}-common < %{version}-%{release} Obsoletes: %{name}-core < %{version}-%{release} Provides: %{name}-common = %{version}-%{release} Provides: %{name}-core = %{version}-%{release} Requires: python2-gluster = %{version}-%{release} Requires: python2 python2-prettytable python-requests attr psmisc rsync Requires: rpcbind pyxattr lvm2 nfs-utils Requires(pre): shadow-utils Requires(post): systemd Requires(preun): systemd Requires(postun): systemd Provides: %{name}-api Obsoletes: %{name}-api Provides: %{name}-cli Obsoletes: %{name}-cli Provides: %{name}-events Obsoletes: %{name}-events Provides: %{name}-client-xlators Obsoletes: %{name}-client-xlators Provides: %{name}-extra-xlators Obsoletes: %{name}-extra-xlators Provides: %{name}-fuse Obsoletes: %{name}-fuse Obsoletes: %{name}-client < %{version}-%{release} Provides: %{name}-client = %{version}-%{release} Provides: %{name}-gnfs Obsoletes: %{name}-gnfs Provides: %{name}-geo-replication Obsoletes: %{name}-geo-replication Provides: %{name}-libs Obsoletes: %{name}-libs Provides: %{name}-rdma Obsoletes: %{name}-rdma Provides: %{name}-server Obsoletes: %{name}-server %description GlusterFS is a scalable network filesystem suitable for data-intensive tasks such as cloud storage and media streaming. %package devel Summary: Development files for glusterfs Provides: %{name}-api-devel Obsoletes: %{name}-api-devel Requires: %{name} = %{version}-%{release} Requires: %{name}-extra-xlators = %{version}-%{release} Requires: libacl-devel %description devel This package provides the development libraries and include files. %package -n python-gluster Summary: GlusterFS python library BuildArch: noarch %description -n python-gluster This package contains the python modules of GlusterFS and own gluster namespace. %package -n python2-gluster Summary: GlusterFS python library %{?python_provide:%python_provide python2-gluster} Provides: python-gluster = %{version}-%{release} Obsoletes: python-gluster < 3.10 Requires: python2 %description -n python2-gluster This package contains the python2 modules of GlusterFS and own gluster namespace. %package help Summary: Including man files for glusterfs. Requires: man %package resource-agents Summary: OCF-compliant resource agents for GlusterFS License: GPLv3+ BuildArch: noarch Requires: %{name}-server = %{version}-%{release} Requires: %{_prefix}/lib/ocf/resource.d %description resource-agents Resource agents for monitoring and managing glusterd daemons under Open Cluster Framework (OCF) compliant resource managers such as Pacemaker. %description help This contains man files for the using of glusterfs. %prep %autosetup -Sgit -n %{name}-%{version} %build sed -i -e 's/--quiet//' configure.ac ./autogen.sh && %configure \ --enable-firewalld \ --enable-gnfs \ --with-tmpfilesdir=%{_tmpfilesdir} #hardening and rpath sed -i 's| \\\$compiler_flags |&\\\$LDFLAGS |' libtool %disable_rpath %make_build V=1 %check make check %install rm -rf %{buildroot} make install DESTDIR=%{buildroot} docdir="%_docdir/%name" %delete_la_and_a install -p -m 0644 contrib/uuid/*.h %{buildroot}%{_includedir}/glusterfs/ install -D -p -m 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/sysconfig/glusterd install -D -p -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/glusterfsd mkdir -p %{buildroot}%{_localstatedir}/log/{glusterd,glusterfs,glusterfsd} mkdir -p %{buildroot}%{_rundir}/gluster/metrics #new working directory mkdir -p %{buildroot}%{_localstatedir}/lib/glusterd # change the configuration file for the new working directory perl -i -pe \ 's{^(\s*option working-directory )\S+}{$1 %{_localstatedir}/lib/glusterd}g' \ "%{buildroot}/%{_sysconfdir}/%name/glusterd.vol" # glusterfsd.service install -D -p -m 0644 %{_sourcedir}/glusterfsd.service %{buildroot}%{_unitdir}/glusterfsd.service install -D -p -m 0644 extras/glusterfs-logrotate %{buildroot}%{_sysconfdir}/logrotate.d/glusterfs #ghosts install -d %{buildroot}%{_localstatedir}/lib/glusterd/geo-replication touch %{buildroot}%{_localstatedir}/lib/glusterd/geo-replication/gsyncd_template.conf install -D -p -m 0644 extras/glusterfs-georep-logrotate %{buildroot}%{_sysconfdir}/logrotate.d/glusterfs-georep touch %{buildroot}%{_localstatedir}/lib/glusterd/glusterd.info touch %{buildroot}%{_localstatedir}/lib/glusterd/options subdirs=(add-brick create copy-file delete gsync-create remove-brick reset set start stop) for dir in ${subdirs[@]}; do mkdir -p %{buildroot}%{_localstatedir}/lib/glusterd/hooks/1/"$dir"/{pre,post} done install -d %{buildroot}%{_localstatedir}/lib/glusterd/{glustershd,peers,vols,nfs/run,bitd,quotad,scrub,snaps,ss_brick} touch %{buildroot}%{_localstatedir}/lib/glusterd/nfs/nfs-server.vol touch %{buildroot}%{_localstatedir}/lib/glusterd/nfs/run/nfs.pid #cli install -p -m 0755 -D extras/command-completion/gluster.bash %{buildroot}%{_sysconfdir}/bash_completion.d/gluster %post /sbin/ldconfig %systemd_postun_with_restart rsyslog %systemd_post glustereventsd if [ $1 -ge 1 ]; then %systemd_postun_with_restart glusterd fi %systemd_post glusterd %systemd_post glusterfsd if [ -f %{_localstatedir}/log/glusterfs/.cmd_log_history ]; then mv %{_localstatedir}/log/glusterfs/.cmd_log_history \ %{_localstatedir}/log/glusterfs/cmd_history.log fi if [ -d /etc/glusterd -a ! -h %{_localstatedir}/lib/glusterd ]; then install -d %{_localstatedir}/lib/glusterd cp -a /etc/glusterd %{_localstatedir}/lib/glusterd rm -rf /etc/glusterd ln -sf %{_localstatedir}/lib/glusterd /etc/glusterd fi if [ -d %{_localstatedir}/lib/glusterd/vols ]; then for file in $(find %{_localstatedir}/lib/glusterd/vols -name '*.vol'); do newfile=${file}.rpmsave echo "warning: ${file} saved as ${newfile}" cp ${file} ${newfile} done fi if [ -e /etc/ld.so.conf.d/glusterfs.conf ]; then rm -f /etc/ld.so.conf.d/glusterfs.conf fi %firewalld_reload pidof -c -o %PPID -x glusterd &> /dev/null if [ $? -eq 0 ]; then kill -9 `pgrep -f gsyncd.py` &> /dev/null killall --wait glusterd &> /dev/null glusterd --xlator-option *.upgrade=on -N rm -f %{_rundir}/glusterd.socket /bin/systemctl --quiet start glusterd.service else glusterd --xlator-option *.upgrade=on -N rm -f %{_rundir}/glusterd.socket fi exit 0 %pre getent group gluster > /dev/null || groupadd -r gluster getent passwd gluster > /dev/null || useradd -r -g gluster -d %{_rundir}/gluster -s /sbin/nologin -c "GlusterFS daemons" gluster exit 0 %preun if [ $1 -eq 0 ]; then if [ -f %{_unitdir}/glustereventsd.service ]; then /bin/systemctl --quiet stop glustereventsd.service %systemd_preun glustereventsd fi if [ -f %{_unitdir}/glusterfsd.service ]; then /bin/systemctl --quiet stop glusterfsd.service fi /bin/systemctl --quiet stop glusterd.service if [ -f %{_unitdir}/glusterfsd.service ]; then %systemd_preun glusterfsd fi %systemd_preun glusterd fi if [ $1 -ge 1 ]; then if [ -f %{_unitdir}/glusterfsd.service ]; then %systemd_postun_with_restart glusterfsd fi %systemd_postun_with_restart glusterd fi exit 0 %postun /sbin/ldconfig %systemd_postun_with_restart rsyslog %firewalld_reload exit 0 %files %license COPYING-GPLV2 COPYING-LGPLV3 %doc extras/clear_xattrs.sh %_docdir/%name %dir %{_localstatedir}/log/glusterfs %dir %{_datadir}/glusterfs %dir %{_datadir}/glusterfs/scripts %{_datadir}/glusterfs/scripts/* %dir %{_libdir}/glusterfs %dir %{_libdir}/glusterfs/%{version} %dir %{_libdir}/glusterfs/%{version}/auth %{_libdir}/glusterfs/%{version}/auth/* %dir %{_libdir}/glusterfs/%{version}/rpc-transport %{_libdir}/glusterfs/%{version}/rpc-transport/* %dir %{_libdir}/glusterfs/%{version}/xlator %dir %{_libdir}/glusterfs/%{version}/xlator/debug %{_libdir}/glusterfs/%{version}/xlator/debug/* %dir %{_libdir}/glusterfs/%{version}/xlator/encryption %{_libdir}/glusterfs/%{version}/xlator/encryption/* %dir %{_libdir}/glusterfs/%{version}/xlator/features %{_libdir}/glusterfs/%{version}/xlator/features/posix* %{_libdir}/glusterfs/%{version}/xlator/features/quota* %{_libdir}/glusterfs/%{version}/xlator/features/*.so %{_libdir}/glusterfs/%{version}/xlator/meta.so %dir %{_libdir}/glusterfs/%{version}/xlator/performance %{_libdir}/glusterfs/%{version}/xlator/performance/*.so %dir %{_libdir}/glusterfs/%{version}/xlator/system %{_libdir}/glusterfs/%{version}/xlator/system/* %dir %attr(0775,gluster,gluster) %{_rundir}/gluster %dir %attr(0775,gluster,gluster) %{_rundir}/gluster/metrics %{_tmpfilesdir}/gluster.conf %exclude %{_libdir}/*.so %dir %{_libdir}/glusterfs/%{version}/xlator/mount %{_libdir}/glusterfs/%{version}/xlator/mount/*.so %{_sbindir}/gluster %{_sysconfdir}/bash_completion.d/gluster %dir %{_libdir}/glusterfs/%{version}/xlator/cluster %{_libdir}/glusterfs/%{version}/xlator/cluster/*.so %dir %{_libdir}/glusterfs/%{version}/xlator/testing %dir %{_libdir}/glusterfs/%{version}/xlator/testing/features %{_libdir}/glusterfs/%{version}/xlator/testing/features/template.so %dir %{_libdir}/glusterfs/%{version}/xlator/testing/performance %{_libdir}/glusterfs/%{version}/xlator/testing/performance/symlink-cache.so # Glupy Python files %dir %{python2_sitelib}/gluster %dir %{python2_sitelib}/gluster/glupy %{python2_sitelib}/gluster/glupy/* %{_sbindir}/glusterfs %{_sbindir}/glusterfsd %{_bindir}/fusermount-glusterfs /sbin/mount.glusterfs %config(noreplace) %{_sysconfdir}/logrotate.d/glusterfs %dir %{_libdir}/glusterfs/%{version}/xlator/nfs %{_libdir}/glusterfs/%{version}/xlator/nfs/* %ghost %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/nfs %ghost %attr(0600,-,-) %{_localstatedir}/lib/glusterd/nfs/nfs-server.vol %ghost %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/nfs/run %ghost %attr(0600,-,-) %{_localstatedir}/lib/glusterd/nfs/run/nfs.pid %config(noreplace) %{_sysconfdir}/logrotate.d/glusterfs-georep %{_sbindir}/gfind_missing_files %{_sbindir}/gluster-mountbroker %dir %{_libexecdir}/glusterfs %dir %{_libexecdir}/glusterfs/python %dir %{_libexecdir}/glusterfs/python/syncdaemon %{_libexecdir}/glusterfs/python/syncdaemon/* %dir %{_libexecdir}/glusterfs/events %{_libexecdir}/glusterfs/events/* %{_libexecdir}/glusterfs/gsyncd %{_libexecdir}/glusterfs/gverify.sh %{_libexecdir}/glusterfs/set_geo_rep_pem_keys.sh %{_libexecdir}/glusterfs/peer_gsec_create %{_libexecdir}/glusterfs/peer_mountbroker %{_libexecdir}/glusterfs/peer_mountbroker.py* %{_libexecdir}/glusterfs/gfind_missing_files %{_libexecdir}/glusterfs/peer_georep-sshkey.py* %{_libexecdir}/glusterfs/mount-shared-storage.sh %{_libexecdir}/glusterfs/glusterfind %{_libexecdir}/glusterfs/peer_add_secret_pub %{_libexecdir}/glusterfs/peer_eventsapi.py* %{_sbindir}/gluster-georep-sshkey %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/geo-replication %ghost %attr(0644,-,-) %{_localstatedir}/lib/glusterd/geo-replication/gsyncd_template.conf %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/gsync-create %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/gsync-create/post %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/gsync-create/post/S56glusterd-geo-rep-create-post.sh %ghost %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/gsync-create/pre %{_libdir}/*.so.* # sysconf %config(noreplace) %{_sysconfdir}/glusterfs %config(noreplace) %{_sysconfdir}/sysconfig/glusterd %config(noreplace) %{_sysconfdir}/sysconfig/glusterfsd # init files %{_unitdir}/glusterd.service %{_unitdir}/glusterfsd.service %{_unitdir}/glusterfssharedstorage.service # binaries %{_sbindir}/glusterd %{_sbindir}/glfsheal %{_sbindir}/gf_attach %{_sbindir}/gluster-setgfid2path %{_libdir}/libgfdb.so.* %dir %{_libdir}/glusterfs/%{version}/xlator/mgmt %{_libdir}/glusterfs/%{version}/xlator/mgmt/*.so %dir %{_libdir}/glusterfs/%{version}/xlator/protocol %{_libdir}/glusterfs/%{version}/xlator/protocol/*.so %dir %{_libdir}/glusterfs/%{version}/xlator/storage %{_libdir}/glusterfs/%{version}/xlator/storage/bd.so %exclude %{_prefix}/lib/debug%{_libdir}/glusterfs/%{version}/xlator/storage/bd.so*debug %{_libdir}/glusterfs/%{version}/xlator/storage/posix.so # snap_scheduler %{_sbindir}/snap_scheduler.py %{_sbindir}/gcron.py %{_sbindir}/conf.py #/var/lib/glusterd,hookscript,etc. %ghost %attr(0644,-,-) %config(noreplace) %{_localstatedir}/lib/glusterd/glusterd.info %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd %ghost %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/bitd %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/groups %attr(0644,-,-) %{_localstatedir}/lib/glusterd/groups/* %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/glusterfind %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/glusterfind/.keys %ghost %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/glustershd %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1 %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/add-brick %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/add-brick/post %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/add-brick/post/* %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/add-brick/pre %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/add-brick/pre/* %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/create %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/create/post %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/create/post/* %ghost %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/create/pre %ghost %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/copy-file %ghost %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/copy-file/post %ghost %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/copy-file/pre %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/delete %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/delete/post %{_localstatedir}/lib/glusterd/hooks/1/delete/post/* %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/delete/pre %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/delete/pre/* %ghost %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/remove-brick %ghost %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/remove-brick/post %ghost %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/remove-brick/pre %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/reset %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/reset/post %ghost %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/reset/pre %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/set %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/set/post %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/set/post/* %ghost %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/set/pre %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/start %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/start/post %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/start/post/* %ghost %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/start/pre %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/stop %ghost %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/stop/post %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/stop/pre %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/stop/pre/* %config(noreplace) %ghost %attr(0600,-,-) %{_localstatedir}/lib/glusterd/options %ghost %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/peers %ghost %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/quotad %ghost %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/scrub %ghost %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/snaps %ghost %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/ss_brick %ghost %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/vols %{_bindir}/glusterfind %{_prefix}/lib/firewalld/services/glusterfs.xml %config(noreplace) %{_sysconfdir}/glusterfs/eventsconfig.json %dir %{_localstatedir}/lib/glusterd/events %{_sbindir}/glustereventsd %{_sbindir}/gluster-eventsapi %{_unitdir}/glustereventsd.service %files -n python2-gluster %dir %{python2_sitelib}/gluster %{python2_sitelib}/gluster/__init__.* %{python2_sitelib}/gluster/cliutils %files devel %dir %{_includedir}/glusterfs %{_includedir}/glusterfs/* %{_libdir}/*.so %dir %{_libdir}/glusterfs/%{version}/xlator/features %dir %{_libdir}/glusterfs/%{version}/xlator/features/glupy %{_libdir}/glusterfs/%{version}/xlator/features/glupy/* %{_libdir}/pkgconfig/*.pc %{_libdir}/libgfapi.so %dir %{_includedir}/glusterfs/api %{_includedir}/glusterfs/api/* %files resource-agents %{_prefix}/lib/ocf/resource.d/glusterfs %files help %{_mandir}/man8/*gluster*.8* %changelog * Sat Sep 21 2019 zoujing - 4.1.5-3 - Type:enhancemnet - ID:NA - SUG:NA - DESC:split the glusterfs-resource-agents * Mon Sep 16 2019 zoujing - 4.1.5-2 - Package init