]> git.ipfire.org Git - people/stevee/ipfire-3.x.git/blame - net-snmp/net-snmp.nm
net-snmp: Switch to patchelf to remove the RPATH
[people/stevee/ipfire-3.x.git] / net-snmp / net-snmp.nm
CommitLineData
8a0917c3 1###############################################################################
802ea3af
MT
2# IPFire.org - An Open Source Firewall Solution #
3# Copyright (C) - IPFire Development Team <info@ipfire.org> #
8a0917c3
SS
4###############################################################################
5
802ea3af 6name = net-snmp
ce6110f7 7version = 5.9.3
b9dbe6d3 8release = 4
8a0917c3 9
802ea3af
MT
10groups = Networking/Daemons
11url = http://net-snmp.sourceforge.net
12license = BSD
13summary = Simple Network Management Protocol Daemon.
8a0917c3 14
802ea3af
MT
15description
16 Simple Network Management Protocol (SNMP) is a widely used protocol
17 for monitoring the health and welfare of network equipment (eg. routers),
8a0917c3 18 computer equipment and even devices like UPSs.
802ea3af
MT
19end
20
e6b79974 21source_dl = https://sourceforge.net/projects/net-snmp/files/net-snmp/%{version}/
802ea3af
MT
22
23build
24 requires
0302c83d
MT
25 autoconf
26 automake
27 bzip2-devel
0302c83d 28 elfutils-devel
0302c83d
MT
29 lm-sensors-devel >= 3
30 openssl-devel
b9dbe6d3 31 patchelf
0302c83d 32 procps
ce6110f7
SS
33 python3-devel
34 python3-setuptools
0302c83d 35 systemd-devel
802ea3af
MT
36 end
37
0302c83d
MT
38 prepare_cmds
39 autoreconf -vfi
40 end
41
42 MIBS = host agentx smux \
43 ucd-snmp/diskio tcp-mib udp-mib mibII/mta_sendmail \
44 ip-mib/ipv4InterfaceTable ip-mib/ipv6InterfaceTable \
45 ip-mib/ipAddressPrefixTable/ipAddressPrefixTable \
46 ip-mib/ipDefaultRouterTable/ipDefaultRouterTable \
47 ip-mib/ipv6ScopeZoneIndexTable ip-mib/ipIfStatsTable \
48 sctp-mib rmon-mib etherlike-mib ucd-snmp/lmsensorsMib
49
802ea3af 50 configure_options += \
891f6b10 51 --with-cflags="%{CFLAGS} -Wformat" \
0302c83d
MT
52 --with-ldflags="%{LDFLAGS}" \
53 --with-sys-contact="root@localhost" \
54 --with-sys-location="Unknown" \
802ea3af 55 --with-logfile=/var/log/snmpd.log \
0302c83d
MT
56 --with-persistent-directory=/var/lib/net-snmp \
57 --with-mib-modules="%{MIBS}" \
58 --sysconfdir=%{sysconfdir} \
59 --enable-ipv6 \
60 --enable-ucd-snmp-compatibility \
61 --with-openssl \
62 --with-pic \
0302c83d 63 --enable-as-needed \
0302c83d
MT
64 --enable-mfd-rewrites \
65 --enable-local-smux \
66 --with-temp-file-pattern=/var/run/net-snmp/snmp-tmp-XXXXXX \
67 --with-transports="DTLSUDP TLSTCP" \
68 --with-security-modules=tsm \
ce6110f7
SS
69 --with-systemd \
70 --with-default-snmp-version="3" \
71 --without-perl-modules \
72 --disable-embedded-perl \
73 --with-python-modules
802ea3af
MT
74
75 install_cmds
0302c83d
MT
76 # Remove stuff we don't want to distribute.
77 rm -vf %{BUILDROOT}%{bindir}/snmpinform
78 ln -svf snmptrap %{BUILDROOT}%{bindir}/snmpinform
79 rm -vf %{BUILDROOT}%{bindir}/snmpcheck
80 rm -vf %{BUILDROOT}{%{bindir}/fixproc,%{mandir}/man1/fixproc*}
81 rm -vf %{BUILDROOT}%{bindir}/ipf-mod.pl
82
83 # Copy missing mib2c.conf files.
84 install -v -m 644 local/mib2c.*.conf %{BUILDROOT}%{datadir}/snmp
85
0302c83d
MT
86 # Make libs executable.
87 find %{BUILDROOT} -name "*.so" | xargs chmod -v 755
88
89 # Install configuration files.
90 mkdir -pv %{BUILDROOT}%{sysconfdir}/snmp
91 install -v -m644 %{DIR_SOURCE}/snmpd.conf \
92 %{BUILDROOT}%{sysconfdir}/snmp/snmpd.conf
93 install -v -m644 %{DIR_SOURCE}/snmptrapd.conf \
94 %{BUILDROOT}%{sysconfdir}/snmp/snmptrapd.conf
95
fe5c2860
SS
96 # Prepare runtime directory
97 mkdir -pv %{BUILDROOT}%{sharedstatedir}/net-snmp
0302c83d 98
ce6110f7
SS
99 # Remove scripts in /bin which requires the SNMP
100 # perl bindings.
101 rm -rvf %{BUILDROOT}%{bindir}/net-snmp-cert
102 rm -rvf %{BUILDROOT}%{bindir}/tkmib
103 rm -rvf %{BUILDROOT}%{bindir}/mib2c
104 rm -rvf %{BUILDROOT}%{bindir}/snmp-bridge-mib
105
106 # Remove checkbandwidth script
107 # This uses a deprecated perl module (Mail::Sender)
108 rm -rvf %{BUILDROOT}%{bindir}/checkbandwidth
109
0302c83d 110 # Remove more RPATHs.
0c039bf2 111 find %{BUILDROOT}%{bindir} -type f -print \
b9dbe6d3 112 -exec patchelf --remove-rpath {} \;
802ea3af
MT
113 end
114end
115
116packages
117 package %{name}
0302c83d
MT
118 configfiles
119 %{sysconfdir}/snmp
120 end
121
122 datafiles
123 %{localstatedir}/lib/net-snmp
124 end
125
126 script postin
127 systemctl daemon-reload >/dev/null 2>&1 || :
128 end
129
130 script preun
131 systemctl --no-reload disable snmpd.service > /dev/null 2>&1 || :
132 systemctl stop snmpd.service > /dev/null 2>&1 || :
133
134 systemctl --no-reload disable snmptrapd.service > /dev/null 2>&1 || :
135 systemctl stop snmptrapd.service > /dev/null 2>&1 || :
136 end
137
138 script postun
139 systemctl daemon-reload >/dev/null 2>&1 || :
140 end
141
142 script postup
143 systemctl daemon-reload 2>&1 || :
144 systemctl reload-or-try-restart snmpd.service >/dev/null 2>&1 || :
145 systemctl reload-or-try-restart snmptrapd.service >/dev/null 2>&1 || :
7ae2a692
MT
146 end
147 end
802ea3af
MT
148
149 package %{name}-libs
150 template LIBS
151 end
152
e5afcdb4
MT
153 package python3-%{name}
154 template PYTHON3
0302c83d
MT
155 end
156
802ea3af
MT
157 package %{name}-devel
158 template DEVEL
0c039bf2
MT
159
160 requires
161 lm-sensors-devel
162 end
802ea3af 163 end
1f9bc2f0
MT
164
165 package %{name}-debuginfo
166 template DEBUGINFO
167 end
802ea3af 168end