package-stuff/maddy/Makefile

56 lines
1.4 KiB
Makefile

.PHONY: control
# ~/go/src/github.com/foxcpp/maddy/build/maddy version
# VERSION=0.6.2+9a87d73
GITVERSION=$(shell ~/go/src/github.com/foxcpp/maddy/build/maddy version |cut -f1 -d\ |head -n 1)
VERSION=$(GITVERSION).3
BASENAME=maddy
all: clean extract DEBIAN build
help:
@echo
@echo "make all # to attempt to download, extract and build the .deb package using dpkg"
@echo
source:
GO111MODULE="off" go get -v -u github.com/foxcpp/maddy
echo
echo "cd ~/go/src/github.com/foxcpp/maddy/ && ./build.sh"
echo
# https://github.com/foxcpp/maddy.git
clean:
rm -rf ../files
rm -f ../*.deb
rm -f ../*.tar.xz data.tar.xz
rm -rf DEBIAN
extract:
cp ~/go/src/github.com/foxcpp/maddy/build/maddy.conf files/etc/maddy/orig-maddy.conf
cp ~/go/src/github.com/foxcpp/maddy/build/systemd/maddy* files/lib/systemd/system/
cp -a files ../
mkdir -p ../files/usr/bin
cp ~/go/src/github.com/foxcpp/maddy/build/maddy ../files/usr/bin
# 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/
# make the control there
mkdir -p DEBIAN
cp control DEBIAN/
echo Version: ${VERSION} >>DEBIAN/control
cp postinst DEBIAN
build:
mv DEBIAN ../files/
cd .. && dpkg-deb --build files ${BASENAME}_${VERSION}_amd64.deb
cd .. && dpkg-deb --info ${BASENAME}_${VERSION}_amd64.deb