1 #############################################################
5 #############################################################
7 NETSNMP_URL
:=http
://aleron.dl.sourceforge.net
/sourceforge
/net-snmp
/
8 NETSNMP_DIR
:=$(BUILD_DIR
)/net-snmp-5.1
9 NETSNMP_SOURCE
:=net-snmp-5.1.
tar.gz
10 NETSNMP_PATCH1
:=net-snmp_5.1
-5.diff.gz
11 NETSNMP_PATCH1_URL
:=http
://ftp.debian.org
/debian
/pool
/main
/n
/net-snmp
/
12 NETSNMP_PATCH2
:=$(SOURCE_DIR
)/netsnmp.patch
14 $(DL_DIR
)/$(NETSNMP_SOURCE
):
15 $(WGET
) -P
$(DL_DIR
) $(NETSNMP_URL
)/$(NETSNMP_SOURCE
)
17 $(DL_DIR
)/$(NETSNMP_PATCH1
):
18 $(WGET
) -P
$(DL_DIR
) $(NETSNMP_PATCH1_URL
)/$(NETSNMP_PATCH1
)
20 $(NETSNMP_DIR
)/.unpacked
: $(DL_DIR
)/$(NETSNMP_SOURCE
) $(DL_DIR
)/$(NETSNMP_PATCH1
)
21 zcat
$(DL_DIR
)/$(NETSNMP_SOURCE
) |
tar -C
$(BUILD_DIR
) -xvf
-
22 zcat
$(DL_DIR
)/$(NETSNMP_PATCH1
) | patch
-p1
-d
$(NETSNMP_DIR
)
23 cat
$(NETSNMP_PATCH2
) | patch
-p1
-d
$(NETSNMP_DIR
)
24 touch
$(NETSNMP_DIR
)/.unpacked
26 # We set CAN_USE_SYSCTL to no and use /proc since the
27 # sysctl code in this thing is apparently intended for
28 # freebsd or some such thing...
29 $(NETSNMP_DIR
)/.configured
: $(NETSNMP_DIR
)/.unpacked
30 (cd
$(NETSNMP_DIR
); autoconf
; \
31 ac_cv_CAN_USE_SYSCTL
=no \
34 --with-cc
=$(TARGET_CROSS
)gcc \
35 --with-ar
=$(TARGET_CROSS
)ar \
36 --target
=$(GNU_TARGET_NAME
) \
37 --host
=$(GNU_TARGET_NAME
) \
38 --build
=$(GNU_HOST_NAME
) \
39 --with-endianness
=little \
40 --with-persistent-directory
=/var
/lib
/snmp \
41 --enable-ucd-snmp-compatibility \
50 --with-sys-contact
="root" \
51 --with-sys-location
="Unknown" \
52 --with-mib-modules
="host smux ucd-snmp/dlmod" \
59 touch
$(NETSNMP_DIR
)/.configured
61 $(NETSNMP_DIR
)/agent
/snmpd
: $(NETSNMP_DIR
)/.configured
62 $(MAKE
) -C
$(NETSNMP_DIR
)
64 $(TARGET_DIR
)/usr
/sbin
/snmpd
: $(NETSNMP_DIR
)/agent
/snmpd
65 #$(MAKE) DESTDIR=$(TARGET_DIR) -C $(NETSNMP_DIR) install
66 $(MAKE
) PREFIX
=$(TARGET_DIR
)/usr \
67 prefix=$(TARGET_DIR
)/usr \
68 exec_prefix=$(TARGET_DIR
)/usr \
69 persistentdir
=$(TARGET_DIR
)/var
/lib
/snmp \
70 infodir=$(TARGET_DIR
)/usr
/info \
71 mandir=$(TARGET_DIR
)/usr
/man \
72 includedir=$(STAGING_DIR
)/include/net-snmp \
73 ucdincludedir
=$(STAGING_DIR
)/include/ucd-snmp \
74 -C
$(NETSNMP_DIR
) install;
75 rm -rf
$(TARGET_DIR
)/share
/locale
$(TARGET_DIR
)/usr
/info \
76 $(TARGET_DIR
)/usr
/man
$(TARGET_DIR
)/usr
/share
/doc
77 # Copy the .conf files.
78 mkdir
-p
$(TARGET_DIR
)/etc
/snmp
79 cp
$(NETSNMP_DIR
)/EXAMPLE.conf
$(TARGET_DIR
)/etc
/snmp
/snmpd.conf
80 cp
$(NETSNMP_DIR
)/EXAMPLE-trap.conf
$(TARGET_DIR
)/etc
/snmp
/snmptrapd.conf
81 -mv
$(TARGET_DIR
)/usr
/share
/snmp
/mib2c
*.conf
$(TARGET_DIR
)/etc
/snmp
82 mkdir
-p
$(TARGET_DIR
)/etc
/default
83 cp
$(NETSNMP_DIR
)/debian
/snmpd.default
$(TARGET_DIR
)/etc
/default
/snmpd
84 # Remove the unsupported snmpcheck program
85 rm $(TARGET_DIR
)/usr
/bin
/snmpcheck
86 # Install the "broken" headers
87 cp
$(NETSNMP_DIR
)/agent
/mibgroup
/struct.h
$(STAGING_DIR
)/include/net-snmp
/agent
88 cp
$(NETSNMP_DIR
)/agent
/mibgroup
/util_funcs.h
$(STAGING_DIR
)/include/net-snmp
89 cp
$(NETSNMP_DIR
)/agent
/mibgroup
/mibincl.h
$(STAGING_DIR
)/include/net-snmp
/library
90 cp
$(NETSNMP_DIR
)/agent
/mibgroup
/header_complex.h
$(STAGING_DIR
)/include/net-snmp
/agent
92 netsnmp
: $(TARGET_DIR
)/usr
/sbin
/snmpd
94 netsnmp-headers
: $(TARGET_DIR
)/usr
/include/net-snmp
/net-snmp-config.h
95 cp
-a
$(STAGING_DIR
)/include/net-snmp
$(TARGET_DIR
)/usr
/include/net-snmp
96 cp
-a
$(STAGING_DIR
)/include/ucd-snmp
$(TARGET_DIR
)/usr
/include/net-snmp
98 netsnmp-source
: $(DL_DIR
)/$(NETSNMP_SOURCE
)
101 $(MAKE
) -C
$(NETSNMP_DIR
) clean
104 rm -rf
$(NETSNMP_DIR
)