Added dependencies and extracted source since it needs to be tracked

This commit is contained in:
2016-10-28 14:51:20 -05:00
parent af4facd894
commit 0a2d3412e1
5 changed files with 323 additions and 28 deletions

View File

@@ -8,38 +8,19 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
DEPENDS =
DEPENDS = find,kmod,psmisc,sed
ARCH = x86_64
URL =
DESC =
SNAPVER = sr0
DESC = This package includes scripts to build an initrd image
SNAPVER = sr1
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/\/.*//')
ARCHIVE := ''
SRCDIR := $(PWD)/SRC/mkinitramfs-*
PATCHDIR := $(PWD)/SRC/patches
VERSION := $(shell echo $(SRCDIR)|egrep -o '\-[0-9].*'|sed 's/^-//')$(SNAPVER)
MAKEINST = make install
SNAPHACKS =
include /usr/share/snap/Makefile.snaplinux
$(SRCDIR)/Makefile: $(ARCHIVE)
@if [ '$(TYPE)' == 'application/x-bzip2' ]; then \
tar -jxf $(ARCHIVE); \
elif [ '$(TYPE)' == 'application/x-gzip' ]; then \
tar -zxf $(ARCHIVE); \
elif [ '$(TYPE)' == 'application/x-tar' ]; then \
tar -xf $(ARCHIVE); \
elif [ '$(TYPE)' == 'application/x-xz' ]; then \
tar -xf $(ARCHIVE); \
else \
echo 'Unable to determine archive type'; \
exit 1; \
fi
@touch $(SRCDIR)/Makefile
$(ROOT): $(SRCDIR)/Makefile
@if [ -d $(ROOT) ]; then \
touch $(ROOT); \
@@ -47,10 +28,7 @@ $(ROOT): $(SRCDIR)/Makefile
mkdir -v $(ROOT); \
fi
@cd $(SRCDIR); \
$(MAKEINST) DESTDIR=$(ROOT)
@$(SNAPHACKS)
@cd $(SRCDIR) && make install DESTDIR=$(ROOT)
clean:
@rm -rvf $(ROOT) \