~ubuntu-branches/ubuntu/trusty/net-snmp/trusty

« back to all changes in this revision

Viewing changes to dist/net-snmp.spec

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2004-09-13 12:06:21 UTC
  • Revision ID: james.westby@ubuntu.com-20040913120621-g952ntonlleihcvm
Tags: upstream-5.1.1
ImportĀ upstreamĀ versionĀ 5.1.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
# Default to no perl
 
3
#
 
4
%define include_perl 0
 
5
#
 
6
# Check for -with embedded_perl
 
7
#
 
8
%{?_with_embedded_perl:%define embedded_perl 1}
 
9
%{!?_with_embedded_perl:%define embedded_perl 0}
 
10
#
 
11
# check for -with perl_modules
 
12
#
 
13
%{?_with_perl_modules:%define perl_modules 1}
 
14
%{!?_with_perl_modules:%define perl_modules 0}
 
15
#
 
16
# if embedded_perl or perl_modules specified, include some perl stuff
 
17
#
 
18
%{?_with_embedded_perl:%define include_perl 1}
 
19
%{?_with_perl_modules:%define include_perl 1}
 
20
#
 
21
Summary: Tools and servers for the SNMP protocol
 
22
Name: net-snmp
 
23
Version: 5.1.1
 
24
# update release for vendor release. (eg 1.rh9, 1.rh72, 1.ydl3, 1.ydl23)
 
25
Release: 1
 
26
URL: http://net-snmp.sourceforge.net/
 
27
Copyright: BSDish
 
28
Group: System Environment/Daemons
 
29
Source: http://prdownloads.sourceforge.net/net-snmp/net-snmp-%{version}.tar.gz
 
30
Prereq: openssl
 
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/>
 
34
BuildRequires: perl
 
35
 
 
36
%description
 
37
 
 
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.
 
44
 
 
45
%if %{embedded_perl}
 
46
This package includes embedded perl support within the agent
 
47
%endif
 
48
 
 
49
%package devel
 
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
 
54
 
 
55
%description devel
 
56
The net-snmp-devel package contains headers and libraries which are
 
57
useful for building SNMP applications, agents, and sub-agents.
 
58
 
 
59
%if %{include_perl}
 
60
%package perlmods
 
61
Group: System Environment/Libraries
 
62
Summary: The perl modules provided with Net-SNMP
 
63
Requires: net-snmp = %{version}, perl
 
64
 
 
65
%description perlmods
 
66
Net-SNMP provides a number of perl modules useful when using the SNMP
 
67
protocol.  Both client and agent support modules are provided.
 
68
%endif
 
69
 
 
70
%prep
 
71
%if %{embedded_perl} == 1 && %{perl_modules} == 0
 
72
echo "'-with embedded_perl' requires '-with perl_modules'"
 
73
exit 1
 
74
%endif
 
75
%setup -q
 
76
 
 
77
%build
 
78
%configure --with-defaults --with-sys-contact="Unknown" \
 
79
        --with-mib-modules="host disman/event-mib smux" \
 
80
        --with-sysconfdir="/etc/net-snmp"               \
 
81
        --enable-shared \
 
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"
 
85
 
 
86
make
 
87
 
 
88
%install
 
89
# ----------------------------------------------------------------------
 
90
# 'install' sets the current directory to _topdir/BUILD/{name}-{version}
 
91
# ----------------------------------------------------------------------
 
92
rm -rf $RPM_BUILD_ROOT
 
93
 
 
94
%makeinstall
 
95
 
 
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
 
103
 
 
104
%if %{include_perl}
 
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
 
108
 
 
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)
 
111
%endif
 
112
 
 
113
%post
 
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
 
118
# been installed.
 
119
%__rm -f $RPM_INSTALL_PREFIX/bin/snmpinform
 
120
%__ln_s $RPM_INSTALL_PREFIX/bin/snmptrap $RPM_INSTALL_PREFIX/bin/snmpinform
 
121
 
 
122
# run ldconfig
 
123
PATH="$PATH:/sbin" ldconfig -n $RPM_INSTALL_PREFIX/lib
 
124
 
 
125
%preun
 
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
 
132
 
 
133
%postun
 
134
# ----------------------------------------------------------------------
 
135
# The 'postun' script is executed just after the package is erased.
 
136
# ----------------------------------------------------------------------
 
137
PATH="$PATH:/sbin" ldconfig -n $RPM_INSTALL_PREFIX/lib
 
138
 
 
139
%clean
 
140
rm -rf $RPM_BUILD_ROOT
 
141
 
 
142
%files
 
143
%defattr(-,root,root)
 
144
 
 
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
 
150
         
 
151
#%config(noreplace) /etc/net-snmp/snmpd.conf
 
152
         
 
153
#%{_datadir}/snmp/snmpconf-data
 
154
%{_datadir}/snmp
 
155
 
 
156
%{_bindir}
 
157
%{_sbindir}
 
158
%{_mandir}/man1/*
 
159
# don't include perl man pages, which start with caps
 
160
%{_mandir}/man3/[^A-Z]*
 
161
%{_mandir}/man5/*
 
162
%{_mandir}/man8/*
 
163
/usr/lib/*.so*
 
164
/etc/rc.d/init.d/snmpd
 
165
 
 
166
%files devel
 
167
%defattr(-,root,root)
 
168
 
 
169
%{_includedir}
 
170
%{_libdir}/*.a
 
171
%{_libdir}/*.la
 
172
 
 
173
%if %{include_perl}
 
174
%files -f net-snmp-perl-files perlmods
 
175
%defattr(-,root,root)
 
176
%{_mandir}/man3/*::*
 
177
%{_mandir}/man3/SNMP*
 
178
%endif
 
179
 
 
180
%verifyscript
 
181
echo "No additional verification is done for net-snmp"
 
182
 
 
183
%changelog
 
184
* Tue Oct 28 2003 rs <rstory@users.sourceforge.net>
 
185
- fix conditional perl build after reading rpm docs
 
186
 
 
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
 
191
 
 
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
 
195
 
 
196
* Fri Sep 12 2003 Wes Hardaker <hardaker@users.sourceforge.net>
 
197
- fixes for 5.0.9's perl support
 
198
 
 
199
* Mon Sep 01 2003 Wes Hardaker <hardaker@users.sourceforge.net>
 
200
- added perl support
 
201
 
 
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
 
204
 
 
205
* Wed Oct 09 2002 Wes Hardaker <hardaker@users.sourceforge.net>
 
206
- Made it possibly almost usable.
 
207
 
 
208
* Mon Apr 22 2002 Robert Story <rstory@users.sourceforge.net>
 
209
- created