Репозиторий ALT Linux backports/2.4
Последнее обновление: 9 июля 2008 | Пакетов: 497 | Посещений: 1583994
 поиск   регистрация   авторизация 
 
Группа :: Система/Серверы
Пакет: net-snmp

 Главная   Изменения   Спек   Патчи   Загрузить   Bugs and FR 

Name: net-snmp
Version: 5.1.1
Release: alt1.1.1

Summary: Tools and servers for the SNMP protocol
License: BSD-like
Group: System/Servers
Url: http://net-snmp.sourceforge.net
Packager: Konstantin Timoshenko <kt at altlinux.ru>

Source0: http://prdownloads.sourceforge.net/net-snmp/net-snmp-%version.tar.bz2
Source1: %name.init
Source2: %name.conf
Source3: %name.logrotate

Patch1: %name-5.1-alt-rpm4.patch
Patch2: %name-5.0.9-libtool.patch
Patch3: %name-5.1-perlmodules.patch
Patch4: %name-5.1-libwrap.patch

%define persistentdir %_localstatedir/%name

PreReq: chkconfig
Requires: lib%name = %version-%release
Obsoletes: cmu-snmp ucd-snmp

BuildPreReq: librpm-devel >= 4.0.4, rpm-build >= 4.0.4

%def_disable static
%{?_enable_static:BuildPreReq: glibc-devel-static}

# we've got perl modules linked against libnetsnmp.so

%define __spec_autodep_custom_pre export LD_LIBRARY_PATH=%buildroot%_libdir

# Automatically added by buildreq on Wed Mar 03 2004 (-bi)

BuildRequires: XFree86-libs chrpath libdb4.2-devel libelf-devel libpopt-devel librpm-devel libssl-devel libwrap-devel pdksh perl-Term-ReadLine-Gnu perl-Tk perl-devel perl-i18n perl-libnet

%package -n lib%name
Summary: The shared libraries for the Net-SNMP project
Group: System/Libraries

%package -n lib%name-devel
Summary: The development environment for the Net-SNMP project
Group: Development/C
Requires: lib%name = %version-%release
Provides: lib%name-devel = %version
Obsoletes: lib%name-devel

%package -n lib%name-devel-static
Summary: static libraries for lib%name
Group: Development/C
Obsoletes: lib%name-devel-static
Requires: lib%name-devel = %version-%release

%package utils
Summary: Network management utilities using SNMP, from the Net-SNMP project
Group: Networking/Other
Requires: lib%name = %version-%release
Obsoletes: cmu-snmp-utils, ucd-snmp-utils

%package -n libucd-snmp
Summary: The shared libraries for the UCD-SNMP project
Group: System/Libraries

%package -n libucd-snmp-devel
Summary: The development environment for the UCD-SNMP project
Group: Development/C
Requires: libucd-snmp = %version-%release
Provides: libucd-snmp-devel = %version
Obsoletes: cmu-snmp-devel, libucd-snmp-devel

%package -n libucd-snmp-devel-static
Summary: static libraries for the UCD-SNMP project
Group: Development/C
Obsoletes: libucd-snmp-devel-static
Requires: libucd-snmp-devel = %version-%release

%package -n perl-SNMP
Summary: Perl SNMP Extension Module
Group: Development/Perl
Requires: lib%name = %version-%release

%description
SNMP (Simple Network Management Protocol) is a protocol used for network
management (hence the name).  The Net-SNMP project includes various SNMP
tools; an extensible agent, an SNMP library, tools for requesting or
setting information from SNMP agents, tools for generating and handling
SNMP traps, a version of the netstat command which uses SNMP, and a
Tk/Perl mib browser.  This package contains the snmpd and snmptrapd
daemons, documentation, etc.

Install the %name package if you need network management tools.
You will probably also want to install the %name-utils package, which
contains Net-SNMP utilities.

%description -n lib%name
The lib%name package contains the shared libraries required for
Net-SNMP software.

%description -n lib%name-devel
This package contains include files required for development
applications for use with the Net-SNMP project's network management
tools. You'll also need to have the lib%name and %name-utils packages
installed.

%description -n lib%name-devel-static
This package contains static libraries required for development
statically linked applications for use with the Net-SNMP project's
network management tools. You'll also need to have the lib%name-devel
package installed.

%description utils
The %name package contains various utilities for use with the
Net-SNMP network management project.

Install this package if you need utilities for managing your network
using the SNMP protocol.  You'll also need to install the %name
package.

%description -n libucd-snmp
The libucd-snmp package contains the shared libraries required for
UCD-SNMP software.

%description -n libucd-snmp-devel
This package contains include files required for development
applications for use with the UCD-SNMP project's network management
tools.

%description -n libucd-snmp-devel-static
This package contains static libraries required for development
statically linked applications for use with the UCD-SNMP project's
network management tools. You'll also need to have the libucd-snmp-devel
package installed.

%description -n perl-SNMP
This is the Perl5 'SNMP' extension module. The SNMP module provides
a full featured, tri-lingual SNMP (SNMPv3, SNMPv2c, SNMPv1) API.
The SNMP module also provides an interface to the SMI MIB parse-tree
for run-time access to parsed MIB data.

%prep
%setup -q
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1

