Skip to content

Commit

Permalink
Init: Dynamically check systemd installation path
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian McGillion committed May 2, 2012
1 parent b669b93 commit f320b95
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 6 deletions.
3 changes: 3 additions & 0 deletions 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
2 changes: 1 addition & 1 deletion autogen.sh
@@ -1,4 +1,4 @@
#!/bin/sh -e

autoreconf --install --symlink
./configure --prefix="/usr"
./configure --prefix="/usr" $@
12 changes: 10 additions & 2 deletions 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])
Expand All @@ -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
7 changes: 5 additions & 2 deletions 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
2 changes: 1 addition & 1 deletion init/smack.mount
@@ -1,6 +1,6 @@
[Unit]
Description=Smack filesystem mounting
Before=local-fs.target
WantedBy=local-fs.target

[Mount]
What=smackfs
Expand Down
3 changes: 3 additions & 0 deletions init/smack.service
@@ -1,5 +1,8 @@
[Unit]
Description=Smack
DefaultDependencies=no
After=smack.mount
Requires=smack.mount
After=basic.target

[Service]
Expand Down

0 comments on commit f320b95

Please sign in to comment.