void-packages/srcpkgs/pps-tools/patches/makefile-DESTDIR.patch

42 lines
1.4 KiB
Diff

# src: https://github.com/redlab-i/pps-tools/commit/b3eae485a8c759d1ce1727076b2c287deb5f24e1.patch
From b3eae485a8c759d1ce1727076b2c287deb5f24e1 Mon Sep 17 00:00:00 2001
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Date: Mon, 3 Dec 2018 13:55:02 +0100
Subject: [PATCH] Makefile: fix installation to empty DESTDIR
When DESTDIR is empty, or at least does not contain usr/bin or
usr/include, the installation fails, because install does not create
those intermediate directories:
$ make DESTDIR=/tmp/koin install
install -m 755 -t /tmp/koin/usr/bin ppsfind ppstest ppsctl ppswatch ppsldisc
install: failed to access '/tmp/koin/usr/bin': No such file or directory
Using the -D option of install fixes this:
$ make DESTDIR=/tmp/koin install
install -D -m 755 -t /tmp/koin/usr/bin ppsfind ppstest ppsctl ppswatch ppsldisc
install -D -m 644 -t /tmp/koin/usr/include/sys timepps.h
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 9394668..30672f7 100644
--- a/Makefile
+++ b/Makefile
@@ -19,8 +19,8 @@ include .depend
endif
install : all
- install -m 755 -t $(DESTDIR)/usr/bin ppsfind $(TARGETS)
- install -m 644 -t $(DESTDIR)/usr/include/sys timepps.h
+ install -D -m 755 -t $(DESTDIR)/usr/bin ppsfind $(TARGETS)
+ install -D -m 644 -t $(DESTDIR)/usr/include/sys timepps.h
uninstall :
for f in $(TARGETS); do rm $(DESTDIR)/usr/bin/$$f; done