build-sys: perform autodetection of quota-tools binaries
authorDave Reisner <dreisner@archlinux.org>
Sun, 2 Sep 2012 21:28:30 +0000 (17:28 -0400)
committerLennart Poettering <lennart@poettering.net>
Mon, 10 Sep 2012 23:43:48 +0000 (01:43 +0200)
Use AC_PATH_PROG to try and locate the quotaon and quotacheck binaries,
falling back on hardcoded defaults when they can't be found.

Makefile.am
configure.ac
units/.gitignore
units/quotaon.service [deleted file]
units/quotaon.service.in [new file with mode: 0644]
units/systemd-quotacheck.service.in

index 135d9f8ab19b8ca9f7740f221255f0250fa3b6f0..730db1d5a888403b65fd687bd7c74a0808d39c53 100644 (file)
@@ -382,6 +382,7 @@ EXTRA_DIST += \
        units/debug-shell.service.in \
        units/systemd-hibernate.service.in \
        units/systemd-suspend.service.in \
+       units/quotaon.service.in \
        introspect.awk \
        man/custom-html.xsl
 
@@ -2794,6 +2795,9 @@ endif
 EXTRA_DIST += \
        units/systemd-quotacheck.service.in
 
+nodist_systemunit_DATA += \
+       units/quotaon.service
+
 # ------------------------------------------------------------------------------
 if ENABLE_RANDOMSEED
 rootlibexec_PROGRAMS += \
@@ -3427,6 +3431,8 @@ SED_PROCESS = \
                -e 's,@rootprefix\@,$(rootprefix),g' \
                -e 's,@udevlibexecdir\@,$(udevlibexecdir),g' \
                -e 's,@sushell\@,$(sushell),g' \
+               -e 's,@QUOTAON\@,$(QUOTAON),g' \
+               -e 's,@QUOTACHECK\@,$(QUOTACHECK),g' \
                < $< > $@
 
 units/%: units/%.in Makefile
index f1b88384f1730e5a3a9a0cfa0cd5f4aa8fc65a3c..b13249955620eb12c1552cc01d6159cd68b67ba4 100644 (file)
@@ -64,6 +64,9 @@ AC_PROG_GCC_TRADITIONAL
 AC_PATH_PROG([M4], [m4])
 AC_PATH_PROG([XSLTPROC], [xsltproc])
 
+AC_PATH_PROG([QUOTAON], [quotaon], [/sbin/quotaon])
+AC_PATH_PROG([QUOTACHECK], [quotacheck], [/sbin/quotacheck])
+
 # gtkdocize greps for '^GTK_DOC_CHECK', so it needs to be on its own line
 m4_ifdef([GTK_DOC_CHECK], [
 GTK_DOC_CHECK([1.18],[--flavour no-tmpl])
index de5117914d298fb48a20eb7b2067b3fca2e83c9a..74bff5431fcea34ca024717b59157418ef251e5f 100644 (file)
@@ -14,6 +14,7 @@
 /rescue.service
 /systemd-ask-password-wall.service
 /systemd-quotacheck.service
+/quotaon.service
 /systemd-fsck@.service
 /systemd-fsck-root.service
 /systemd-tmpfiles-clean.service
diff --git a/units/quotaon.service b/units/quotaon.service
deleted file mode 100644 (file)
index caaf12d..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-#  This file is part of systemd.
-#
-#  systemd is free software; you can redistribute it and/or modify it
-#  under the terms of the GNU Lesser General Public License as published by
-#  the Free Software Foundation; either version 2.1 of the License, or
-#  (at your option) any later version.
-
-[Unit]
-Description=Enable File System Quotas
-Documentation=man:quotaon(8)
-DefaultDependencies=no
-After=systemd-readahead-collect.service systemd-readahead-replay.service systemd-quotacheck.service
-Before=local-fs.target shutdown.target
-ConditionPathExists=/sbin/quotaon
-
-[Service]
-Type=oneshot
-RemainAfterExit=yes
-ExecStart=/sbin/quotaon -aug
diff --git a/units/quotaon.service.in b/units/quotaon.service.in
new file mode 100644 (file)
index 0000000..49a50a7
--- /dev/null
@@ -0,0 +1,19 @@
+#  This file is part of systemd.
+#
+#  systemd is free software; you can redistribute it and/or modify it
+#  under the terms of the GNU Lesser General Public License as published by
+#  the Free Software Foundation; either version 2.1 of the License, or
+#  (at your option) any later version.
+
+[Unit]
+Description=Enable File System Quotas
+Documentation=man:quotaon(8)
+DefaultDependencies=no
+After=systemd-readahead-collect.service systemd-readahead-replay.service systemd-quotacheck.service
+Before=local-fs.target shutdown.target
+ConditionPathExists=@QUOTAON@
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=@QUOTAON@ -aug
index 319a3ced48c3da12df7d42d9ae4b819fd97c5916..f726ea1bcd2c3389e9eb4c2cd327ab570fb66b34 100644 (file)
@@ -11,7 +11,7 @@ Documentation=man:systemd-quotacheck.service(8)
 DefaultDependencies=no
 After=systemd-readahead-collect.service systemd-readahead-replay.service systemd-remount-fs.service
 Before=local-fs.target shutdown.target
-ConditionPathExists=/sbin/quotacheck
+ConditionPathExists=@QUOTACHECK@
 
 [Service]
 Type=oneshot