commit eb7e765e1b66330adc08c54f2606244da5c71597
Author: Yaroslav Shmelev <yars068@yandex.ru>
Date:   Thu Jan 7 05:59:44 2016 +0300

    makefiles: possiblity to disable systemd user dir

diff --git a/daemon/Makefile.am b/daemon/Makefile.am
index 79113c7..662ffb4 100644
--- a/daemon/Makefile.am
+++ b/daemon/Makefile.am
@@ -39,9 +39,11 @@ servicedir = $(DBUS_SERVICE_DIR)
 service_in_files = org.gtk.vfs.Daemon.service.in
 service_DATA = org.gtk.vfs.Daemon.service
 
-systemd_userdir = ${prefix}/lib/systemd/user
+if HAVE_SYSTEMD
+systemd_userdir = @systemd_user_units_dir@
 systemd_user_in_files = gvfs-daemon.service.in
 systemd_user_DATA = gvfs-daemon.service
+endif
 
 %.mount: %.mount.in ../config.log
    $(AM_V_GEN) $(SED) -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
@@ -141,13 +143,18 @@ noinst_DATA = $(mount_DATA:.mount=.localmount)
 
 EXTRA_DIST =                           \
    $(service_in_files)         \
-       $(systemd_user_in_files)        \
    $(mount_in_files)           \
    $(gvfs_gschemas_dist)               \
    $(gvfs_gschemas_convert_dist)       \
    $(gsettings_ENUM_FILES)             \
    $(NULL)
 
+if HAVE_SYSTEMD
+EXTRA_DIST += \
+       $(systemd_user_in_files)        \
+        $(NULL)
+endif
+
 DISTCLEANFILES = $(mount_DATA) $(noinst_DATA)
 
 CLEANFILES =                                   \
diff --git a/metadata/Makefile.am b/metadata/Makefile.am
index e15e40e..b050dd2 100644
--- a/metadata/Makefile.am
+++ b/metadata/Makefile.am
@@ -72,16 +72,22 @@ servicedir = $(DBUS_SERVICE_DIR)
 service_in_files = org.gtk.vfs.Metadata.service.in
 service_DATA = org.gtk.vfs.Metadata.service
 
-systemd_userdir = ${prefix}/lib/systemd/user
+if HAVE_SYSTEMD
+systemd_userdir = @systemd_user_units_dir@
 systemd_user_in_files = gvfs-metadata.service.in
 systemd_user_DATA = gvfs-metadata.service
+endif
 
 EXTRA_DIST =                           \
    $(service_in_files)         \
-       $(systemd_user_in_files)        \
    dbus-interface.xml          \
    $(NULL)
 
+if HAVE_SYSTEMD
+       $(systemd_user_in_files)        \
+        $(NULL)
+endif
+
 CLEANFILES =                           \
    $(dbus_built_sources)               \
    $(service_DATA)                     \
diff --git a/monitor/afc/Makefile.am b/monitor/afc/Makefile.am
index bde7a90..e8af95d 100644
--- a/monitor/afc/Makefile.am
+++ b/monitor/afc/Makefile.am
@@ -35,15 +35,19 @@ servicedir = $(datadir)/dbus-1/services
 service_in_files = org.gtk.vfs.AfcVolumeMonitor.service.in
 service_DATA = $(service_in_files:.service.in=.service)
 
-systemd_userdir = ${prefix}/lib/systemd/user
+if HAVE_SYSTEMD
+systemd_userdir = @systemd_user_units_dir@
 systemd_user_in_files = gvfs-afc-volume-monitor.service.in
 systemd_user_DATA = $(systemd_user_in_files:.service.in=.service)
+endif
 
 $(service_DATA): $(service_in_files) Makefile
    $(AM_V_GEN) $(SED) -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
 
+if HAVE_SYSTEMD
 $(systemd_user_DATA): $(systemd_user_in_files) Makefile
    $(AM_V_GEN) $(SED) -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
+endif
 
 CLEANFILES = \
    *~ \
@@ -58,3 +62,9 @@ EXTRA_DIST = \
    $(systemd_user_in_files) \
    $(remote_volume_monitors_DATA) \
    $(NULL)
