net-snmp: move systemd support from meta-systemd back to meta-oe
authorMartin Jansa <Martin.Jansa@gmail.com>
Sat, 13 Apr 2013 12:38:19 +0000 (14:38 +0200)
committerPatrick Ohly <patrick.ohly@intel.com>
Fri, 9 Jan 2015 16:29:15 +0000 (08:29 -0800)
(From meta-openembedded rev: ca1f7c0399905206be0bc5f36fc0c881b915e4f0)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
meta-openembedded/meta-oe/recipes-extended/net-snmp/net-snmp.inc
meta-openembedded/meta-oe/recipes-extended/net-snmp/net-snmp/snmpd.service [moved from meta-openembedded/meta-systemd/meta-oe/recipes-extended/net-snmp/net-snmp/snmpd.service with 100% similarity]
meta-openembedded/meta-oe/recipes-extended/net-snmp/net-snmp/snmptrapd.service [moved from meta-openembedded/meta-systemd/meta-oe/recipes-extended/net-snmp/net-snmp/snmptrapd.service with 100% similarity]
meta-openembedded/meta-oe/recipes-extended/net-snmp/net-snmp/systemd-support.patch [moved from meta-openembedded/meta-systemd/meta-oe/recipes-extended/net-snmp/net-snmp/systemd-support.patch with 100% similarity]
meta-openembedded/meta-oe/recipes-extended/net-snmp/net-snmp_5.7.1.bb
meta-openembedded/meta-systemd/meta-oe/recipes-extended/net-snmp/net-snmp_5.7.1.bbappend [deleted file]

index 11b81ad..e369ccf 100644 (file)
@@ -9,9 +9,9 @@ RDEPENDS_${PN}-server += "net-snmp-server-snmpd net-snmp-server-snmptrapd"
 RDEPENDS_${PN}-client += "net-snmp-mibs"
 RDEPENDS_${PN}-dev = "net-snmp-client (= ${EXTENDPKGV}) net-snmp-server (= ${EXTENDPKGV})"
 RRECOMMENDS_${PN}-dbg = "net-snmp-client (= ${EXTENDPKGV}) net-snmp-server (= ${EXTENDPKGV})"
-INC_PR = "r3"
+INC_PR = "r6"
 
-inherit autotools update-rc.d siteinfo
+inherit autotools update-rc.d siteinfo systemd
 
 TARGET_CC_ARCH += "${LDFLAGS}"
 
@@ -36,6 +36,9 @@ do_install_append() {
                -e "s@^includedir=.*@includedir=${STAGING_INCDIR}@g" \
                -e "s@^libdir=.*@libdir=${STAGING_LIBDIR}@g" \
                -i ${STAGING_BINDIR}/net-snmp-config
+        install -d ${D}${systemd_unitdir}/system
+        install -m 0644 ${WORKDIR}/snmpd.service ${D}${systemd_unitdir}/system
+        install -m 0644 ${WORKDIR}/snmptrapd.service ${D}${systemd_unitdir}/system
 }
 
 PACKAGES = "${PN}-dbg ${PN}-doc ${PN}-dev ${PN}-staticdev ${PN}-static ${PN}-libs \
@@ -44,8 +47,15 @@ PACKAGES = "${PN}-dbg ${PN}-doc ${PN}-dev ${PN}-staticdev ${PN}-static ${PN}-lib
 ALLOW_EMPTY_${PN}-server = "1"
 FILES_${PN}-libs = "${libdir}/lib*${SOLIBS}"
 FILES_${PN}-mibs = "${datadir}/snmp/mibs"
-FILES_${PN}-server-snmpd = "${sbindir}/snmpd ${sysconfdir}/snmp/snmpd.conf ${sysconfdir}/init.d"
-FILES_${PN}-server-snmptrapd = "${sbindir}/snmptrapd ${sysconfdir}/snmp/snmptrapd.conf"
+FILES_${PN}-server-snmpd = "${sbindir}/snmpd \
+  ${sysconfdir}/snmp/snmpd.conf \
+  ${sysconfdir}/init.d \
+  ${systemd_unitdir}/system/snmpd.service \
+"
+FILES_${PN}-server-snmptrapd = "${sbindir}/snmptrapd \
+  ${sysconfdir}/snmp/snmptrapd.conf \
+  ${systemd_unitdir}/system/snmptrapd.service \
+"
 FILES_${PN}-client = "${bindir}/* ${datadir}/snmp/"
 FILES_${PN}-dbg += "${libdir}/.debug/ ${sbindir}/.debug/ ${bindir}/.debug/"
 FILES_${PN}-dev += "${bindir}/net-snmp-config ${bindir}/mib2c ${bindir}/mib2c-update"
