%define name libsmi %define version 0.4.0 %define release 1mdk 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 Url: http://www.ibr.cs.tu-bs.de/projects/libsmi/ Prereq: fileutils BuildRoot: /%{_tmppath}/%{name}-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 devel Group: Development/Other Summary: Development tools for LibSMI Requires: libsmi = %{version} %description 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 #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 #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 %prep rm -rf $RPM_BUILD_ROOT %setup -n %{name}-%{version} %build # Warning: using "--host=i586" disables shared libraries # Warning: make install will fail if --bindir or the like is used # ./configure $FIX --prefix=%{_prefix} --enable-static --enable-shared \ --with-mibdir="${RPM_BUILD_ROOT}/%{mibsdir}" \ --with-smipath="%{mibsdir}/site:%{mibsdir}/ietf:%{mibsdir}/iana" \ --enable-smi --enable-sming --mandir=%_mandir # make %__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 mkdir -p $RPM_BUILD_ROOT%_mandir/{man1,man3} DIR=`dirname %{file_config}` %__install -m 755 -d "${RPM_BUILD_ROOT}/${DIR}" %__install -m 644 "%{name}.conf" "${RPM_BUILD_ROOT}/%{file_config}" # Install executables, libraries and mibs %makeinstall # Copy indispensable MIBs to site mibs MIBS="${RPM_BUILD_ROOT}/%{mibsdir}" %__install -m 777 -d "${MIBS}/site" #for MIB in SNMPv2-SMI SNMPv2-TC SNMPv2-CONF ; do # if test ! -f "${MIBS}/ietf/${FILE}" ; then continue ; fi # mv "${MIBS}/ietf/${FILE}" "${MIBS}/site" #done %clean if test `dirname "${RPM_BUILD_ROOT}"` != "/" ; then rm -rf "${RPM_BUILD_ROOT}" ; fi %post -p /sbin/ldconfig %postun -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 %files %defattr(-,root,root,0755) %doc README COPYING TODO THANKS %attr(644,root,root) %config(noreplace) %{file_config} %{_bindir}/* %{_mandir}/man1/* %{_mandir}/man3/* %attr(755,root,root) %{_libdir}/%{name}.so.* %dir %{mibsdir}/site # %files devel %defattr(-,root,root,0755) %attr(644,root,root) %{_includedir}/smi.h %attr(755,root,root) %{_libdir}/%{name}.so %attr(644,root,root) %{_libdir}/%{name}.a %attr(755,root,root) %{_libdir}/%{name}.la # %files mibs-std %defattr(-,root,root,0755) %{mibsdir}/ietf %{mibsdir}/iana %files mibs-ext %defattr(-,root,root,0755) %{mibsdir}/irtf %{mibsdir}/tubs %changelog * 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.