source: packages/net/net-snmp/Makefile @ 24399

Last change on this file since 24399 was 24399, checked in by jow, 6 years ago

[packages] net-snmp: don't autoreconf

  • Property copyright set to Copyright (C) 2006 OpenWrt.org
  • Property licence set to GPLv2
  • Property svn:eol-style set to native
File size: 6.2 KB
Line 
1#
2# Copyright (C) 2006-2010 OpenWrt.org
3#
4# This is free software, licensed under the GNU General Public License v2.
5# See /LICENSE for more information.
6#
7
8include $(TOPDIR)/rules.mk
9
10PKG_NAME:=net-snmp
11PKG_VERSION:=5.4.2.1
12PKG_RELEASE:=3
13
14PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15PKG_SOURCE_URL:=@SF/net-snmp
16PKG_MD5SUM:=984932520143f0c8bf7b7ce1fc9e1da1
17
18PKG_FIXUP = libtool no-autoreconf
19
20include $(INCLUDE_DIR)/package.mk
21
22define Package/net-snmp/Default
23  SECTION:=net
24  CATEGORY:=Network
25  URL:=http://www.net-snmp.org/
26endef
27
28define Package/net-snmp/Default/description
29 Simple Network Management Protocol (SNMP) is a widely used protocol for
30 monitoring the health and welfare of network equipment (eg. routers),
31 computer equipment and even devices like UPSs. Net-SNMP is a suite of
32 applications used to implement SNMP v1, SNMP v2c and SNMP v3 using both
33 IPv4 and IPv6.
34endef
35
36
37define Package/libnetsnmp
38$(call Package/net-snmp/Default)
39  SECTION:=libs
40  CATEGORY:=Libraries
41  DEPENDS:=+libelf
42  TITLE:=Open source SNMP implementation (libraries)
43endef
44
45define Package/libnetsnmp/description
46$(call Package/net-snmp/Default/description)
47 .
48 This package contains shared libraries, needed by other programs.
49endef
50
51
52define Package/snmp-utils
53$(call Package/net-snmp/Default)
54  DEPENDS:=+libnetsnmp
55  TITLE:=Open source SNMP implementation (utilities)
56endef
57
58define Package/snmp-utils/description
59$(call Package/net-snmp/Default/description)
60 .
61 This package contains SNMP client utilities.
62endef
63
64
65define Package/snmpd
66$(call Package/net-snmp/Default)
67  DEPENDS:=+libnetsnmp
68  TITLE:=Open source SNMP implementation (daemon)
69endef
70
71define Package/snmpd/description
72$(call Package/net-snmp/Default/description)
73 .
74 This package contains the SNMP agent, dynamically linked.
75endef
76
77
78define Package/snmpd-static
79$(call Package/net-snmp/Default)
80  TITLE:=Open source SNMP implementation (daemon)
81  DEPENDS:=+libelf
82endef
83
84define Package/snmpd-static/description
85$(call Package/net-snmp/Default/description)
86 .
87 This package contains the SNMP agent, statically linked.
88endef
89
90
91SNMP_MIB_MODULES_INCLUDED = \
92        host/hr_device \
93        host/hr_disk \
94        host/hr_filesys \
95        host/hr_network \
96        host/hr_partition \
97        host/hr_proc \
98        host/hr_storage \
99        host/hr_system \
100        ieee802dot11 \
101        mibII/at \
102        mibII/icmp \
103        mibII/ifTable \
104        mibII/ip \
105        mibII/snmp_mib \
106        mibII/sysORTable \
107        mibII/system_mib \
108        mibII/tcp \
109        mibII/udp \
110        mibII/vacm_context \
111        mibII/vacm_vars \
112        snmpv3/snmpEngine \
113        snmpv3/snmpMPDStats \
114        snmpv3/usmConf \
115        snmpv3/usmStats \
116        snmpv3/usmUser \
117        tunnel \
118        ucd-snmp/disk \
119        ucd-snmp/dlmod \
120        ucd-snmp/extensible \
121        ucd-snmp/loadave \
122        ucd-snmp/memory \
123        ucd-snmp/pass \
124        ucd-snmp/proc \
125        ucd-snmp/vmstat \
126        util_funcs \
127        utilities/execute \
128
129SNMP_MIB_MODULES_EXCLUDED = \
130        agent_mibs \
131        agentx \
132        disman/event \
133        disman/schedule \
134        hardware \
135        host \
136        if-mib \
137        mibII \
138        notification \
139        notification-log-mib \
140        snmpv3mibs \
141        target \
142        tcp-mib \
143        ucd_snmp \
144        udp-mib \
145        utilities \
146
147SNMP_TRANSPORTS_INCLUDED = Callback UDP
148
149SNMP_TRANSPORTS_EXCLUDED = TCP TCPIPv6 Unix
150
151TARGET_CFLAGS += $(FPIC)
152
153CONFIGURE_ARGS += \
154        --enable-shared \
155        --enable-static \
156        --with-endianness=little \
157        --with-logfile=/var/log/snmpd.log \
158        --with-persistent-directory=/usr/lib/snmp/ \
159        --with-default-snmp-version=1 \
160        --with-sys-contact=root@localhost \
161        --with-sys-location=Unknown \
162        --enable-applications \
163        --disable-debugging \
164        --disable-manuals \
165        --disable-mibs \
166        --disable-scripts \
167        --with-out-mib-modules="$(SNMP_MIB_MODULES_EXCLUDED)" \
168        --with-mib-modules="$(SNMP_MIB_MODULES_INCLUDED)" \
169        --with-out-transports="$(SNMP_TRANSPORTS_EXCLUDED)" \
170        --with-transports="$(SNMP_TRANSPORTS_INCLUDED)" \
171        --without-openssl \
172        --without-libwrap \
173        --without-rpm \
174        --without-zlib \
175
176ifeq ($(CONFIG_IPV6),y)
177SNMP_TRANSPORTS_INCLUDED+= UDPIPv6
178CONFIGURE_ARGS+= --enable-ipv6
179endif
180
181TARGET_LDFLAGS += -L$(TOOLCHAIN_DIR)/usr/lib
182
183ifdef CONFIG_PACKAGE_snmpd-static
184  define Build/Compile/static
185        $(MAKE) -C $(PKG_BUILD_DIR)/agent \
186                LDFLAGS="$(TARGET_LDFLAGS) -lm -static" \
187                EXEEXT="-static" \
188                snmpd-static
189  endef
190endif
191
192define Build/Compile
193        $(MAKE) -C $(PKG_BUILD_DIR) \
194                INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
195                LDFLAGS="$(TARGET_LDFLAGS) -lm -lc" \
196                all install     
197        $(Build/Compile/static)
198endef
199
200define Build/InstallDev
201        $(INSTALL_DIR) $(2)/bin
202        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/net-snmp-config $(2)/bin/
203        $(SED) 's,=/usr,=$(STAGING_DIR)/usr,g' $(2)/bin/net-snmp-config
204
205        $(INSTALL_DIR) $(1)/usr/include
206        $(CP) $(PKG_INSTALL_DIR)/usr/include/net-snmp $(1)/usr/include/
207        $(INSTALL_DIR) $(1)/usr/lib
208        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnetsnmp{,agent,helpers,mibs}.{a,so*} $(1)/usr/lib/
209endef
210
211define Package/libnetsnmp/install
212        $(INSTALL_DIR) $(1)/usr/lib
213        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnetsnmp{,agent,helpers,mibs}.so.* $(1)/usr/lib/
214endef
215
216define Package/snmpd/conffiles
217/etc/default/snmpd
218/etc/config/snmpd
219endef
220
221define Package/snmpd/install
222        $(INSTALL_DIR) $(1)/etc/config
223        $(INSTALL_DATA) ./files/snmpd.conf $(1)/etc/config/snmpd
224        $(INSTALL_DIR) $(1)/etc/snmp
225        ln -sf /var/run/snmpd.conf $(1)/etc/snmp/
226        $(INSTALL_DIR) $(1)/etc/default
227        $(INSTALL_DATA) ./files/snmpd.default $(1)/etc/default/snmpd
228        $(INSTALL_DIR) $(1)/etc/init.d
229        $(INSTALL_BIN) ./files/snmpd.init $(1)/etc/init.d/snmpd
230        $(INSTALL_DIR) $(1)/usr/sbin
231        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/snmpd $(1)/usr/sbin/snmpd
232endef
233
234define Package/snmpd-static/conffiles
235/etc/default/snmpd
236/etc/config/snmpd
237endef
238
239define Package/snmpd-static/install
240        $(INSTALL_DIR) $(1)/etc/config
241        $(INSTALL_DATA) ./files/snmpd.conf $(1)/etc/config/snmpd
242        $(INSTALL_DIR) $(1)/etc/snmp
243        ln -sf /var/run/snmpd.conf $(1)/etc/snmp/
244        $(INSTALL_DIR) $(1)/etc/default
245        $(INSTALL_DATA) ./files/snmpd.default $(1)/etc/default/snmpd
246        $(INSTALL_DIR) $(1)/etc/init.d
247        $(INSTALL_BIN) ./files/snmpd.init $(1)/etc/init.d/snmpd
248        $(INSTALL_DIR) $(1)/usr/sbin
249        $(INSTALL_BIN) $(PKG_BUILD_DIR)/agent/snmpd-static $(1)/usr/sbin/snmpd
250endef
251
252define Package/snmp-utils/install
253        $(INSTALL_DIR) $(1)/usr/bin
254        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/snmp{get,set,status,test,trap,walk} $(1)/usr/bin/
255endef
256
257$(eval $(call BuildPackage,libnetsnmp))
258$(eval $(call BuildPackage,snmp-utils))
259$(eval $(call BuildPackage,snmpd))
260$(eval $(call BuildPackage,snmpd-static))
Note: See TracBrowser for help on using the repository browser.