meta-google: gbmc-ip-monitor: Add package

Add a daemon that monitors all link / addr / route changes on a system,
and runs a set of installed hooks to perform customized behavior when
these changes occur.

Change-Id: Id2a6b7dc2534ebae1beca7135528a6e1e4eada57
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/meta-google/recipes-google/networking/gbmc-ip-monitor.bb b/meta-google/recipes-google/networking/gbmc-ip-monitor.bb
new file mode 100644
index 0000000..3280430
--- /dev/null
+++ b/meta-google/recipes-google/networking/gbmc-ip-monitor.bb
@@ -0,0 +1,35 @@
+SUMMARY = "Allows hooking netlink events to perform network actions"
+PR = "r1"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
+
+inherit systemd
+
+SRC_URI += " \
+  file://gbmc-ip-monitor.service \
+  file://gbmc-ip-monitor.sh \
+  file://gbmc-ip-monitor-test.sh \
+  "
+
+S = "${WORKDIR}"
+
+DEPENDS += "test-sh"
+
+RDEPENDS_${PN} += " \
+  bash \
+  iproute2 \
+  "
+
+SYSTEMD_SERVICE_${PN} += "gbmc-ip-monitor.service"
+
+do_compile() {
+  SYSROOT="$PKG_CONFIG_SYSROOT_DIR" bash gbmc-ip-monitor-test.sh || exit
+}
+
+do_install_append() {
+  install -d -m0755 ${D}${libexecdir}
+  install -m0755 gbmc-ip-monitor.sh ${D}${libexecdir}/
+
+  install -d -m0755 ${D}${systemd_system_unitdir}
+  install -m0644 gbmc-ip-monitor.service ${D}${systemd_system_unitdir}/
+}