Add A.L.F.R.E.D. daemon to ptxdist. It is used to distribute data
between nodes of batman mesh networks.

Signed-off-by: Markus Pargmann <[email protected]>
---

Notes:
    Changes in v4:
     - Add default interface bat0
    
    Changes in v2:
     - Cleanup make file

 generic/lib/systemd/system/[email protected]     |  8 +++
 generic/lib/systemd/system/[email protected] |  9 ++++
 rules/alfred.in                                | 26 ++++++++++
 rules/alfred.make                              | 68 ++++++++++++++++++++++++++
 4 files changed, 111 insertions(+)
 create mode 100644 generic/lib/systemd/system/[email protected]
 create mode 100644 generic/lib/systemd/system/[email protected]
 create mode 100644 rules/alfred.in
 create mode 100644 rules/alfred.make

diff --git a/generic/lib/systemd/system/[email protected] 
b/generic/lib/systemd/system/[email protected]
new file mode 100644
index 000000000000..08e014c417a2
--- /dev/null
+++ b/generic/lib/systemd/system/[email protected]
@@ -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/[email protected] 
b/generic/lib/systemd/system/[email protected]
new file mode 100644
index 000000000000..39b4b6f34710
--- /dev/null
+++ b/generic/lib/systemd/system/[email protected]
@@ -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 [email protected]
+Requires = [email protected]
+
+[Service]
+ExecStart=/usr/bin/batadv-vis -s -i %i
+
diff --git a/rules/alfred.in b/rules/alfred.in
new file mode 100644
index 000000000000..c4b88951a9b3
--- /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 000000000000..9b74dfcd27de
--- /dev/null
+++ b/rules/alfred.make
@@ -0,0 +1,68 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2014 by Markus Pargmann <[email protected]>
+#
+# 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 
<[email protected]>")
+       @$(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/[email protected])
+       @$(call install_alternative, alfred, 0, 0, 0644, 
/lib/systemd/system/[email protected])
+ifneq ($(PTXCONF_ALFRED_SYSTEMD_SERVICE_ALFRED_INTF),"")
+       @$(call install_link, alfred, ../[email protected], \
+       
/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, ../[email protected], \
+       
/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
-- 
2.0.0


-- 
ptxdist mailing list
[email protected]

Reply via email to