diff options
Diffstat (limited to 'meta-oe/recipes-extended/net-snmp/net-snmp_5.7.2.bb')
-rw-r--r-- | meta-oe/recipes-extended/net-snmp/net-snmp_5.7.2.bb | 112 |
1 files changed, 98 insertions, 14 deletions
diff --git a/meta-oe/recipes-extended/net-snmp/net-snmp_5.7.2.bb b/meta-oe/recipes-extended/net-snmp/net-snmp_5.7.2.bb index 3cbb34b76..81ad6ffcb 100644 --- a/meta-oe/recipes-extended/net-snmp/net-snmp_5.7.2.bb +++ b/meta-oe/recipes-extended/net-snmp/net-snmp_5.7.2.bb | |||
@@ -1,4 +1,9 @@ | |||
1 | require net-snmp.inc | 1 | DESCRIPTION = "Various tools relating to the Simple Network Management Protocol" |
2 | HOMEPAGE = "http://www.net-snmp.org/" | ||
3 | LICENSE = "BSD" | ||
4 | |||
5 | SRC_URI[md5sum] = "5bddd02e2f82b62daa79f82717737a14" | ||
6 | SRC_URI[sha256sum] = "09ed31b4cc1f3c0411ef9a16eff79ef3b30d89c32ca46d5a01a41826c4ceb816" | ||
2 | 7 | ||
3 | LIC_FILES_CHKSUM = "file://README;beginline=3;endline=8;md5=7f7f00ba639ac8e8deb5a622ea24634e" | 8 | LIC_FILES_CHKSUM = "file://README;beginline=3;endline=8;md5=7f7f00ba639ac8e8deb5a622ea24634e" |
4 | 9 | ||
@@ -12,22 +17,101 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/net-snmp/net-snmp-${PV}.tar.gz \ | |||
12 | file://ifmib.patch \ | 17 | file://ifmib.patch \ |
13 | " | 18 | " |
14 | 19 | ||
15 | PR = "${INC_PR}.0" | 20 | DEPENDS = "openssl libnl pciutils" |
21 | RDEPENDS_${PN}-server-snmpd += "net-snmp-mibs" | ||
22 | RDEPENDS_${PN}-server-snmptrapd += "net-snmp-server-snmpd" | ||
23 | RDEPENDS_${PN}-server += "net-snmp-server-snmpd net-snmp-server-snmptrapd" | ||
24 | RDEPENDS_${PN}-client += "net-snmp-mibs" | ||
25 | RDEPENDS_${PN}-dev = "net-snmp-client (= ${EXTENDPKGV}) net-snmp-server (= ${EXTENDPKGV})" | ||
26 | RRECOMMENDS_${PN}-dbg = "net-snmp-client (= ${EXTENDPKGV}) net-snmp-server (= ${EXTENDPKGV})" | ||
16 | 27 | ||
17 | EXTRA_OECONF += "--disable-embedded-perl --with-perl-modules=no" | 28 | inherit autotools update-rc.d siteinfo systemd |
18 | EXTRA_OEMAKE = "INSTALL_PREFIX=${D}" | ||
19 | 29 | ||
20 | do_configure_prepend() { | 30 | EXTRA_OEMAKE = "INSTALL_PREFIX=${D}" |
21 | gnu-configize -f | ||
22 | # We better change sources and re-autoconf here, but | ||
23 | # required autoconf is too new for us. | ||
24 | sed -e '/echo.*\".*\\\\.*\"/s/echo/echo -e/g' \ | ||
25 | -e 's/tail -1/tail -n 1/g' \ | ||
26 | -i configure | ||
27 | } | ||
28 | 31 | ||
29 | PARALLEL_MAKE = "" | 32 | PARALLEL_MAKE = "" |
30 | CCACHE = "" | 33 | CCACHE = "" |
31 | 34 | ||
32 | SRC_URI[md5sum] = "5bddd02e2f82b62daa79f82717737a14" | 35 | TARGET_CC_ARCH += "${LDFLAGS}" |
33 | SRC_URI[sha256sum] = "09ed31b4cc1f3c0411ef9a16eff79ef3b30d89c32ca46d5a01a41826c4ceb816" | 36 | |
37 | EXTRA_OECONF = "--disable-embedded-perl \ | ||
38 | --with-perl-modules=no \ | ||
39 | --enable-shared \ | ||
40 | --disable-manuals \ | ||
41 | --with-defaults \ | ||
42 | ${@base_conditional('SITEINFO_ENDIANNESS', 'le', '--with-endianness=little', '--with-endianness=big', d)}" | ||
43 | |||
44 | do_install_append() { | ||
45 | install -d ${D}${sysconfdir}/snmp | ||
46 | install -d ${D}${sysconfdir}/init.d | ||
47 | install -m 755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/snmpd | ||
48 | install -m 644 ${WORKDIR}/snmpd.conf ${D}${sysconfdir}/snmp/ | ||
49 | install -m 644 ${WORKDIR}/snmptrapd.conf ${D}${sysconfdir}/snmp/ | ||
50 | install -d ${STAGING_BINDIR} | ||
51 | install -m 0755 ${D}${bindir}/net-snmp-config ${STAGING_BINDIR}/ | ||
52 | sed -e "s@-I/usr/include@@g" \ | ||
53 | -e "s@^prefix=.*@prefix=${STAGING_DIR_HOST}@g" \ | ||
54 | -e "s@^exec_prefix=.*@exec_prefix=${STAGING_DIR_HOST}@g" \ | ||
55 | -e "s@^includedir=.*@includedir=${STAGING_INCDIR}@g" \ | ||
56 | -e "s@^libdir=.*@libdir=${STAGING_LIBDIR}@g" \ | ||
57 | -i ${STAGING_BINDIR}/net-snmp-config | ||
58 | install -d ${D}${systemd_unitdir}/system | ||
59 | install -m 0644 ${WORKDIR}/snmpd.service ${D}${systemd_unitdir}/system | ||
60 | install -m 0644 ${WORKDIR}/snmptrapd.service ${D}${systemd_unitdir}/system | ||
61 | } | ||
62 | |||
63 | PACKAGES = "${PN}-dbg ${PN}-doc ${PN}-dev ${PN}-staticdev ${PN}-static ${PN}-libs \ | ||
64 | ${PN}-mibs ${PN}-server ${PN}-client ${PN}-server-snmpd ${PN}-server-snmptrapd" | ||
65 | |||
66 | ALLOW_EMPTY_${PN}-server = "1" | ||
67 | |||
68 | FILES_${PN}-libs = "${libdir}/lib*${SOLIBS}" | ||
69 | FILES_${PN}-mibs = "${datadir}/snmp/mibs" | ||
70 | FILES_${PN}-server-snmpd = "${sbindir}/snmpd \ | ||
71 | ${sysconfdir}/snmp/snmpd.conf \ | ||
72 | ${sysconfdir}/init.d \ | ||
73 | ${systemd_unitdir}/system/snmpd.service \ | ||
74 | " | ||
75 | |||
76 | FILES_${PN}-server-snmptrapd = "${sbindir}/snmptrapd \ | ||
77 | ${sysconfdir}/snmp/snmptrapd.conf \ | ||
78 | ${systemd_unitdir}/system/snmptrapd.service \ | ||
79 | " | ||
80 | |||
81 | FILES_${PN}-client = "${bindir}/* ${datadir}/snmp/" | ||
82 | FILES_${PN}-dbg += "${libdir}/.debug/ ${sbindir}/.debug/ ${bindir}/.debug/" | ||
83 | FILES_${PN}-dev += "${bindir}/net-snmp-config ${bindir}/mib2c ${bindir}/mib2c-update" | ||
84 | |||
85 | CONFFILES_${PN}-server-snmpd = "${sysconfdir}/snmp/snmpd.conf" | ||
86 | CONFFILES_${PN}-server-snmptrapd = "${sysconfdir}/snmp/snmptrapd.conf" | ||
87 | |||
88 | INITSCRIPT_PACKAGES = "${PN}-server" | ||
89 | INITSCRIPT_NAME_${PN}-server = "snmpd" | ||
90 | INITSCRIPT_PARAMS_${PN}-server = "defaults" | ||
91 | |||
92 | EXTRA_OECONF += "${@base_contains('DISTRO_FEATURES', 'systemd', '--with-systemd', '--without-systemd', d)}" | ||
93 | |||
94 | SYSTEMD_PACKAGES = "${PN}-server-snmpd-systemd \ | ||
95 | ${PN}-server-snmptrapd-systemd" | ||
96 | |||
97 | SYSTEMD_SERVICE_${PN}-server-snmpd = "snmpd.service" | ||
98 | SYSTEMD_SERVICE_${PN}-server-snmptrapd = "snmptrapd.service" | ||
99 | |||
100 | RPROVIDES_${PN}-server-snmpd += "${PN}-server-snmpd-systemd" | ||
101 | RREPLACES_${PN}-server-snmpd += "${PN}-server-snmpd-systemd" | ||
102 | RCONFLICTS_${PN}-server-snmpd += "${PN}-server-snmpd-systemd" | ||
103 | |||
104 | RPROVIDES_${PN}-server-snmptrapd += "${PN}-server-snmptrapd-systemd" | ||
105 | RREPLACES_${PN}-server-snmptrapd += "${PN}-server-snmptrapd-systemd" | ||
106 | RCONFLICTS_${PN}-server-snmptrapd += "${PN}-server-snmptrapd-systemd" | ||
107 | |||
108 | LEAD_SONAME = "libnetsnmp.so" | ||
109 | |||
110 | pkg_postrm_${PN}-server() { | ||
111 | if test "x$D" != "x"; then | ||
112 | OPT="-r $D " | ||
113 | else | ||
114 | OPT="" | ||
115 | /etc/init.d/snmpd stop | ||
116 | fi | ||
117 | } | ||