Sophie

Sophie

distrib > Mandriva > 10.0-com > i586 > by-pkgid > 2db06da7cbcf6bcc1a531f858cd9af94 > files > 3

libsmi-0.4.1-3mdk.src.rpm

%define name	libsmi
%define version	0.4.1
%define release	3mdk

%define	major	2
%define libname	%mklibname smi %{major}

Summary:	LibSMI deals with SNMP MIBS definitions
Name:		%{name}
Version:	%{version}
Release:	%{release}
License:	BSD-like
Group:		System/Libraries
Source0:	ftp://ftp.ibr.cs.tu-bs.de/pub/local/libsmi/%{name}-%{version}.tar.bz2
Patch0:		libsmi-0.4.1-sysconfdir.patch.bz2
URL:		http://www.ibr.cs.tu-bs.de/projects/libsmi/
Prereq:		fileutils
BuildRequires:	flex
BuildRequires:	bison
BuildRoot:	%{_tmppath}/%{name}-%{version}-buildroot

# config file, could be %{_sysconf}/smi.conf
%define file_config   /etc/smi.conf
# mib repository
%define mibsdir     %{_datadir}/mibs
#

%description
This package contains the SMI library and standard IETF and IANA
Mibs. This library provides a programmer-friendly interface to
access MIB module information. 

System config file: %{file_config} 
User config file:   .smirc

%package -n	%{libname}
Summary:	LibSMI deals with SNMP MIBS definitions
Group:          System/Libraries
Provides:	libsmi = %{version}

%description -n	%{libname}
This package contains the shared SMI libraries and standard IETF
and IANA Mibs. This library provides a programmer-friendly
interface to access MIB module information.

System config file: %{file_config} 
User config file:   .smirc


%package -n	%{libname}-devel
Group:		Development/Other
Summary:	Development tools for LibSMI
Requires:	%{libname} = %{version}
Provides:	libsmi-devel

%description -n	%{libname}-devel
This package contails the include files and static library needed
to develop applications based on the SMI Library

%package	mibs-std
Group:		System/Libraries
Summary:	Standard MIB files for LibSMI
PreReq:		smi-tools = %{version}
#Requires:	libsmi = %{version}
#BuildArch:     noarch   # disabled because of a RPM bug

%description	mibs-std
This package contains standard MIB files for use with the SMI
Library:

IETF - standard MIBS for SNMP, SNMPv2, interfaces, IP, 
IANA - standard identifiers for protocols, ifType, etc.

%package	mibs-ext
Group:		System/Libraries
Summary:	Extended MIB files for LibSMI
PreReq:		smi-tools = %{version}
#Requires:	libsmi = %{version}
#BuildArch:     noarch   # disabled because of a RPM bug

%description	mibs-ext
This package contains Extended MIB files for use with the SMI
Library:

IRTF - SMIng oids, extensions, types 
TUBS - MIBS for the Technical University of Braunschweig

%package -n	smi-tools
Summary:	LibSMI tools
Group:          Networking/Other
Requires:	%{libname} = %{version}
Requires:	wget

%description -n	smi-tools
This package contains the LibSMI tools-

%prep

%setup -q -n %{name}-%{version}
%patch0 -p1

%build

%configure2_5x \
    --with-mibdir=%{mibsdir} \
    --with-smipath=%{mibsdir}/site:%{mibsdir}/ietf:%{mibsdir}/iana \
    --enable-smi \
    --enable-sming

%make

make check

%__cat > "%{name}.conf" <<EOF
## smi.conf - Global/User SMI configuration file.
#path :%{mibsdir}/site
#path :%{mibsdir}/iana
#path :%{mibsdir}/ietf
## Don't show any errors by default.
level 0
## Preload some basic SMIv2 modules.
load SNMPv2-SMI
load SNMPv2-TC
load SNMPv2-CONF
## Make smilint shout loud to report all errors and warnings.
smilint: level 9
## Dont claim about any names longer than 32 chars.
smilint: hide namelength-32
## Preloading some more modules for special applications.
tcpdump: load DISMAN-SCRIPT-MIB
tcpdump: load IF-MIB
smiquery: load IF-MIB
smidump:  load IF-MIB
EOF

