]>
Commit | Line | Data |
---|---|---|
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 | 6 | name = net-snmp |
0302c83d MT |
7 | version = 5.7.2 |
8 | release = 1 | |
8a0917c3 | 9 | |
802ea3af MT |
10 | groups = Networking/Daemons |
11 | url = http://net-snmp.sourceforge.net | |
12 | license = BSD | |
13 | summary = Simple Network Management Protocol Daemon. | |
8a0917c3 | 14 | |
802ea3af MT |
15 | description |
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 |
19 | end |
20 | ||
e6b79974 | 21 | source_dl = https://sourceforge.net/projects/net-snmp/files/net-snmp/%{version}/ |
802ea3af MT |
22 | |
23 | build | |
24 | requires | |
0302c83d MT |
25 | autoconf |
26 | automake | |
27 | bzip2-devel | |
28 | chrpath | |
29 | elfutils-devel | |
802ea3af | 30 | libselinux-devel |
0302c83d MT |
31 | lm-sensors-devel >= 3 |
32 | openssl-devel | |
33 | perl(ExtUtils::Embed) | |
34 | procps | |
35 | python-setuptools | |
36 | python-devel | |
37 | systemd-devel | |
38 | systemd-units | |
802ea3af MT |
39 | end |
40 | ||
41 | PARALLELISMFLAGS = # No parallel build | |
42 | ||
0302c83d MT |
43 | prepare_cmds |
44 | autoreconf -vfi | |
45 | end | |
46 | ||
47 | MIBS = host agentx smux \ | |
48 | ucd-snmp/diskio tcp-mib udp-mib mibII/mta_sendmail \ | |
49 | ip-mib/ipv4InterfaceTable ip-mib/ipv6InterfaceTable \ | |
50 | ip-mib/ipAddressPrefixTable/ipAddressPrefixTable \ | |
51 | ip-mib/ipDefaultRouterTable/ipDefaultRouterTable \ | |
52 | ip-mib/ipv6ScopeZoneIndexTable ip-mib/ipIfStatsTable \ | |
53 | sctp-mib rmon-mib etherlike-mib ucd-snmp/lmsensorsMib | |
54 | ||
802ea3af | 55 | configure_options += \ |
0302c83d MT |
56 | --with-cflags="%{CFLAGS}" \ |
57 | --with-ldflags="%{LDFLAGS}" \ | |
58 | --with-sys-contact="root@localhost" \ | |
59 | --with-sys-location="Unknown" \ | |
802ea3af | 60 | --with-logfile=/var/log/snmpd.log \ |
0302c83d MT |
61 | --with-persistent-directory=/var/lib/net-snmp \ |
62 | --with-mib-modules="%{MIBS}" \ | |
63 | --sysconfdir=%{sysconfdir} \ | |
64 | --enable-ipv6 \ | |
65 | --enable-ucd-snmp-compatibility \ | |
66 | --with-openssl \ | |
67 | --with-pic \ | |
68 | --enable-embedded-perl \ | |
69 | --enable-as-needed \ | |
70 | --with-perl-modules="INSTALLDIRS=vendor" \ | |
71 | --enable-mfd-rewrites \ | |
72 | --enable-local-smux \ | |
73 | --with-temp-file-pattern=/var/run/net-snmp/snmp-tmp-XXXXXX \ | |
74 | --with-transports="DTLSUDP TLSTCP" \ | |
75 | --with-security-modules=tsm \ | |
76 | --with-systemd | |
77 | ||
78 | build_cmds | |
79 | # Remove rpath from compiled perl libs | |
80 | find perl/blib -type f -name "*.so" -print -exec chrpath --delete {} \; | |
81 | ||
82 | # Compile python module | |
83 | pushd python | |
84 | %{python} setup.py --basedir=".." build | |
85 | popd | |
86 | end | |
802ea3af MT |
87 | |
88 | install_cmds | |
0302c83d MT |
89 | # Remove stuff we don't want to distribute. |
90 | rm -vf %{BUILDROOT}%{bindir}/snmpinform | |
91 | ln -svf snmptrap %{BUILDROOT}%{bindir}/snmpinform | |
92 | rm -vf %{BUILDROOT}%{bindir}/snmpcheck | |
93 | rm -vf %{BUILDROOT}{%{bindir}/fixproc,%{mandir}/man1/fixproc*} | |
94 | rm -vf %{BUILDROOT}%{bindir}/ipf-mod.pl | |
95 | ||
96 | # Copy missing mib2c.conf files. | |
97 | install -v -m 644 local/mib2c.*.conf %{BUILDROOT}%{datadir}/snmp | |
98 | ||
99 | # Install python module. | |
100 | pushd python | |
101 | %{python} setup.py --basedir=".." install -O1 --skip-build --root %{BUILDROOT} | |
102 | popd | |
103 | ||
104 | # Make libs executable. | |
105 | find %{BUILDROOT} -name "*.so" | xargs chmod -v 755 | |
106 | ||
107 | # Install configuration files. | |
108 | mkdir -pv %{BUILDROOT}%{sysconfdir}/snmp | |
109 | install -v -m644 %{DIR_SOURCE}/snmpd.conf \ | |
110 | %{BUILDROOT}%{sysconfdir}/snmp/snmpd.conf | |
111 | install -v -m644 %{DIR_SOURCE}/snmptrapd.conf \ | |
112 | %{BUILDROOT}%{sysconfdir}/snmp/snmptrapd.conf | |
113 | ||
114 | # Prepare runtime directories. | |
115 | mkdir -pv %{BUILDROOT}%{localstatedir}/{lib,run}/net-snmp | |
116 | ||
117 | # Remove more RPATHs. | |
118 | find %{BUILDROOT}{%{bindir},%{sbindir},%{libdir}} -type f -print \ | |
119 | -exec chrpath --delete {} \; | |
802ea3af MT |
120 | end |
121 | end | |
122 | ||
123 | packages | |
124 | package %{name} | |
0302c83d MT |
125 | configfiles |
126 | %{sysconfdir}/snmp | |
127 | end | |
128 | ||
129 | datafiles | |
130 | %{localstatedir}/lib/net-snmp | |
131 | end | |
132 | ||
133 | script postin | |
134 | systemctl daemon-reload >/dev/null 2>&1 || : | |
135 | end | |
136 | ||
137 | script preun | |
138 | systemctl --no-reload disable snmpd.service > /dev/null 2>&1 || : | |
139 | systemctl stop snmpd.service > /dev/null 2>&1 || : | |
140 | ||
141 | systemctl --no-reload disable snmptrapd.service > /dev/null 2>&1 || : | |
142 | systemctl stop snmptrapd.service > /dev/null 2>&1 || : | |
143 | end | |
144 | ||
145 | script postun | |
146 | systemctl daemon-reload >/dev/null 2>&1 || : | |
147 | end | |
148 | ||
149 | script postup | |
150 | systemctl daemon-reload 2>&1 || : | |
151 | systemctl reload-or-try-restart snmpd.service >/dev/null 2>&1 || : | |
152 | systemctl reload-or-try-restart snmptrapd.service >/dev/null 2>&1 || : | |
7ae2a692 MT |
153 | end |
154 | end | |
802ea3af MT |
155 | |
156 | package %{name}-libs | |
157 | template LIBS | |
158 | end | |
159 | ||
0302c83d MT |
160 | package %{name}-python |
161 | template PYTHON | |
162 | end | |
163 | ||
802ea3af MT |
164 | package %{name}-devel |
165 | template DEVEL | |
166 | end | |
1f9bc2f0 MT |
167 | |
168 | package %{name}-debuginfo | |
169 | template DEBUGINFO | |
170 | end | |
802ea3af | 171 | end |