glibc in Fedora 28 has removed rpc headers and rpcgen, use libtirpc

Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
This commit is contained in:
Kaleb S. KEITHLEY 2018-01-18 12:45:53 -05:00
parent a39583ebb7
commit 3a9e8490b7
2 changed files with 48 additions and 4 deletions

30
0001-libtirpc.patch Normal file
View File

@ -0,0 +1,30 @@
diff --git a/configure.ac b/configure.ac
index 14fc0b826..0b48807f1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -293,6 +293,10 @@ else
CFLAGS="${CFLAGS} -g -rdynamic"
fi
+AC_ARG_WITH([libtirpc],
+ AS_HELP_STRING([--with-libtirpc], [Use libtirpc as RPC implementation (instead of sunrpc)]),
+ [], [with_libtirpc=no])
+
AC_ARG_WITH([ipv6-default], AC_HELP_STRING([--with-ipv6-default], [Set IPv6 as default.]))
if test "x$with_ipv6_default" = "xyes"; then
IPV6_DEFAULT=yes
@@ -1066,6 +1070,14 @@ AC_SUBST(GF_DISTRIBUTION)
GF_HOST_OS=""
GF_LDFLAGS="-rdynamic"
+dnl include tirpc for IPv6 builds
+if test "x$with_libtirpc" = "xyes" || test "x$IPV6_DEFAULT" = "xyes" ; then
+ PKG_CHECK_MODULES([TIRPC], [libtirpc],
+ [GF_CFLAGS="$GF_CFLAGS $TIRPC_CFLAGS"; GF_LDFLAGS="$GF_LDFLAGS $TIRPC_LIBS";],
+ [AC_MSG_ERROR([libtirpc requested or needed for IPv6 default but library not found])]
+ )
+fi
+
dnl include tirpc for IPv6 builds
if test "x$IPV6_DEFAULT" = "xyes"; then
AC_CHECK_LIB([tirpc], [xdr_string], , AC_MSG_ERROR([libtirpc is required to build glusterfs with IPv6 default]))

View File

@ -88,6 +88,10 @@
%global _without_tiering --disable-tiering
%endif
%if ( 0%{?fedora} && 0%{?fedora} > 27 )
%global _with_libtirpc --with-libtirpc
%endif
##-----------------------------------------------------------------------------
## All %%global definitions should be placed here and keep them sorted
##
@ -180,7 +184,7 @@ Summary: Distributed File System
%if ( 0%{_for_fedora_koji_builds} )
Name: glusterfs
Version: 3.13.1
Release: %{?prereltag:0.}2%{?prereltag:.%{prereltag}}%{?dist}
Release: %{?prereltag:0.}3%{?prereltag:.%{prereltag}}%{?dist}
%else
Name: @PACKAGE_NAME@
Version: @PACKAGE_VERSION@
@ -198,6 +202,7 @@ Source8: glusterfsd.init
%else
Source0: @PACKAGE_NAME@-@PACKAGE_VERSION@.tar.gz
%endif
Patch0: 0001-libtirpc.patch
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
@ -222,9 +227,12 @@ BuildRequires: python2-devel
%if ( 0%{?rhel} && 0%{?rhel} <= 7 )
BuildRequires: python-ctypes
%endif
%if ( 0%{?_with_ipv6default:1} )
%if ( 0%{?fedora} && 0%{?fedora} > 27 ) || ( 0%{?_with_ipv6default:1} )
BuildRequires: libtirpc-devel
%endif
%if ( 0%{?fedora} && 0%{?fedora} > 27 )
BuildRequires: rpcgen
%endif
BuildRequires: userspace-rcu-devel >= 0.7
%if ( 0%{?rhel} && 0%{?rhel} < 7 )
BuildRequires: automake
@ -654,6 +662,7 @@ This package provides the glusterfs server daemon.
%prep
%setup -q -n %{name}-%{version}%{?prereltag}
%patch0 -p1
%build
%if ( 0%{?rhel} && 0%{?rhel} < 6 )
@ -661,6 +670,7 @@ CFLAGS=-DUSE_INSECURE_OPENSSL
export CFLAGS
%endif
sed -i -e 's/--quiet//' configure.ac
./autogen.sh && %configure \
%{?_with_cmocka} \
%{?_with_debug} \
@ -677,7 +687,8 @@ export CFLAGS
%{?_without_rdma} \
%{?_without_syslog} \
%{?_without_tiering} \
%{?_with_ipv6default}
%{?_with_ipv6default} \
%{?_with_libtirpc}
# fix hardening and remove rpath in shlibs
%if ( 0%{?fedora} ) || ( 0%{?rhel} && 0%{?rhel} > 6 )
@ -686,7 +697,7 @@ 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 %{?_smp_mflags}
make %{?_smp_mflags} V=1
%check
make check
@ -1378,6 +1389,9 @@ exit 0
%endif
%changelog
* Thu Jan 18 2018 Kaleb S. KEITHLEY <kkeithle[at]redhat.com> - 3.13.1-3
- glibc in Fedora 28 has removed rpc headers and rpcgen, use libtirpc
* Mon Dec 25 2017 Niels de Vos <ndevos@redhat.com> - 3.13.1-2
- Fedora 28 has renamed pyxattr