68 lines
1.8 KiB
Makefile
68 lines
1.8 KiB
Makefile
.PHONY: control
|
|
|
|
VERSION=7.7.1
|
|
MINOR=v10
|
|
|
|
help:
|
|
@echo
|
|
@echo "make all # to attempt to download, extract and build the .deb package using dpkg"
|
|
@echo "make raw # to attempt to download, extract and build the .deb package using 'tar' and 'ar'"
|
|
@echo
|
|
|
|
all: download clean extract DEBIAN build
|
|
|
|
raw: download clean extract DEBIAN tar-ar
|
|
|
|
clean:
|
|
rm -rf files/opt files/DEBIAN/control
|
|
rm -f *.deb
|
|
rm -f control.tar.xz data.tar.xz
|
|
rm -rf files/DEBIAN DEBIAN
|
|
|
|
download:
|
|
@echo
|
|
@echo
|
|
@echo CHECK FOR NEW VERSION AT: https://mattermost.com/deploy/
|
|
@echo CHECK FOR NEW VERSION AT: https://mattermost.com/deploy/
|
|
@echo CHECK FOR NEW VERSION AT: https://mattermost.com/deploy/
|
|
@echo
|
|
@echo
|
|
sleep 3
|
|
cd .. && wget -c https://releases.mattermost.com/${VERSION}/mattermost-${VERSION}-linux-amd64.tar.gz
|
|
|
|
extract:
|
|
mkdir -p ../files/opt/
|
|
cd ../files/opt/ && tar xfz ../../mattermost-${VERSION}-linux-amd64.tar.gz
|
|
|
|
# update the bash-completion script
|
|
bash-completion:
|
|
cd ../ && mattermost completion bash > files/etc/bash_completion.d/mattermost
|
|
|
|
# makes the DEBIAN/ directory
|
|
DEBIAN:
|
|
mkdir -p DEBIAN
|
|
make md5sum
|
|
make control
|
|
cp preinst DEBIAN
|
|
cp postinst DEBIAN
|
|
|
|
control:
|
|
mkdir -p DEBIAN
|
|
cp control DEBIAN/
|
|
echo Version: ${VERSION}.${MINOR} >>DEBIAN/control
|
|
|
|
md5sum:
|
|
cd ../files/ && find -type f -exec md5sum '{}' \; |sort -k2 >../DEBIAN/md5sums
|
|
|
|
build:
|
|
mv DEBIAN ../files/
|
|
cd ../files && dpkg-deb --build files mattermost_${VERSION}.${MINOR}_amd64.deb
|
|
cd ../files && dpkg-deb --info mattermost_${VERSION}.${MINOR}_amd64.deb
|
|
|
|
# how to make a debian package "raw" just using tar and ar
|
|
tar-ar: control
|
|
cd DEBIAN && tar --ignore-failed-read -cvJf ../control.tar.xz .
|
|
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
|