diff options
author | Jack Mitchell <jack.mitchell@dbbroadcast.co.uk> | 2013-04-17 12:59:44 +0100 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2013-04-19 02:45:28 +0200 |
commit | affc95fd851cde2a8e0bd82217c38b16c8aca302 (patch) | |
tree | b18f3e4b9d749fb07ee48e2b1df429e0c3d2c23d | |
parent | 71548ec82d676dc1eb0dda39a7fb7a0351478684 (diff) | |
download | meta-openembedded-affc95fd851cde2a8e0bd82217c38b16c8aca302.tar.gz |
net-snmp: merge .inc into .bb and clean up obsolete parts of recipe
Signed-off-by: Jack Mitchell <jack.mitchell@dbbroadcast.co.uk>
-rw-r--r-- | meta-oe/recipes-extended/net-snmp/net-snmp.inc | 95 | ||||
-rw-r--r-- | meta-oe/recipes-extended/net-snmp/net-snmp_5.7.2.bb | 112 |
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 @@ | |||
1 | DESCRIPTION = "Various tools relating to the Simple Network Management Protocol" | ||
2 | HOMEPAGE = "http://www.net-snmp.org/" | ||
3 | LICENSE = "BSD" | ||
4 | |||
5 | DEPENDS = "openssl libnl pciutils" | ||
6 | RDEPENDS_${PN}-server-snmpd += "net-snmp-mibs" | ||
7 | RDEPENDS_${PN}-server-snmptrapd += "net-snmp-server-snmpd" | ||
8 | RDEPENDS_${PN}-server += "net-snmp-server-snmpd net-snmp-server-snmptrapd" | ||
9 | RDEPENDS_${PN}-client += "net-snmp-mibs" | ||
10 | RDEPENDS_${PN}-dev = "net-snmp-client (= ${EXTENDPKGV}) net-snmp-server (= ${EXTENDPKGV})" | ||
11 | RRECOMMENDS_${PN}-dbg = "net-snmp-client (= ${EXTENDPKGV}) net-snmp-server (= ${EXTENDPKGV})" | ||
12 | INC_PR = "r6" | ||
13 | |||
14 | inherit autotools update-rc.d siteinfo systemd | ||
15 | |||
16 | TARGET_CC_ARCH += "${LDFLAGS}" | ||
17 | |||
18 | EXTRA_OECONF = "--enable-shared --disable-manuals --with-defaults \ | ||
19 | ${@base_conditional('SITEINFO_ENDIANNESS', 'le', '--with-endianness=little', '--with-endianness=big', d)}" | ||
20 | |||
21 | do_install () { | ||
22 | oe_runmake install | ||
23 | } | ||
24 | |||
25 | do_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 | |||
44 | PACKAGES = "${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 | |||
47 | ALLOW_EMPTY_${PN}-server = "1" | ||
48 | FILES_${PN}-libs = "${libdir}/lib*${SOLIBS}" | ||
49 | FILES_${PN}-mibs = "${datadir}/snmp/mibs" | ||
50 | FILES_${PN}-server-snmpd = "${sbindir}/snmpd \ | ||
51 | ${sysconfdir}/snmp/snmpd.conf \ | ||
52 | ${sysconfdir}/init.d \ | ||
53 | ${systemd_unitdir}/system/snmpd.service \ | ||
54 | " | ||
55 | FILES_${PN}-server-snmptrapd = "${sbindir}/snmptrapd \ | ||
56 | ${sysconfdir}/snmp/snmptrapd.conf \ | ||
57 | ${systemd_unitdir}/system/snmptrapd.service \ | ||
58 | " | ||
59 | FILES_${PN}-client = "${bindir}/* ${datadir}/snmp/" | ||
60 | FILES_${PN}-dbg += "${libdir}/.debug/ ${sbindir}/.debug/ ${bindir}/.debug/" | ||
61 | FILES_${PN}-dev += "${bindir}/net-snmp-config ${bindir}/mib2c ${bindir}/mib2c-update" | ||
62 | |||
63 | CONFFILES_${PN}-server-snmpd = "${sysconfdir}/snmp/snmpd.conf" | ||
64 | CONFFILES_${PN}-server-snmptrapd = "${sysconfdir}/snmp/snmptrapd.conf" | ||
65 | |||
66 | INITSCRIPT_PACKAGES = "${PN}-server" | ||
67 | INITSCRIPT_NAME_${PN}-server = "snmpd" | ||
68 | INITSCRIPT_PARAMS_${PN}-server = "defaults" | ||
69 | |||
70 | EXTRA_OECONF += "${@base_contains('DISTRO_FEATURES', 'systemd', '--with-systemd', '--without-systemd', d)}" | ||
71 | |||
72 | SYSTEMD_PACKAGES = "${PN}-server-snmpd-systemd \ | ||
73 | ${PN}-server-snmptrapd-systemd" | ||
74 | |||
75 | SYSTEMD_SERVICE_${PN}-server-snmpd = "snmpd.service" | ||
76 | SYSTEMD_SERVICE_${PN}-server-snmptrapd = "snmptrapd.service" | ||
77 | |||
78 | RPROVIDES_${PN}-server-snmpd += "${PN}-server-snmpd-systemd" | ||
79 | RREPLACES_${PN}-server-snmpd += "${PN}-server-snmpd-systemd" | ||
80 | RCONFLICTS_${PN}-server-snmpd += "${PN}-server-snmpd-systemd" | ||
81 | |||
82 | RPROVIDES_${PN}-server-snmptrapd += "${PN}-server-snmptrapd-systemd" | ||
83 | RREPLACES_${PN}-server-snmptrapd += "${PN}-server-snmptrapd-systemd" | ||
84 | RCONFLICTS_${PN}-server-snmptrapd += "${PN}-server-snmptrapd-systemd" | ||
85 | |||
86 | LEAD_SONAME = "libnetsnmp.so" | ||
87 | |||
88 | pkg_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 @@ | |||
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 | } | ||