%install
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}

# Install executables, libraries and mibs
%makeinstall_std

DIR=`dirname %{file_config}`
install -d %{buildroot}/${DIR}
install -m644 %{name}.conf %{buildroot}/%{file_config}

install -d %{buildroot}%{mibsdir}/site

%post -n %{libname} -p /sbin/ldconfig
%postun -n %{libname} -p /sbin/ldconfig

%post mibs-ext
## Append to config file: path for irtf and tubs
if test ! -f %{file_config}; then echo "# Generated by %{name}" > %{file_config} ; fi
for DIR in irtf tubs ; do
  if %__grep -q -e "^path.*%{mibsdir}/${DIR}" %{file_config} ; then continue; fi
  echo "path :%{mibsdir}/${DIR}" >> %{file_config}
done

%clean
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}

%files -n	%{libname}
%defattr(-,root,root,0755)
%doc ANNOUNCE COPYING README THANKS
%attr(0755,root,root) %{_libdir}/lib*.so.*

%files -n	%{libname}-devel
%defattr(-,root,root,0755)
%doc TODO doc/draft-irtf-nmrg-sming-02.txt
%attr(0644,root,root) %{_includedir}/*.h
%attr(0755,root,root) %{_libdir}/lib*.so
%attr(0644,root,root) %{_libdir}/lib*.a
%attr(0755,root,root) %{_libdir}/lib*.la
%attr(0644,root,root) %{_datadir}/aclocal/*.m4
%attr(0644,root,root) %{_libdir}/pkgconfig/libsmi.pc
%attr(0644,root,root) %{_mandir}/man3/libsmi.3*
%attr(0644,root,root) %{_mandir}/man3/smi_*.3*

%files		mibs-std
%defattr(-,root,root,0755)
%dir %{mibsdir}
%{mibsdir}/ietf
%{mibsdir}/iana

%files		mibs-ext
%defattr(-,root,root,0755)
%dir %{mibsdir}
%{mibsdir}/irtf
%{mibsdir}/tubs

%files -n	smi-tools
%defattr(-,root,root,0755)
%doc libsmi.conf
%attr(0644,root,root) %config(noreplace) %{file_config}
%attr(0755,root,root) %{_bindir}/smi*
%dir %{mibsdir}
%dir %{mibsdir}/site
%attr(0644,root,root) %{_mandir}/man1/smi*.1*

%changelog
* Fri Feb 27 2004 Olivier Thauvin <thauvin@aerov.jussieu.fr> 0.4.1-3mdk
- Own dir (distlint)

* Thu Jul 10 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 0.4.1-2mdk
- rebuild

* Sun Jun 29 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 0.4.1-1mdk
- libi and macrofiction
- run make check
- added P0
- broke out the utilities into the smi-tools sub package
- misc spec file fixes

* Fri Jan 24 2003 Lenny Cartier <lenny@mandrakesoft.com> 0.4.0-2mdk
- rebuild

* Thu Aug 29 2002 Lenny Cartier <lenny@mandrakesoft.com>  0.4.0-1mdk
- 0.4.0

* Mon Aug 20 2001 Lenny Cartier <lenny@mandrakesoft.com>  0.2.16-1mdk
- updated to 0.2.16

* Mon Feb 26 2001 Lenny Cartier <lenny@mandrakesoft.com>  0.2.13-1mdk
- added in contribs by Olivier Montanuy <olivier.montanuy@wanadoo.fr> :
	- Attempt to make it conform to Mandrake packaging rules. rpmlint.

* Mon Feb 05 2001 Olivier Montanuy <olivier.montanuy@wanadoo.fr> 0.2.13-2
- First spec file for Mandrake distribution.