[packages/gsnmp] fix it!

glen glen at pld-linux.org
Fri Apr 5 23:13:33 CEST 2013


commit d8a7bc1e5227154a84b3a1b9785ecdb58af44718
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Sat Apr 6 00:12:10 2013 +0300

    fix it!
    
    - base requires libs, not opposite
    - rename lib to libs
    - devel requires -libs
    - proper libs packaging
    - ldconfig for libs
    - disable static, instead of build and remove
    - .la not needed if pkgconfig present
    - adjust epoches in deps

 gsnmp.spec | 35 ++++++++++++++++++++---------------
 1 file changed, 20 insertions(+), 15 deletions(-)
---
diff --git a/gsnmp.spec b/gsnmp.spec
index ae55a8c..df2c79a 100644
--- a/gsnmp.spec
+++ b/gsnmp.spec
@@ -1,19 +1,21 @@
 Summary:	An SNMP library implementation based on glib and gnet
 Name:		gsnmp
 Version:	0.3.0
-Release:	0.1
+Release:	0.2
 License:	GPL v2
 Group:		Networking
 URL:		http://www.ibr.cs.tu-bs.de/projects/scli/
 Source0:	ftp://ftp.ibr.cs.tu-bs.de/local/gsnmp/%{name}-%{version}.tar.gz
 # Source0-md5:	466699c11b70e18a04d51388b8f89f1c
 BuildRequires:	autoconf >= 2.59
-BuildRequires:	glib2-devel >= 2.0.0
+BuildRequires:	glib2-devel >= 1:2.0.0
 BuildRequires:	gnet-devel >= 2.0.4
 BuildRequires:	libxml2-devel
 BuildRequires:	ncurses-devel
-BuildRequires:	pkgconfig >= 0.16
+BuildRequires:	pkgconfig >= 1:0.16
 BuildRequires:	readline-devel
+Requires:	%{name}-libs = %{version}-%{release}
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %define         skip_post_check_so	libgsnmp.so.0.0.0
 
@@ -25,19 +27,18 @@ found in the examples directory. Some examples use stub files
 generated by the smidump MIB compiler, which is part of the libsmi
 package.
 
-%package lib
+%package libs
 Summary:	A library of functions for the snmp protocol
 Group:		Libraries
-Requires:	%{name} = %{version}-%{release}
 
-%description lib
+%description libs
 This package contains the library needed to run programs dynamically
 linked with libgsnmp.
 
 %package devel
 Summary:	Development tools for the snmp protocol
 Group:		Development/Libraries
-Requires:	%{name} = %{version}-%{release}
+Requires:	%{name}-libs = %{version}-%{release}
 Requires:	glib2-devel
 
 %description devel
@@ -49,8 +50,8 @@ developing programs using libgsnmp.
 
 %build
 %{__autoconf}
-%configure
-
+%configure \
+	--disable-static
 %{__make}
 
 %install
@@ -58,25 +59,29 @@ rm -rf $RPM_BUILD_ROOT
 %{__make} install \
 	DESTDIR=$RPM_BUILD_ROOT
 
-%{__rm} -f $RPM_BUILD_ROOT%{_libdir}/libgsnmp.a
+# obsoleted by pkgconfig
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/libgsnmp.la
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%post	libs -p /sbin/ldconfig
+%postun	libs -p /sbin/ldconfig
+
 %files
 %defattr(644,root,root,755)
 %doc AUTHORS ChangeLog NEWS README
 %attr(755,root,root) %{_bindir}/gsnmp-get
-%{_mandir}/man1/gsnmp-get.*
+%{_mandir}/man1/gsnmp-get.1*
 
-%files lib
+%files libs
 %defattr(644,root,root,755)
-%attr(755,root,root) %{_libdir}/libgsnmp.so.*
+%ghost %{_libdir}/libgsnmp.so.0
+%attr(755,root,root) %{_libdir}/libgsnmp.so.*.*.*
 
 %files devel
 %defattr(644,root,root,755)
-%{_includedir}/%{name}
-%{_libdir}/libgsnmp.la
 %attr(755,root,root) %{_libdir}/libgsnmp.so
+%{_includedir}/%{name}
 %{_pkgconfigdir}/%{name}.pc
 %{_aclocaldir}/%{name}.m4
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/gsnmp.git/commitdiff/d8a7bc1e5227154a84b3a1b9785ecdb58af44718



More information about the pld-cvs-commit mailing list