+
+if HAVE_SYSTEMD
+EXTRA_DIST += \
+       $(systemd_user_in_files) \
+        $(NULL)
+endif
diff --git a/monitor/gdu/Makefile.am b/monitor/gdu/Makefile.am
index 0c5c4e8..b847f04 100644
--- a/monitor/gdu/Makefile.am
+++ b/monitor/gdu/Makefile.am
@@ -43,15 +43,19 @@ servicedir       = $(datadir)/dbus-1/services
 service_in_files = org.gtk.vfs.GduVolumeMonitor.service.in
 service_DATA     = $(service_in_files:.service.in=.service)
 
-systemd_userdir = ${prefix}/lib/systemd/user
+if HAVE_SYSTEMD
+systemd_userdir = @systemd_user_units_dir@
 systemd_user_in_files = gvfs-gdu-volume-monitor.service.in
 systemd_user_DATA = $(systemd_user_in_files:.service.in=.service)
+endif
 
 $(service_DATA): $(service_in_files) Makefile
    $(AM_V_GEN) $(SED) -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
 
+if HAVE_SYSTEMD
 $(systemd_user_DATA): $(systemd_user_in_files) Makefile
    $(AM_V_GEN) $(SED) -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
+endif
 
 CLEANFILES = \
    *~ \
@@ -66,3 +70,9 @@ EXTRA_DIST = \
    $(systemd_user_in_files) \
    $(remote_volume_monitors_DATA) \
    $(NULL)
+
+if HAVE_SYSTEMD
+EXTRA_DIST += \
+       $(systemd_user_in_files) \
+        $(NULL)
+endif
diff --git a/monitor/goa/Makefile.am b/monitor/goa/Makefile.am
index c1c45d9..819a2be 100644
--- a/monitor/goa/Makefile.am
+++ b/monitor/goa/Makefile.am
@@ -35,15 +35,19 @@ servicedir = $(datadir)/dbus-1/services
 service_in_files = org.gtk.vfs.GoaVolumeMonitor.service.in
 service_DATA = $(service_in_files:.service.in=.service)
 
-systemd_userdir = ${prefix}/lib/systemd/user
+if HAVE_SYSTEMD 
+systemd_userdir = @systemd_user_units_dir@
 systemd_user_in_files = gvfs-goa-volume-monitor.service.in
 systemd_user_DATA = $(systemd_user_in_files:.service.in=.service)
+endif
 
 $(service_DATA): $(service_in_files) Makefile
    $(AM_V_GEN) $(SED) -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
 
+if HAVE_SYTEMD
 $(systemd_user_DATA): $(systemd_user_in_files) Makefile
    $(AM_V_GEN) $(SED) -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
+endif
 
 CLEANFILES = \
    *~ \
@@ -55,6 +59,11 @@ CLEANFILES = \
 
 EXTRA_DIST = \
    $(service_in_files) \
-       $(systemd_user_in_files) \
    $(remote_volume_monitors_DATA) \
+        $(NULL)
+
+if HAVE_SYSTEMD
+EXTRA_DIST += \
+       $(systemd_user_in_files) \
    $(NULL)
+endif
diff --git a/monitor/gphoto2/Makefile.am b/monitor/gphoto2/Makefile.am
index 723fbbc..91e59b0 100644
--- a/monitor/gphoto2/Makefile.am
+++ b/monitor/gphoto2/Makefile.am
@@ -77,15 +77,19 @@ servicedir       = $(datadir)/dbus-1/services
 service_in_files = org.gtk.vfs.GPhoto2VolumeMonitor.service.in
 service_DATA     = $(service_in_files:.service.in=.service)
 
-systemd_userdir = ${prefix}/lib/systemd/user
+if HAVE_SYSTEMD
+systemd_userdir = @systemd_user_units_dir@
 systemd_user_in_files = gvfs-gphoto2-volume-monitor.service.in
 systemd_user_DATA = $(systemd_user_in_files:.service.in=.service)
+endif
 
 $(service_DATA): $(service_in_files) Makefile
    $(AM_V_GEN) $(SED) -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
 
+if HAVE_SYSTEMD
 $(systemd_user_DATA): $(systemd_user_in_files) Makefile
    $(AM_V_GEN) $(SED) -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
+endif
 
 CLEANFILES = \
    *~ \
@@ -98,6 +102,10 @@ CLEANFILES = \
 EXTRA_DIST = \
    hal-marshal.list \
    $(service_in_files) \
-       $(systemd_user_in_files) \
    $(remote_volume_monitors_DATA) \
    $(NULL)
