On Fri, Aug 30, 2019 at 11:06:32AM +0200, Oleksij Rempel wrote:
> Socketcand is a daemon that provides access to CAN interfaces on a
> machine via a network interface. The communication protocol uses a
> TCP/IP connection and a specific protocol to transfer CAN frames and
> control commands.
> 
> Signed-off-by: Oleksij Rempel <[email protected]>
> ---
>  .../socketcand-0.4.2-27-gec47073/autogen.sh   |  1 +
>  projectroot/etc/socketcand.conf               | 19 +++++++
>  .../usr/lib/systemd/system/socketcand.service |  7 +++
>  rules/socketcand.in                           | 12 ++++
>  rules/socketcand.make                         | 56 +++++++++++++++++++
>  5 files changed, 95 insertions(+)
>  create mode 120000 patches/socketcand-0.4.2-27-gec47073/autogen.sh
>  create mode 100644 projectroot/etc/socketcand.conf
>  create mode 100644 projectroot/usr/lib/systemd/system/socketcand.service
>  create mode 100644 rules/socketcand.in
>  create mode 100644 rules/socketcand.make
> 
> diff --git a/patches/socketcand-0.4.2-27-gec47073/autogen.sh 
> b/patches/socketcand-0.4.2-27-gec47073/autogen.sh
> new file mode 120000
> index 000000000..9f8a4cb7d
> --- /dev/null
> +++ b/patches/socketcand-0.4.2-27-gec47073/autogen.sh
> @@ -0,0 +1 @@
> +../autogen.sh
> \ No newline at end of file
> diff --git a/projectroot/etc/socketcand.conf b/projectroot/etc/socketcand.conf
> new file mode 100644
> index 000000000..0fdc19d07
> --- /dev/null
> +++ b/projectroot/etc/socketcand.conf
> @@ -0,0 +1,19 @@
> +# The network interface the socketcand will bind to
> +# listen = "eth0";
> +
> +# The port the socketcand is listening on
> +# port = 29536;
> +
> +# List of busses the daemon shall provide access to
> +# Multiple busses must be separated with ',' and whitespace
> +# is not allowed. eg "vcan0,vcan1"
> +busses = "can0";
> +
> +# Description of the service. This will show up in the discovery beacon
> +# description = "socketcand";
> +
> +# AF_UNIX name. As alternative to bind to a TCP/IP socket the socketcand can
> +# listen on an AF_UNIX socket.
> +# When afuxname starts with a '/' a path for the AF_UNIX socket is created.
> +# Alternatively an abstact AF_UNIX namespace is allocated with afuxname
> +# afuxname = "socketcand";
> diff --git a/projectroot/usr/lib/systemd/system/socketcand.service 
> b/projectroot/usr/lib/systemd/system/socketcand.service
> new file mode 100644
> index 000000000..3c1030676
> --- /dev/null
> +++ b/projectroot/usr/lib/systemd/system/socketcand.service
> @@ -0,0 +1,7 @@
> +[Unit]
> +Description=Server to access CAN sockets over ASCII protocol
> +After=network.target
> +
> +[Service]
> +ExecStart=/usr/bin/socketcand
> +Restart=always
> diff --git a/rules/socketcand.in b/rules/socketcand.in
> new file mode 100644
> index 000000000..779721208
> --- /dev/null
> +++ b/rules/socketcand.in
> @@ -0,0 +1,12 @@
> +## SECTION=communication
> +
> +config SOCKETCAND
> +     tristate
> +     prompt "socketcand"
> +     select LIBCONFIG
> +     help
> +       Socketcand is a daemon that provides access to CAN interfaces on a
> +       machine via a network interface. The communication protocol uses a
> +       TCP/IP connection and a specific protocol to transfer CAN frames and
> +       control commands.
> +
> diff --git a/rules/socketcand.make b/rules/socketcand.make
> new file mode 100644
> index 000000000..ecff9e05b
> --- /dev/null
> +++ b/rules/socketcand.make
> @@ -0,0 +1,56 @@
> +# -*-makefile-*-
> +#
> +# Copyright (C) 2019 by Oleksij Rempel <[email protected]>
> +#
> +# For further information about the PTXdist project and license conditions
> +# see the README file.
> +#
> +
> +#
> +# We provide this package
> +#
> +PACKAGES-$(PTXCONF_SOCKETCAND) += socketcand
> +
> +#
> +# Paths and names
> +#
> +SOCKETCAND_VERSION   := 0.4.2-27-gec47073
> +SOCKETCAND_MD5               := 2b32adf77d359af0f3cca27050e2c32d
> +SOCKETCAND           := socketcand-$(SOCKETCAND_VERSION)
> +SOCKETCAND_SUFFIX    := tar.gz
> +SOCKETCAND_URL               := 
> https://github.com/linux-can/socketcand/archive/$(SOCKETCAND_VERSION).$(SOCKETCAND_SUFFIX)
> +SOCKETCAND_SOURCE    := $(SRCDIR)/$(SOCKETCAND).$(SOCKETCAND_SUFFIX)
> +SOCKETCAND_DIR               := $(BUILDDIR)/$(SOCKETCAND)
> +SOCKETCAND_LICENSE   := GPL-2.0
> +
> +# 
> ----------------------------------------------------------------------------
> +# Prepare
> +# 
> ----------------------------------------------------------------------------
> +
> +SOCKETCAND_CONF_TOOL := autoconf
> +
> +# 
> ----------------------------------------------------------------------------
> +# Target-Install
> +# 
> ----------------------------------------------------------------------------
> +
> +$(STATEDIR)/socketcand.targetinstall:
> +     @$(call targetinfo)
> +
> +     @$(call install_init, socketcand)
> +     @$(call install_fixup, socketcand,PRIORITY,optional)
> +     @$(call install_fixup, socketcand,SECTION,base)
> +     @$(call install_fixup, socketcand,AUTHOR,"Oleksij Rempel 
> <[email protected]>")
> +     @$(call install_fixup, socketcand,DESCRIPTION,missing)
> +
> +        @$(call install_link, socketcand, ../socketcand.service, \
> +                
> /usr/lib/systemd/system/multi-user.target.wants/socketcand.service)

Indent with tabs.

> +     @$(call install_alternative, socketcand, 0, 0, 0644, 
> /usr/lib/systemd/system/socketcand.service)

There should be a SOCKETCAND_SYSTEMD_UNIT option for this.

Michael

> +     @$(call install_alternative, socketcand, 0, 0, 0644, 
> /etc/socketcand.conf)
> +     @$(call install_copy, socketcand, 0, 0, 0755, -, /usr/bin/socketcand)
> +     @$(call install_copy, socketcand, 0, 0, 0755, -, /usr/bin/socketcandcl)
> +
> +     @$(call install_finish, socketcand)
> +
> +     @$(call touch)
> +
> +# vim: syntax=make
> -- 
> 2.23.0
> 
> 
> _______________________________________________
> ptxdist mailing list
> [email protected]
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
[email protected]

Reply via email to