%build
%__autoconf
%{?!_enable_static:export lt_cv_prog_cc_static_works=no}
%configure %{subst_enable static} \
--enable-shared \
--with-cflags="$RPM_OPT_FLAGS" \
--with-sys-location="Unknown" \
--with-sys-contact="root at localhost" \
--with-logfile="/var/log/snmpd.log" \
--with-includedir=%_includedir/%name \
--with-persistent-directory="%persistentdir" \
--with-mib-modules="host ucd-snmp/pass_persist" \
--with-libwrap \
--with-openssl \
--with-sysconfdir=%_sysconfdir/%name \
--with-default-snmp-version="1" \
--enable-ucd-snmp-compatibility \
--with-defaults

%make

# XXX tests fail

%def_without test

#if [ ! -d /proc/1 ]; then

#: /proc not available, removing some tests
#%__rm -fv t/bulkwalk.t t/get.t
#fi

# this subset of perl modules is recommended in perl/Makefile.PL

# the order matters for tests!
%define perl_subdirs default_store ASN SNMP OID agent

# build perl modules

for d in %perl_subdirs; do
pushd perl/$d
export PERL5LIB="$PERL5LIB:$PWD/blib/lib:$PWD/blib/arch"
%perl_vendor_build --NET-SNMP-CONFIG=../../net-snmp-config --NET-SNMP-IN-SOURCE=true
popd
done

%install
%makeinstall INSTALL='$(LIBTOOL) --mode=install /usr/bin/install -c' \
    includedir=$RPM_BUILD_ROOT%_includedir/%name \
    ucdincludedir=$RPM_BUILD_ROOT%_includedir/ucd-snmp

%__mkdir_p $RPM_BUILD_ROOT%_initdir
%__mkdir_p $RPM_BUILD_ROOT%persistentdir

%__install -p -m755 -D %SOURCE1 $RPM_BUILD_ROOT%_initdir/snmpd
%__install -p -m644 -D %SOURCE2 $RPM_BUILD_ROOT%_sysconfdir/snmp/snmpd.conf
%__install -p -m644 -D %SOURCE3 $RPM_BUILD_ROOT%_sysconfdir/logrotate.d/snmpd

# Remove tkmib.

%__rm -fv $RPM_BUILD_ROOT%_bindir/tkmib

# install perl modules

for d in %perl_subdirs; do
pushd perl/$d
%perl_vendor_install
popd
done

# perl loadable objects contain $RPM_BUILD_DIR-dependent RPATH

chrpath -d `find $RPM_BUILD_ROOT%perl_vendor_autolib -type f -name '*.so'`

%post -n lib%name -p %post_ldconfig
%postun -n lib%name -p %postun_ldconfig

%post -n libucd-snmp -p %post_ldconfig
%postun -n libucd-snmp -p %postun_ldconfig

%post
/usr/sbin/useradd -r -d /dev/null -s /dev/null -n snmp >/dev/null 2>&1 ||:
/usr/sbin/usermod -g proc snmp &>/dev/null ||:

%post_service snmpd

%preun
%preun_service snmpd

%files
%doc AGENT.txt COPYING ChangeLog EXAMPLE.conf FAQ NEWS PORTING README* TODO
%doc local/{README.mib2c,passtest,ipf-mod.pl}
%dir %_sysconfdir/snmp
%config(noreplace) %_sysconfdir/snmp/snmpd.conf
%config(noreplace) %_initdir/snmpd
%config(noreplace) %_sysconfdir/logrotate.d/snmpd
%_sbindir/*
%_datadir/snmp
%attr(0770,snmp,root) %persistentdir
%_mandir/man[158]/*

%files -n lib%name
%_libdir/libnetsnmp.so.*
%_libdir/libnetsnmpagent.so.*
%_libdir/libnetsnmphelpers.so.*
%_libdir/libnetsnmpmibs.so.*
%_libdir/libnetsnmptrapd.so.*

%files utils
%_bindir/*
%_mandir/man1/snmp??*.*

%files -n lib%name-devel
%_libdir/libnetsnmp.so
%_libdir/libnetsnmpagent.so
%_libdir/libnetsnmphelpers.so
%_libdir/libnetsnmpmibs.so
%_libdir/libnetsnmptrapd.so
%_includedir/%name
%_man3dir/*
%exclude %perl_vendor_man3dir/SNMP*
%exclude %perl_vendor_man3dir/NetSNMP*

%if_enabled static
%files -n lib%name-devel-static
%_libdir/libnetsnmp.a
%_libdir/libnetsnmpagent.a
%_libdir/libnetsnmphelpers.a
%_libdir/libnetsnmpmibs.a
%endif

%files -n libucd-snmp
%_libdir/libsnmp.so.*

%files -n libucd-snmp-devel
%_libdir/libsnmp.so
%_includedir/ucd-snmp

%if_enabled static
%files -n libucd-snmp-devel-static
%_libdir/libsnmp.a
%endif

%files -n perl-SNMP
%doc perl/SNMP/{examples,README,BUG,TODO}
%perl_vendor_man3dir/SNMP*
%perl_vendor_man3dir/NetSNMP*
%perl_vendor_archlib/SNMP*
%perl_vendor_autolib/SNMP*
%perl_vendor_archlib/NetSNMP*
%perl_vendor_autolib/NetSNMP*

%changelog

Полный changelog можно просмотреть здесь

 
design & coding: Vladimir Lettiev aka crux © 2004-2005