6
# Check for -with embedded_perl
8
%{?_with_embedded_perl:%define embedded_perl 1}
9
%{!?_with_embedded_perl:%define embedded_perl 0}
11
# check for -with perl_modules
13
%{?_with_perl_modules:%define perl_modules 1}
14
%{!?_with_perl_modules:%define perl_modules 0}
16
# if embedded_perl or perl_modules specified, include some perl stuff
18
%{?_with_embedded_perl:%define include_perl 1}
19
%{?_with_perl_modules:%define include_perl 1}
21
Summary: Tools and servers for the SNMP protocol
24
# update release for vendor release. (eg 1.rh9, 1.rh72, 1.ydl3, 1.ydl23)
26
URL: http://net-snmp.sourceforge.net/
28
Group: System Environment/Daemons
29
Source: http://prdownloads.sourceforge.net/net-snmp/net-snmp-%{version}.tar.gz
31
Obsoletes: cmu-snmp ucd-snmp ucd-snmp-utils
32
BuildRoot: /tmp/%{name}-root
33
Packager: The Net-SNMP Coders <http://sourceforge.net/projects/net-snmp/>
38
Net-SNMP provides tools and libraries relating to the Simple Network
39
Management Protocol including: An extensible agent, An SNMP library,
40
tools to request or set information from SNMP agents, tools to
41
generate and handle SNMP traps, etc. Using SNMP you can check the
42
status of a network of computers, routers, switches, servers, ... to
43
evaluate the state of your network.
46
This package includes embedded perl support within the agent
50
Group: Development/Libraries
51
Summary: The includes and static libraries from the Net-SNMP package.
52
Requires: net-snmp = %{version}
53
Obsoletes: cmu-snmp-devel ucd-snmp-devel
56
The net-snmp-devel package contains headers and libraries which are
57
useful for building SNMP applications, agents, and sub-agents.
61
Group: System Environment/Libraries
62
Summary: The perl modules provided with Net-SNMP
63
Requires: net-snmp = %{version}, perl
66
Net-SNMP provides a number of perl modules useful when using the SNMP
67
protocol. Both client and agent support modules are provided.
71
%if %{embedded_perl} == 1 && %{perl_modules} == 0
72
echo "'-with embedded_perl' requires '-with perl_modules'"
78
%configure --with-defaults --with-sys-contact="Unknown" \
79
--with-mib-modules="host disman/event-mib smux" \
80
--with-sysconfdir="/etc/net-snmp" \
82
%{?_with_perl_modules: --with-perl-modules="PREFIX=$RPM_BUILD_ROOT/usr INSTALLDIRS=vendor"} \
83
%{?_with_embedded_perl: --enable-embedded-perl} \
84
--with-cflags="$RPM_OPT_FLAGS"
89
# ----------------------------------------------------------------------
90
# 'install' sets the current directory to _topdir/BUILD/{name}-{version}
91
# ----------------------------------------------------------------------
92
rm -rf $RPM_BUILD_ROOT
96
# Remove 'snmpinform' from the temporary directory because it is a
97
# symbolic link, which cannot be handled by the rpm installation process.
98
%__rm -f $RPM_BUILD_ROOT%{_prefix}/bin/snmpinform
99
# install the init script
100
mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
101
perl -i -p -e 's@/usr/local/share/snmp/@/etc/snmp/@g;s@usr/local@usr@g' dist/snmpd-init.d
102
install -m 755 dist/snmpd-init.d $RPM_BUILD_ROOT/etc/rc.d/init.d/snmpd
105
# unneeded perl stuff
106
find $RPM_BUILD_ROOT/usr/lib/perl5/ -name Bundle -type d | xargs rm -rf
107
find $RPM_BUILD_ROOT/usr/lib/perl5/ -name perllocal.pod | xargs rm -f
109
# store a copy of installed perl stuff. It's too comlpex to predict
110
(xxdir=`pwd` && cd $RPM_BUILD_ROOT && find usr/lib/perl5 -type f | sed 's/^/\//' > $xxdir/net-snmp-perl-files)
114
# ----------------------------------------------------------------------
115
# The 'post' script is executed just after the package is installed.
116
# ----------------------------------------------------------------------
117
# Create the symbolic link 'snmpinform' after all other files have
119
%__rm -f $RPM_INSTALL_PREFIX/bin/snmpinform
120
%__ln_s $RPM_INSTALL_PREFIX/bin/snmptrap $RPM_INSTALL_PREFIX/bin/snmpinform
123
PATH="$PATH:/sbin" ldconfig -n $RPM_INSTALL_PREFIX/lib
126
# ----------------------------------------------------------------------
127
# The 'preun' script is executed just before the package is erased.
128
# ----------------------------------------------------------------------
129
# Remove the symbolic link 'snmpinform' before anything else, in case
130
# it is in a directory that rpm wants to remove (at present, it isn't).
131
%__rm -f $RPM_INSTALL_PREFIX/bin/snmpinform
134
# ----------------------------------------------------------------------
135
# The 'postun' script is executed just after the package is erased.
136
# ----------------------------------------------------------------------
137
PATH="$PATH:/sbin" ldconfig -n $RPM_INSTALL_PREFIX/lib
140
rm -rf $RPM_BUILD_ROOT
143
%defattr(-,root,root)
145
# Install the following documentation in _defaultdocdir/{name}-{version}/
146
%doc AGENT.txt ChangeLog CodingStyle COPYING
147
%doc EXAMPLE.conf.def FAQ INSTALL NEWS PORTING TODO
148
%doc README README.agentx README.hpux11 README.krb5
149
%doc README.snmpv3 README.solaris README.thread README.win32
151
#%config(noreplace) /etc/net-snmp/snmpd.conf
153
#%{_datadir}/snmp/snmpconf-data
159
# don't include perl man pages, which start with caps
160
%{_mandir}/man3/[^A-Z]*
164
/etc/rc.d/init.d/snmpd
167
%defattr(-,root,root)
174
%files -f net-snmp-perl-files perlmods
175
%defattr(-,root,root)
177
%{_mandir}/man3/SNMP*
181
echo "No additional verification is done for net-snmp"
184
* Tue Oct 28 2003 rs <rstory@users.sourceforge.net>
185
- fix conditional perl build after reading rpm docs
187
* Sat Oct 4 2003 rs <rstory@users.sourceforge.net> - 5.0.9-4
188
- fix to build without requiring arguments
189
- separate embedded perl and perl modules options
190
- fix fix for init.d script for non-/usr/local installation
192
* Fri Sep 26 2003 Wes Hardaker <hardaker@users.sourceforge.net>
193
- fix perl's UseNumeric
194
- fix init.d script for non-/usr/local installation
196
* Fri Sep 12 2003 Wes Hardaker <hardaker@users.sourceforge.net>
197
- fixes for 5.0.9's perl support
199
* Mon Sep 01 2003 Wes Hardaker <hardaker@users.sourceforge.net>
202
* Wed Oct 09 2002 Wes Hardaker <hardaker@users.sourceforge.net>
203
- Incorperated most of Mark Harig's better version of the rpm spec and Makefile
205
* Wed Oct 09 2002 Wes Hardaker <hardaker@users.sourceforge.net>
206
- Made it possibly almost usable.
208
* Mon Apr 22 2002 Robert Story <rstory@users.sourceforge.net>