Signed-off-by: Peter Hutterer <[email protected]>
---
 conf/.gitignore                    |  1 +
 conf/Makefile.am                   | 19 +++++++++++++++++++
 conf/[email protected] |  7 +++++++
 conf/wacom.rules                   | 17 +++++++++++++++++
 configure.ac                       | 18 ++++++++++++++++++
 5 files changed, 62 insertions(+)
 create mode 100644 conf/.gitignore
 create mode 100644 conf/[email protected]
 create mode 100644 conf/wacom.rules

diff --git a/conf/.gitignore b/conf/.gitignore
new file mode 100644
index 0000000..17c9edb
--- /dev/null
+++ b/conf/.gitignore
@@ -0,0 +1 @@
[email protected]
diff --git a/conf/Makefile.am b/conf/Makefile.am
index ab138f5..1ce39ba 100644
--- a/conf/Makefile.am
+++ b/conf/Makefile.am
@@ -1,6 +1,25 @@
+CLEANFILES=
+
 if HAS_XORG_CONF_DIR
 dist_config_DATA = 50-wacom.conf
 else
 fdidir = $(datadir)/hal/fdi/policy/20thirdparty
 dist_fdi_DATA = wacom.fdi
 endif
+
+if HAVE_SYSTEMD_UNIT_DIR
+unitdir = $(SYSTEMD_UNIT_DIR)
+unit_DATA = [email protected]
+
+$(unit_DATA): $(unit_DATA).in
+       $(AM_V_GEN)$(SED) -e 's|__BIN_PREFIX__|$(bindir)|g' < $< > $@ 
+
+CLEANFILES += [email protected]
+endif
+
+if HAVE_UDEV_RULES_DIR
+udevdir=$(UDEV_RULES_DIR)
+udev_DATA = wacom.rules
+endif
+
+EXTRA_DIST = wacom.rules [email protected]
diff --git a/conf/[email protected] 
b/conf/[email protected]
new file mode 100644
index 0000000..4cfdcfd
--- /dev/null
+++ b/conf/[email protected]
@@ -0,0 +1,7 @@
+[Unit]
+Description=inputattach for Wacom ISDv4-compatible serial devices
+
+[Service]
+Type=simple
+ExecStart=__BIN_PREFIX__/isdv4-serial-inputattach /dev/%I
+Restart=on-success
diff --git a/conf/wacom.rules b/conf/wacom.rules
new file mode 100644
index 0000000..6093af3
--- /dev/null
+++ b/conf/wacom.rules
@@ -0,0 +1,17 @@
+ACTION!="add|change", GOTO="wacom_end"
+
+# Match all serial wacom tablets with a serial ID starting with WACf
+# Notes: We assign NAME though we shouldn't, but currently the server requires 
it
+#        We assign the lot to subsystem pnp too because server reads NAME from
+#        the parent device. Once all that's fixed, as simple SUBSYSTEM="tty"
+#        will do and the ENV{NAME} can be removed.
+SUBSYSTEM=="tty|pnp", SUBSYSTEMS=="pnp", ATTRS{id}=="WACf*", 
ENV{ID_MODEL}="Serial Wacom Tablet $attr{id}", ENV{ID_INPUT}="1", 
ENV{ID_INPUT_TABLET}="1", ENV{NAME}="Serial Wacom Tablet $attr{id}"
+SUBSYSTEM=="tty|pnp", SUBSYSTEMS=="pnp", ATTRS{id}=="FUJ*", 
ENV{ID_MODEL}="Serial Wacom Tablet $attr{id}", ENV{ID_INPUT}="1", 
ENV{ID_INPUT_TABLET}="1", ENV{NAME}="Serial Wacom Tablet $attr{id}"
+
+# comment out the next line if your distribution does not provide systemd
+# If a /dev/ttySx device with the WACf name is detected, start the
+# wacom-inputattach service with the kernel name as parameter
+SUBSYSTEM=="tty|pnp", KERNEL=="ttyS[0-9]*", ATTRS{id}=="WACf*", 
TAG+="systemd", ENV{SYSTEMD_WANTS}+="wacom-inputattach@%k.service"
+
+LABEL="wacom_end"
+
diff --git a/configure.ac b/configure.ac
index be211f8..a762ad5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -146,6 +146,24 @@ if test "x$UNITTESTS" = xyes; then
 fi
 AM_CONDITIONAL(UNITTESTS, [test "x$UNITTESTS" = xyes])
 
+AC_ARG_WITH([systemd-unit-dir],
+            AS_HELP_STRING([--with-systemd-unit-dir=DIR],
+                           [systemd unit directory 
[[default=$libdir/systemd/system]]]),
+            [unitdir="$withval"],
+            [unitdir="$libdir/systemd/system"])
+SYSTEMD_UNIT_DIR=${unitdir}
+AC_SUBST(SYSTEMD_UNIT_DIR)
+AM_CONDITIONAL(HAVE_SYSTEMD_UNIT_DIR, [test "x$SYSTEMD_UNIT_DIR" != "xno"])
+
+AC_ARG_WITH(udev-rules-dir,                                                   
+            AS_HELP_STRING([--with-udev-rules-dir=DIR],
+                           [Directory where udev expects its rules files
+                           [[default=$libdir/udev/rules.d]]]),
+            [udevdir="$withval"],                   
+            [udevdir="$libdir/udev/rules.d"])
+UDEV_RULES_DIR=${udevdir}
+AC_SUBST(UDEV_RULES_DIR)                                               
+AM_CONDITIONAL(HAVE_UDEV_RULES_DIR, [test "x$UDEV_RULES_DIR" != "xno"])
 
 
 # -----------------------------------------------------------------------------
-- 
1.8.5.3


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Linuxwacom-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to