50 lines
1.4 KiB
Makefile
50 lines
1.4 KiB
Makefile
.PHONY: control
|
|
|
|
VERSION=7.3.0
|
|
MINOR=v6
|
|
|
|
help:
|
|
@echo
|
|
@echo "make all # to attempt to download, extract and build the .deb package"
|
|
@echo "make raw # to build a .deb using 'tar' and 'ar'"
|
|
@echo
|
|
|
|
all: download clean extract build
|
|
|
|
raw: download clean extract raw
|
|
|
|
clean:
|
|
rm -rf .debian/files/opt/
|
|
rm -rf files/opt files/DEBIAN/control
|
|
rm -f *.deb
|
|
rm -f control.tar.xz data.tar.xz
|
|
|
|
download:
|
|
wget -c https://releases.mattermost.com/${VERSION}/mattermost-${VERSION}-linux-amd64.tar.gz
|
|
|
|
extract:
|
|
mkdir -p .debian/files/opt/
|
|
cd .debian/files/opt/ && tar xfz ../../../mattermost-${VERSION}-linux-amd64.tar.gz
|
|
mkdir -p files/opt/
|
|
cd files/opt/ && tar xfz ../../mattermost-${VERSION}-linux-amd64.tar.gz
|
|
|
|
# update the bash-completion script
|
|
bash-completion:
|
|
mattermost completion bash > .debian/files/etc/bash_completion.d/mattermost
|
|
|
|
control:
|
|
mkdir -p files/DEBIAN
|
|
cp control files/DEBIAN/
|
|
echo Version: ${VERSION}.${MINOR} >>files/DEBIAN/control
|
|
|
|
build: control
|
|
dpkg-deb --build files mattermost_${VERSION}.${MINOR}_amd64.deb
|
|
dpkg-deb --info mattermost_${VERSION}.${MINOR}_amd64.deb
|
|
|
|
# how to make a debian package "raw" just using tar and ar
|
|
raw: control
|
|
cd files/DEBIAN && tar --ignore-failed-read -cvJf ../../control.tar.xz preinst md5sums control
|
|
cd files && tar -cvJf ../data.tar.xz .
|
|
ar rcs mattermost_${VERSION}.${MINOR}_amd64.deb debian-binary control.tar.xz data.tar.xz
|
|
dpkg-deb --info mattermost_${VERSION}.${MINOR}_amd64.deb
|