From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id AF06F58973 for ; Fri, 22 Jan 2016 03:15:49 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5996E21C021; Fri, 22 Jan 2016 03:15:48 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 2087C21C029 for ; Fri, 22 Jan 2016 03:15:47 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 45728340931 for ; Fri, 22 Jan 2016 03:15:46 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 639B9E5F for ; Fri, 22 Jan 2016 03:15:43 +0000 (UTC) From: "Michael Orlitzky" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michael Orlitzky" Message-ID: <1453420398.79787fcc061362905f0b47a67c922884a27616fc.mjo@gentoo> Subject: [gentoo-commits] proj/eselect-php:master commit in: src/, / X-VCS-Repository: proj/eselect-php X-VCS-Files: Makefile.am configure.ac src/php.eselect.in src/php.eselect.in.in X-VCS-Directories: / src/ X-VCS-Committer: mjo X-VCS-Committer-Name: Michael Orlitzky X-VCS-Revision: 79787fcc061362905f0b47a67c922884a27616fc X-VCS-Branch: master Date: Fri, 22 Jan 2016 03:15:43 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 43e0fb6c-8974-4d62-8c23-aed781f67584 X-Archives-Hash: 789b0913180c3335620e33dabc63e2ab commit: 79787fcc061362905f0b47a67c922884a27616fc Author: Michael Orlitzky gentoo org> AuthorDate: Thu Jan 21 23:53:18 2016 +0000 Commit: Michael Orlitzky gentoo org> CommitDate: Thu Jan 21 23:53:18 2016 +0000 URL: https://gitweb.gentoo.org/proj/eselect-php.git/commit/?id=79787fcc Add another layer of indirection to get @bindir@ and friends in the output. When we create php.eselect from php.eselect.in using autoconf, we don't have a way to get the full, expanded value of @bindir@, @libdir@, and the other paths that we need. The autoconf documentation suggests a workaround for this: add another layer of indirection, and use the Makefile to substitute those values into the output files. This commit sets the stage by renaming php.eselect.in to php.eselect.in.in. The first round of processing by autoconf takes php.eselect.in.in to php.eselect.in. The Makefile will then generate php.eselect from php.eselect.in after substituting @bindir@, @libdir@, and @localstatedir@. Makefile.am | 19 ++++++++++++++++++- configure.ac | 2 +- src/{php.eselect.in => php.eselect.in.in} | 0 3 files changed, 19 insertions(+), 2 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 diff --git a/configure.ac b/configure.ac index 2f1f609..c118e0e 100644 --- a/configure.ac +++ b/configure.ac @@ -8,6 +8,6 @@ AC_PATH_PROG(SORT,sort) AC_PATH_PROG(UNIQ,uniq) # List of output files. -AC_CONFIG_FILES([Makefile src/php.eselect]) +AC_CONFIG_FILES([Makefile src/php.eselect.in]) AC_OUTPUT diff --git a/src/php.eselect.in b/src/php.eselect.in.in similarity index 100% rename from src/php.eselect.in rename to src/php.eselect.in.in