Skip to content

Commit a686abf

Browse files
behlendorfRageLtMan
authored andcommitted
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 Reviewed-by: Olaf Faaland <[email protected]> Reviewed-by: Tony Hutter <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes openzfs#11931
1 parent a7246d0 commit a686abf

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 %{defined ldconfig_scriptlets}
176+
%ldconfig_scriptlets -n libzpool5
177+
%else
175178
%post -n libzpool5 -p /sbin/ldconfig
176179
%postun -n libzpool5 -p /sbin/ldconfig
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 %{defined ldconfig_scriptlets}
194+
%ldconfig_scriptlets -n libnvpair3
195+
%else
189196
%post -n libnvpair3 -p /sbin/ldconfig
190197
%postun -n libnvpair3 -p /sbin/ldconfig
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 %{defined ldconfig_scriptlets}
217+
%ldconfig_scriptlets -n libuutil3
218+
%else
208219
%post -n libuutil3 -p /sbin/ldconfig
209220
%postun -n libuutil3 -p /sbin/ldconfig
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 %{defined ldconfig_scriptlets}
236+
%ldconfig_scriptlets -n libzfs5
237+
%else
223238
%post -n libzfs5 -p /sbin/ldconfig
224239
%postun -n libzfs5 -p /sbin/ldconfig
240+
%endif
225241

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

0 commit comments

Comments
 (0)