From f320b9556aed087e6dc830d3629d391517fc930a Mon Sep 17 00:00:00 2001 From: Brian McGillion Date: Wed, 2 May 2012 09:34:55 +0300 Subject: [PATCH] Init: Dynamically check systemd installation path --- Makefile.am | 3 +++ autogen.sh | 2 +- configure.ac | 12 ++++++++++-- init/Makefile.am | 7 +++++-- init/smack.mount | 2 +- init/smack.service | 3 +++ 6 files changed, 23 insertions(+), 6 deletions(-) diff --git a/Makefile.am b/Makefile.am index 4f90bc5..c7e156a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 diff --git a/autogen.sh b/autogen.sh index f8cd5e8..219fb1b 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,4 +1,4 @@ #!/bin/sh -e autoreconf --install --symlink -./configure --prefix="/usr" +./configure --prefix="/usr" $@ diff --git a/configure.ac b/configure.ac index 6e4d7a1..9f9ce2b 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/init/Makefile.am b/init/Makefile.am index 8fad8e5..8dd3ac4 100644 --- a/init/Makefile.am +++ b/init/Makefile.am @@ -1,2 +1,5 @@ -initdir = /lib/systemd/system -init_DATA = smack.mount smack.service +if HAVE_SYSTEMD +systemdsystemunit_DATA = \ + smack.mount \ + smack.service +endif diff --git a/init/smack.mount b/init/smack.mount index 312e077..2a81668 100644 --- a/init/smack.mount +++ b/init/smack.mount @@ -1,6 +1,6 @@ [Unit] Description=Smack filesystem mounting -Before=local-fs.target +WantedBy=local-fs.target [Mount] What=smackfs diff --git a/init/smack.service b/init/smack.service index ac4115c..2b689a5 100644 --- a/init/smack.service +++ b/init/smack.service @@ -1,5 +1,8 @@ [Unit] Description=Smack +DefaultDependencies=no +After=smack.mount +Requires=smack.mount After=basic.target [Service]