[phodav] build-sys: fix distcheck



commit 53dcbfa4ce91797bc923b7671a68fc2115d8eae9
Author: Marc-André Lureau <marcandre lureau gmail com>
Date:   Wed Feb 5 13:24:13 2014 +0100

    build-sys: fix distcheck

 Makefile.am  |   12 ++++++++++--
 configure.ac |   13 +++++++++++--
 2 files changed, 21 insertions(+), 4 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 5b5d1e0..5d64acc 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -66,13 +66,17 @@ chezdav_LDADD =                     \
        $(AVAHI_LIBS)           \
        $(NULL)
 
+if HAVE_SYSTEMD
 systemdunitdir = $(SYSTEMDSYSTEMUNITDIR)
 systemdunit_DATA = \
        $(top_srcdir)/data/spice-webdavd.service \
        $(top_srcdir)/data/spice-webdavd.target
+endif
 
-udevrulesdir = /lib/udev/rules.d
-udevrules_DATA = $(top_srcdir)/data/70-spice-webdavd.rules
+if HAVE_UDEV
+udevdir = $(UDEVDIR)/rules.d
+udev_DATA = $(top_srcdir)/data/70-spice-webdavd.rules
+endif
 
 BUILT_SOURCES += $(top_srcdir)/.version
 $(top_srcdir)/.version:
@@ -93,4 +97,8 @@ MAINTAINERCLEANFILES =                                        \
        $(GITIGNORE_MAINTAINERCLEANFILES_MAKEFILE_IN)   \
        $(GITIGNORE_MAINTAINERCLEANFILES_M4_LIBTOOL)
 
+DISTCHECK_CONFIGURE_FLAGS =                                                    \
+       --with-systemdsystemunitdir='$${libdir}/systemd/system-distcheck'       \
+       --with-udevdir='$${libdir}/udev-distcheck'
+
 -include $(top_srcdir)/git.mk
diff --git a/configure.ac b/configure.ac
index ca96ec4..1ab02dc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -101,8 +101,17 @@ else
   have_pie=no
 fi
 
-SYSTEMDSYSTEMUNITDIR=`${PKG_CONFIG} systemd --variable=systemdsystemunitdir`
-AC_SUBST(SYSTEMDSYSTEMUNITDIR)
+AC_ARG_WITH([systemdsystemunitdir],
+            AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
+            [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
+AC_SUBST([SYSTEMDSYSTEMUNITDIR], [$with_systemdsystemunitdir])
+AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$systemdsystemunitdir"])
+
+AC_ARG_WITH([udevdir],
+            AS_HELP_STRING([--with-udevdir=DIR], [Directory for udev files]),
+            [], [with_udevdir=$($PKG_CONFIG --variable=udevdir udev)])
+AC_SUBST([UDEVDIR], [$with_udevdir])
+AM_CONDITIONAL(HAVE_UDEV, [test -n "$with_udevdir"])
 
 AC_ARG_VAR([XMLTO], [Path to xmlto command])
 AC_PATH_PROG([XMLTO], [xmlto])


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]