63 lines
1.3 KiB
Makefile
63 lines
1.3 KiB
Makefile
.PHONY: control
|
|
|
|
VERSION=0.6.2
|
|
BASENAME=maddy
|
|
|
|
help:
|
|
@echo
|
|
@echo "make all # to attempt to download, extract and build the .deb package using dpkg"
|
|
@echo
|
|
|
|
all: download clean extract DEBIAN build
|
|
|
|
# uses 'ar' to make a .deb file
|
|
raw: download clean extract DEBIAN tar-ar
|
|
|
|
clean:
|
|
rm -rf ../files
|
|
rm -f ../*.deb
|
|
rm -f ../*.tar.xz data.tar.xz
|
|
rm -rf DEBIAN
|
|
|
|
download:
|
|
@echo
|
|
@echo This uses the binary /usr/local/bin/maddy
|
|
@echo
|
|
|
|
extract:
|
|
cp -a files ../
|
|
mkdir -p ../files/usr/bin
|
|
cp /usr/local/bin/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
|
|
|
|
# how to make a debian package "raw" just using tar and ar
|
|
#
|
|
# READ THIS AGAIN:
|
|
#
|
|
# A .deb file is just output from 'ar rcs'
|
|
#
|
|
tar-ar: control
|
|
cd DEBIAN && tar --ignore-failed-read -cvJf ../control.tar.xz .
|
|
cd files && tar -cvJf ../data.tar.xz .
|
|
ar rcs ${BASENAME}_${VERSION}_amd64.deb debian-binary control.tar.xz data.tar.xz
|
|
dpkg-deb --info ${BASENAME}_${VERSION}_amd64.deb
|