SPECS: pciutils.spec - build shared libpci, static moved to -static no mo...

qboosh qboosh at pld-linux.org
Sat May 31 02:09:54 CEST 2008


Author: qboosh                       Date: Sat May 31 00:09:54 2008 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- build shared libpci, static moved to -static
  no more problems with library dependencies (like -lz -lresolv)

---- Files affected:
SPECS:
   pciutils.spec (1.102 -> 1.103) 

---- Diffs:

================================================================
Index: SPECS/pciutils.spec
diff -u SPECS/pciutils.spec:1.102 SPECS/pciutils.spec:1.103
--- SPECS/pciutils.spec:1.102	Fri May 16 17:58:08 2008
+++ SPECS/pciutils.spec	Sat May 31 02:09:49 2008
@@ -39,6 +39,8 @@
 %define		_datadir	/etc
 %define		_sbindir	/sbin
 
+%define		specflags	-fomit-frame-pointer
+
 %description
 This package contains various utilities for inspecting and setting of
 devices connected to the PCI bus. Requires kernel version 2.1.82 or
@@ -157,6 +159,7 @@
 Summary(uk.UTF-8):	Хедери та інші файли для розробки програм, що працюють з шиною PCI
 Summary(zh_CN.UTF-8):	Linux PCI 开发程序库。
 Group:		Development/Libraries
+Requires:	%{name} = %{version}-%{release}
 Requires:	zlib-devel
 
 %description devel
@@ -234,6 +237,18 @@
 %description devel -l zh_CN.UTF-8
 此软件包包含一个程序库,用于检查和设置与 PCI 总线连接的设备。
 
+%package static
+Summary:	Static version of PCI library
+Summary(pl.UTF-8):	Statyczna wersja biblioteki PCI
+Group:		Development/Libraries
+Requires:	%{name}-devel = %{version}-%{release}
+
+%description static
+Static version of PCI library.
+
+%description static -l pl.UTF-8
+Statyczna wersja biblioteki PCI.
+
 %prep
 %setup -q
 %patch0 -p1
@@ -250,29 +265,28 @@
 ln -sf lib pci
 
 %build
-%define	config	ZLIB=yes DNS=yes SHARED=no
+%define	config	ZLIB=yes DNS=yes SHARED=yes
 
-%{__make} lib/config.h \
-	%{config} \
-	SHAREDIR=%{_datadir}
-
-%{__make} -C lib \
-	%{config} \
+%{__make} lib/libpci.a \
+	ZLIB=yes DNS=yes SHARED=no \
 	CC="%{__cc}" \
-	CFLAGS="%{rpmcflags} -fPIC" \
-	RANLIB=ranlib \
+	OPT="%{rpmcflags}" \
 	PREFIX=%{_prefix} \
 	IDSDIR=%{_datadir} \
 	INCDIR=%{_includedir} \
-	LIBDIR=%{_libdir} \
-	VERSION=%{version}
+	LIBDIR=%{_libdir}
+
+rm -f lib/*.o lib/config.h lib/config.mk
 
 %{__make} \
 	%{config} \
 	CC="%{__cc}" \
-	OPT="%{rpmcflags} %{!?debug:-fomit-frame-pointer}" \
+	OPT="%{rpmcflags}" \
 	LDFLAGS="%{rpmldflags}" \
-	SHAREDIR=%{_datadir}
+	PREFIX=%{_prefix} \
+	IDSDIR=%{_datadir} \
+	INCDIR=%{_includedir} \
+	LIBDIR=%{_libdir}
 
 %install
 rm -rf $RPM_BUILD_ROOT
@@ -285,6 +299,15 @@
 	SHAREDIR=%{_datadir} \
 	PCI_IDS=pci.ids
 
+install -d $RPM_BUILD_ROOT/%{_lib}
+mv $RPM_BUILD_ROOT%{_libdir}/libpci.so.* $RPM_BUILD_ROOT/%{_lib}
+# let rpm find deps
+chmod 755 $RPM_BUILD_ROOT/%{_lib}/libpci.so.*
+ln -sf $(basename $RPM_BUILD_ROOT/%{_lib}/libpci.so.*.*.*) $RPM_BUILD_ROOT/%{_lib}/libpci.so.3
+ln -sf /%{_lib}/$(basename $RPM_BUILD_ROOT/%{_lib}/libpci.so.*.*.*) $RPM_BUILD_ROOT%{_libdir}/libpci.so
+
+install lib/libpci.a $RPM_BUILD_ROOT%{_libdir}
+
 install pcimodules $RPM_BUILD_ROOT%{_sbindir}
 # private pciutils header, what does it use?
 install pciutils.h $RPM_BUILD_ROOT%{_includedir}/pci
@@ -296,29 +319,47 @@
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%post	-p /sbin/ldconfig
+%postun	-p /sbin/ldconfig
+
 %files
 %defattr(644,root,root,755)
 %doc ChangeLog README TODO
+%attr(755,root,root) %{_sbindir}/lspci
+%attr(755,root,root) %{_sbindir}/setpci
+%attr(755,root,root) %{_sbindir}/pcimodules
+%attr(755,root,root) %{_sbindir}/update-pciids
+%attr(755,root,root) /%{_lib}/libpci.so.*.*.*
+%attr(755,root,root) %ghost /%{_lib}/libpci.so.3
 %{_datadir}/pci.ids
-%attr(755,root,root) %{_sbindir}/*
-%{_mandir}/man7/*
-%{_mandir}/man8/*
+%{_mandir}/man7/pcilib.7*
+%{_mandir}/man8/lspci.8*
+%{_mandir}/man8/setpci.8*
+%{_mandir}/man8/update-pciids.8*
 %lang(ja) %{_mandir}/ja/man8/*
 %lang(pl) %{_mandir}/pl/man8/*
 
 %files devel
 %defattr(644,root,root,755)
-%{_libdir}/libpci.a
+%attr(755,root,root) %{_libdir}/libpci.so
 %dir %{_includedir}/pci
 %{_includedir}/pci/*.h
 %{_pkgconfigdir}/libpci.pc
 
+%files static
+%defattr(644,root,root,755)
+%{_libdir}/libpci.a
+
 %define date	%(echo `LC_ALL="C" date +"%a %b %d %Y"`)
 %changelog
 * %{date} PLD Team <feedback at pld-linux.org>
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.103  2008-05-31 00:09:49  qboosh
+- build shared libpci, static moved to -static
+  no more problems with library dependencies (like -lz -lresolv)
+
 Revision 1.102  2008-05-16 15:58:08  arekm
 - enable zlib/dns
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SPECS/pciutils.spec?r1=1.102&r2=1.103&f=u



More information about the pld-cvs-commit mailing list