move service file, dbus conf into repo

Move the service file for phosphor-networkd from the bitbake recipe to
the source repository.
Move the dbus configuration file for phosphor-network from a generated
file to the source repository.

Tested: Verified dbus conf and service file were installed where
expected.
Change-Id: Idd1a1872aeb020f6b0e2eb9dba7c2e96198be2af
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/configure.ac b/configure.ac
index 1bc24c7..14ed382 100644
--- a/configure.ac
+++ b/configure.ac
@@ -55,6 +55,34 @@
 # Checks for library functions.
 LT_INIT # Removes 'unrecognized options: --with-libtool-sysroot'
 
+PKG_PROG_PKG_CONFIG
+AC_ARG_WITH([systemdsystemunitdir],
+     [AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files])],
+     [],
+     [with_systemdsystemunitdir=auto]
+)
+AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitdir" = "xauto"],
+    [def_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
+     AS_IF([test "x$def_systemdsystemunitdir" = "x"],
+           [AS_IF([test "x$with_systemdsystemunitdir" = "xyes"],
+                  [AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])]
+            )
+            with_systemdsystemunitdir=no],
+           [with_systemdsystemunitdir="$def_systemdsystemunitdir"]
+     )]
+)
+AS_IF([test "x$with_systemdsystemunitdir" != "xno"],
+      [AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])]
+)
+AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$with_systemdsystemunitdir" != "xno"])
+
+AC_ARG_WITH([dbuspolicydir],
+    AS_HELP_STRING([--with-dbuspolicydir=DIR], [Directory for D-Bus system policy files])
+)
+AS_IF([test "x$with_dbuspolicydir" = "x"],
+      [with_dbuspolicydir="${sysconfdir}/dbus-1/system.d"]
+)
+AC_SUBST([dbuspolicydir], [$with_dbuspolicydir])
 
 # Check/set gtest specific functions.
 AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-GTEST_HAS_PTHREAD=0"])
@@ -106,10 +134,15 @@
 AS_IF([test "x$NETWORK_CONF_DIR" == "x"], [NETWORK_CONF_DIR="/etc/systemd/network"])
 AC_DEFINE_UNQUOTED([NETWORK_CONF_DIR], ["$NETWORK_CONF_DIR"], [Network configuration directory])
 
+AC_ARG_VAR(SYSTEMD_TARGET, "Target for starting this service")
+AS_IF([test "x$SYSTEMD_TARGET" == "x"], [SYSTEMD_TARGET="multi-user.target"])
+
 AC_DEFINE(SYSTEMD_BUSNAME, "org.freedesktop.systemd1", [systemd busname.])
 AC_DEFINE(SYSTEMD_PATH, "/org/freedesktop/systemd1", [systemd path.])
 AC_DEFINE(SYSTEMD_INTERFACE, "org.freedesktop.systemd1.Manager", [systemd interface.])
 
 # Create configured output.
 AC_CONFIG_FILES([Makefile test/Makefile])
+AC_CONFIG_FILES([xyz.openbmc_project.Network.service])
+AC_CONFIG_FILES([xyz.openbmc_project.Network.conf])
 AC_OUTPUT