+
+if HAVE_SYSTEMD
+EXTRA_DIST += \
+       $(systemd_user_in_files)
+endif
diff --git a/monitor/hal/Makefile.am b/monitor/hal/Makefile.am
index 888268f..ebdc2bd 100644
--- a/monitor/hal/Makefile.am
+++ b/monitor/hal/Makefile.am
@@ -56,16 +56,21 @@ servicedir       = $(datadir)/dbus-1/services
 service_in_files = org.gtk.vfs.HalVolumeMonitor.service.in
 service_DATA     = $(service_in_files:.service.in=.service)
 
-systemd_userdir = ${prefix}/lib/systemd/user
+if HAVE_SYSTEMD
+systemd_userdir = @systemd_user_units_dir@
 systemd_user_in_files = gvfs-hal-volume-monitor.service.in
 systemd_user_DATA = $(systemd_user_in_files:.service.in=.service)
+endif
 
 $(service_DATA): $(service_in_files) Makefile
    $(AM_V_GEN) $(SED) -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
 
+if HAVE_SYSTEMD
 $(systemd_user_DATA): $(systemd_user_in_files) Makefile
    $(AM_V_GEN) $(SED) -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
 
+endif
+
 CLEANFILES = \
    *~ \
    *.loT \
@@ -77,6 +82,11 @@ CLEANFILES = \
 EXTRA_DIST = \
    hal-marshal.list \
    $(service_in_files) \
-       $(systemd_user_in_files) \
    $(remote_volume_monitors_DATA) \
    $(NULL)
+
+if HAVE_SYSTEMD
+EXTRA_DIST += \
+       $(systemd_user_in_files) \
+        $(NULL)
+endif
diff --git a/monitor/mtp/Makefile.am b/monitor/mtp/Makefile.am
index 98e64b3..3620a06 100644
--- a/monitor/mtp/Makefile.am
+++ b/monitor/mtp/Makefile.am
@@ -40,15 +40,19 @@ servicedir       = $(datadir)/dbus-1/services
 service_in_files = org.gtk.vfs.MTPVolumeMonitor.service.in
 service_DATA     = $(service_in_files:.service.in=.service)
 
-systemd_userdir = ${prefix}/lib/systemd/user
+if HAVE_SYSTEMD
+systemd_userdir = @systemd_user_units_dir@
 systemd_user_in_files = gvfs-mtp-volume-monitor.service.in
 systemd_user_DATA = $(systemd_user_in_files:.service.in=.service)
+endif
 
 $(service_DATA): $(service_in_files) Makefile
    $(AM_V_GEN) $(SED) -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
 
+if HAVE_SYSTEMD
 $(systemd_user_DATA): $(systemd_user_in_files) Makefile
    $(AM_V_GEN) $(SED) -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
+endif
 
 CLEANFILES = \
    *~ \
@@ -63,3 +67,9 @@ EXTRA_DIST = \
    $(systemd_user_in_files) \
    $(remote_volume_monitors_DATA) \
    $(NULL)
+
+if HAVE_SYSTEMD
+EXTRA_DIST += \
+       $(systemd_user_in_files) \
+        $(NULL)
+endif
diff --git a/monitor/udisks2/Makefile.am b/monitor/udisks2/Makefile.am
index 5c0a801..9bd41a0 100644
--- a/monitor/udisks2/Makefile.am
+++ b/monitor/udisks2/Makefile.am
@@ -48,15 +48,19 @@ servicedir       = $(datadir)/dbus-1/services
 service_in_files = org.gtk.vfs.UDisks2VolumeMonitor.service.in
 service_DATA     = $(service_in_files:.service.in=.service)
 
-systemd_userdir = ${prefix}/lib/systemd/user
+if HAVE_SYSTEMD
+systemd_userdir = @systemd_user_units_dir@
 systemd_user_in_files = gvfs-udisks2-volume-monitor.service.in
 systemd_user_DATA = $(systemd_user_in_files:.service.in=.service)
+endif
 
 $(service_DATA): $(service_in_files) Makefile
    $(AM_V_GEN) $(SED) -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
 
+if HAVE_SYSTEMD
 $(systemd_user_DATA): $(systemd_user_in_files) Makefile
    $(AM_V_GEN) $(SED) -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
+endif
 
 CLEANFILES = \
    *~ \
@@ -72,3 +76,9 @@ EXTRA_DIST = \
    $(systemd_user_in_files) \
    $(remote_volume_monitors_DATA) \
    $(NULL)
