The following changes were made:

* Moved to new version scheme
  * Moved make/make install out of variables
  * Corrected patch loop
  * Updated dependencies
This commit is contained in:
2017-05-30 16:28:46 -05:00
parent 010235dcd1
commit b53cdf6da6

View File

@@ -8,22 +8,19 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
DEPENDS = DEPENDS = glibc
ARCH = x86_64 ARCH = x86_64
URL = http://www.gnu.org/software/diffutils/ URL = http://www.gnu.org/software/diffutils/
BRIEF = Display differences between files
DESC = GNU Diffutils is a package of several programs related to finding \ DESC = GNU Diffutils is a package of several programs related to finding \
differences between files. differences between files.
SNAPVER = sr1 SNAPVER = 2
ARCHIVE := $(PWD)/SRC/$(shell ls SRC|egrep '(bz2|gz|tar|xz)$$'|tail -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') TYPE := $(shell file -ib $(ARCHIVE)|cut -d';' -f1|tr -d '\n')
SRCDIR := $(shell tar -tf $(ARCHIVE)|head -1|sed 's/\/.*//') SRCDIR := $(shell tar -tf $(ARCHIVE)|head -1|sed 's/\/.*//')
PATCHDIR := $(PWD)/SRC/patches PATCHDIR := $(PWD)/SRC/patches
VERSION := $(shell echo $(SRCDIR)|egrep -o '\-[0-9].*'|sed 's/^-//')$(SNAPVER) VERSION := $(shell echo $(SRCDIR)|egrep -o '\-[0-9].*'|sed 's/^-//')-$(SNAPVER)
MAKE = make
MAKEINST = make mkdir_p='/bin/mkdir -p' install
SNAPHACKS =
include /usr/share/snap/Makefile.snaplinux include /usr/share/snap/Makefile.snaplinux
@@ -40,11 +37,13 @@ $(SRCDIR)/configure: $(ARCHIVE)
echo 'Unable to determine archive type'; \ echo 'Unable to determine archive type'; \
exit 1; \ exit 1; \
fi fi
@touch $(SRCDIR)/configure
$(SRCDIR)/config.log: $(SRCDIR)/configure $(SRCDIR)/config.log: $(SRCDIR)/configure
@if [ -f $(PATCHDIR)/*.patch ]; then \ @cd $(SRCDIR) && \
cd $(SRCDIR) && cat $(PATCHDIR)/*.patch|patch --verbose -Np1; \ for patch in `find $(PATCHDIR) -name \*.patch|sort`; do \
fi patch --verbose -Np1 -i $$patch; \
done
@cd $(SRCDIR); \ @cd $(SRCDIR); \
./configure \ ./configure \
--prefix=/usr \ --prefix=/usr \
@@ -53,8 +52,7 @@ $(SRCDIR)/config.log: $(SRCDIR)/configure
--target=x86_64-snap-linux-gnu --target=x86_64-snap-linux-gnu
$(SRCDIR)/src/diff: $(SRCDIR)/config.log $(SRCDIR)/src/diff: $(SRCDIR)/config.log
@cd $(SRCDIR); \ @cd $(SRCDIR) && make
$(MAKE)
$(ROOT): $(SRCDIR)/src/diff $(ROOT): $(SRCDIR)/src/diff
@if [ -d $(ROOT) ]; then \ @if [ -d $(ROOT) ]; then \
@@ -63,14 +61,10 @@ $(ROOT): $(SRCDIR)/src/diff
mkdir -v $(ROOT); \ mkdir -v $(ROOT); \
fi fi
@cd $(SRCDIR); \ @cd $(SRCDIR) && make mkdir_p='/bin/mkdir -p' install DESTDIR=$(ROOT)
$(MAKEINST) DESTDIR=$(ROOT)
@$(SNAPHACKS)
test: $(ROOT) test: $(ROOT)
@cd $(SRCDIR); \ @cd $(SRCDIR) && make check
make check
clean: clean:
@rm -rvf $(ROOT) \ @rm -rvf $(ROOT) \