void-packages/srcpkgs/pps-tools/patches/makefile-DESTDIR.patch
Đoàn Trần Công Danh 49cb564d14 srcpkgs/p*: convert patches to -Np1
* par is kept at -Np0

```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.-][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.-][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

41 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