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}"
-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 \
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"
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() {
+++ /dev/null
-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"