summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am19
1 files changed, 18 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am
index 330f491..073abf9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,2 +1,19 @@
eselectdir = $(datadir)/eselect/modules
-nodist_eselect_DATA = src/php.eselect
+nodist_eselect_DATA = $(srcdir)/src/php.eselect
+
+# The next few rules allow us to replace bindir, libdir, and
+# localstatedir within our script and conf file. The example is taken
+# from the autoconf documentation and can be found in the
+# "Installation Directory Variables" section.
+edit = sed -e 's|@bindir[@]|$(bindir)|g' \
+ -e 's|@libdir[@]|$(libdir)|g' \
+ -e 's|@localstatedir[@]|$(localstatedir)|g'
+
+$(nodist_eselect_DATA): Makefile
+ rm -f $@ $@.tmp
+ srcdir=''; \
+ test -f ./$@.in || srcdir=$(srcdir)/; \
+ $(edit) $${srcdir}$@.in > $@.tmp
+ mv $@.tmp $@
+
+$(srcdir)/src/php.eselect: $(srcdir)/src/php.eselect.in