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