Skip to content

Commit 72052a8

Browse files
committed
Fix variable replacement in non config files
Fixes: #132 Signed-off-by: Simo Sorce <[email protected]> Reviewed-by: Lukas Slebodnik <[email protected]>
1 parent 22a4b37 commit 72052a8

File tree

2 files changed

+35
-7
lines changed

2 files changed

+35
-7
lines changed

proxy/Makefile.am

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ localedir = @localedir@
2323
ccpath = @ccpath@
2424
initdir = @initdir@
2525
systemdunitdir = @systemdunitdir@
26+
examplesdir= @datarootdir@/examples
2627
logpath = @logpath@
2728
pubconfpath = @pubconfpath@
2829
pkgconfigdir = $(libdir)/pkgconfig
@@ -221,11 +222,33 @@ endif
221222
#######################
222223

223224
dist_init_SCRIPTS =
224-
dist_systemdunit_DATA =
225-
if HAVE_SYSTEMD_UNIT
226-
dist_systemdunit_DATA += \
227-
systemd/gssproxy.service
228-
endif
225+
226+
edit_cmd = $(SED) \
227+
-e 's|@sbindir[@]|$(sbindir)|g' \
228+
-e 's|@localstatedir[@]|$(localstatedir)|g' \
229+
-e 's|@libdir[@]|$(libdir)|g' \
230+
-e 's|@gpstatedir[@]|$(prefix)|g'
231+
232+
replace_script = \
233+
@rm -f $@ $@.tmp; \
234+
srcdir=''; \
235+
test -f ./$@.in || srcdir=$(srcdir)/; \
236+
$(edit_cmd) $${srcdir}$@.in >$@.tmp; \
237+
mv $@.tmp $@
238+
239+
EXTRA_DIST = \
240+
systemd/gssproxy.service.in \
241+
examples/gssproxy.conf.in \
242+
examples/mech.in
243+
244+
systemd/gssproxy.service: systemd/gssproxy.service.in Makefile
245+
$(replace_script)
246+
247+
examples/gssproxy.conf: examples/gssproxy.conf.in Makefile
248+
$(replace_script)
249+
250+
examples/mech: examples/mech.in Makefile
251+
$(replace_script)
229252

230253
installgsspdirs::
231254
mkdir -p \
@@ -257,6 +280,11 @@ else
257280
mkdir -p $(DESTDIR)$(initdir)
258281
endif
259282

283+
install-data-hook: systemd/gssproxy.service examples/mech examples/gssproxy.conf
284+
if HAVE_SYSTEMD_UNIT
285+
cp systemd/gssproxy.service $(DESTDIR)$(systemdunitdir)
286+
endif
287+
260288
clean-local:
261289
rm -Rf doc
262290

proxy/configure.ac

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ abs_build_dir=`pwd`
180180
AC_DEFINE_UNQUOTED([ABS_BUILD_DIR], ["$abs_build_dir"], [Absolute path to the build directory])
181181
AC_SUBST([abs_builddir], $abs_build_dir)
182182

183-
AC_CONFIG_FILES([Makefile tests/Makefile systemd/gssproxy.service man/Makefile
184-
contrib/gssproxy.spec examples/mech examples/gssproxy.conf
183+
AC_CONFIG_FILES([Makefile tests/Makefile man/Makefile
184+
contrib/gssproxy.spec
185185
man/gssproxy-mech.8.xml])
186186
AC_OUTPUT

0 commit comments

Comments
 (0)