From e422abc269e2ef377153066d44e198897b2550a7 Mon Sep 17 00:00:00 2001 From: Stephen Hassard Date: Sat, 2 Jul 2022 08:35:29 -0700 Subject: [PATCH] Use relative path for include/janet.h symlink When using make to build an rpm, the current symlink is created with an absolute path to the buildroot as causes the make install target to fail with: error: Symlink points to BuildRoot: /usr/include/janet.h -> /home/stephen/rpmbuild/BUILDROOT/janet-1.23.0-3.x86_64/usr/include/janet/janet.h We can create the link relatively which makes this more portable, where: ln -sf -t '/home/stephen/rpmbuild/BUILDROOT/janet-1.23.0-3.x86_64/usr/include' janet.h janet/janet.h Resulting in the following symlink: ls -la BUILDROOT/usr/include/janet.h lrwxrwxrwx. 1 stephen stephen 13 Jul 2 08:17 BUILDROOT/usr/include/janet.h -> janet/janet.h This symlink can then be properly packaged without path issues. Signed-off-by: Stephen Hassard --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 0fdcb64d..e49349ee 100644 --- a/Makefile +++ b/Makefile @@ -283,7 +283,7 @@ install: $(JANET_TARGET) $(JANET_LIBRARY) $(JANET_STATIC_LIBRARY) build/janet.pc cp $(JANET_TARGET) '$(DESTDIR)$(BINDIR)/janet' mkdir -p '$(DESTDIR)$(INCLUDEDIR)/janet' cp -r build/janet.h '$(DESTDIR)$(INCLUDEDIR)/janet' - ln -sf '$(DESTDIR)$(INCLUDEDIR)/janet/janet.h' '$(DESTDIR)$(INCLUDEDIR)/janet.h' + ln -sf -t '$(DESTDIR)$(INCLUDEDIR)' janet.h janet/janet.h mkdir -p '$(DESTDIR)$(JANET_PATH)' mkdir -p '$(DESTDIR)$(LIBDIR)' if test $(UNAME) = Darwin ; then \