Skip to content

Commit 374c5cc

Browse files
committed
zfs.spec.in: remove post ldconfig scriptlets
In Fedora 28 the packaging guidelines were changed such that ldconfig should no longer be called in either the %post or %postun scriptlets. Instead the new compatibility macros %ldconfig_post, %ldconfig_postun, and %ldocnfig_scriptlets should be used. Since we only currently support Fedora 31 and newer, we could drop %post or %postun scriptlets entirely according to the guidelines. However, since we also use the same spec file for CentOS / RHEL it's convenient to call the macros which are available starting with CentOS / RHEL 8. For CentOS / RHEL 7 we must still call ldconfig in the traditional way. https://fedoraproject.org/wiki/Changes/Removing_ldconfig_scriptlets Signed-off-by: Brian Behlendorf <[email protected]>
1 parent 60ffc1c commit 374c5cc

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

rpm/generic/zfs.spec.in

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,12 @@ Obsoletes: libzpool4
172172
This package contains the zpool library, which provides support
173173
for managing zpools
174174

175+
%if 0%{?rhel} == 7 || 0%{?centos} == 7
175176
%post -n libzpool5 -p /sbin/ldconfig
176177
%postun -n libzpool5 -p /sbin/ldconfig
178+
%else
179+
%ldconfig_scriptlets -n libzpool5
180+
%endif
177181

178182
%package -n libnvpair3
179183
Summary: Solaris name-value library for Linux
@@ -186,8 +190,12 @@ pairs. This functionality is used to portably transport data across
186190
process boundaries, between kernel and user space, and can be used
187191
to write self describing data structures on disk.
188192

193+
%if 0%{?rhel} == 7 || 0%{?centos} == 7
189194
%post -n libnvpair3 -p /sbin/ldconfig
190195
%postun -n libnvpair3 -p /sbin/ldconfig
196+
%else
197+
%ldconfig_scriptlets -n libnvpair3
198+
%endif
191199

192200
%package -n libuutil3
193201
Summary: Solaris userland utility library for Linux
@@ -205,8 +213,12 @@ This library provides a variety of compatibility functions for OpenZFS:
205213
partitioning.
206214
* libshare: NFS, SMB, and iSCSI service integration for ZFS.
207215

216+
%if 0%{?rhel} == 7 || 0%{?centos} == 7
208217
%post -n libuutil3 -p /sbin/ldconfig
209218
%postun -n libuutil3 -p /sbin/ldconfig
219+
%else
220+
%ldconfig_scriptlets -n libuutil3
221+
%endif
210222

211223
# The library version is encoded in the package name. When updating the
212224
# version information it is important to add an obsoletes line below for
@@ -220,8 +232,12 @@ Obsoletes: libzfs4
220232
%description -n libzfs5
221233
This package provides support for managing ZFS filesystems
222234

235+
%if 0%{?rhel} == 7 || 0%{?centos} == 7
223236
%post -n libzfs5 -p /sbin/ldconfig
224237
%postun -n libzfs5 -p /sbin/ldconfig
238+
%else
239+
%ldconfig_scriptlets -n libzfs5
240+
%endif
225241

226242
%package -n libzfs5-devel
227243
Summary: Development headers

0 commit comments

Comments
 (0)