[packages/pciutils] add static_libs bcond

atler atler at pld-linux.org
Tue Apr 23 12:42:24 CEST 2024


commit e85d670e1462b5fccf120cf7433b53a478c5d109
Author: Jan Palus <atler at pld-linux.org>
Date:   Tue Apr 23 11:42:31 2024 +0200

    add static_libs bcond

 pciutils.spec | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/pciutils.spec b/pciutils.spec
index deed0e6..04de565 100644
--- a/pciutils.spec
+++ b/pciutils.spec
@@ -1,6 +1,7 @@
 #
 # Conditional build:
-%bcond_without	udev	# device names resolving fallback using HWDB
+%bcond_without	static_libs	# static library
+%bcond_without	udev		# device names resolving fallback using HWDB
 
 Summary:	Linux PCI utilities
 Summary(cs.UTF-8):	Linuxové utility pro PCI
@@ -284,6 +285,7 @@ ln -sf lib pci
 %build
 %define	config	ZLIB=yes DNS=yes SHARED=yes LIBKMOD=yes %{?with_udev:HWDB=yes}%{!?with_udev:HWDB=no} PCI_IDS=
 
+%if %{with static_libs}
 %{__make} lib/libpci.a \
 	%{config} SHARED=no \
 	CC="%{__cc}" \
@@ -293,6 +295,7 @@ ln -sf lib pci
 	LIBDIR=%{_libdir}
 
 %{__rm} lib/*.o lib/config.h lib/config.mk lib/libpci.pc
+%endif
 
 %{__make} \
 	%{config} \
@@ -322,7 +325,7 @@ ln -sf /%{_lib}/$(basename $RPM_BUILD_ROOT/%{_lib}/libpci.so.*.*.*) $RPM_BUILD_R
 # let rpm find deps
 chmod 755 $RPM_BUILD_ROOT/%{_lib}/libpci.so.*
 
-cp -p lib/libpci.a $RPM_BUILD_ROOT%{_libdir}
+%{?with_static_libs:cp -p lib/libpci.a $RPM_BUILD_ROOT%{_libdir}}
 
 install -p pcimodules $RPM_BUILD_ROOT%{_sbindir}
 # private pciutils header, what does it use?
@@ -367,6 +370,8 @@ rm -rf $RPM_BUILD_ROOT
 %{_includedir}/pci/*.h
 %{_pkgconfigdir}/libpci.pc
 
+%if %{with static_libs}
 %files static
 %defattr(644,root,root,755)
 %{_libdir}/libpci.a
+%endif
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/pciutils.git/commitdiff/e85d670e1462b5fccf120cf7433b53a478c5d109



More information about the pld-cvs-commit mailing list