```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 ```
26 lines
660 B
Diff
26 lines
660 B
Diff
--- a/Makefile.bck 2018-06-12 23:21:49.258145269 -0400
|
|
+++ b/Makefile 2018-06-12 23:22:23.446097218 -0400
|
|
@@ -1,5 +1,6 @@
|
|
-CC ?= cc
|
|
-PREFIX ?= /usr/local
|
|
+CC ?= cc
|
|
+DESTDIR ?= /
|
|
+PREFIX ?= /usr/local
|
|
|
|
ifdef EXE
|
|
BINS = clib.exe clib-install.exe clib-search.exe
|
|
@@ -35,11 +36,11 @@
|
|
$(RM) $(OBJS)
|
|
|
|
install: $(BINS)
|
|
- $(MKDIR) $(PREFIX)/bin
|
|
- $(foreach c, $(BINS), $(CP) $(c) $(PREFIX)/bin/$(c);)
|
|
+ $(MKDIR) $(DESTDIR)$(PREFIX)/bin
|
|
+ $(foreach c, $(BINS), $(CP) $(c) $(DESTDIR)$(PREFIX)/bin/$(c);)
|
|
|
|
uninstall:
|
|
- $(foreach c, $(BINS), $(RM) $(PREFIX)/bin/$(c);)
|
|
+ $(foreach c, $(BINS), $(RM) $(DESTDIR)$(PREFIX)/bin/$(c);)
|
|
|
|
test:
|
|
@./test.sh
|