2018-01-31 16:30:19 +00:00
|
|
|
PHOHY = clean release
|
|
|
|
|
2018-08-28 07:15:10 +00:00
|
|
|
VERSION:=0.16.0
|
2018-01-31 16:30:19 +00:00
|
|
|
BASEURL:=https://azuredraft.blob.core.windows.net/draft
|
|
|
|
URL_386:=${BASEURL}/draft-v${VERSION}-linux-386.tar.gz
|
|
|
|
URL_AMD64:=${BASEURL}/draft-v${VERSION}-linux-amd64.tar.gz
|
|
|
|
|
|
|
|
check:
|
|
|
|
ifndef VERSION
|
|
|
|
@echo "Define version in ENV"
|
|
|
|
@exit 1;
|
|
|
|
else
|
|
|
|
@echo "Build version ${VERSION}"
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
tmp:
|
|
|
|
@mkdir -p tmp
|
|
|
|
|
|
|
|
tmp/draft_amd64-${VERSION}: tmp
|
|
|
|
curl -s ${URL_AMD64} > tmp/draft_amd64-${VERSION}
|
|
|
|
|
|
|
|
|
|
|
|
tmp/draft_386-${VERSION}: tmp
|
|
|
|
curl -s ${URL_386} > tmp/draft_386-${VERSION}
|
|
|
|
|
|
|
|
pkgbuild: tmp/draft_amd64-${VERSION} tmp/draft_386-${VERSION} PKGBUILD.template
|
|
|
|
set -e; \
|
|
|
|
echo ${URL_386}; \
|
|
|
|
MD5_386=`md5sum tmp/draft_386-${VERSION} | awk '{print $$1}'`; \
|
|
|
|
MD5_AMD64=`md5sum tmp/draft_amd64-${VERSION} | awk '{print $$1}'`; \
|
|
|
|
sed -r -e "s#PKGVER#${VERSION}#g" \
|
|
|
|
-e "s#URL_386#${URL_386}#g" \
|
|
|
|
-e "s#URL_AMD64#${URL_AMD64}#g" \
|
|
|
|
-e "s#MD5_386#$${MD5_386}#g" \
|
|
|
|
-e "s#MD5_AMD64#$${MD5_AMD64}#g" PKGBUILD.template > PKGBUILD; \
|
|
|
|
makepkg --printsrcinfo > .SRCINFO; \
|
|
|
|
|
|
|
|
release: pkgbuild
|
|
|
|
makepkg; \
|
2018-04-12 08:22:45 +00:00
|
|
|
sudo pacman -U draft-bin-${VERSION}-*; \
|
2018-01-31 16:30:19 +00:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf PKGBUILD draft-* pkg src *.bak tmp
|