+
+if HAVE_SYSTEMD
+EXTRA_DIST += \
+       $(systemd_user_in_files) \
+        $(NULL)
+endif

commit 53fdc38c830cab962e4388519014f8ae9ea3ef91
Author: Yaroslav Shmelev <yars068@yandex.ru>
Date:   Thu Jan 7 02:04:03 2016 +0300

    configure.ac: add possiblity to disable systemd-userdir

diff --git a/configure.ac b/configure.ac
index bb358c6..70da802 100644
--- a/configure.ac
+++ b/configure.ac
@@ -260,6 +260,26 @@ fi
 
 AM_CONDITIONAL(USE_UDISKS2, [test "$msg_udisks2" = "yes"])
 
+dnl ****************************************
+dnl *** Check for systemd user units dir ***
+dnl ****************************************
+
+sustemd_user_dir=${prefix}/lib/systemd/user
+AC_ARG_WITH([systemd-userunits], 
+    [AS_HELP_STRING([--with-systemd-userunits=PATH],
+         [enable or disable systemd user units support, defaults to no])], 
+       [systemd_user_units=$withval],
+       [msg_systemd_user_units=no])
+    
+if test "x$systemd_user_units" != "xno"; then
+    PKG_CHECK_MODULES([SYSTEMD], [systemd >= 219],
+        AC_SUBST(systemd_user_units_dir, [$systemd_user_dir]))
+fi
+
+msg_systemd_user_units=${systemd_user_units}
+
+AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$systemd_user_units" != "xno"])
+
 dnl **********************************
 dnl *** Check for libsystemd-login ***
 dnl **********************************
@@ -923,33 +943,34 @@ AC_OUTPUT
 echo 
 echo "gvfs configuration summary:"
 echo "
-        gio module directory : $giomodulesdir
-
-        hotplug backend:              $msg_hotplug_backend
-
-       Blu-ray metadata support:     $msg_bluray
-       Google support:               $msg_google
-        HTTP/WebDAV support:          $msg_http
-       Samba support:                $msg_samba
-       FUSE support:                 $msg_fuse
-        CDDA support:                 $msg_cdda
-        Gphoto2 support:              $msg_gphoto2
-        MTP support:                  $msg_libmtp
-       archive support:              $msg_archive
-       AFC support:                  $msg_afc
-        AFP support:                  $msg_afp
-        NFS support:                  $msg_nfs
-        DNS-SD support:               $msg_avahi
-       Build HAL volume monitor:     $msg_hal (with fast init path: $have_hal_fast_init)
-       Build GDU volume monitor:     $msg_gdu
-       Build udisks2 volume monitor: $msg_udisks2
-       Build GOA volume monitor:     $msg_goa
-        Use libsystemd-login:         $msg_libsystemd_login
-        Use GCR:                      $msg_gcr
-       GNOME Keyring support:        $msg_keyring
-       GTK+ support:                 $msg_gtk
-       Bash-completion support:      $msg_bash_completion
-       Installed tests:              $msg_installed_tests
+        gio module directory :            $giomodulesdir
+
+        hotplug backend:                  $msg_hotplug_backend
+
+        Blu-ray metadata support:         $msg_bluray
+        Google support:                   $msg_google
+        HTTP/WebDAV support:              $msg_http
+        Samba support:                    $msg_samba
+        FUSE support:                     $msg_fuse
+        CDDA support:                     $msg_cdda
+        Gphoto2 support:                  $msg_gphoto2
+        MTP support:                      $msg_libmtp
+        archive support:                  $msg_archive
+        AFC support:                      $msg_afc
+        AFP support:                      $msg_afp
+        NFS support:                      $msg_nfs
+        DNS-SD support:                   $msg_avahi
+        Build HAL volume monitor:         $msg_hal (with fast init path: $have_hal_fast_init)
+        Build GDU volume monitor:         $msg_gdu
+        Build udisks2 volume monitor:     $msg_udisks2
+        Build GOA volume monitor:         $msg_goa
+        Use libsystemd-login:             $msg_libsystemd_login
+        Use GCR:                          $msg_gcr
+        GNOME Keyring support:            $msg_keyring
+        GTK+ support:                     $msg_gtk
+        Bash-completion support:          $msg_bash_completion
+        Directory for systemd user units: $msg_systemd_user_units
+        Installed tests:                  $msg_installed_tests
 "
 
 # The gudev gphoto monitor needs a recent libgphoto; point to the required patch if the version is too old
