0001-Makefile.in-fix-cross-compilation.patch 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. From 7535d990645d867a6e491d16cd2548ea7e54958e Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Mon, 5 Apr 2021 16:21:32 +0200
  4. Subject: [PATCH] Makefile.in: fix cross-compilation
  5. - Use DESTDIR to install each files instead of prepending prefix with it
  6. as this will result in dotlockfile being wrongly install in $(bindir)
  7. - Use -f when creating symlink to avoid an error if link already exists
  8. - Do not install files with root group as this will break
  9. cross-compilation
  10. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  11. [Upstream status: https://github.com/miquels/liblockfile/pull/11]
  12. ---
  13. Makefile.in | 36 ++++++++++++++++++------------------
  14. 1 file changed, 18 insertions(+), 18 deletions(-)
  15. diff --git a/Makefile.in b/Makefile.in
  16. index 9c74b35..5ce8153 100644
  17. --- a/Makefile.in
  18. +++ b/Makefile.in
  19. @@ -10,7 +10,7 @@ CFLAGS = @CFLAGS@ -I.
  20. LDFLAGS = @LDFLAGS@
  21. CC = @CC@
  22. -prefix = $(DESTDIR)@prefix@
  23. +prefix = @prefix@
  24. exec_prefix = @exec_prefix@
  25. bindir = @bindir@
  26. libdir = @libdir@
  27. @@ -60,34 +60,34 @@ dlockfile.o: lockfile.c
  28. -c lockfile.c -o dlockfile.o
  29. install_static: static install_common
  30. - install -d -m 755 -g root -p $(libdir)
  31. - install -m 644 liblockfile.a $(libdir)
  32. + install -d -m 755 -p $(DESTDIR)$(libdir)
  33. + install -m 644 liblockfile.a $(DESTDIR)$(libdir)
  34. install_shared: shared install_static install_common
  35. - install -d -m 755 -g root -p $(libdir)
  36. + install -d -m 755 -p $(DESTDIR)$(libdir)
  37. install -m 755 liblockfile.so \
  38. - $(libdir)/liblockfile.so.$(SOVER)
  39. - ln -s liblockfile.so.$(SOVER) $(libdir)/liblockfile.so.$(MAJOR)
  40. - ln -s liblockfile.so.$(SOVER) $(libdir)/liblockfile.so
  41. + $(DESTDIR)$(libdir)/liblockfile.so.$(SOVER)
  42. + ln -sf liblockfile.so.$(SOVER) $(DESTDIR)$(libdir)/liblockfile.so.$(MAJOR)
  43. + ln -sf liblockfile.so.$(SOVER) $(DESTDIR)$(libdir)/liblockfile.so
  44. if test "$(DESTDIR)" = ""; then @LDCONFIG@; fi
  45. install_common:
  46. - install -d -m 755 -g root -p $(includedir)
  47. - install -d -m 755 -g root -p $(bindir)
  48. - install -d -m 755 -g root -p $(mandir)/man1
  49. - install -d -m 755 -g root -p $(mandir)/man3
  50. - install -m 644 lockfile.h maillock.h $(includedir)
  51. + install -d -m 755 -p $(DESTDIR)$(includedir)
  52. + install -d -m 755 -p $(DESTDIR)$(bindir)
  53. + install -d -m 755 -p $(DESTDIR)$(mandir)/man1
  54. + install -d -m 755 -p $(DESTDIR)$(mandir)/man3
  55. + install -m 644 lockfile.h maillock.h $(DESTDIR)$(includedir)
  56. if [ "$(MAILGROUP)" != "" ]; then\
  57. - install -g $(MAILGROUP) -m 2755 dotlockfile $(bindir);\
  58. + install -g $(MAILGROUP) -m 2755 dotlockfile $(DESTDIR)$(bindir);\
  59. else \
  60. - install -g root -m 755 dotlockfile $(bindir); \
  61. + install -m 755 dotlockfile $(DESTDIR)$(bindir); \
  62. fi
  63. - install -m 644 *.1 $(mandir)/man1
  64. - install -m 644 *.3 $(mandir)/man3
  65. + install -m 644 *.1 $(DESTDIR)$(mandir)/man1
  66. + install -m 644 *.3 $(DESTDIR)$(mandir)/man3
  67. install_nfslib: nfslib
  68. - install -d -m 755 -g root -p $(nfslockdir)
  69. - install -m 755 nfslock.so.$(NFSVER) $(nfslockdir)
  70. + install -d -m 755 -p $(DESTDIR)$(nfslockdir)
  71. + install -m 755 nfslock.so.$(NFSVER) $(DESTDIR)$(nfslockdir)
  72. if test "$(DESTDIR)" = ""; then @LDCONFIG@; fi
  73. test: test-stamp