Patchwork [10/11] Have ./configure do variable substitution in Python scripts

login
register
mail settings
Submitter Chuck Lever
Date Jan. 10, 2014, 4:20 p.m.
Message ID <20140110162018.32524.54065.stgit@seurat.1015granger.net>
Download mbox | patch
Permalink /patch/309332/
State Accepted
Headers show

Comments

Chuck Lever - Jan. 10, 2014, 4:20 p.m.
Clean up the Makefile in src/domainroot and src/jumpstart, removing
open-coded text substitution logic from the makefiles.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 configure.ac                       |    2 ++
 src/domainroot/Makefile.am         |   11 +----------
 src/domainroot/fedfs-domainroot.in |    4 ++--
 src/jumpstart/Makefile.am          |   11 +----------
 src/jumpstart/nsdb-jumpstart.in    |    4 ++--
 5 files changed, 8 insertions(+), 24 deletions(-)

Patch

diff --git a/configure.ac b/configure.ac
index 1120ff7..65f90d6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -226,10 +226,12 @@  AC_CONFIG_FILES([Makefile
                  doc/man/rpc.fedfsd.8
                  doc/rpcl/Makefile
                  src/Makefile
+                 src/domainroot/fedfs-domainroot
                  src/domainroot/Makefile
                  src/fedfsc/Makefile
                  src/fedfsd/Makefile
                  src/include/Makefile
+                 src/jumpstart/nsdb-jumpstart
                  src/jumpstart/Makefile
                  src/libadmin/Makefile
                  src/libjunction/Makefile
diff --git a/src/domainroot/Makefile.am b/src/domainroot/Makefile.am
index 26a3c2e..bae6645 100644
--- a/src/domainroot/Makefile.am
+++ b/src/domainroot/Makefile.am
@@ -27,14 +27,5 @@ 
 bin_SCRIPTS = fedfs-domainroot
 EXTRA_DIST = fedfs-domainroot.in
 
-do_substitution = $(SED) -e 's,[@]pythondir[@],$(pythondir),g' \
-	-e 's,[@]PACKAGE[@],$(PACKAGE),g' \
-	-e 's,[@]VERSION[@],$(VERSION),g' \
-	-e 's,[@]STATEDIR[@],$(statedir),g'
-
-fedfs-domainroot: fedfs-domainroot.in Makefile
-	$(do_substitution) < $(srcdir)/fedfs-domainroot.in > fedfs-domainroot
-	chmod +x fedfs-domainroot
-
-CLEANFILES		= $(bin_SCRIPTS) cscope.in.out cscope.out cscope.po.out *~
+CLEANFILES		= cscope.in.out cscope.out cscope.po.out *~
 DISTCLEANFILES		= Makefile.in
diff --git a/src/domainroot/fedfs-domainroot.in b/src/domainroot/fedfs-domainroot.in
index e8878de..6db32eb 100644
--- a/src/domainroot/fedfs-domainroot.in
+++ b/src/domainroot/fedfs-domainroot.in
@@ -68,8 +68,8 @@  There is NO WARRANTY, to the extent permitted by law.''')
                         help='Display less output',
                         action='store_true')
     parser.add_argument('--statedir',
-                        help='FedFS state dir (default @STATEDIR@)',
-                        default='@STATEDIR@')
+                        help='FedFS state dir (default @statedir@)',
+                        default='@statedir@')
     subparsers = parser.add_subparsers(title='Sub-commands')
 
     add_parser = subparsers.add_parser('add',
diff --git a/src/jumpstart/Makefile.am b/src/jumpstart/Makefile.am
index 0c5723b..26b5891 100644
--- a/src/jumpstart/Makefile.am
+++ b/src/jumpstart/Makefile.am
@@ -27,14 +27,5 @@ 
 bin_SCRIPTS = nsdb-jumpstart
 EXTRA_DIST = nsdb-jumpstart.in
 
-do_substitution = $(SED) -e 's,[@]pythondir[@],$(pythondir),g' \
-	-e 's,[@]PACKAGE[@],$(PACKAGE),g' \
-	-e 's,[@]VERSION[@],$(VERSION),g' \
-	-e 's,[@]STATEDIR[@],$(statedir),g'
-
-nsdb-jumpstart: nsdb-jumpstart.in Makefile
-	$(do_substitution) < $(srcdir)/nsdb-jumpstart.in > nsdb-jumpstart
-	chmod +x nsdb-jumpstart
-
-CLEANFILES		= $(bin_SCRIPTS) cscope.in.out cscope.out cscope.po.out *~
+CLEANFILES		= cscope.in.out cscope.out cscope.po.out *~
 DISTCLEANFILES		= Makefile.in
diff --git a/src/jumpstart/nsdb-jumpstart.in b/src/jumpstart/nsdb-jumpstart.in
index fb5b058..345c553 100644
--- a/src/jumpstart/nsdb-jumpstart.in
+++ b/src/jumpstart/nsdb-jumpstart.in
@@ -65,8 +65,8 @@  There is NO WARRANTY, to the extent permitted by law.''')
                         action='version',
                         version='@PACKAGE@ @VERSION@')
     parser.add_argument('--statedir',
-                        help='FedFS state dir (default @STATEDIR@)',
-                        default='@STATEDIR@')
+                        help='FedFS state dir (default @statedir@)',
+                        default='@statedir@')
     subparsers = parser.add_subparsers(title='Sub-commands')
 
     install_parser = subparsers.add_parser('install',