package-stuff/wit/Makefile

43 lines
1011 B
Makefile

VERSION=$(shell git describe --tags $(git rev-list --tags --max-count=1) | sed 's/^v//')
BASENAME=wit
all: clean extract DEBIAN build
cd .. && wit mirrors
help:
@echo
@echo "make all # to attempt to download, extract and build the .deb package using dpkg"
@echo
update-keyring:
curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor >bazel-archive-keyring.gpg
clean:
rm -rf ../files
rm -f ../*.deb
rm -f ../*.tar.xz data.tar.xz
rm -rf DEBIAN
extract:
cp -r files ..
# makes the DEBIAN/ directory
DEBIAN:
mkdir -p DEBIAN
# make the md5sum file
cd files/ && find -type f -exec md5sum '{}' \; |sort -k2 >../md5sums
mv md5sums DEBIAN/
cp control DEBIAN/
echo Version: ${VERSION} >>DEBIAN/control
echo Build-Date: `date` >>DEBIAN/control
echo Source-Date: `stat -c %z ../wit` >>DEBIAN/control
cp postinst DEBIAN/
mv DEBIAN ../files/
build:
cd .. && dpkg-deb --build files ${BASENAME}_${VERSION}_amd64.deb
cd .. && dpkg-deb --info ${BASENAME}_${VERSION}_amd64.deb