Init: Dynamically check systemd installation path
authorBrian McGillion <brian.mcgillion@intel.com>
Wed, 2 May 2012 06:34:55 +0000 (09:34 +0300)
committerBrian McGillion <brian.mcgillion@intel.com>
Wed, 2 May 2012 06:34:55 +0000 (09:34 +0300)
Makefile.am
autogen.sh
configure.ac
init/Makefile.am
init/smack.mount
init/smack.service

index 4f90bc5..c7e156a 100644 (file)
@@ -1,4 +1,7 @@
 ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
 AM_MAKEFLAGS = --no-print-directory
 
+DISTCHECK_CONFIGURE_FLAGS = \
+       --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
+
 SUBDIRS = libsmack utils doc init
index f8cd5e8..219fb1b 100755 (executable)
@@ -1,4 +1,4 @@
 #!/bin/sh -e
 
 autoreconf --install --symlink
-./configure --prefix="/usr"
+./configure --prefix="/usr" $@
index 6e4d7a1..9f9ce2b 100644 (file)
@@ -1,9 +1,9 @@
 AC_PREREQ(2.60)
 AC_INIT([libsmack],
        [1.0],
-       [jarkko.sakkinen@iki.fi],
+       [jarkko.sakkinen@intel.com],
        [libsmack],
-       [https://github.com/jarkkos/smack])
+       [https://github.com/organizations/smack-team/smack])
 AC_CONFIG_SRCDIR([libsmack/libsmack.c])
 AC_CONFIG_AUX_DIR([build-aux])
 AM_INIT_AUTOMAKE([-Wall -Werror dist-bzip2 foreign])
@@ -23,6 +23,14 @@ fi
 AM_CONDITIONAL([ENABLE_DOXYGEN],[test ! -z "$DOXYGEN"], [Build API documentation.])
 AC_SUBST([DOXYGEN], [$DOXYGEN])
 
+# systemd
+AC_ARG_WITH([systemdsystemunitdir],
+        AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
+        [],
+        [with_systemdsystemunitdir=$(pkg-config --silence-errors --variable=systemdsystemunitdir systemd)])
+AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
+AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir"])
+
 AC_CONFIG_FILES([Makefile libsmack/Makefile libsmack/libsmack.pc utils/Makefile doc/Makefile init/Makefile])
 
 AC_OUTPUT
index 8fad8e5..8dd3ac4 100644 (file)
@@ -1,2 +1,5 @@
-initdir = /lib/systemd/system
-init_DATA = smack.mount smack.service
+if HAVE_SYSTEMD
+systemdsystemunit_DATA = \
+        smack.mount \
+        smack.service
+endif
index 312e077..2a81668 100644 (file)
@@ -1,6 +1,6 @@
 [Unit]
 Description=Smack filesystem mounting
-Before=local-fs.target
+WantedBy=local-fs.target
 
 [Mount]
 What=smackfs
index ac4115c..2b689a5 100644 (file)
@@ -1,5 +1,8 @@
 [Unit]
 Description=Smack
+DefaultDependencies=no
+After=smack.mount
+Requires=smack.mount
 After=basic.target
 
 [Service]