--- /dev/null
+Spice agent for guests offering the following features:
+
+Features:
+* Client mouse mode (no need to grab mouse by client, no mouse lag)
+ this is handled by the daemon by feeding mouse events into the kernel
+ via uinput. This will only work if the active X-session is running a
+ spice-vdagent process so that its resolution can be determined.
+* Automatic adjustment of the X-session resolution to the client resolution
+* Support of copy and paste (text and images) between the active X-session
+ and the client
--- /dev/null
+# $NetBSD$
+
+DISTNAME= spice-vdagent-0.19.0
+CATEGORIES= sysutils
+MASTER_SITES= https://www.spice-space.org/download/releases/
+EXTRACT_SUFX= .tar.bz2
+
+MAINTAINER= pkgsrc-users@NetBSD.org
+HOMEPAGE= https://spice-space.org/
+COMMENT= Agent for Spice guests
+LICENSE= gnu-gpl-v3
+
+GNU_CONFIGURE= yes
+USE_TOOLS+= pkg-config
+
+CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFBASEDIR}
+
+INSTALL_MAKE_FLAGS+= sysconfdir=${PREFIX}/share/examples/${PKGBASE}
+
+MAKE_DIRS+= ${PKG_SYSCONFBASEDIR}/xdg/autostart
+CONF_FILES+= ${PREFIX}/share/examples/${PKGBASE}/xdg/autostart/spice-vdagent.desktop \
+ ${PKG_SYSCONFBASEDIR}/xdg/autostart/spice-vdagent.desktop
+
+.include "../../sysutils/dbus/buildlink3.mk"
+.include "../../audio/alsa-lib/buildlink3.mk"
+.include "../../devel/glib2/buildlink3.mk"
+.include "../../sysutils/spice-protocol/buildlink3.mk"
+.include "../../x11/libXinerama/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
--- /dev/null
+@comment $NetBSD$
+bin/spice-vdagent
+man/man1/spice-vdagent.1
+man/man1/spice-vdagentd.1
+sbin/spice-vdagentd
+share/examples/spice-vdagent/xdg/autostart/spice-vdagent.desktop
+share/gdm/autostart/LoginWindow/spice-vdagent.desktop
+share/gdm/greeter/autostart/spice-vdagent.desktop
+@pkgdir var/run/spice-vdagentd
--- /dev/null
+$NetBSD$
+
+SHA1 (spice-vdagent-0.19.0.tar.bz2) = ba2297228f26c60fe33539f15dd7e9bf2d216888
+RMD160 (spice-vdagent-0.19.0.tar.bz2) = 68c5b4016247be02e04fd924d70a3222f51866c0
+SHA512 (spice-vdagent-0.19.0.tar.bz2) = f5056dfe66df3ee8205549be22bbc8c17d2196c8448eda97f01659ff30c34d9929f330767d7fafec557dc5f7fb9b65eaf85973193b38df774042de9b72d6e60d
+Size (spice-vdagent-0.19.0.tar.bz2) = 151356 bytes
+SHA1 (patch-src_udscs.c) = 12439cbb7e6a14ee2cd6b15ef8e4ef4e629f7e24
+SHA1 (patch-src_vdagentd_uinput.c) = 2d38ccfdb96bfabd456f0b033a4a0d936d5f97a3
--- /dev/null
+$NetBSD$
+
+Add NetBSD support.
+
+--- src/udscs.c.orig 2019-02-11 11:16:16.000000000 +0000
++++ src/udscs.c
+@@ -34,6 +34,15 @@
+ #include "udscs.h"
+ #include "vdagentd-proto-strings.h"
+
++#if defined(__NetBSD__)
++#include <sys/param.h>
++#include <sys/ucred.h>
++#define ucred unpcbid
++#include <sys/un.h>
++#define SO_PEERCRED LOCAL_PEEREID
++#define pid unp_pid
++#endif
++
+ struct udscs_buf {
+ uint8_t *buf;
+ size_t pos;
--- /dev/null
+$NetBSD$
+
+Add NetBSD support.
+
+--- src/vdagentd/uinput.c.orig 2019-02-11 11:16:16.000000000 +0000
++++ src/vdagentd/uinput.c
+@@ -26,12 +26,15 @@
+ #include <unistd.h>
+ #include <fcntl.h>
+ #include <errno.h>
++#if defined(__linux__)
+ #include <linux/input.h>
+ #include <linux/uinput.h>
++#endif
+ #include <spice/vd_agent.h>
+ #include <glib.h>
+ #include "uinput.h"
+
++#if defined(__linux__)
+ struct vdagentd_uinput {
+ const char *devname;
+ int fd;
+@@ -265,3 +268,31 @@ void vdagentd_uinput_do_mouse(struct vda
+ if (*uinputp)
+ uinput->last = *mouse;
+ }
++#elif defined(__NetBSD__)
++struct vdagentd_uinput {
++};
++
++void vdagentd_uinput_do_mouse(struct vdagentd_uinput **uinputp,
++ VDAgentMouseState *mouse)
++{
++}
++
++void vdagentd_uinput_destroy(struct vdagentd_uinput **uinputp)
++{
++}
++
++void vdagentd_uinput_update_size(struct vdagentd_uinput **uinputp,
++ int width, int height,
++ struct vdagentd_guest_xorg_resolution *screen_info,
++ int screen_count)
++{
++}
++
++struct vdagentd_uinput *vdagentd_uinput_create(const char *devname,
++ int width, int height,
++ struct vdagentd_guest_xorg_resolution *screen_info, int screen_count,
++ int debug, int fake)
++{
++ return NULL;
++}
++#endif