[PATCH bzip2 1/6] install relative symlinks

~eschwartz eschwartz@git.sr.ht
Fri Jun 3 03:45:49 GMT 2022


From: Eli Schwartz <eschwartz93@gmail.com>

During `make install`, symlinks for command aliases are created which
embed an absolute path to the installed location of the real file. This
causes issues with relocation, for example when packaging for distros.

Use symlinks that search for a file in the same directory as the
symlink, instead. This is guaranteed to have the same results, except
more accurate.
---
 Makefile | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index b0fef95..009463a 100644
--- a/Makefile
+++ b/Makefile
@@ -90,14 +90,14 @@ install: bzip2 bzip2recover
 	cp -f libbz2.a $(PREFIX)/lib
 	chmod a+r $(PREFIX)/lib/libbz2.a
 	cp -f bzgrep $(PREFIX)/bin/bzgrep
-	ln -s -f $(PREFIX)/bin/bzgrep $(PREFIX)/bin/bzegrep
-	ln -s -f $(PREFIX)/bin/bzgrep $(PREFIX)/bin/bzfgrep
+	ln -s -f bzgrep $(PREFIX)/bin/bzegrep
+	ln -s -f bzgrep $(PREFIX)/bin/bzfgrep
 	chmod a+x $(PREFIX)/bin/bzgrep
 	cp -f bzmore $(PREFIX)/bin/bzmore
-	ln -s -f $(PREFIX)/bin/bzmore $(PREFIX)/bin/bzless
+	ln -s -f bzmore $(PREFIX)/bin/bzless
 	chmod a+x $(PREFIX)/bin/bzmore
 	cp -f bzdiff $(PREFIX)/bin/bzdiff
-	ln -s -f $(PREFIX)/bin/bzdiff $(PREFIX)/bin/bzcmp
+	ln -s -f bzdiff $(PREFIX)/bin/bzcmp
 	chmod a+x $(PREFIX)/bin/bzdiff
 	cp -f bzgrep.1 bzmore.1 bzdiff.1 $(PREFIX)/man/man1
 	chmod a+r $(PREFIX)/man/man1/bzgrep.1
-- 
2.34.2



More information about the Bzip2-devel mailing list