summaryrefslogtreecommitdiffstats
path: root/rpm
diff options
context:
space:
mode:
authorArvind Sankar <[email protected]>2020-06-30 13:10:41 -0400
committerBrian Behlendorf <[email protected]>2020-07-10 14:26:00 -0700
commit4d61ade1a317606dc899e38b516410a0c2fdae0e (patch)
treed6c2003638fe28b2fe341515aaded236d6c1320f /rpm
parentb6437ea41c7611481925d72d294677434639b847 (diff)
Clean up lib dependencies
libzutil is currently statically linked into libzfs, libzfs_core and libzpool. Avoid the unnecessary duplication by removing it from libzfs and libzpool, and adding libzfs_core to libzpool. Remove a few unnecessary dependencies: - libuutil from libzfs_core - libtirpc from libspl - keep only libcrypto in libzfs, as we don't use any functions from libssl - librt is only used for clock_gettime, however on modern systems that's in libc rather than librt. Add a configure check to see if we actually need librt - libdl from raidz_test Add a few missing dependencies: - zlib to libefi and libzfs - libuuid to zpool, and libuuid and libudev to zed - libnvpair uses assertions, so add assert.c to provide aok and libspl_assertf Sort the LDADD for programs so that libraries that satisfy dependencies come at the end rather than the beginning of the linker command line. Revamp the configure tests for libaries to use FIND_SYSTEM_LIBRARY instead. This can take advantage of pkg-config, and it also avoids polluting LIBS. List all the required dependencies in the pkgconfig files, and move the one for libzfs_core into the latter's directory. Install pkgconfig files in $(libdir)/pkgconfig on linux and $(prefix)/libdata/pkgconfig on FreeBSD, instead of /usr/share/pkgconfig, as the more correct location for library .pc files. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Arvind Sankar <[email protected]> Closes #10538
Diffstat (limited to 'rpm')
-rw-r--r--rpm/generic/zfs.spec.in9
1 files changed, 7 insertions, 2 deletions
diff --git a/rpm/generic/zfs.spec.in b/rpm/generic/zfs.spec.in
index e972a10ee..e0bed4cc4 100644
--- a/rpm/generic/zfs.spec.in
+++ b/rpm/generic/zfs.spec.in
@@ -48,6 +48,10 @@
%global _systemdgeneratordir %{_prefix}/lib/systemd/system-generators
%endif
+%if %{undefined _pkgconfigdir}
+%global _pkgconfigdir %{_prefix}/%{_lib}/pkgconfig
+%endif
+
%bcond_with debug
%bcond_with debuginfo
%bcond_with asan
@@ -345,6 +349,7 @@ image which is ZFS aware.
--with-udevruledir=%{_udevruledir} \
--with-dracutdir=%{_dracutdir} \
--with-python=%{__python} \
+ --with-pkgconfigdir=%{_pkgconfigdir} \
--disable-static \
%{debug} \
%{debuginfo} \
@@ -483,8 +488,8 @@ systemctl --system daemon-reload >/dev/null || true
%{_libdir}/libzfs*.so.*
%files -n libzfs2-devel
-%{_datarootdir}/pkgconfig/libzfs.pc
-%{_datarootdir}/pkgconfig/libzfs_core.pc
+%{_pkgconfigdir}/libzfs.pc
+%{_pkgconfigdir}/libzfs_core.pc
%{_libdir}/*.so
%{_includedir}/*
%doc AUTHORS COPYRIGHT LICENSE NOTICE README.md