[packages] mini-snmpd: make IPv4 / IPv6 mode switchable when daemon is built with...
[openwrt/svn-archive/archive.git] / net / mini_snmpd / Makefile
1 #
2 # Copyright (C) 2009-2011 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=mini_snmpd
11 PKG_VERSION:=1.2b
12 PKG_RELEASE:=2
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://members.aon.at/linuxfreak/linux/
16 PKG_MD5SUM:=9e432c50ba8216d7fab0983b11b7112a
17
18 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_NAME)
19 PKG_BUILD_PARALLEL:=1
20 PKG_INSTALL:=1
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/mini-snmpd/Default
25 TITLE:=SNMP server for embedded systems
26 URL:=http://members.aon.at/linuxfreak/linux/mini_snmpd.html
27 endef
28
29 define Package/mini-snmpd
30 $(call Package/mini-snmpd/Default)
31 SECTION:=net
32 CATEGORY:=Network
33 TITLE+= Mini Snmpd
34 endef
35
36 PKG_OFLAGS:=$(TARGET_CFLAGS) -DSYSLOG
37
38 ifeq ($(CONFIG_IPV6),y)
39 PKG_OFLAGS+= -D__IPV6__
40 else
41 PKG_OFLAGS+= -D__IPV4__
42 endif
43
44 MAKE_FLAGS+= \
45 OFLAGS="$(PKG_OFLAGS)" \
46 STRIP="/bin/true" \
47 INSTALL_ROOT="$(PKG_INSTALL_DIR)"
48
49 define Build/Compile
50 $(call Build/Compile/Default,mini_snmpd)
51 endef
52
53 define Package/mini-snmpd/install
54 $(INSTALL_DIR) $(1)/usr/bin
55 $(CP) $(PKG_INSTALL_DIR)/sbin/mini_snmpd $(1)/usr/bin/
56 $(INSTALL_DIR) $(1)/etc/config
57 $(INSTALL_CONF) ./files/mini_snmpd.config $(1)/etc/config/mini_snmpd
58 $(INSTALL_DIR) $(1)/etc/init.d
59 $(INSTALL_BIN) ./files/mini_snmpd.init $(1)/etc/init.d/mini_snmpd
60 endef
61
62 Package/mini-snmpd6/install=$(Package/mini-snmpd/install)
63
64 $(eval $(call BuildPackage,mini-snmpd))