@@ -57,6 +67,22 @@ INITSCRIPT_PACKAGES = "${PN}-server"
 INITSCRIPT_NAME_${PN}-server = "snmpd"
 INITSCRIPT_PARAMS_${PN}-server = "defaults"
 
+EXTRA_OECONF += "${@base_contains('DISTRO_FEATURES', 'systemd', '--with-systemd', '--without-systemd', d)}"
+
+SYSTEMD_PACKAGES = "${PN}-server-snmpd-systemd \
+                    ${PN}-server-snmptrapd-systemd"
+
+SYSTEMD_SERVICE_${PN}-server-snmpd = "snmpd.service"
+SYSTEMD_SERVICE_${PN}-server-snmptrapd =  "snmptrapd.service"
+
+RPROVIDES_${PN}-server-snmpd += "${PN}-server-snmpd-systemd"
+RREPLACES_${PN}-server-snmpd += "${PN}-server-snmpd-systemd"
+RCONFLICTS_${PN}-server-snmpd += "${PN}-server-snmpd-systemd"
+
+RPROVIDES_${PN}-server-snmptrapd += "${PN}-server-snmptrapd-systemd"
+RREPLACES_${PN}-server-snmptrapd += "${PN}-server-snmptrapd-systemd"
+RCONFLICTS_${PN}-server-snmptrapd += "${PN}-server-snmptrapd-systemd"
+
 LEAD_SONAME = "libnetsnmp.so"
 
 pkg_postrm_${PN}-server() {
index f1e42b5..74d006c 100644 (file)
@@ -8,7 +8,11 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/net-snmp/net-snmp-${PV}.tar.gz \
         file://libnl-3-support.patch \
         file://init \
         file://snmpd.conf \
-        file://snmptrapd.conf"
+        file://snmptrapd.conf \
+        file://systemd-support.patch \
+        file://snmpd.service \
+        file://snmptrapd.service \
+"
 
 EXTRA_OECONF += "--disable-embedded-perl --with-perl-modules=no"
 EXTRA_OEMAKE = "INSTALL_PREFIX=${D}"
diff --git a/meta-openembedded/meta-systemd/meta-oe/recipes-extended/net-snmp/net-snmp_5.7.1.bbappend b/meta-openembedded/meta-systemd/meta-oe/recipes-extended/net-snmp/net-snmp_5.7.1.bbappend
deleted file mode 100644 (file)
index c3538b3..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
-
-PRINC := "${@int(PRINC) + 2}"
-
-inherit systemd
-
-SRC_URI += " \
-        file://systemd-support.patch \
-        file://snmpd.service \
-        file://snmptrapd.service \
-"
-do_install_append() {
-       install -d ${D}${systemd_unitdir}/system
-       install -m 0644 ${WORKDIR}/snmpd.service ${D}${systemd_unitdir}/system
-       install -m 0644 ${WORKDIR}/snmptrapd.service ${D}${systemd_unitdir}/system
-}
-
-EXTRA_OECONF += "--with-systemd"
-
-SYSTEMD_PACKAGES = "${PN}-server-snmpd-systemd \
-                    ${PN}-server-snmptrapd-systemd"
-
-SYSTEMD_SERVICE_${PN}-server-snmpd = "snmpd.service"
-SYSTEMD_SERVICE_${PN}-server-snmptrapd =  "snmptrapd.service"
-RPROVIDES_${PN}-server-snmpd += "${PN}-server-snmpd-systemd"
-RREPLACES_${PN}-server-snmpd += "${PN}-server-snmpd-systemd"
-RCONFLICTS_${PN}-server-snmpd += "${PN}-server-snmpd-systemd"
-RPROVIDES_${PN}-server-snmptrapd += "${PN}-server-snmptrapd-systemd"
-RREPLACES_${PN}-server-snmptrapd += "${PN}-server-snmptrapd-systemd"
-RCONFLICTS_${PN}-server-snmptrapd += "${PN}-server-snmptrapd-systemd"
-FILES_${PN}-server-snmpd += "${systemd_unitdir}/system/snmpd.service"
-FILES_${PN}-server-snmptrapd += "${systemd_unitdir}/system/snmptrapd.service"