From 0961a952cb61557d98d5a5d2a81acaaa6fd39dbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juhani=20Krekel=C3=A4?= Date: Sat, 8 Sep 2018 19:12:43 +0300 Subject: [PATCH] Use the zipapp module of python instead of using zip and manually adding the hashbang --- Makefile | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index d43578c..2f646ce 100644 --- a/Makefile +++ b/Makefile @@ -15,28 +15,19 @@ sshwot-export-known-hosts: $(SSHWOT_EXPORT_KNOWN_HOSTS_MAIN) $(SSHWOT_EXPORT_KNO mkdir -p build/$@ cp $(SSHWOT_EXPORT_KNOWN_HOSTS_DEPS) build/$@/ cp $(SSHWOT_EXPORT_KNOWN_HOSTS_MAIN) build/$@/__main__.py - zip --quiet --junk-paths build/$@.zip build/$@/*.py - echo '#!/usr/bin/env python3' > $@ - cat build/$@.zip >> $@ - chmod +x $@ + python3 -m zipapp -o $@ -p "/usr/bin/env python3" build/$@ sshwot-filter: $(SSHWOT_FILTER_MAIN) $(SSHWOT_FILTER_DEPS) mkdir -p build/$@ cp $(SSHWOT_FILTER_DEPS) build/$@/ cp $(SSHWOT_FILTER_MAIN) build/$@/__main__.py - zip --quiet --junk-paths build/$@.zip build/$@/*.py - echo '#!/usr/bin/env python3' > $@ - cat build/$@.zip >> $@ - chmod +x $@ + python3 -m zipapp -o $@ -p "/usr/bin/env python3" build/$@ sshwot-verify: $(SSHWOT_VERIFY_MAIN) $(SSHWOT_VERIFY_DEPS) mkdir -p build/$@ cp $(SSHWOT_VERIFY_DEPS) build/$@/ cp $(SSHWOT_VERIFY_MAIN) build/$@/__main__.py - zip --quiet --junk-paths build/$@.zip build/$@/*.py - echo '#!/usr/bin/env python3' > $@ - cat build/$@.zip >> $@ - chmod +x $@ + python3 -m zipapp -o $@ -p "/usr/bin/env python3" build/$@ .PHONY: all clean distclean buildclean