diff --git a/glusterd.sysconfig b/glusterd.sysconfig new file mode 100644 index 0000000000000000000000000000000000000000..3a9cb86425f3f38eefaae1b2dbf089cf95d7cc05 --- /dev/null +++ b/glusterd.sysconfig @@ -0,0 +1,6 @@ +# Change the glusterd service defaults here. +# See "glusterd --help" outpout for defaults and possible values. + +#GLUSTERD_LOGFILE="/var/log/gluster/gluster.log" +#GLUSTERD_LOGLEVEL="NORMAL" + diff --git a/glusterfs-11.0.tar.gz b/glusterfs-11.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..eb9ede6e47dfacf46147b89c926ee8bc6f1ae796 Binary files /dev/null and b/glusterfs-11.0.tar.gz differ diff --git a/glusterfs.spec b/glusterfs.spec new file mode 100644 index 0000000000000000000000000000000000000000..28c4f5da3fa19e21fe3f5981483f48e2235cac46 --- /dev/null +++ b/glusterfs.spec @@ -0,0 +1,1266 @@ +%define anolis_release 1 + +%global _hardened_build 1 + +%{?_with_asan:%global _with_asan --enable-asan} +%{?_with_cmocka:%global _with_cmocka --enable-cmocka} +%{?_with_debug:%global _with_debug --enable-debug} +%{?_without_epoll:%global _without_epoll --disable-epoll} +%{?_without_fusermount:%global _without_fusermount --disable-fusermount} +%{?_without_georeplication:%global _without_georeplication --disable-georeplication} +%{?_without_gnfs:%global _with_gnfs --disable-gnfs} +%{?_with_ipv6default:%global _with_ipv6default --with-ipv6-default} +%{?_without_linux_io_uring:%global _without_linux_io_uring --disable-linux-io_uring} +%{?_without_libtirpc:%global _without_libtirpc --without-libtirpc} +%{?_without_tcmalloc:%global _without_tcmalloc --without-tcmalloc} + +%ifnarch x86_64 +%global _without_tcmalloc --without-tcmalloc +%endif + +%{?_without_ocf:%global _without_ocf --without-ocf} +%{?_without_server:%global _without_server --without-server} +%{?_without_syslog:%global _without_syslog --disable-syslog} +%{?_with_tsan:%global _with_tsan --enable-tsan} +%{?_with_valgrind:%global _with_valgrind --enable-valgrind} + +%global selinuxbooleans rsync_full_access=1 rsync_client=1 +%global _with_firewalld --enable-firewalld + +%if ( 0%{?_tmpfilesdir:1} ) +%global _with_tmpfilesdir --with-tmpfilesdir=%{_tmpfilesdir} +%else +%global _with_tmpfilesdir --without-tmpfilesdir +%endif + +%if ( 0%{?_without_server:1} ) +%global _without_events --disable-events +%global _without_georeplication --disable-georeplication +%global _with_gnfs %{nil} +%global _without_ocf --without-ocf +%endif + +%global service_start() /bin/systemctl --quiet start %1.service || : \ +%{nil} +%global service_stop() /bin/systemctl --quiet stop %1.service || :\ +%{nil} +%global service_install() install -D -p -m 0644 %{_sourcedir}/%1.service %{buildroot}%2 \ +%{nil} + +%global glusterd_svcfile %{_unitdir}/glusterd.service +%global glusterfsd_svcfile %{_unitdir}/glusterfsd.service +%global glusterta_svcfile %{_unitdir}/gluster-ta-volume.service +%global glustereventsd_svcfile %{_unitdir}/glustereventsd.service +%global glusterfssharedstorage_svcfile %{_unitdir}/glusterfssharedstorage.service + +%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}} + +%global __provides_exclude_from ^%{_libdir}/glusterfs/%{version}/.*$ + + +Summary: Distributed File System +Name: glusterfs +Version: 11.0 +Release: %{anolis_release}%{?dist} +License: GPL-2.0-only OR LGPL-3.0-or-later +URL: http://docs.gluster.org/ +Source0: http://bits.gluster.org/pub/gluster/glusterfs/src/glusterfs-%{version}.tar.gz +Source1: glusterd.sysconfig +Source2: glusterfsd.sysconfig +Source3: glusterfsd.service + +Requires(pre): shadow-utils +BuildRequires: systemd + +%if 0%{!?_without_tcmalloc:1} +Requires: gperftools-libs +%endif + +Requires: libglusterfs0 = %{version}-%{release} +Requires: libgfrpc0 = %{version}-%{release} +Requires: libgfxdr0 = %{version}-%{release} +%{?systemd_requires} +%if 0%{?_with_asan:1} +BuildRequires: libasan +%endif +%if 0%{?_with_tsan:1} +BuildRequires: libtsan +%endif +BuildRequires: bison flex +BuildRequires: gcc make libtool +BuildRequires: ncurses-devel readline-devel +BuildRequires: libxml2-devel openssl-devel openssl +BuildRequires: libaio-devel libacl-devel +BuildRequires: python3-devel +%if 0%{!?_without_tcmalloc:1} +BuildRequires: gperftools-devel +%endif +%if ( ( 0%{?_with_ipv6default:1} ) || ( 0%{!?_without_libtirpc:1} ) ) +BuildRequires: libtirpc-devel +%endif +BuildRequires: rpcgen +BuildRequires: userspace-rcu-devel >= 0.7 +BuildRequires: libuuid-devel +%if ( 0%{?_with_cmocka:1} ) +BuildRequires: libcmocka-devel >= 1.0.1 +%endif +%if ( 0%{!?_without_georeplication:1} ) +BuildRequires: libattr-devel +%endif + +%if ( 0%{?_with_firewalld:1} ) +BuildRequires: firewalld +%endif + +%if ( 0%{!?_without_linux_io_uring:1} ) +BuildRequires: liburing-devel +%endif + +Obsoletes: hekafs <= %{version}-%{release} +Obsoletes: %{name}-common < %{version}-%{release} +Obsoletes: %{name}-core < %{version}-%{release} +Obsoletes: %{name}-regression-tests <= %{version}-%{release} +Obsoletes: %{name}-ufo <= %{version}-%{release} +%if ( 0%{!?_with_gnfs:1} ) +Obsoletes: %{name}-gnfs <= %{version}-%{release} +%endif +Obsoletes: %{name}-rdma < %{version}-%{release} +Provides: %{name}-common = %{version}-%{release} +Provides: %{name}-core = %{version}-%{release} +Provides: %{name}-rdma = %{version}-%{release} + +%description +GlusterFS is a distributed file-system capable of scaling to several +petabytes. It aggregates various storage bricks over TCP/IP interconnect +into one large parallel network filesystem. GlusterFS is one of the +most sophisticated file systems in terms of features and extensibility. +It borrows a powerful concept called Translators from GNU Hurd kernel. +Much of the code in GlusterFS is in user space and easily manageable. + +This package includes the glusterfs binary, the glusterfsd daemon and the +libglusterfs and glusterfs translator modules common to both GlusterFS server +and client framework. + +%package cli +Summary: GlusterFS CLI +BuildRequires: pkgconfig(bash-completion) +Requires: libglusterfs0 = %{version}-%{release} + +%description cli +GlusterFS is a distributed file-system capable of scaling to several +petabytes. It aggregates various storage bricks over TCP/IP interconnect +into one large parallel network filesystem. GlusterFS is one of the +most sophisticated file systems in terms of features and extensibility. +It borrows a powerful concept 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 + +%package client-xlators +Summary: GlusterFS client-side translators + +%description client-xlators +GlusterFS is a distributed file-system capable of scaling to several +petabytes. It aggregates various storage bricks over TCP/IP interconnect +into one large parallel network filesystem. GlusterFS is one of the +most sophisticated file systems in terms of features and extensibility. +It borrows a powerful concept called Translators from GNU Hurd kernel. +Much of the code in GlusterFS is in user space and easily manageable. + +This package provides the translators needed on any GlusterFS client. + +%package cloudsync-plugins +Summary: Cloudsync Plugins +BuildRequires: libcurl-devel + +%description cloudsync-plugins +GlusterFS is a distributed file-system capable of scaling to several +petabytes. It aggregates various storage bricks over TCP/IP interconnect +into one large parallel network filesystem. GlusterFS is one of the +most sophisticated file systems in terms of features and extensibility. +It borrows a powerful concept called Translators from GNU Hurd kernel. +Much of the code in GlusterFS is in user space and easily manageable. + +This package provides cloudsync plugins for archival feature. + +%if ( 0%{!?_without_events:1} ) +%package events +Summary: GlusterFS Events +Requires: %{name}-server = %{version}-%{release} +Requires: python3 +Requires: python3-prettytable +Requires: python3-gluster = %{version}-%{release} +Requires: python3-requests +%{?systemd_requires} + +%description events +GlusterFS is a distributed file-system capable of scaling to several +petabytes. It aggregates various storage bricks over TCP/IP interconnect +into one large parallel network filesystem. GlusterFS is one of the +most sophisticated file systems in terms of features and extensibility. +It borrows a powerful concept called Translators from GNU Hurd kernel. +Much of the code in GlusterFS is in user space and easily manageable. + +This package provides the GlusterFS Events +%endif + +%package extra-xlators +Summary: Extra Gluster filesystem Translators +Requires: python3-gluster = %{version}-%{release} +Requires: python3 + +%description extra-xlators +GlusterFS is a distributed file-system capable of scaling to several +petabytes. It aggregates various storage bricks over TCP/IP interconnect +into one large parallel network filesystem. GlusterFS is one of the +most sophisticated file systems in terms of features and extensibility. +It borrows a powerful concept called Translators from GNU Hurd kernel. +Much of the code in GlusterFS is in user space and easily manageable. + +This package provides extra filesystem Translators, such as Glupy, +for GlusterFS. + +%package fuse +Summary: Fuse client +BuildRequires: fuse3-devel +Requires: attr +Requires: psmisc + +Requires: %{name} = %{version}-%{release} +Requires: %{name}-client-xlators = %{version}-%{release} + +Obsoletes: %{name}-client < %{version}-%{release} +Provides: %{name}-client = %{version}-%{release} + +%description fuse +GlusterFS is a distributed file-system capable of scaling to several +petabytes. It aggregates various storage bricks over TCP/IP interconnect +into one large parallel network filesystem. GlusterFS is one of the +most sophisticated file systems in terms of features and extensibility. +It borrows a powerful concept called Translators from GNU Hurd kernel. +Much of the code in GlusterFS is in user space and easily manageable. + +This package provides support to FUSE based clients and includes the +glusterfs and glusterfsd binaries. + +%if ( 0%{!?_without_server:1} ) +%package ganesha +Summary: NFS-Ganesha configuration +Group: Applications/File + +Requires: %{name}-server = %{version}-%{release} +Requires: nfs-ganesha-selinux >= 2.7.6 +Requires: nfs-ganesha-gluster >= 2.7.6 +Requires: pcs >= 0.10.0 +Requires: resource-agents >= 4.2.0 +Requires: dbus + +Requires: net-tools + +Requires(post): policycoreutils-python-utils +Requires(postun): policycoreutils-python-utils + +%description ganesha +GlusterFS is a distributed file-system capable of scaling to several +petabytes. It aggregates various storage bricks over TCP/IP interconnect +into one large parallel network filesystem. GlusterFS is one of the +most sophisticated file systems in terms of features and extensibility. +It borrows a powerful concept called Translators from GNU Hurd kernel. +Much of the code in GlusterFS is in user space and easily manageable. + +This package provides the configuration and related files for using +NFS-Ganesha as the NFS server using GlusterFS +%endif + +%if ( 0%{!?_without_georeplication:1} ) +%package geo-replication +Summary: GlusterFS Geo-replication +Requires: %{name} = %{version}-%{release} +Requires: %{name}-server = %{version}-%{release} +Requires: python3 +Requires: python3-prettytable +Requires: python3-gluster = %{version}-%{release} + +Requires: rsync +Requires: util-linux +Requires: tar + +%description geo-replication +GlusterFS is a distributed file-system capable of scaling to several +petabytes. It aggregates various storage bricks over TCP/IP interconnect +into one large parallel network filesystem. GlusterFS is one of the +most sophisticated file systems in terms of features and extensibility. +It borrows a powerful concept called Translators from GNU Hurd kernel. +Much of the code in GlusterFS is in user space and easily manageable. + +This package provides support to geo-replication. +%endif + +%if ( 0%{?_with_gnfs:1} ) +%package gnfs +Summary: GlusterFS gNFS server +Requires: %{name} = %{version}-%{release} +Requires: %{name}-client-xlators = %{version}-%{release} +Requires: nfs-utils + +%description gnfs +GlusterFS is a distributed file-system capable of scaling to several +petabytes. It aggregates various storage bricks over Infiniband RDMA +or TCP/IP interconnect into one large parallel network file +system. GlusterFS is one of the most sophisticated file systems in +terms of features and extensibility. It borrows a powerful concept +called Translators from GNU Hurd kernel. Much of the code in GlusterFS +is in user space and easily manageable. + +This package provides the glusterfs legacy gNFS server xlator +%endif + +%package -n libglusterfs0 +Summary: GlusterFS libglusterfs library +Requires: libgfrpc0 = %{version}-%{release} +Requires: libgfxdr0 = %{version}-%{release} +Obsoletes: %{name}-libs <= %{version}-%{release} +Provides: %{name}-libs = %{version}-%{release} +Obsoletes: libglusterd0 <= %{version}-%{release} +Provides: libglusterd0 = %{version}-%{release} + +%description -n libglusterfs0 +GlusterFS is a distributed file-system capable of scaling to several +petabytes. It aggregates various storage bricks over TCP/IP interconnect +into one large parallel network filesystem. GlusterFS is one of the +most sophisticated file systems in terms of features and extensibility. +It borrows a powerful concept called Translators from GNU Hurd kernel. +Much of the code in GlusterFS is in user space and easily manageable. + +This package provides the base libglusterfs library + +%package -n libglusterfs-devel +Summary: GlusterFS libglusterfs library +Requires: libgfrpc-devel = %{version}-%{release} +Requires: libgfxdr-devel = %{version}-%{release} +Obsoletes: %{name}-devel <= %{version}-%{release} +Provides: %{name}-devel = %{version}-%{release} + +%description -n libglusterfs-devel +GlusterFS is a distributed file-system capable of scaling to several +petabytes. It aggregates various storage bricks over TCP/IP interconnect +into one large parallel network filesystem. GlusterFS is one of the +most sophisticated file systems in terms of features and extensibility. +It borrows a powerful concept called Translators from GNU Hurd kernel. +Much of the code in GlusterFS is in user space and easily manageable. + +This package provides libglusterfs.so and the gluster C header files. + +%package -n libgfapi0 +Summary: GlusterFS api library +Requires: libglusterfs0 = %{version}-%{release} +Requires: %{name}-client-xlators = %{version}-%{release} +Obsoletes: %{name}-api <= %{version}-%{release} +Provides: %{name}-api = %{version}-%{release} + +%description -n libgfapi0 +GlusterFS is a distributed file-system capable of scaling to several +petabytes. It aggregates various storage bricks over TCP/IP interconnect +into one large parallel network filesystem. GlusterFS is one of the +most sophisticated file systems in terms of features and extensibility. +It borrows a powerful concept called Translators from GNU Hurd kernel. +Much of the code in GlusterFS is in user space and easily manageable. + +This package provides the glusterfs libgfapi library. + +%package -n libgfapi-devel +Summary: Development Libraries +Requires: libglusterfs-devel = %{version}-%{release} +Requires: libacl-devel +Obsoletes: %{name}-api-devel <= %{version}-%{release} +Provides: %{name}-api-devel = %{version}-%{release} + +%description -n libgfapi-devel +GlusterFS is a distributed file-system capable of scaling to several +petabytes. It aggregates various storage bricks over TCP/IP interconnect +into one large parallel network filesystem. GlusterFS is one of the +most sophisticated file systems in terms of features and extensibility. +It borrows a powerful concept called Translators from GNU Hurd kernel. +Much of the code in GlusterFS is in user space and easily manageable. + +This package provides libgfapi.so and the api C header files. + +%package -n libgfchangelog0 +Summary: GlusterFS libchangelog library +Requires: libglusterfs0 = %{version}-%{release} +Obsoletes: %{name}-libs <= %{version}-%{release} + +%description -n libgfchangelog0 +GlusterFS is a distributed file-system capable of scaling to several +petabytes. It aggregates various storage bricks over TCP/IP interconnect +into one large parallel network filesystem. GlusterFS is one of the +most sophisticated file systems in terms of features and extensibility. +It borrows a powerful concept called Translators from GNU Hurd kernel. +Much of the code in GlusterFS is in user space and easily manageable. + +This package provides the libgfchangelog library + +%package -n libgfchangelog-devel +Summary: GlusterFS libchangelog library +Requires: libglusterfs-devel = %{version}-%{release} +Obsoletes: %{name}-devel <= %{version}-%{release} + +%description -n libgfchangelog-devel +GlusterFS is a distributed file-system capable of scaling to several +petabytes. It aggregates various storage bricks over TCP/IP interconnect +into one large parallel network filesystem. GlusterFS is one of the +most sophisticated file systems in terms of features and extensibility. +It borrows a powerful concept called Translators from GNU Hurd kernel. +Much of the code in GlusterFS is in user space and easily manageable. + +This package provides libgfchangelog.so and changelog C header files. + +%package -n libgfrpc0 +Summary: GlusterFS libgfrpc0 library +Requires: libglusterfs0 = %{version}-%{release} +Obsoletes: %{name}-libs <= %{version}-%{release} + +%description -n libgfrpc0 +GlusterFS is a distributed file-system capable of scaling to several +petabytes. It aggregates various storage bricks over TCP/IP interconnect +into one large parallel network filesystem. GlusterFS is one of the +most sophisticated file systems in terms of features and extensibility. +It borrows a powerful concept called Translators from GNU Hurd kernel. +Much of the code in GlusterFS is in user space and easily manageable. + +This package provides the libgfrpc library + +%package -n libgfrpc-devel +Summary: GlusterFS libgfrpc library +Requires: libglusterfs0 = %{version}-%{release} +Obsoletes: %{name}-devel <= %{version}-%{release} + +%description -n libgfrpc-devel +GlusterFS is a distributed file-system capable of scaling to several +petabytes. It aggregates various storage bricks over TCP/IP interconnect +into one large parallel network filesystem. GlusterFS is one of the +most sophisticated file systems in terms of features and extensibility. +It borrows a powerful concept called Translators from GNU Hurd kernel. +Much of the code in GlusterFS is in user space and easily manageable. + +This package provides libgfrpc.so and rpc C header files. + +%package -n libgfxdr0 +Summary: GlusterFS libgfxdr0 library +Requires: libglusterfs0 = %{version}-%{release} +Obsoletes: %{name}-libs <= %{version}-%{release} + +%description -n libgfxdr0 +GlusterFS is a distributed file-system capable of scaling to several +petabytes. It aggregates various storage bricks over TCP/IP interconnect +into one large parallel network filesystem. GlusterFS is one of the +most sophisticated file systems in terms of features and extensibility. +It borrows a powerful concept called Translators from GNU Hurd kernel. +Much of the code in GlusterFS is in user space and easily manageable. + +This package provides the libgfxdr library + +%package -n libgfxdr-devel +Summary: GlusterFS libgfxdr library +Requires: libglusterfs0 = %{version}-%{release} +Obsoletes: %{name}-devel <= %{version}-%{release} + +%description -n libgfxdr-devel +GlusterFS is a distributed file-system capable of scaling to several +petabytes. It aggregates various storage bricks over TCP/IP interconnect +into one large parallel network filesystem. GlusterFS is one of the +most sophisticated file systems in terms of features and extensibility. +It borrows a powerful concept called Translators from GNU Hurd kernel. +Much of the code in GlusterFS is in user space and easily manageable. + +This package provides libgfxdr.so. + +%package -n python3-gluster +Summary: GlusterFS python library +Requires: python3 + +%description -n python3-gluster +GlusterFS is a distributed file-system capable of scaling to several +petabytes. It aggregates various storage bricks over TCP/IP interconnect +into one large parallel network filesystem. GlusterFS is one of the +most sophisticated file systems in terms of features and extensibility. +It borrows a powerful concept called Translators from GNU Hurd kernel. +Much of the code in GlusterFS is in user space and easily manageable. + +This package contains the python modules of GlusterFS and own gluster +namespace. + +%if ( 0%{!?_without_ocf:1} ) +%package resource-agents +Summary: OCF Resource Agents for GlusterFS +License: GPL-3.0-or-later +BuildArch: noarch +Requires: %{name}-server = %{version}-%{release} +Requires: %{_prefix}/lib/ocf/resource.d + +%description resource-agents +GlusterFS is a distributed file-system capable of scaling to several +petabytes. It aggregates various storage bricks over TCP/IP interconnect +into one large parallel network filesystem. GlusterFS is one of the +most sophisticated file systems in terms of features and extensibility. +It borrows a powerful concept called Translators from GNU Hurd kernel. +Much of the code in GlusterFS is in user space and easily manageable. + +This package provides the resource agents which plug glusterd into +Open Cluster Framework (OCF) compliant cluster resource managers, +like Pacemaker. +%endif + +%if ( 0%{!?_without_server:1} ) +%package server +Summary: Distributed file-system server +Requires: %{name} = %{version}-%{release} +Requires: libglusterfs0 = %{version}-%{release} +Requires: libgfchangelog0 = %{version}-%{release} +Requires: %{name}-cli = %{version}-%{release} +Requires: %{name}-fuse = %{version}-%{release} +Requires: libgfapi0 = %{version}-%{release} +Requires: %{name}-client-xlators = %{version}-%{release} +Requires: psmisc +Requires: lvm2 +%{?systemd_requires} +Requires: rpcbind +Requires: python3-pyxattr +%if (0%{?_with_valgrind:1}) +Requires: valgrind +%endif + +%description server +GlusterFS is a distributed file-system capable of scaling to several +petabytes. It aggregates various storage bricks over Infiniband RDMA +or TCP/IP interconnect into one large parallel network file +system. GlusterFS is one of the most sophisticated file systems in +terms of features and extensibility. It borrows a powerful concept +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 thin-arbiter +Summary: GlusterFS thin-arbiter module +Requires: %{name} = %{version}-%{release} +Requires: %{name}-server = %{version}-%{release} + +%description thin-arbiter +This package provides a tie-breaker functionality to GlusterFS +replicate volume. It includes translators required to provide the +functionality, and also few other scripts required for setup. + +This package provides the glusterfs thin-arbiter translator. + +%package doc +Summary: Doc files for %{name} +Requires: %{name} = %{version}-%{release} +BuildArch: noarch + +%description doc +Doc files for %{name} + +%prep +%autosetup -p1 -n %{name}-%{version} + +%build +sed -i -e 's/--quiet//' configure.ac +./autogen.sh && %configure \ + %{?_with_asan} \ + %{?_with_cmocka} \ + %{?_with_debug} \ + %{?_with_firewalld} \ + %{?_with_gnfs} \ + %{?_with_tmpfilesdir} \ + %{?_with_tsan} \ + %{?_with_valgrind} \ + %{?_without_epoll} \ + %{?_without_events} \ + %{?_without_fusermount} \ + %{?_without_georeplication} \ + %{?_without_ocf} \ + %{?_without_server} \ + %{?_with_ipv6default} \ + %{?_without_linux_io_uring} \ + %{?_without_libtirpc} \ + %{?_without_tcmalloc} + +for file in $(find . -type f -name Makefile -print); do +sed -i -e 's/-Wl,-dT.*$//' $file +done + +# fix hardening and remove rpath in shlibs +sed -i 's| \\\$compiler_flags |&\\\$LDFLAGS |' libtool +sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|' libtool +sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|' libtool + +%make_build V=1 GCC_COLORS= + +%check +%make_build check + +%install +rm -rf %{buildroot} +%make_install +%if ( 0%{!?_without_server:1} ) +install -D -p -m 0644 %{SOURCE1} \ + %{buildroot}%{_sysconfdir}/sysconfig/glusterd +install -D -p -m 0644 %{SOURCE2} \ + %{buildroot}%{_sysconfdir}/sysconfig/glusterfsd +%endif + +mkdir -p %{buildroot}%{_localstatedir}/log/glusterd +mkdir -p %{buildroot}%{_localstatedir}/log/glusterfs +mkdir -p %{buildroot}%{_localstatedir}/log/glusterfsd +mkdir -p %{buildroot}%{_rundir}/gluster/metrics + +# Remove unwanted files from all the shared libraries +find %{buildroot}%{_libdir} -name '*.a' -delete +find %{buildroot}%{_libdir} -name '*.la' -delete + +# Remove installed docs, the ones we want are included by %%doc, in +# /usr/share/doc/glusterfs or /usr/share/doc/glusterfs-x.y.z depending +# on the distribution +rm -rf %{buildroot}%{_pkgdocdir}/* + +head -50 ChangeLog > ChangeLog.head && mv ChangeLog.head ChangeLog +cat << EOM >> ChangeLog + +More commit messages for this ChangeLog can be found at +https://forge.gluster.org/glusterfs-core/glusterfs/commits/v%{version} +EOM + +# Remove benchmarking and other unpackaged files +# make install always puts these in %%{_defaultdocdir}/%%{name} so don't +# use %%{_pkgdocdir}; that will be wrong on later Fedora distributions +rm -rf %{buildroot}%{_defaultdocdir}/%{name}/benchmarking +rm -f %{buildroot}%{_defaultdocdir}/%{name}/glusterfs-mode.el +rm -f %{buildroot}%{_defaultdocdir}/%{name}/glusterfs.vim + +%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 + +%if ( 0%{!?_without_server:1} ) +%service_install glusterfsd %{glusterfsd_svcfile} +%endif + +install -D -p -m 0644 extras/glusterfs-logrotate \ + %{buildroot}%{_sysconfdir}/logrotate.d/glusterfs + +%if ( 0%{!?_without_server:1} ) +mkdir -p %{buildroot}%{_sysconfdir}/ganesha +touch %{buildroot}%{_sysconfdir}/ganesha/ganesha-ha.conf +mkdir -p %{buildroot}%{_localstatedir}/run/gluster/shared_storage/nfs-ganesha/ +touch %{buildroot}%{_localstatedir}/run/gluster/shared_storage/nfs-ganesha/ganesha.conf +touch %{buildroot}%{_localstatedir}/run/gluster/shared_storage/nfs-ganesha/ganesha-ha.conf +%endif + +%if ( 0%{!?_without_georeplication:1} ) +mkdir -p %{buildroot}%{_sharedstatedir}/glusterd/geo-replication +touch %{buildroot}%{_sharedstatedir}/glusterd/geo-replication/gsyncd_template.conf +install -D -p -m 0644 extras/glusterfs-georep-logrotate \ + %{buildroot}%{_sysconfdir}/logrotate.d/glusterfs-georep +%endif + +%if ( 0%{!?_without_server:1} ) +touch %{buildroot}%{_sharedstatedir}/glusterd/glusterd.info +touch %{buildroot}%{_sharedstatedir}/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}%{_sharedstatedir}/glusterd/hooks/1/"$dir"/{pre,post} +done +mkdir -p %{buildroot}%{_sharedstatedir}/glusterd/glustershd +mkdir -p %{buildroot}%{_sharedstatedir}/glusterd/peers +mkdir -p %{buildroot}%{_sharedstatedir}/glusterd/vols +mkdir -p %{buildroot}%{_sharedstatedir}/glusterd/nfs/run +mkdir -p %{buildroot}%{_sharedstatedir}/glusterd/bitd +mkdir -p %{buildroot}%{_sharedstatedir}/glusterd/quotad +mkdir -p %{buildroot}%{_sharedstatedir}/glusterd/scrub +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 + +%generate_compatibility_deps +# remove unexpected abi files +rm -f %{buildroot}%{abidir}/{addr.dump,afr.dump,api.dump,arbiter.dump,barrier.dump,bit-rot.dump,bitrot-stub.dump,cdc.dump,changelog.dump,client.dump,cloudsync.dump,cloudsynccvlt.dump,cloudsyncs3.dump,delay-gen.dump,dht.dump,ec.dump,error-gen.dump,fuse.dump,gfid-access.dump,glusterd.dump,index.dump,io-cache.dump,io-stats.dump,io-threads.dump,leases.dump,locks.dump,login.dump,marker.dump,md-cache.dump,meta.dump,namespace.dump,nl-cache.dump,nufa.dump,open-behind.dump,posix-acl.dump,posix.dump,quick-read.dump,quiesce.dump,quota.dump,quotad.dump,read-ahead.dump,read-only.dump,readdir-ahead.dump,sdfs.dump,selinux.dump,server.dump,shard.dump,simple-quota.dump,sink.dump,snapview-client.dump,snapview-server.dump,socket.dump,switch.dump,template.dump,thin-arbiter.dump,trace.dump,trash.dump,upcall.dump,utime.dump,worm.dump,write-behind.dump} +rm -f %{buildroot}/usr/sbin/__pycache__/conf.cpython-310.pyc + +%global bashcompdir %(pkg-config --variable=completionsdir bash-completion 2>/dev/null) +%if "%{bashcompdir}" == "" +%global bashcompdir ${sysconfdir}/bash_completion.d +%endif + +%post +%if ( 0%{!?_without_syslog:1} ) +%systemd_postun_with_restart rsyslog +%endif +exit 0 + +%if ( 0%{!?_without_events:1} ) +%post events +%systemd_post glustereventsd +exit 0 +%endif + +%if ( 0%{!?_without_server:1} ) +%post ganesha +if [ $1 -eq 1 ]; then + %selinux_set_booleans ganesha_use_fusefs=1 +fi +exit 0 +%endif + +%if ( 0%{!?_without_georeplication:1} ) +%post geo-replication +if [ $1 -eq 1 ]; then + %selinux_set_booleans %{selinuxbooleans} +fi +if [ $1 -ge 1 ]; then + %systemd_postun_with_restart glusterd +fi +exit 0 +%endif + +%if ( 0%{!?_without_server:1} ) +%post server +%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 %{_sharedstatedir}/glusterd ]; then + mkdir -p %{_sharedstatedir}/glusterd + cp -a /etc/glusterd %{_sharedstatedir}/glusterd + rm -rf /etc/glusterd + ln -sf %{_sharedstatedir}/glusterd /etc/glusterd +fi + +if [ -d %{_sharedstatedir}/glusterd/vols ]; then + for file in $(find %{_sharedstatedir}/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 + /sbin/ldconfig +fi + +%if (0%{?_with_firewalld:1}) + %firewalld_reload +%endif + +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 + + %service_start glusterd +else + glusterd --xlator-option *.upgrade=on -N + + rm -f %{_rundir}/glusterd.socket +fi +exit 0 +%endif + +%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 + +%if ( 0%{!?_without_events:1} ) +%preun events +if [ $1 -eq 0 ]; then + if [ -f %glustereventsd_svcfile ]; then + %service_stop glustereventsd + %systemd_preun glustereventsd + fi +fi +exit 0 +%endif + +%if ( 0%{!?_without_server:1} ) +%preun server +if [ $1 -eq 0 ]; then + if [ -f %glusterfsd_svcfile ]; then + %service_stop glusterfsd + fi + %service_stop glusterd + if [ -f %glusterfsd_svcfile ]; then + %systemd_preun glusterfsd + fi + %systemd_preun glusterd +fi +if [ $1 -ge 1 ]; then + if [ -f %glusterfsd_svcfile ]; then + %systemd_postun_with_restart glusterfsd + fi + %systemd_postun_with_restart glusterd +fi +exit 0 +%endif + +%preun thin-arbiter +if [ $1 -eq 0 ]; then + if [ -f %glusterta_svcfile ]; then + %service_stop gluster-ta-volume + %systemd_preun gluster-ta-volume + fi +fi + +%postun +%if ( 0%{!?_without_syslog:1} ) +%systemd_postun_with_restart rsyslog +%endif +exit 0 + +%if ( 0%{!?_without_server:1} ) +%postun server +%if (0%{?_with_firewalld:1}) + %firewalld_reload +%endif +exit 0 +%endif + +%if ( 0%{!?_without_server:1} ) +%postun ganesha +if [ $1 -eq 0 ]; then + %selinux_unset_booleans ganesha_use_fusefs=1 +fi +exit 0 +%endif + +%if ( 0%{!?_without_georeplication:1} ) +%postun geo-replication +if [ $1 -eq 0 ]; then + %selinux_unset_booleans %{selinuxbooleans} +fi +exit 0 +%endif + +%if ( 0%{!?_without_server:1} ) +%triggerun ganesha -- selinux-policy-targeted +semanage boolean -m ganesha_use_fusefs --on -S targeted +exit 0 +%endif + +%files +%{!?_licensedir:%global license %%doc} +%license COPYING-GPLV2 COPYING-LGPLV3 +%{_mandir}/man8/*gluster*.8* +%if ( 0%{!?_without_server:1} ) +%exclude %{_mandir}/man8/gluster.8* +%endif +%dir %{_localstatedir}/log/glusterfs +%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 +%dir %{_libdir}/glusterfs +%dir %{_libdir}/glusterfs/%{version} +%dir %{_libdir}/glusterfs/%{version}/auth + %{_libdir}/glusterfs/%{version}/auth/addr.so + %{_libdir}/glusterfs/%{version}/auth/login.so +%dir %{_libdir}/glusterfs/%{version}/rpc-transport + %{_libdir}/glusterfs/%{version}/rpc-transport/socket.so +%dir %{_libdir}/glusterfs/%{version}/xlator +%dir %{_libdir}/glusterfs/%{version}/xlator/debug + %{_libdir}/glusterfs/%{version}/xlator/debug/error-gen.so + %{_libdir}/glusterfs/%{version}/xlator/debug/delay-gen.so + %{_libdir}/glusterfs/%{version}/xlator/debug/io-stats.so + %{_libdir}/glusterfs/%{version}/xlator/debug/sink.so + %{_libdir}/glusterfs/%{version}/xlator/debug/trace.so +%dir %{_libdir}/glusterfs/%{version}/xlator/features + %{_libdir}/glusterfs/%{version}/xlator/features/access-control.so + %{_libdir}/glusterfs/%{version}/xlator/features/barrier.so + %{_libdir}/glusterfs/%{version}/xlator/features/cdc.so + %{_libdir}/glusterfs/%{version}/xlator/features/changelog.so + %{_libdir}/glusterfs/%{version}/xlator/features/utime.so + %{_libdir}/glusterfs/%{version}/xlator/features/gfid-access.so + %{_libdir}/glusterfs/%{version}/xlator/features/namespace.so + %{_libdir}/glusterfs/%{version}/xlator/features/read-only.so + %{_libdir}/glusterfs/%{version}/xlator/features/shard.so + %{_libdir}/glusterfs/%{version}/xlator/features/snapview-client.so + %{_libdir}/glusterfs/%{version}/xlator/features/worm.so + %{_libdir}/glusterfs/%{version}/xlator/features/cloudsync.so + %{_libdir}/glusterfs/%{version}/xlator/meta.so +%dir %{_libdir}/glusterfs/%{version}/xlator/performance + %{_libdir}/glusterfs/%{version}/xlator/performance/io-cache.so + %{_libdir}/glusterfs/%{version}/xlator/performance/io-threads.so + %{_libdir}/glusterfs/%{version}/xlator/performance/md-cache.so + %{_libdir}/glusterfs/%{version}/xlator/performance/open-behind.so + %{_libdir}/glusterfs/%{version}/xlator/performance/quick-read.so + %{_libdir}/glusterfs/%{version}/xlator/performance/read-ahead.so + %{_libdir}/glusterfs/%{version}/xlator/performance/readdir-ahead.so + %{_libdir}/glusterfs/%{version}/xlator/performance/stat-prefetch.so + %{_libdir}/glusterfs/%{version}/xlator/performance/write-behind.so + %{_libdir}/glusterfs/%{version}/xlator/performance/nl-cache.so +%dir %{_libdir}/glusterfs/%{version}/xlator/system + %{_libdir}/glusterfs/%{version}/xlator/system/posix-acl.so +%dir %attr(0775,gluster,gluster) %{_rundir}/gluster +%dir %attr(0775,gluster,gluster) %{_rundir}/gluster/metrics +%if 0%{?_tmpfilesdir:1} +%{_tmpfilesdir}/gluster.conf +%endif + +%if ( 0%{?_without_server:1} ) +#exclude ganesha related files +%exclude %{_sysconfdir}/ganesha/ganesha-ha.conf.sample +%exclude %{_libexecdir}/ganesha/* +%exclude %{_prefix}/lib/ocf/resource.d/heartbeat/* +%endif + +%files cli +%{_sbindir}/gluster +%{_mandir}/man8/gluster.8* +%{bash_completions_dir}/gluster.bash +%{abidir}/gluster-option.list + +%files client-xlators +%dir %{_libdir}/glusterfs/%{version}/xlator/cluster + %{_libdir}/glusterfs/%{version}/xlator/cluster/*.so +%dir %{_libdir}/glusterfs/%{version}/xlator/protocol +%{_libdir}/glusterfs/%{version}/xlator/protocol/client.so + +%files cloudsync-plugins +%dir %{_libdir}/glusterfs/%{version}/cloudsync-plugins + %{_libdir}/glusterfs/%{version}/cloudsync-plugins/cloudsyncs3.so + %{_libdir}/glusterfs/%{version}/cloudsync-plugins/cloudsynccvlt.so + +%files -n libglusterfs-devel +%dir %{_includedir}/glusterfs + %{_includedir}/glusterfs/*.h + %{_includedir}/glusterfs/server/*.h +%{_libdir}/libglusterfs.so + +%files -n libgfapi-devel +%dir %{_includedir}/glusterfs/api + %{_includedir}/glusterfs/api/*.h +%{_libdir}/libgfapi.so +%{_libdir}/pkgconfig/glusterfs-api.pc + + +%files -n libgfchangelog-devel +%dir %{_includedir}/glusterfs/gfchangelog + %{_includedir}/glusterfs/gfchangelog/*.h +%{_libdir}/libgfchangelog.so +%{_libdir}/pkgconfig/libgfchangelog.pc + +%files -n libgfrpc-devel +%dir %{_includedir}/glusterfs/rpc + %{_includedir}/glusterfs/rpc/*.h +%{_libdir}/libgfrpc.so + +%files -n libgfxdr-devel +%{_libdir}/libgfxdr.so + +# Events +%if ( 0%{!?_without_events:1} ) +%files events +%config(noreplace) %{_sysconfdir}/glusterfs/eventsconfig.json +%dir %{_sharedstatedir}/glusterd +%dir %{_sharedstatedir}/glusterd/events +%dir %{_libexecdir}/glusterfs +%dir %{_libexecdir}/glusterfs/gfevents + %{_libexecdir}/glusterfs/gfevents/* + %{_libexecdir}/glusterfs/peer_eventsapi.py* +%{_sbindir}/glustereventsd +%{_sbindir}/gluster-eventsapi +%{_datadir}/glusterfs/scripts/eventsdash.py* +%{_unitdir}/glustereventsd.service +%endif + +%files extra-xlators +%dir %{_libdir}/glusterfs/%{version}/xlator/features + %{_libdir}/glusterfs/%{version}/xlator/features/quiesce.so +%dir %{_libdir}/glusterfs/%{version}/xlator/playground + %{_libdir}/glusterfs/%{version}/xlator/playground/template.so + +%files fuse +# glusterfs is a symlink to glusterfsd, -server depends on -fuse. +%{_sbindir}/glusterfs +%{_sbindir}/glusterfsd +%config(noreplace) %{_sysconfdir}/logrotate.d/glusterfs +%dir %{_libdir}/glusterfs/%{version}/xlator/mount + %{_libdir}/glusterfs/%{version}/xlator/mount/fuse.so +/sbin/mount.glusterfs +%if ( 0%{!?_without_fusermount:1} ) +%{_bindir}/fusermount-glusterfs +%{abidir}/glusterfsd-option.list +%endif + +%if ( 0%{?_with_gnfs:1} && 0%{!?_without_server:1} ) +%files gnfs +%dir %{_libdir}/glusterfs/%{version}/xlator/nfs + %{_libdir}/glusterfs/%{version}/xlator/nfs/* +%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/nfs +%ghost %attr(0600,-,-) %{_sharedstatedir}/glusterd/nfs/nfs-server.vol +%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/nfs/run +%ghost %attr(0600,-,-) %{_sharedstatedir}/glusterd/nfs/run/nfs.pid +%endif + + +%if ( 0%{!?_without_server:1} ) +%files ganesha +%dir %{_libexecdir}/ganesha +%{_sysconfdir}/ganesha/ganesha-ha.conf.sample +%{_libexecdir}/ganesha/* +%{_prefix}/lib/ocf/resource.d/heartbeat/* +%{_sharedstatedir}/glusterd/hooks/1/start/post/S31ganesha-start.sh +%ghost %attr(0644,-,-) %config(noreplace) %{_sysconfdir}/ganesha/ganesha-ha.conf +%ghost %dir %attr(0755,-,-) %{_localstatedir}/run/gluster/shared_storage/nfs-ganesha +%ghost %attr(0644,-,-) %config(noreplace) %{_localstatedir}/run/gluster/shared_storage/nfs-ganesha/ganesha.conf +%ghost %attr(0644,-,-) %config(noreplace) %{_localstatedir}/run/gluster/shared_storage/nfs-ganesha/ganesha-ha.conf +%endif + +%if ( 0%{!?_without_georeplication:1} ) +%files geo-replication +%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/gsyncd + %{_libexecdir}/glusterfs/python/syncdaemon/* +%dir %{_libexecdir}/glusterfs/scripts + %{_libexecdir}/glusterfs/scripts/get-gfid.sh + %{_libexecdir}/glusterfs/scripts/secondary-upgrade.sh + %{_libexecdir}/glusterfs/scripts/gsync-upgrade.sh + %{_libexecdir}/glusterfs/scripts/generate-gfid-file.sh + %{_libexecdir}/glusterfs/scripts/gsync-sync-gfid + %{_libexecdir}/glusterfs/scripts/schedule_georep.py* + %{_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* +%{_sbindir}/gluster-georep-sshkey + + + %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/geo-replication +%ghost %attr(0644,-,-) %{_sharedstatedir}/glusterd/geo-replication/gsyncd_template.conf + %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/gsync-create + %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/gsync-create/post + %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/gsync-create/post/S56glusterd-geo-rep-create-post.sh +%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/gsync-create/pre +%endif + +%files -n libglusterfs0 +%{_libdir}/libglusterfs.so.* +%dir %{abidir} +%{abidir}/libglusterfs.dump + +%files -n libgfapi0 +%{_libdir}/libgfapi.so.* +%dir %{_libdir}/glusterfs/%{version}/xlator/mount + %{_libdir}/glusterfs/%{version}/xlator/mount/api.so +%{abidir}/libgfapi.dump + +%files -n libgfchangelog0 +%{_libdir}/libgfchangelog.so.* +%{abidir}/libgfchangelog.dump + +%files -n libgfrpc0 +%{_libdir}/libgfrpc.so.* +%{abidir}/libgfrpc.dump + +%files -n libgfxdr0 +%{_libdir}/libgfxdr.so.* +%{abidir}/libgfxdr.dump + +%files -n python3-gluster +%dir %{python3_sitelib}/gluster + %{python3_sitelib}/gluster/__init__.* + %{python3_sitelib}/gluster/__pycache__ + %{python3_sitelib}/gluster/cliutils + +%if ( 0%{!?_without_ocf:1} ) +%files resource-agents +# /usr/lib is the standard for OCF, also on x86_64 +%{_prefix}/lib/ocf/resource.d/glusterfs +%endif + +%if ( 0%{!?_without_server:1} ) +%files server +%doc extras/clear_xattrs.sh +# sysconf +%config(noreplace) %{_sysconfdir}/glusterfs +%exclude %{_sysconfdir}/glusterfs/thin-arbiter.vol +%exclude %{_sysconfdir}/glusterfs/eventsconfig.json +%exclude %{_sharedstatedir}/glusterd/nfs/nfs-server.vol +%exclude %{_sharedstatedir}/glusterd/nfs/run/nfs.pid +%if ( 0%{?_with_gnfs:1} ) +%exclude %{_libdir}/glusterfs/%{version}/xlator/nfs/* +%endif +%config(noreplace) %{_sysconfdir}/sysconfig/glusterd +%config(noreplace) %{_sysconfdir}/sysconfig/glusterfsd + +# init files +%glusterd_svcfile +%glusterfsd_svcfile +%glusterfssharedstorage_svcfile + +# binaries +%{_sbindir}/glusterd +%{_libexecdir}/glusterfs/glfsheal +%{_sbindir}/gf_attach +%{_sbindir}/gluster-setgfid2path + +# Manpages +%{_mandir}/man8/gluster-setgfid2path.8* + +%dir %{_libdir}/glusterfs/%{version}/xlator/features + %{_libdir}/glusterfs/%{version}/xlator/features/arbiter.so + %{_libdir}/glusterfs/%{version}/xlator/features/bit-rot.so + %{_libdir}/glusterfs/%{version}/xlator/features/bitrot-stub.so + %{_libdir}/glusterfs/%{version}/xlator/features/sdfs.so + %{_libdir}/glusterfs/%{version}/xlator/features/index.so + %{_libdir}/glusterfs/%{version}/xlator/features/locks.so + %{_libdir}/glusterfs/%{version}/xlator/features/posix* + %{_libdir}/glusterfs/%{version}/xlator/features/snapview-server.so + %{_libdir}/glusterfs/%{version}/xlator/features/marker.so + %{_libdir}/glusterfs/%{version}/xlator/features/simple-quota.so + %{_libdir}/glusterfs/%{version}/xlator/features/quota* + %{_libdir}/glusterfs/%{version}/xlator/features/selinux.so + %{_libdir}/glusterfs/%{version}/xlator/features/trash.so + %{_libdir}/glusterfs/%{version}/xlator/features/upcall.so + %{_libdir}/glusterfs/%{version}/xlator/features/leases.so +%dir %{_libdir}/glusterfs/%{version}/xlator/mgmt + %{_libdir}/glusterfs/%{version}/xlator/mgmt/glusterd.so +%dir %{_libdir}/glusterfs/%{version}/xlator/protocol + %{_libdir}/glusterfs/%{version}/xlator/protocol/server.so +%dir %{_libdir}/glusterfs/%{version}/xlator/storage + %{_libdir}/glusterfs/%{version}/xlator/storage/posix.so + +# snap_scheduler +%{_sbindir}/snap_scheduler.py +%{_sbindir}/gcron.py +%{_sbindir}/conf.py + +# /var/lib/glusterd, e.g. hookscripts, etc. +%ghost %attr(0644,-,-) %config(noreplace) %{_sharedstatedir}/glusterd/glusterd.info + %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd +%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/bitd + %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/groups + %attr(0644,-,-) %{_sharedstatedir}/glusterd/groups/virt + %attr(0644,-,-) %{_sharedstatedir}/glusterd/groups/metadata-cache + %attr(0644,-,-) %{_sharedstatedir}/glusterd/groups/gluster-block + %attr(0644,-,-) %{_sharedstatedir}/glusterd/groups/nl-cache + %attr(0644,-,-) %{_sharedstatedir}/glusterd/groups/db-workload + %attr(0644,-,-) %{_sharedstatedir}/glusterd/groups/distributed-virt + %attr(0644,-,-) %{_sharedstatedir}/glusterd/groups/samba + %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/glusterfind + %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/glusterfind/.keys +%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/glustershd + %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks + %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1 + %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/add-brick + %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/add-brick/post + %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/add-brick/post/disabled-quota-root-xattr-heal.sh + %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/add-brick/post/S10selinux-label-brick.sh + %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/add-brick/post/S13create-subdir-mounts.sh + %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/add-brick/pre + %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/add-brick/pre/S28Quota-enable-root-xattr-heal.sh + %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/create + %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/create/post + %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/create/post/S10selinux-label-brick.sh +%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/create/pre +%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/copy-file +%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/copy-file/post +%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/copy-file/pre + %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/delete + %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/delete/post + %{_sharedstatedir}/glusterd/hooks/1/delete/post/S57glusterfind-delete-post + %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/delete/pre + %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/delete/pre/S10selinux-del-fcontext.sh +%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/remove-brick +%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/remove-brick/post +%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/remove-brick/pre + %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/reset + %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/reset/post +%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/reset/pre + %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/set + %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/set/post + %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/set/post/S30samba-set.sh + %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/set/post/S32gluster_enable_shared_storage.sh +%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/set/pre + %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/start + %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/start/post + %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/start/post/S29CTDBsetup.sh + %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/start/post/S30samba-start.sh +%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/start/pre + %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/stop +%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/stop/post + %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/stop/pre + %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/stop/pre/S30samba-stop.sh + %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/stop/pre/S29CTDB-teardown.sh +%config(noreplace) %ghost %attr(0600,-,-) %{_sharedstatedir}/glusterd/options +%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/peers +%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/quotad +%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/scrub +%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/snaps +%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/ss_brick +%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/vols + +# Extra utility script +%dir %{_datadir}/glusterfs +%dir %{_datadir}/glusterfs/scripts +%{_datadir}/glusterfs/scripts/stop-all-gluster-processes.sh + %{_libexecdir}/glusterfs/mount-shared-storage.sh + %{_datadir}/glusterfs/scripts/control-cpu-load.sh + %{_datadir}/glusterfs/scripts/control-mem.sh + +# Incrementalapi +%dir %{_libexecdir}/glusterfs + %{_libexecdir}/glusterfs/glusterfind + %{_libexecdir}/glusterfs/peer_add_secret_pub +%{_bindir}/glusterfind + +%if ( 0%{?_with_firewalld:1} ) +%{_prefix}/lib/firewalld/services/glusterfs.xml +%endif + +# end of server files +%endif + +%files thin-arbiter +%dir %{_libdir}/glusterfs/%{version}/xlator +%dir %{_libdir}/glusterfs/%{version}/xlator/features + %{_libdir}/glusterfs/%{version}/xlator/features/thin-arbiter.so +%dir %{_datadir}/glusterfs/scripts + %{_datadir}/glusterfs/scripts/setup-thin-arbiter.sh +%config %{_sysconfdir}/glusterfs/thin-arbiter.vol +%{_unitdir}/gluster-ta-volume.service + +%files doc +%doc ChangeLog INSTALL README.md THANKS COMMITMENT + +%changelog +* Thu Mar 16 2023 Chunmei Xu - 11.0-1 +- init from upstream diff --git a/glusterfsd.service b/glusterfsd.service new file mode 100644 index 0000000000000000000000000000000000000000..e25405de908e9100a97bc2f22099e73cf25c6e27 --- /dev/null +++ b/glusterfsd.service @@ -0,0 +1,16 @@ +[Unit] +Description=GlusterFS brick processes (stopping only) +After=network.target glusterd.service + +[Service] +Type=oneshot +# glusterd starts the glusterfsd processed on-demand +# /bin/true will mark this service as started, RemainAfterExit keeps it active +ExecStart=/bin/true +RemainAfterExit=yes +# if there are no glusterfsd processes, a stop/reload should not give an error +ExecStop=/bin/sh -c "/bin/killall --wait glusterfsd || /bin/true" +ExecReload=/bin/sh -c "/bin/killall -HUP glusterfsd || /bin/true" + +[Install] +WantedBy=multi-user.target diff --git a/glusterfsd.sysconfig b/glusterfsd.sysconfig new file mode 100644 index 0000000000000000000000000000000000000000..b87deb18411db20280fa51cb7e888106bce06dae --- /dev/null +++ b/glusterfsd.sysconfig @@ -0,0 +1,6 @@ +# Change the glusterfsd service defaults here. +# See "glusterfsd --help" outpout for defaults and possible values. + +#GLUSTERFSD_CONFIG="/etc/glusterfs/glusterfsd.vol" +#GLUSTERFSD_LOGFILE="/var/log/glusterfs/glusterfs.log" +#GLUSTERFSD_LOGLEVEL="NORMAL"