add fixes from whiterussian,
[openwrt.git] / openwrt / package / net-snmp / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME:=net-snmp
6 PKG_VERSION:=5.1.2
7 PKG_RELEASE:=1
8 PKG_MD5SUM:=8080555ab3f90011f25d5122042d9a8d
9
10 PKG_SOURCE_URL:=@SF/net-snmp
11 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
12 PKG_CAT:=zcat
13
14 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
15 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
16
17 SNMP_MIB_MODULES_INCLUDED = \
18 host/hr_device \
19 host/hr_disk \
20 host/hr_filesys \
21 host/hr_network \
22 host/hr_partition \
23 host/hr_proc \
24 host/hr_storage \
25 host/hr_system \
26 ieee802dot11 \
27 mibII/at \
28 mibII/icmp \
29 mibII/interfaces \
30 mibII/ip \
31 mibII/snmp_mib \
32 mibII/sysORTable \
33 mibII/system_mib \
34 mibII/tcp \
35 mibII/udp \
36 mibII/vacm_context \
37 mibII/vacm_vars \
38 snmpv3/snmpEngine \
39 snmpv3/snmpMPDStats \
40 snmpv3/usmStats \
41 snmpv3/usmUser \
42 snmpv3mibs \
43 tunnel \
44 ucd-snmp/disk \
45 ucd-snmp/extensible \
46 ucd-snmp/loadave \
47 ucd-snmp/memory \
48 ucd-snmp/pass \
49 ucd-snmp/proc \
50 ucd-snmp/vmstat \
51 util_funcs \
52 utilities/execute \
53
54 SNMP_MIB_MODULES_EXCLUDED = \
55 agent_mibs \
56 agentx \
57 host \
58 mibII \
59 notification \
60 snmpv3mibs \
61 target \
62 ucd_snmp \
63 utilities \
64
65 SNMP_TRANSPORTS_INCLUDED = UDP
66
67 SNMP_TRANSPORTS_EXCLUDED = Callback TCP TCPv6 UDPv6 Unix
68
69 PKG_CONFIGURE_OPTIONS = \
70 --enable-shared \
71 --enable-static \
72 --with-endianness=little \
73 --with-logfile=/var/log/snmpd.log \
74 --with-persistent-directory=/usr/lib/snmp/ \
75 --with-default-snmp-version=1 \
76 --with-sys-contact=root@localhost \
77 --with-sys-location=Unknown \
78 --enable-applications \
79 --disable-debugging \
80 --disable-ipv6 \
81 --disable-manuals \
82 --disable-mib-loading \
83 --disable-mibs \
84 --disable-scripts \
85 --with-out-mib-modules="$(SNMP_MIB_MODULES_EXCLUDED)" \
86 --with-mib-modules="$(SNMP_MIB_MODULES_INCLUDED)" \
87 --with-out-transports="$(SNMP_TRANSPORTS_EXCLUDED)" \
88 --with-transports="$(SNMP_TRANSPORTS_INCLUDED)" \
89 --without-opaque-special-types \
90 --without-openssl \
91 --without-libwrap \
92 --without-rpm \
93 --without-zlib \
94
95 include $(TOPDIR)/package/rules.mk
96
97 $(eval $(call PKG_template,LIBNETSNMP,libnetsnmp,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
98 $(eval $(call PKG_template,SNMPD,snmpd,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
99 $(eval $(call PKG_template,SNMP_UTILS,snmp-utils,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
100
101 $(PKG_BUILD_DIR)/.configured:
102 (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status} ; \
103 $(TARGET_CONFIGURE_OPTS) \
104 CFLAGS="$(TARGET_CFLAGS)" \
105 CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
106 LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
107 ac_cv_header_pcap_h=no \
108 ./configure \
109 --target=$(GNU_TARGET_NAME) \
110 --host=$(GNU_TARGET_NAME) \
111 --build=$(GNU_HOST_NAME) \
112 --program-prefix="" \
113 --program-suffix="" \
114 --prefix=/usr \
115 --exec-prefix=/usr \
116 --bindir=/usr/bin \
117 --datadir=/usr/share \
118 --includedir=/usr/include \
119 --infodir=/usr/share/info \
120 --libdir=/usr/lib \
121 --libexecdir=/usr/lib \
122 --localstatedir=/var \
123 --mandir=/usr/share/man \
124 --sbindir=/usr/sbin \
125 --sysconfdir=/etc \
126 $(DISABLE_LARGEFILE) \
127 $(DISABLE_NLS) \
128 $(PKG_CONFIGURE_OPTIONS) \
129 );
130 touch $@
131
132 $(PKG_BUILD_DIR)/.built:
133 rm -rf $(PKG_INSTALL_DIR)
134 mkdir -p $(PKG_INSTALL_DIR)
135 $(MAKE) -C $(PKG_BUILD_DIR) \
136 INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
137 all install
138 touch $@
139
140 $(IPKG_LIBNETSNMP):
141 install -d -m0755 $(IDIR_LIBNETSNMP)/usr/lib
142 cp -fpR $(PKG_INSTALL_DIR)/usr/lib/libnetsnmp{,agent,helpers,mibs}.so.* $(IDIR_LIBNETSNMP)/usr/lib/
143 $(RSTRIP) $(IDIR_LIBNETSNMP)
144 $(IPKG_BUILD) $(IDIR_LIBNETSNMP) $(PACKAGE_DIR)
145
146 $(IPKG_SNMPD):
147 install -d -m0755 $(IDIR_SNMPD)/etc/snmp
148 install -m0644 ./files/snmpd.conf $(IDIR_SNMPD)/etc/snmp/snmpd.conf
149 install -d -m0755 $(IDIR_SNMPD)/etc/default
150 install -m0644 ./files/snmpd.default $(IDIR_SNMPD)/etc/default/snmpd
151 install -d -m0755 $(IDIR_SNMPD)/etc/init.d
152 install -m0755 ./files/snmpd.init $(IDIR_SNMPD)/etc/init.d/snmpd
153 install -d -m0755 $(IDIR_SNMPD)/usr/sbin
154 cp -fpR $(PKG_INSTALL_DIR)/usr/sbin/snmpd $(IDIR_SNMPD)/usr/sbin/
155 $(RSTRIP) $(IDIR_SNMPD)
156 $(IPKG_BUILD) $(IDIR_SNMPD) $(PACKAGE_DIR)
157
158 $(IPKG_SNMP_UTILS):
159 install -d -m0755 $(IDIR_SNMP_UTILS)/usr/bin
160 cp -fpR $(PKG_INSTALL_DIR)/usr/bin/snmp{get,set,status,test,trap,walk} $(IDIR_SNMP_UTILS)/usr/bin/
161 $(RSTRIP) $(IDIR_SNMP_UTILS)
162 $(IPKG_BUILD) $(IDIR_SNMP_UTILS) $(PACKAGE_DIR)
163
164 $(STAGING_DIR)/usr/lib/libnetsnmp.so: $(PKG_BUILD_DIR)/.built
165 mkdir -p $(STAGING_DIR)/usr/bin
166 cp -fpR $(PKG_INSTALL_DIR)/usr/bin/net-snmp-config $(STAGING_DIR)/usr/bin/
167 mkdir -p $(STAGING_DIR)/usr/include
168 cp -fpR $(PKG_INSTALL_DIR)/usr/include/net-snmp $(STAGING_DIR)/usr/include/
169 mkdir -p $(STAGING_DIR)/usr/lib
170 cp -fpR $(PKG_INSTALL_DIR)/usr/lib/libnetsnmp{,agent,helpers,mibs}.{a,so*} $(STAGING_DIR)/usr/lib/
171 touch $@
172
173 install-dev: $(STAGING_DIR)/usr/lib/libnetsnmp.so
174
175 uninstall-dev:
176 rm -rf \
177 $(STAGING_DIR)/usr/bin/net-snmp-config \
178 $(STAGING_DIR)/usr/include/net-snmp \
179 $(STAGING_DIR)/usr/lib/libnetsnmp{,agent,helpers,mibs}.{a,so*} \
180
181 compile: install-dev
182 clean: uninstall-dev
This page took 0.045063 seconds and 5 git commands to generate.