summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss Allbery <eagle@eyrie.org>2016-01-23 15:17:49 -0800
committerRuss Allbery <eagle@eyrie.org>2016-01-23 15:21:55 -0800
commitf532471b897dfb426890cd96b77f0f44e36c061d (patch)
tree4334d349cbd303baf6e8946215b0b7bc91d07e10
parent4abe4ae9b4149a5eb8a30a6e7b1070ff97d69021 (diff)
Clean up generation of Perl scripts
Use @PERL@ as the substitution variable instead of WALLET_PERL_PATH to match normal Automake conventions. Write the scripts into the build path, not the source path, to work properly with out-of-tree builds. Clean up the distribution rules. Use separate Makefile rules for each script so that make has proper dependencies. Also fix the Perl paths in (some of) the test scripts, although there are others for which this still isn't going to work.
-rw-r--r--.gitignore4
-rw-r--r--Makefile.am84
-rw-r--r--configure.ac1
-rw-r--r--server/keytab-backend.in3
-rw-r--r--server/wallet-admin.in3
-rw-r--r--server/wallet-backend.in3
-rw-r--r--server/wallet-report.in3
-rw-r--r--tests/client/full-t.in3
-rw-r--r--tests/client/prompt-t.in3
9 files changed, 65 insertions, 42 deletions
diff --git a/.gitignore b/.gitignore
index 67dd38b..cca3069 100644
--- a/.gitignore
+++ b/.gitignore
@@ -22,6 +22,10 @@
/perl/t/data/test.krbtype
/perl/t/lib/Test/RRA.pm
/perl/t/lib/Test/RRA/
+/server/keytab-backend
+/server/wallet-admin
+/server/wallet-backend
+/server/wallet-report
/tests/client/basic-t
/tests/client/full-t
/tests/client/prompt-t
diff --git a/Makefile.am b/Makefile.am
index 3e76885..d05039b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -100,34 +100,36 @@ PERL_DIRECTORIES = perl perl/lib perl/lib/Wallet perl/lib/Wallet/ACL \
perl/t/policy perl/t/style perl/t/util perl/t/verifier
ACLOCAL_AMFLAGS = -I m4
-EXTRA_DIST = .gitignore .travis.yml LICENSE autogen client/wallet.pod \
- client/wallet-rekey.pod config/allow-extract config/keytab \
- config/keytab.acl config/wallet config/wallet-report.acl \
- docs/design contrib/README contrib/commerzbank/wallet-history \
- contrib/convert-srvtab-db contrib/used-principals \
- contrib/wallet-contacts contrib/wallet-rekey-periodic \
- contrib/wallet-rekey-periodic.8 contrib/wallet-summary \
- contrib/wallet-summary.8 contrib/wallet-unknown-hosts \
- contrib/wallet-unknown-hosts.8 docs/design-acl docs/design-api \
- docs/netdb-role-api docs/notes docs/objects-and-schemes docs/setup \
- docs/stanford-naming examples/stanford.conf tests/HOWTO tests/TESTS \
- tests/config/README tests/data/allow-extract tests/data/basic.conf \
- tests/data/cmd-fake tests/data/cmd-wrapper tests/data/fake-data \
- tests/data/fake-kadmin tests/data/fake-keytab \
- tests/data/fake-keytab-2 tests/data/fake-keytab-foreign \
- tests/data/fake-keytab-merge tests/data/fake-keytab-old \
- tests/data/fake-keytab-partial \
- tests/data/fake-keytab-partial-result tests/data/fake-keytab-rekey \
- tests/data/fake-keytab-unknown tests/data/fake-srvtab \
- tests/data/full.conf tests/data/perl.conf tests/data/wallet.conf \
- tests/docs/pod-spelling-t tests/docs/pod-t \
- tests/perl/minimum-version-t tests/perl/module-version-t \
- tests/perl/strict-t tests/server/admin-t tests/server/backend-t \
- tests/server/keytab-t tests/server/report-t tests/tap/kerberos.sh \
- tests/tap/libtap.sh tests/tap/perl/Test/RRA.pm \
- tests/tap/perl/Test/RRA/Automake.pm \
- tests/tap/perl/Test/RRA/Config.pm \
- tests/tap/perl/Test/RRA/ModuleVersion.pm tests/tap/remctl.sh \
+EXTRA_DIST = .gitignore .travis.yml LICENSE autogen client/wallet.pod \
+ client/wallet-rekey.pod config/allow-extract config/keytab \
+ config/keytab.acl config/wallet config/wallet-report.acl \
+ docs/design contrib/README contrib/commerzbank/wallet-history \
+ contrib/convert-srvtab-db contrib/used-principals \
+ contrib/wallet-contacts contrib/wallet-rekey-periodic \
+ contrib/wallet-rekey-periodic.8 contrib/wallet-summary \
+ contrib/wallet-summary.8 contrib/wallet-unknown-hosts \
+ contrib/wallet-unknown-hosts.8 docs/design-acl docs/design-api \
+ docs/netdb-role-api docs/notes docs/objects-and-schemes docs/setup \
+ docs/stanford-naming examples/stanford.conf \
+ server/keytab-backend.in server/wallet-admin.in \
+ server/wallet-backend.in server/wallet-report.in tests/HOWTO \
+ tests/TESTS tests/config/README tests/data/allow-extract \
+ tests/data/basic.conf tests/data/cmd-fake tests/data/cmd-wrapper \
+ tests/data/fake-data tests/data/fake-kadmin tests/data/fake-keytab \
+ tests/data/fake-keytab-2 tests/data/fake-keytab-foreign \
+ tests/data/fake-keytab-merge tests/data/fake-keytab-old \
+ tests/data/fake-keytab-partial \
+ tests/data/fake-keytab-partial-result tests/data/fake-keytab-rekey \
+ tests/data/fake-keytab-unknown tests/data/fake-srvtab \
+ tests/data/full.conf tests/data/perl.conf tests/data/wallet.conf \
+ tests/docs/pod-spelling-t tests/docs/pod-t \
+ tests/perl/minimum-version-t tests/perl/module-version-t \
+ tests/perl/strict-t tests/server/admin-t tests/server/backend-t \
+ tests/server/keytab-t tests/server/report-t tests/tap/kerberos.sh \
+ tests/tap/libtap.sh tests/tap/perl/Test/RRA.pm \
+ tests/tap/perl/Test/RRA/Automake.pm \
+ tests/tap/perl/Test/RRA/Config.pm \
+ tests/tap/perl/Test/RRA/ModuleVersion.pm tests/tap/remctl.sh \
tests/util/xmalloc-t $(PERL_FILES)
# Supporting convenience libraries used by other targets.
@@ -150,7 +152,7 @@ client_libwallet_a_CPPFLAGS = $(REMCTL_CPPFLAGS) $(KRB5_CPPFLAGS)
# The client and server programs.
bin_PROGRAMS = client/wallet client/wallet-rekey
-dist_sbin_SCRIPTS = server/keytab-backend server/wallet-admin \
+sbin_SCRIPTS = server/keytab-backend server/wallet-admin \
server/wallet-backend server/wallet-report
client_wallet_CPPFLAGS = $(REMCTL_CPPFLAGS) $(KRB5_CPPFLAGS)
client_wallet_LDFLAGS = $(REMCTL_LDFLAGS) $(KRB5_LDFLAGS)
@@ -209,19 +211,29 @@ warnings:
KRB5_CPPFLAGS='$(KRB5_CPPFLAGS_GCC)' $(check_PROGRAMS)
# Remove some additional files.
-CLEANFILES = perl/t/lib/Test/RRA.pm perl/t/lib/Test/RRA/Automake.pm \
- perl/t/lib/Test/RRA/Config.pm $(dist_sbin_SCRIPTS)
+CLEANFILES = perl/t/lib/Test/RRA.pm perl/t/lib/Test/RRA/Automake.pm \
+ perl/t/lib/Test/RRA/Config.pm server/keytab-backend \
+ server/wallet-admin server/wallet-backend server/wallet-report
MAINTAINERCLEANFILES = Makefile.in aclocal.m4 build-aux/compile \
build-aux/depcomp build-aux/install-sh build-aux/missing \
client/wallet.1 config.h.in config.h.in~ configure \
contrib/wallet-report.8 server/keytab-backend.8 \
server/wallet-admin.8 server/wallet-backend.8 server/wallet-report.8
-# For each of the perl scripts in server/, we need to fill in the path to the
-# Perl binary that was located during configuration.
-$(dist_sbin_SCRIPTS):
- sed 's|WALLET_PERL_PATH|$(PERL)|' < $(srcdir)/$@.in > $(srcdir)/$@
- chmod a+x $(srcdir)/$@
+# For each of the Perl scripts, we need to fill in the path to the Perl
+# binary that was located during configuration.
+server/keytab-backend: $(srcdir)/server/keytab-backend.in Makefile
+ sed 's|@PERL@|$(PERL)|' <$(srcdir)/server/keytab-backend.in >$@
+ chmod a+x $@
+server/wallet-admin: $(srcdir)/server/wallet-admin.in Makefile
+ sed 's|@PERL@|$(PERL)|' <$(srcdir)/server/wallet-admin.in >$@
+ chmod a+x $@
+server/wallet-backend: $(srcdir)/server/wallet-backend.in Makefile
+ sed 's|@PERL@|$(PERL)|' <$(srcdir)/server/wallet-backend.in >$@
+ chmod a+x $@
+server/wallet-report: $(srcdir)/server/wallet-report.in Makefile
+ sed 's|@PERL@|$(PERL)|' <$(srcdir)/server/wallet-report.in >$@
+ chmod a+x $@
# Take appropriate actions in the Perl directory as well. We don't want to
# always build the Perl directory in all-local, since otherwise Automake does
diff --git a/configure.ac b/configure.ac
index bf26055..0bccef0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -98,6 +98,7 @@ AC_CONFIG_FILES([tests/client/basic-t], [chmod +x tests/client/basic-t])
AC_CONFIG_FILES([tests/client/full-t], [chmod +x tests/client/full-t])
AC_CONFIG_FILES([tests/client/prompt-t], [chmod +x tests/client/prompt-t])
AC_CONFIG_FILES([tests/client/rekey-t], [chmod +x tests/client/rekey-t])
+AC_CONFIG_COMMANDS([server], [test -d server || mkdir server])
AC_CONFIG_COMMANDS([tests/config],
[test -d tests/config || mkdir tests/config])
AC_OUTPUT
diff --git a/server/keytab-backend.in b/server/keytab-backend.in
index 13cb33e..56c375b 100644
--- a/server/keytab-backend.in
+++ b/server/keytab-backend.in
@@ -1,4 +1,5 @@
-#!WALLET_PERL_PATH
+#!@PERL@
+# -*- perl -*-
#
# Extract keytabs from the KDC without changing the key.
#
diff --git a/server/wallet-admin.in b/server/wallet-admin.in
index 84141e6..6c18b82 100644
--- a/server/wallet-admin.in
+++ b/server/wallet-admin.in
@@ -1,4 +1,5 @@
-#!WALLET_PERL_PATH
+#!@PERL@
+# -*- perl -*-
#
# Wallet server administrative commands.
diff --git a/server/wallet-backend.in b/server/wallet-backend.in
index d7dde42..4803f96 100644
--- a/server/wallet-backend.in
+++ b/server/wallet-backend.in
@@ -1,4 +1,5 @@
-#!WALLET_PERL_PATH
+#!@PERL@
+# -*- perl -*-
#
# Wallet server for storing and retrieving secure data.
diff --git a/server/wallet-report.in b/server/wallet-report.in
index 2b59803..10a3b00 100644
--- a/server/wallet-report.in
+++ b/server/wallet-report.in
@@ -1,4 +1,5 @@
-#!WALLET_PERL_PATH
+#!@PERL@
+# -*- perl -*-
#
# Wallet server reporting interface.
diff --git a/tests/client/full-t.in b/tests/client/full-t.in
index 4861723..80bb20f 100644
--- a/tests/client/full-t.in
+++ b/tests/client/full-t.in
@@ -1,4 +1,5 @@
-#!/usr/bin/perl
+#!@PERL@
+# -*- perl -*-
#
# End-to-end tests for the wallet client.
#
diff --git a/tests/client/prompt-t.in b/tests/client/prompt-t.in
index 686cc88..d3a1eac 100644
--- a/tests/client/prompt-t.in
+++ b/tests/client/prompt-t.in
@@ -1,4 +1,5 @@
-#!/usr/bin/perl
+#!@PERL@
+# -*- perl -*-
#
# Password prompting tests for the wallet client.
#