summaryrefslogtreecommitdiffstats
path: root/Makefile.am
diff options
context:
space:
mode:
authorLukas Slebodnik <lslebodn@redhat.com>2014-04-04 10:13:44 +0200
committerJakub Hrozek <jhrozek@redhat.com>2014-04-04 14:51:06 +0200
commita203f4a0e7c60d6198f4ce8bf99952cfec5a0351 (patch)
treeb3d759eede7dd8c723b5a24b68f820e5baaa048e /Makefile.am
parent0a6fa194bad18f417dc8542d3b8f654f898375c5 (diff)
downloadsssd-a203f4a0e7c60d6198f4ce8bf99952cfec5a0351.tar.gz
sssd-a203f4a0e7c60d6198f4ce8bf99952cfec5a0351.tar.xz
sssd-a203f4a0e7c60d6198f4ce8bf99952cfec5a0351.zip
Makefile: Use alternative method to replace *bindir
https://www.gnu.org/software/autoconf/manual/autoconf-2.67/html_node/Installation-Directory-Variables.html Most of these variables have values that rely on prefix or exec_prefix. It is deliberate that the directory output variables keep them unexpanded: typically ‘@sbindir@’ is replaced by ‘${exec_prefix}/sbin’, not ‘/usr/local/sbin’. This behavior is mandated by the GNU Coding Standards. Installation directory variables (sbindir, pkgdatadir ...) should be used only in makefiles. Similarly, we should not rely on AC_CONFIG_FILES to replace sbindir and friends in shell scripts and other files; instead, let make manage their replacement. Resolves: https://fedorahosted.org/sssd/ticket/2293 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am27
1 files changed, 27 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index c5ae3a028..19e013915 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2261,6 +2261,31 @@ dist_sssdapiplugin_DATA = \
src/config/etc/sssd.api.d/sssd-proxy.conf \
src/config/etc/sssd.api.d/sssd-simple.conf
+edit_cmd = $(SED) \
+ -e 's|@sbindir[@]|$(sbindir)|g' \
+ -e 's|@environment_file[@]|$(environment_file)|g' \
+ -e 's|@localstatedir[@]|$(localstatedir)|g' \
+ -e 's|@prefix[@]|$(prefix)|g'
+
+replace_script = \
+ @rm -f $@ $@.tmp; \
+ srcdir=''; \
+ test -f ./$@.in || srcdir=$(srcdir)/; \
+ $(edit_cmd) $${srcdir}$@.in >$@.tmp; \
+ mv $@.tmp $@
+
+EXTRA_DIST += \
+ src/sysv/systemd/sssd.service.in \
+ src/sysv/systemd/journal.conf.in
+
+src/sysv/systemd/sssd.service: src/sysv/systemd/sssd.service.in Makefile
+ @$(MKDIR_P) src/sysv/systemd/
+ $(replace_script)
+
+src/sysv/systemd/journal.conf: src/sysv/systemd/journal.conf.in Makefile
+ @$(MKDIR_P) src/sysv/systemd/
+ $(replace_script)
+
installsssddirs::
mkdir -p \
$(DESTDIR)$(includedir) \
@@ -2372,6 +2397,8 @@ endif
rm -Rf $$doc; \
done;
rm -Rf ldb_mod_test_dir
+ rm -f $(builddir)/src/sysv/systemd/sssd.service
+ rm -f $(builddir)/src/sysv/systemd/journal.conf
CLEANFILES = *.X */*.X */*/*.X