diff --git a/coredns/Makefile b/coredns/Makefile new file mode 100644 index 0000000..6781d7f --- /dev/null +++ b/coredns/Makefile @@ -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 diff --git a/coredns/changelog b/coredns/changelog new file mode 100644 index 0000000..ebe01f2 --- /dev/null +++ b/coredns/changelog @@ -0,0 +1,5 @@ +coredns (0-0) UNRELEASED; urgency=medium + + * Package for Debian. + + -- Miek Gieben Sat, 11 Nov 2017 09:52:00 +0000 diff --git a/coredns/compat b/coredns/compat new file mode 100644 index 0000000..f599e28 --- /dev/null +++ b/coredns/compat @@ -0,0 +1 @@ +10 diff --git a/coredns/control b/coredns/control new file mode 100644 index 0000000..f264ce9 --- /dev/null +++ b/coredns/control @@ -0,0 +1,7 @@ +Source: coredns +Maintainer: Miek Gieben +Build-Depends: debhelper (>= 9), ca-certificates, curl, lsb-release, jq +Package: coredns +Architecture: any +Description: DNS server that chains plugins +Depends: adduser diff --git a/coredns/coredns.manpages b/coredns/coredns.manpages new file mode 100644 index 0000000..89711df --- /dev/null +++ b/coredns/coredns.manpages @@ -0,0 +1,3 @@ +debian/man/coredns.1 +debian/man/corefile.5 +debian/man/coredns-*.7 diff --git a/coredns/postinst b/coredns/postinst new file mode 100755 index 0000000..6225e5b --- /dev/null +++ b/coredns/postinst @@ -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