From fb060df50fb6e0b7b080c4cdba268ea40cf6cc6f Mon Sep 17 00:00:00 2001 From: Jay Larson Date: Sun, 11 Jun 2017 14:24:09 -0500 Subject: [PATCH] The following changes were made: * Moved to new version scheme * Moved make/make install out of variables * Corrected patch loop --- Makefile | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 7d2886b..c601ea3 100644 --- a/Makefile +++ b/Makefile @@ -14,17 +14,13 @@ URL = https://savannah.gnu.org/projects/patch/ DESC = Patch takes a patch file containing a difference listing produced \ by the diff programm and applies those differences to one or more original \ files, producing patched versions -SNAPVER = sr0 +SNAPVER = 1 ARCHIVE := $(PWD)/SRC/$(shell ls SRC|egrep '(bz2|gz|tar|xz)$$'|tail -1) TYPE := $(shell file -ib $(ARCHIVE)|cut -d';' -f1|tr -d '\n') SRCDIR := $(shell tar -tf $(ARCHIVE)|head -1|sed 's/\/.*//') PATCHDIR := $(PWD)/SRC/patches -VERSION := $(shell echo $(SRCDIR)|egrep -o '\-[0-9].*'|sed 's/^-//')$(SNAPVER) - -MAKE = make -MAKEINST = make install -SNAPHACKS = +VERSION := $(shell echo $(SRCDIR)|egrep -o '\-[0-9].*'|sed 's/^-//')-$(SNAPVER) include /usr/share/snap/Makefile.snaplinux @@ -44,7 +40,8 @@ $(SRCDIR)/configure: $(ARCHIVE) @touch $(SRCDIR)/configure $(SRCDIR)/config.log: $(SRCDIR)/configure - @cd $(SRCDIR) && for patch in `find $(PATCHDIR) -name \*.patch`; do \ + @cd $(SRCDIR) && \ + for patch in `find $(PATCHDIR) -name \*.patch|sort`; do \ patch --verbose -Np1 -i $$patch; \ done @cd $(SRCDIR); \ @@ -55,8 +52,7 @@ $(SRCDIR)/config.log: $(SRCDIR)/configure --target=x86_64-snap-linux-gnu $(SRCDIR)/src/patch: $(SRCDIR)/config.log - @cd $(SRCDIR); \ - $(MAKE) + @cd $(SRCDIR) && make $(ROOT): $(SRCDIR)/src/patch @if [ -d $(ROOT) ]; then \ @@ -65,10 +61,7 @@ $(ROOT): $(SRCDIR)/src/patch mkdir -v $(ROOT); \ fi - @cd $(SRCDIR); \ - $(MAKEINST) DESTDIR=$(ROOT) - - @$(SNAPHACKS) + @cd $(SRCDIR) && make install DESTDIR=$(ROOT) test: $(ROOT) @cd $(SRCDIR); \