add something to make coredns deb packages

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2023-01-27 13:55:22 -06:00
parent 391c8f7f77
commit fc61b5b9b5
6 changed files with 101 additions and 0 deletions

69
coredns/Makefile Normal file
View File

@ -0,0 +1,69 @@
.PHONY: control
# TARBALL=~/tmp/flutter-3.7.0-1.5.pre.tgz
VERSION=1.10.1
MINOR=7da2ceda
BASENAME=coredns
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 CHECK FOR NEW VERSION via 'git tags'
@echo
extract:
mkdir -p ../files/
mkdir -p ../files/usr/bin
mkdir -p ../files/usr/share/man/man1/ ../files/usr/share/man/man5/ ../files/usr/share/man/man7/
cp ~/go/src/github.com/coredns/coredns/coredns ../files/usr/bin
cp ~/go/src/github.com/coredns/coredns/man/*.1 ../files/usr/share/man/man1/
cp ~/go/src/github.com/coredns/coredns/man/*.5 ../files/usr/share/man/man5/
cp ~/go/src/github.com/coredns/coredns/man/*.7 ../files/usr/share/man/man7/
# makes the DEBIAN/ directory
DEBIAN:
mkdir -p DEBIAN
make md5sum
make control
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 >../md5sums
mv ../md5sums DEBIAN/
build:
mv DEBIAN ../files/
cd .. && dpkg-deb --build files ${BASENAME}_${VERSION}.${MINOR}_amd64.deb
cd .. && dpkg-deb --info ${BASENAME}_${VERSION}.${MINOR}_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}.${MINOR}_amd64.deb debian-binary control.tar.xz data.tar.xz
dpkg-deb --info ${BASENAME}_${VERSION}.${MINOR}_amd64.deb

5
coredns/changelog Normal file
View File

@ -0,0 +1,5 @@
coredns (0-0) UNRELEASED; urgency=medium
* Package for Debian.
-- Miek Gieben <miek@coredns.io> Sat, 11 Nov 2017 09:52:00 +0000

1
coredns/compat Normal file
View File

@ -0,0 +1 @@
10

7
coredns/control Normal file
View File

@ -0,0 +1,7 @@
Source: coredns
Maintainer: Miek Gieben <miek@coredns.io>
Build-Depends: debhelper (>= 9), ca-certificates, curl, lsb-release, jq
Package: coredns
Architecture: any
Description: DNS server that chains plugins
Depends: adduser

3
coredns/coredns.manpages Normal file
View File

@ -0,0 +1,3 @@
debian/man/coredns.1
debian/man/corefile.5
debian/man/coredns-*.7

16
coredns/postinst Executable file
View File

@ -0,0 +1,16 @@
#!/bin/sh
set -e
case "$1" in
configure)
if ! getent passwd coredns > /dev/null; then
adduser --system --disabled-password --disabled-login --home /var/lib/coredns \
--quiet --force-badname --group coredns
fi
;;
esac
#DEBHELPER#
exit 0