The following changes were made to Makefile:
* Added BRIEF * Moved to new version scheme * Corrected patch loop * Moved make commands to more appropriate location * Moved old snaphacks (cleanup) to make install section
This commit is contained in:
29
Makefile
29
Makefile
@@ -11,21 +11,16 @@
|
||||
DEPENDS =
|
||||
ARCH = x86_64
|
||||
URL = http://www.gzip.org/
|
||||
BRIEF = Compression utility
|
||||
DESC = gzip (GNU zip) is a compression utility designed to be a replacement \
|
||||
for compress.
|
||||
SNAPVER = sr1
|
||||
SNAPVER = 2
|
||||
|
||||
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 = install -d -m 755 $(ROOT)/bin && \
|
||||
mv -v $(ROOT)/usr/bin/{gunzip,gzip,zcat} $(ROOT)/bin && \
|
||||
rm -v $(ROOT)/usr/share/info/dir
|
||||
VERSION := $(shell echo $(SRCDIR)|egrep -o '\-[0-9].*'|sed 's/^-//')-$(SNAPVER)
|
||||
|
||||
include /usr/share/snap/Makefile.snaplinux
|
||||
|
||||
@@ -45,9 +40,10 @@ $(SRCDIR)/configure: $(ARCHIVE)
|
||||
@touch $(SRCDIR)/configure
|
||||
|
||||
$(SRCDIR)/config.log: $(SRCDIR)/configure
|
||||
@if [ -f $(PATCHDIR)/*.patch ]; then \
|
||||
cd $(SRCDIR) && cat $(PATCHDIR)/*.patch|patch --verbose -Np1; \
|
||||
fi
|
||||
@cd $(SRCDIR) && \
|
||||
for patch in `find $(PATCHDIR) -name \*.patch|sort`; do \
|
||||
patch --verbose -Np1 -i $$patch; \
|
||||
done
|
||||
@cd $(SRCDIR); \
|
||||
./configure \
|
||||
--prefix=/usr \
|
||||
@@ -56,8 +52,7 @@ $(SRCDIR)/config.log: $(SRCDIR)/configure
|
||||
--target=x86_64-snap-linux-gnu
|
||||
|
||||
$(SRCDIR)/gzip: $(SRCDIR)/config.log
|
||||
@cd $(SRCDIR); \
|
||||
$(MAKE)
|
||||
@cd $(SRCDIR) && make
|
||||
|
||||
$(ROOT): $(SRCDIR)/gzip
|
||||
@if [ -d $(ROOT) ]; then \
|
||||
@@ -66,10 +61,10 @@ $(ROOT): $(SRCDIR)/gzip
|
||||
mkdir -v $(ROOT); \
|
||||
fi
|
||||
|
||||
@cd $(SRCDIR); \
|
||||
$(MAKEINST) DESTDIR=$(ROOT)
|
||||
|
||||
@$(SNAPHACKS)
|
||||
@cd $(SRCDIR) && make install DESTDIR=$(ROOT) && \
|
||||
install -d -m 755 $(ROOT)/bin && \
|
||||
mv -v $(ROOT)/usr/bin/{gunzip,gzip,zcat} $(ROOT)/bin && \
|
||||
rm -v $(ROOT)/usr/share/info/dir
|
||||
|
||||
test: $(ROOT)
|
||||
@cd $(SRCDIR); \
|
||||
|
||||
Reference in New Issue
Block a user