diff --git a/.gitignore b/.gitignore index 66acf991a..1a4374edc 100644 --- a/.gitignore +++ b/.gitignore @@ -81,6 +81,9 @@ src/libknot/libknot.h # Generated tarballs /knot-*.tar.xz +# Packaging output +/pkg + # Code coverage *.gcda *.gcno diff --git a/distro/Makefile.am b/distro/Makefile.am index 442960d90..7228a1b8e 100644 --- a/distro/Makefile.am +++ b/distro/Makefile.am @@ -1,6 +1,4 @@ EXTRA_DIST = \ - arch \ common \ - deb \ - rpm \ + pkg \ tests diff --git a/distro/config/apkg.toml b/distro/config/apkg.toml new file mode 100644 index 000000000..abb8cbcd3 --- /dev/null +++ b/distro/config/apkg.toml @@ -0,0 +1,12 @@ +[project] +name = "knot-dns" +# needed for make-archive +make_archive_script = "scripts/make-dev-archive.sh" + +[upstream] +# needed for get-archive +archive_url = "https://secure.nic.cz/files/knot-dns/knot-{{ version }}.tar.xz" +signature_url = "https://secure.nic.cz/files/knot-dns/knot-{{ version }}.tar.xz.asc" + +[apkg] +compat = 1 diff --git a/distro/deb/knot.service b/distro/deb/knot.service deleted file mode 120000 index b340efb47..000000000 --- a/distro/deb/knot.service +++ /dev/null @@ -1 +0,0 @@ -../common/knot.service \ No newline at end of file diff --git a/distro/deb/knot.tmpfile b/distro/deb/knot.tmpfile deleted file mode 120000 index d0be116f6..000000000 --- a/distro/deb/knot.tmpfile +++ /dev/null @@ -1 +0,0 @@ -../common/knot.tmpfiles \ No newline at end of file diff --git a/distro/arch/PKGBUILD b/distro/pkg/arch/PKGBUILD similarity index 96% rename from distro/arch/PKGBUILD rename to distro/pkg/arch/PKGBUILD index eccde30ae..f8d68eaef 100644 --- a/distro/arch/PKGBUILD +++ b/distro/pkg/arch/PKGBUILD @@ -6,7 +6,7 @@ # Contributor: Otto Sabart pkgname=knot -pkgver=__VERSION__ +pkgver={{ version }} pkgrel=1 pkgdesc="High-performance authoritative-only DNS server" arch=('x86_64') @@ -23,7 +23,7 @@ depends=('fstrm' 'protobuf-c' 'systemd') backup=('etc/knot/knot.conf') -source=("${pkgname}_${pkgver}.orig.tar.xz") +source=("${pkgname}-${pkgver}.tar.xz") sha256sums=('SKIP') validpgpkeys=('742FA4E95829B6C5EAC6B85710BB7AF6FEBBD6AB') # Daniel Salzman diff --git a/distro/arch/knot.sysusers b/distro/pkg/arch/knot.sysusers similarity index 100% rename from distro/arch/knot.sysusers rename to distro/pkg/arch/knot.sysusers diff --git a/distro/arch/knot.tmpfiles.arch b/distro/pkg/arch/knot.tmpfiles.arch similarity index 100% rename from distro/arch/knot.tmpfiles.arch rename to distro/pkg/arch/knot.tmpfiles.arch diff --git a/distro/deb/changelog b/distro/pkg/deb/changelog similarity index 67% rename from distro/deb/changelog rename to distro/pkg/deb/changelog index 285b69e2c..5538ae1e3 100644 --- a/distro/deb/changelog +++ b/distro/pkg/deb/changelog @@ -1,4 +1,4 @@ -knot (__VERSION__-cznic.1) unstable; urgency=medium +knot ({{ version }}-cznic.{{ release }}) unstable; urgency=medium * move changelog to OBS * see NEWS or https://knot-dns.cz diff --git a/distro/deb/clean b/distro/pkg/deb/clean similarity index 100% rename from distro/deb/clean rename to distro/pkg/deb/clean diff --git a/distro/deb/compat b/distro/pkg/deb/compat similarity index 100% rename from distro/deb/compat rename to distro/pkg/deb/compat diff --git a/distro/deb/control b/distro/pkg/deb/control similarity index 99% rename from distro/deb/control rename to distro/pkg/deb/control index 58c1047a2..912b7b178 100644 --- a/distro/deb/control +++ b/distro/pkg/deb/control @@ -9,6 +9,8 @@ Build-Depends-Indep: python3-setuptools, python3-sphinx, Build-Depends: + autoconf, + automake, debhelper (>= 9), dh-python, libcap-ng-dev [!kfreebsd-i386 !kfreebsd-amd64 !hurd-i386], @@ -25,6 +27,7 @@ Build-Depends: libsofthsm2 , libsystemd-dev [linux-any] | libsystemd-daemon-dev [linux-any], libsystemd-dev [linux-any] | libsystemd-journal-dev [linux-any], + libtool, liburcu-dev (>= 0.4), pkg-config, protobuf-c-compiler, diff --git a/distro/deb/copyright b/distro/pkg/deb/copyright similarity index 100% rename from distro/deb/copyright rename to distro/pkg/deb/copyright diff --git a/distro/deb/docs b/distro/pkg/deb/docs similarity index 100% rename from distro/deb/docs rename to distro/pkg/deb/docs diff --git a/distro/deb/knot-dnsutils.NEWS b/distro/pkg/deb/knot-dnsutils.NEWS similarity index 100% rename from distro/deb/knot-dnsutils.NEWS rename to distro/pkg/deb/knot-dnsutils.NEWS diff --git a/distro/deb/knot-dnsutils.install b/distro/pkg/deb/knot-dnsutils.install similarity index 100% rename from distro/deb/knot-dnsutils.install rename to distro/pkg/deb/knot-dnsutils.install diff --git a/distro/deb/knot-doc.install b/distro/pkg/deb/knot-doc.install similarity index 100% rename from distro/deb/knot-doc.install rename to distro/pkg/deb/knot-doc.install diff --git a/distro/deb/knot-doc.links b/distro/pkg/deb/knot-doc.links similarity index 100% rename from distro/deb/knot-doc.links rename to distro/pkg/deb/knot-doc.links diff --git a/distro/deb/knot-host.NEWS b/distro/pkg/deb/knot-host.NEWS similarity index 100% rename from distro/deb/knot-host.NEWS rename to distro/pkg/deb/knot-host.NEWS diff --git a/distro/deb/knot-host.install b/distro/pkg/deb/knot-host.install similarity index 100% rename from distro/deb/knot-host.install rename to distro/pkg/deb/knot-host.install diff --git a/distro/deb/knot-module-dnstap.install b/distro/pkg/deb/knot-module-dnstap.install similarity index 100% rename from distro/deb/knot-module-dnstap.install rename to distro/pkg/deb/knot-module-dnstap.install diff --git a/distro/deb/knot-module-geoip.install b/distro/pkg/deb/knot-module-geoip.install similarity index 100% rename from distro/deb/knot-module-geoip.install rename to distro/pkg/deb/knot-module-geoip.install diff --git a/distro/deb/knot.NEWS b/distro/pkg/deb/knot.NEWS similarity index 100% rename from distro/deb/knot.NEWS rename to distro/pkg/deb/knot.NEWS diff --git a/distro/deb/knot.dirs b/distro/pkg/deb/knot.dirs similarity index 100% rename from distro/deb/knot.dirs rename to distro/pkg/deb/knot.dirs diff --git a/distro/deb/knot.init b/distro/pkg/deb/knot.init similarity index 100% rename from distro/deb/knot.init rename to distro/pkg/deb/knot.init diff --git a/distro/deb/knot.install b/distro/pkg/deb/knot.install similarity index 100% rename from distro/deb/knot.install rename to distro/pkg/deb/knot.install diff --git a/distro/deb/knot.maintscript b/distro/pkg/deb/knot.maintscript similarity index 100% rename from distro/deb/knot.maintscript rename to distro/pkg/deb/knot.maintscript diff --git a/distro/deb/knot.postinst b/distro/pkg/deb/knot.postinst similarity index 100% rename from distro/deb/knot.postinst rename to distro/pkg/deb/knot.postinst diff --git a/distro/deb/knot.postrm b/distro/pkg/deb/knot.postrm similarity index 100% rename from distro/deb/knot.postrm rename to distro/pkg/deb/knot.postrm diff --git a/distro/pkg/deb/knot.service b/distro/pkg/deb/knot.service new file mode 120000 index 000000000..fd50d80fe --- /dev/null +++ b/distro/pkg/deb/knot.service @@ -0,0 +1 @@ +../../common/knot.service \ No newline at end of file diff --git a/distro/pkg/deb/knot.tmpfile b/distro/pkg/deb/knot.tmpfile new file mode 120000 index 000000000..76b7acf6c --- /dev/null +++ b/distro/pkg/deb/knot.tmpfile @@ -0,0 +1 @@ +../../common/knot.tmpfiles \ No newline at end of file diff --git a/distro/deb/libdnssec8.install b/distro/pkg/deb/libdnssec8.install similarity index 100% rename from distro/deb/libdnssec8.install rename to distro/pkg/deb/libdnssec8.install diff --git a/distro/deb/libdnssec8.symbols b/distro/pkg/deb/libdnssec8.symbols similarity index 100% rename from distro/deb/libdnssec8.symbols rename to distro/pkg/deb/libdnssec8.symbols diff --git a/distro/deb/libknot-dev.install b/distro/pkg/deb/libknot-dev.install similarity index 100% rename from distro/deb/libknot-dev.install rename to distro/pkg/deb/libknot-dev.install diff --git a/distro/deb/libknot11.install b/distro/pkg/deb/libknot11.install similarity index 100% rename from distro/deb/libknot11.install rename to distro/pkg/deb/libknot11.install diff --git a/distro/deb/libknot11.symbols b/distro/pkg/deb/libknot11.symbols similarity index 98% rename from distro/deb/libknot11.symbols rename to distro/pkg/deb/libknot11.symbols index 748539df0..c097c60ab 100644 --- a/distro/deb/libknot11.symbols +++ b/distro/pkg/deb/libknot11.symbols @@ -7,8 +7,6 @@ libknot.so.11 libknot11 #MINVER# KNOT_DB_LMDB_RDONLY@Base 3.0.0 KNOT_DB_LMDB_WRITEMAP@Base 3.0.0 KNOT_DUMP_STYLE_DEFAULT@Base 3.0.0 - KNOT_XDP_PAYLOAD_OFFSET4@Base 3.0.0 - KNOT_XDP_PAYLOAD_OFFSET6@Base 3.0.0 knot_ctl_accept@Base 3.0.0 knot_ctl_alloc@Base 3.0.0 knot_ctl_bind@Base 3.0.0 @@ -78,6 +76,7 @@ libknot.so.11 libknot11 #MINVER# knot_edns_set_ext_rcode@Base 3.0.0 knot_edns_set_version@Base 3.0.0 knot_error_from_libdnssec@Base 3.0.0 + knot_eth_mtu@Base 3.1.0 knot_eth_name_from_addr@Base 3.0.0 knot_eth_queues@Base 3.0.0 knot_eth_xdp_mode@Base 3.0.2 @@ -181,11 +180,15 @@ libknot.so.11 libknot11 #MINVER# knot_xdp_init@Base 3.0.0 knot_xdp_recv@Base 3.0.0 knot_xdp_recv_finish@Base 3.0.0 + knot_xdp_reply_alloc@Base 3.1.0 knot_xdp_send@Base 3.0.0 knot_xdp_send_alloc@Base 3.0.0 knot_xdp_send_finish@Base 3.0.0 + knot_xdp_send_free@Base 3.1.0 knot_xdp_send_prepare@Base 3.0.0 knot_xdp_socket_fd@Base 3.0.0 + knot_xdp_tcp_relay@Base 3.1.0 + knot_xdp_tcp_send@Base 3.1.0 yp_addr@Base 3.0.0 yp_addr_noport@Base 3.0.0 yp_addr_noport_to_bin@Base 3.0.0 diff --git a/distro/deb/libzscanner3.install b/distro/pkg/deb/libzscanner3.install similarity index 100% rename from distro/deb/libzscanner3.install rename to distro/pkg/deb/libzscanner3.install diff --git a/distro/deb/libzscanner3.symbols b/distro/pkg/deb/libzscanner3.symbols similarity index 100% rename from distro/deb/libzscanner3.symbols rename to distro/pkg/deb/libzscanner3.symbols diff --git a/distro/deb/not-installed b/distro/pkg/deb/not-installed similarity index 100% rename from distro/deb/not-installed rename to distro/pkg/deb/not-installed diff --git a/distro/deb/prepare-environment b/distro/pkg/deb/prepare-environment similarity index 100% rename from distro/deb/prepare-environment rename to distro/pkg/deb/prepare-environment diff --git a/distro/deb/rules b/distro/pkg/deb/rules similarity index 100% rename from distro/deb/rules rename to distro/pkg/deb/rules diff --git a/distro/deb/source/format b/distro/pkg/deb/source/format similarity index 100% rename from distro/deb/source/format rename to distro/pkg/deb/source/format diff --git a/distro/deb/tests/control b/distro/pkg/deb/tests/control similarity index 100% rename from distro/deb/tests/control rename to distro/pkg/deb/tests/control diff --git a/distro/deb/tests/kdig b/distro/pkg/deb/tests/kdig similarity index 100% rename from distro/deb/tests/kdig rename to distro/pkg/deb/tests/kdig diff --git a/distro/deb/ufw/knot b/distro/pkg/deb/ufw/knot similarity index 100% rename from distro/deb/ufw/knot rename to distro/pkg/deb/ufw/knot diff --git a/distro/deb/watch b/distro/pkg/deb/watch similarity index 100% rename from distro/deb/watch rename to distro/pkg/deb/watch diff --git a/distro/rpm/01-test_net-disable-udp-send-on-unconnected.patch b/distro/pkg/rpm/01-test_net-disable-udp-send-on-unconnected.patch similarity index 100% rename from distro/rpm/01-test_net-disable-udp-send-on-unconnected.patch rename to distro/pkg/rpm/01-test_net-disable-udp-send-on-unconnected.patch diff --git a/distro/rpm/knot.spec b/distro/pkg/rpm/knot.spec similarity index 98% rename from distro/rpm/knot.spec rename to distro/pkg/rpm/knot.spec index 12a632591..254d6805d 100644 --- a/distro/rpm/knot.spec +++ b/distro/pkg/rpm/knot.spec @@ -2,17 +2,16 @@ %{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}} %define GPG_CHECK 0 -%define VERSION __VERSION__ %define BASE_VERSION %(echo "%{version}" | sed 's/^\\([^.]\\+\\.[^.]\\+\\).*/\\1/') %define repodir %{_builddir}/%{name}-%{version} Summary: High-performance authoritative DNS server Name: knot -Version: %{VERSION} -Release: cznic.1%{?dist} +Version: {{ version }} +Release: cznic.{{ release }}%{?dist} License: GPL-3.0-or-later URL: https://www.knot-dns.cz -Source0: %{name}_%{version}.orig.tar.xz +Source0: %{name}-%{version}.tar.xz %if 0%{?GPG_CHECK} Source1: https://secure.nic.cz/files/knot-dns/%{name}-%{version}.tar.xz.asc @@ -27,6 +26,9 @@ BuildRequires: gnupg2 Patch1: 01-test_net-disable-udp-send-on-unconnected.patch # Required dependencies +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: libtool BuildRequires: make BuildRequires: gcc BuildRequires: pkgconfig(liburcu) diff --git a/scripts/make-dev-archive.sh b/scripts/make-dev-archive.sh new file mode 100755 index 000000000..693ca506e --- /dev/null +++ b/scripts/make-dev-archive.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-3.0-or-later +# Create a develpoment tarball +set -o errexit -o nounset -o xtrace + +cd "$(dirname ${0})/.." + +# configure Knot DNS in order to create archive +autoreconf -if +./configure +# create archive and parse output for archive name +TARDIR=$(make dist 2>&1 | sed -n 's/tardir=\([^ ]\+\).*/\1/p') +# print created archive name +ls -1 $TARDIR.tar.*