summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/lib/systemd/system/alfred@.service8
-rw-r--r--generic/lib/systemd/system/batadv-vis@.service9
-rw-r--r--rules/alfred.in26
-rw-r--r--rules/alfred.make70
4 files changed, 113 insertions, 0 deletions
diff --git a/generic/lib/systemd/system/alfred@.service b/generic/lib/systemd/system/alfred@.service
new file mode 100644
index 000000000..08e014c41
--- /dev/null
+++ b/generic/lib/systemd/system/alfred@.service
@@ -0,0 +1,8 @@
+[Unit]
+Description = A.L.F.R.E.D. server on interface %i
+BindsTo = sys-subsystem-net-devices-%i.device
+After = sys-subsystem-net-devices-%i.device
+
+[Service]
+ExecStart=/usr/bin/alfred -i %i
+
diff --git a/generic/lib/systemd/system/batadv-vis@.service b/generic/lib/systemd/system/batadv-vis@.service
new file mode 100644
index 000000000..39b4b6f34
--- /dev/null
+++ b/generic/lib/systemd/system/batadv-vis@.service
@@ -0,0 +1,9 @@
+[Unit]
+Description = batman-adv visualisation service on interface %i
+BindsTo = sys-subsystem-net-devices-%i.device
+After = sys-subsystem-net-devices-%i.device alfred@.service
+Requires = alfred@.service
+
+[Service]
+ExecStart=/usr/bin/batadv-vis -s -i %i
+
diff --git a/rules/alfred.in b/rules/alfred.in
new file mode 100644
index 000000000..c4b88951a
--- /dev/null
+++ b/rules/alfred.in
@@ -0,0 +1,26 @@
+## SECTION=networking
+
+menuconfig ALFRED
+ tristate
+ prompt "A.L.F.R.E.D. "
+ help
+ Alfred is a distributed data distribution service which is used for
+ batman mesh networks.
+
+if ALFRED
+
+config ALFRED_SYSTEMD_SERVICE
+ bool "install alfred and batadv-vis systemd service files"
+ default y
+
+config ALFRED_SYSTEMD_SERVICE_ALFRED_INTF
+ string "Enable alfred systemd service file for this interface"
+ default "bat0"
+ depends on ALFRED_SYSTEMD_SERVICE
+
+config ALFRED_SYSTEMD_SERVICE_BATADVVIS_INTF
+ string "Enable batadv-vis systemd service file for this interface"
+ default "bat0"
+ depends on ALFRED_SYSTEMD_SERVICE
+
+endif
diff --git a/rules/alfred.make b/rules/alfred.make
new file mode 100644
index 000000000..e125fd40b
--- /dev/null
+++ b/rules/alfred.make
@@ -0,0 +1,70 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2014 by Markus Pargmann <mpa@pengutronix.de>
+#
+# See CREDITS for details about who has contributed to this project.
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_ALFRED) += alfred
+
+#
+# Paths and names
+#
+ALFRED_VERSION := 2014.1.0
+ALFRED_MD5 := aaee0fbbc3aa011ba9c0a1d3f3b2801e
+ALFRED := alfred-$(ALFRED_VERSION)
+ALFRED_SUFFIX := tar.gz
+ALFRED_URL := http://downloads.open-mesh.org/batman/stable/sources/alfred/$(ALFRED).$(ALFRED_SUFFIX)
+ALFRED_SOURCE := $(SRCDIR)/$(ALFRED).$(ALFRED_SUFFIX)
+ALFRED_DIR := $(BUILDDIR)/$(ALFRED)
+ALFRED_LICENSE := unknown
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+ALFRED_CONF_TOOL := NO
+ALFRED_MAKE_ENV := \
+ $(CROSS_ENV) \
+ CONFIG_ALFRED_GPSD=n
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/alfred.targetinstall:
+ @$(call targetinfo)
+
+ @$(call install_init, alfred)
+ @$(call install_fixup, alfred,PRIORITY,optional)
+ @$(call install_fixup, alfred,SECTION,base)
+ @$(call install_fixup, alfred,AUTHOR,"Markus Pargmann <mpa@pengutronix.de>")
+ @$(call install_fixup, alfred,DESCRIPTION,missing)
+
+ @$(call install_copy, alfred, 0, 0, 0755, $(ALFRED_DIR)/alfred, /usr/bin/alfred)
+ @$(call install_copy, alfred, 0, 0, 0755, $(ALFRED_DIR)/vis/batadv-vis, /usr/bin/batadv-vis)
+
+ifdef PTXCONF_ALFRED_SYSTEMD_SERVICE
+ @$(call install_alternative, alfred, 0, 0, 0644, /lib/systemd/system/alfred@.service)
+ @$(call install_alternative, alfred, 0, 0, 0644, /lib/systemd/system/batadv-vis@.service)
+ifneq ($(PTXCONF_ALFRED_SYSTEMD_SERVICE_ALFRED_INTF),"")
+ @$(call install_link, alfred, ../alfred@.service, \
+ /lib/systemd/system/multi-user.target.wants/alfred@$(PTXCONF_ALFRED_SYSTEMD_SERVICE_ALFRED_INTF).service)
+endif
+ifneq ($(PTXCONF_ALFRED_SYSTEMD_SERVICE_BATADVVIS_INTF),"")
+ @$(call install_link, alfred, ../batadv-vis@.service, \
+ /lib/systemd/system/multi-user.target.wants/batadv-vis@$(PTXCONF_ALFRED_SYSTEMD_SERVICE_BATADVVIS_INTF).service)
+endif
+endif
+
+ @$(call install_finish, alfred)
+
+ @$(call touch)
+
+# vim: syntax=make