Link against libnsl in Fedora 28 or later

Resolves rhbz#1573636
This commit is contained in:
Alexander Bokovoy 2018-05-02 09:39:32 +03:00
parent ad9fe36aec
commit a936e6da81
2 changed files with 38 additions and 2 deletions

View File

@ -0,0 +1,28 @@
From 062c157013c5af8714d9015582de898b42d1a981 Mon Sep 17 00:00:00 2001
From: Alexander Bokovoy <abokovoy@redhat.com>
Date: Wed, 2 May 2018 08:56:15 +0300
Subject: [PATCH] support transition from libtirpc to libnsl in Fedora 28
libnsl2-devel in Fedora 28 depends on libtirpc-devel internally
so we can also reduce the dependency in spec
diff --git a/configure.ac b/configure.ac
index 184a9af..80f2ca2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -273,6 +273,12 @@ AC_ARG_WITH(tirpc,
])
if test $use_tirpc = yes ; then
PKG_CHECK_MODULES(TIRPC,libtirpc)
+fi
+
+PKG_CHECK_MODULES(NSL,libnsl,[use_libnsl=yes],[use_libnsl=no])
+if test "$use_libnsl" = yes ; then
+ RPC_CFLAGS="$NSL_CFLAGS"
+ RPC_LIBS="$NSL_LIBS"
else
RPC_CFLAGS=
RPC_LIBS=-lnsl
--
2.14.3

View File

@ -11,13 +11,14 @@
Name: slapi-nis
Version: 0.56.2
Release: 4%{?dist}
Release: 5%{?dist}
Summary: NIS Server and Schema Compatibility plugins for Directory Server
Group: System Environment/Daemons
License: GPLv2
URL: http://pagure.io/slapi-nis/
Source0: https://releases.pagure.org/slapi-nis/slapi-nis-%{version}.tar.gz
Source1: https://releases.pagure.org/slapi-nis/slapi-nis-%{version}.tar.gz.sig
Patch1: 0001-support-transition-from-libtirpc-to-libnsl-in-Fedora.patch
BuildRequires: 389-ds-base-devel >= 1.3.5.6, %{ldap_impl}-devel
BuildRequires: nspr-devel, nss-devel, /usr/bin/rpcgen
%if 0%{?fedora} > 18 || 0%{?rhel} > 6
@ -27,8 +28,10 @@ BuildRequires: libsss_nss_idmap-devel > 1.16.0-5
%define sss_nss_opts %{nil}
%endif
BuildRequires: pam-devel
%if 0%{?fedora} > 14 || 0%{?rhel} > 6
%if (0%{?fedora} > 14 && 0%{?fedora} < 28) || (0%{?rhel} > 6 && 0%{?rhel} < 8)
BuildRequires: libtirpc-devel
%else:
BuildRequires: libnsl2-devel
%endif
%if 0%{?fedora} > 27
ExcludeArch: %{ix86}
@ -77,6 +80,11 @@ make check
%{_sbindir}/nisserver-plugin-defs
%changelog
* Wed May 02 2018 Alexander Bokovoy <abokovoy@redhat.com> - 0.56.2-5
- Link with libnsl explicitly in Fedora 28 or later
- Require libnsl2-devel for build
- Resolves rhbz#1573636
* Thu Mar 15 2018 Alexander Bokovoy <abokovoy@redhat.com> - 0.56.2-4
- Remove tcpwrappers support as they aren't available in Fedora anymore