Skip to content
Snippets Groups Projects
Verified Commit 0a7fdf08 authored by Tomas Krizek's avatar Tomas Krizek
Browse files

debian: remove deprecated files and cleanup

parent ac2acdba
No related branches found
No related tags found
1 merge request!884Packaging: automate build in OBS
[Unit]
Description=Knot DNS server
After=syslog.target network.target
Wants=network-online.target
After=syslog.target network-online.target
Documentation=man:knotd(8) man:knot.conf(5) man:knotc(8)
[Service]
Type=notify
......
......@@ -36,12 +36,8 @@ Depends:
libknot7 (= ${binary:Version}),
libzscanner1 (= ${binary:Version}),
lsb-base (>= 3.0-6),
python3,
python3-yaml,
${misc:Depends},
${shlibs:Depends},
Recommends:
python3-lmdb,
Suggests:
systemd,
Description: Authoritative domain name server
......
......@@ -32,11 +32,11 @@ License: GPL-3+ with OpenSSL exception
On Debian systems, the full text of the GNU General Public License
version 3 can be found in the file `/usr/share/common-licenses/GPL-3'.
Files: libtap/*
Files: tests/tap/*
Copyright: 2000-2001, 2004, 2006-2011 Russ Allbery <rra@stanford.edu>
License: Expat
Files: src/contrib/ucw/lists.c
Files: src/contrib/ucw/*
Copyright: 1998 Martin Mares <mj@ucw.cz>
License: GPL-3+
......
README
THANKS
#!/usr/bin/python3
import yaml, os.path, sys
conf_file = '/etc/knot/knot.conf'
ip_fields = ['listen', 'address', 'via', 'whitelist', 'network']
try:
conf = yaml.load(open(conf_file, 'r'))
except yaml.scanner.ScannerError:
conf = False
if not conf:
import io
conf_io = io.BytesIO()
with open(conf_file) as f:
for line in f:
if line.split(':')[0].strip() not in ip_fields:
conf_io.write(line)
conf_io.seek(0)
try:
conf = yaml.load(conf_io)
except yaml.scanner.ScannerError:
sys.exit(1)
dirs = set()
# if we have valid yaml use it
if conf.has_key("template"):
for template in conf["template"]:
if template.has_key("kasp-db"):
kasp_db = template["kasp-db"]
else:
continue
if not os.path.isabs(kasp_db):
if template.has_key("storage"):
kasp_db = os.path.join(template["storage"], kasp_db)
else:
continue
dirs.add(kasp_db)
if conf.has_key("zone"):
for domain in conf["zone"]:
if domain.has_key("kasp-db"):
kasp_db = domain["kasp-db"]
else:
continue
if not os.path.isabs(kasp_db):
if domain.has_key("storage"):
kasp_db = os.path.join(domain["storage"], kasp_db)
else:
continue
dirs.add(kasp_db)
for dir in dirs:
print(dir)
#!/usr/bin/python3
import yaml, sys
conf_file = '/etc/knot/knot.conf'
ip_fields = ['listen', 'address', 'via', 'whitelist', 'network']
try:
conf = yaml.load(open(conf_file, 'r'))
except yaml.scanner.ScannerError:
conf = False
if not conf:
import io
conf_io = io.BytesIO()
with open(conf_file) as f:
for line in f:
if line.split(':')[0].strip() not in ip_fields:
conf_io.write(line)
conf_io.seek(0)
try:
conf = yaml.load(conf_io)
except yaml.scanner.ScannerError:
sys.exit(1)
if conf.has_key("server"):
if conf["server"].has_key("user"):
print(conf["server"]["user"].split(":")[0].split(".")[0])
KNOTD_ARGS=""
debian/get_kaspdb usr/lib/knot/
debian/get_user usr/lib/knot/
debian/ufw/knot etc/ufw/applications.d/
etc/knot/knot.conf
usr/bin/kjournalprint
usr/sbin/kjournalprint
usr/bin/knsec3hash
usr/bin/kzonecheck
usr/sbin/keymgr
usr/sbin/knotc
usr/sbin/knotd
usr/sbin/pykeymgr
usr/share/man/man1/kjournalprint.1
usr/share/man/man1/knsec3hash.1
usr/share/man/man1/kzonecheck.1
......@@ -16,4 +13,3 @@ usr/share/man/man5/knot.conf.5
usr/share/man/man8/keymgr.8
usr/share/man/man8/knotc.8
usr/share/man/man8/knotd.8
usr/share/man/man8/pykeymgr.8
......@@ -8,17 +8,7 @@ if [ "$1" = "configure" ]; then
dpkg-statoverride --list /var/lib/knot > /dev/null || dpkg-statoverride --update --add knot knot 0755 /var/lib/knot
dpkg-statoverride --list /etc/knot/knot.conf > /dev/null || dpkg-statoverride --update --add knot knot 0640 /etc/knot/knot.conf
dpkg-statoverride --list /etc/knot > /dev/null || dpkg-statoverride --update --add knot knot 0750 /etc/knot
fi
if [ "$1" = "configure" ] && [ -n "$2" ] && dpkg --compare-versions "$2" lt "2.5.0-1~"; then
KNOT_USER=$(/usr/lib/knot/get_user 2>/dev/null || echo "knot")
/usr/lib/knot/get_kaspdb | while read KASPDB; do
if [ ! -f "${KASPDB}/data.mdb" ]; then
su --shell /bin/bash --command "/usr/sbin/pykeymgr -i '${KASPDB}'" "${KNOT_USER}";
fi
done
dpkg-statoverride --list /etc/knot > /dev/null || dpkg-statoverride --update --add knot knot 0750 /etc/knot
fi
#DEBHELPER#
......
[Unit]
Description=Knot DNS server
Wants=network-online.target
After=network-online.target
Documentation=man:knotd(8) man:knot.conf(5) man:knotc(8)
[Service]
EnvironmentFile=/etc/default/knot
ExecReload=/usr/sbin/knotc reload
ExecStart=/usr/sbin/knotd $KNOTD_ARGS
Restart=on-abort
[Install]
WantedBy=multi-user.target
../../common/knot.service
\ No newline at end of file
From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Date: Tue, 20 Feb 2018 11:08:30 -0800
Subject: use python3 in pykeymgr
Debian currently explicitly uses the name "python3" to refer to python
3, so adjust the shebang line to match.
While we're at it, encourage the user to install packages via apt,
instead of pip.
Also, note that py3 uses / for "normal" division, but // is integer
division on both py2 and py3.
---
src/utils/pykeymgr/pykeymgr.in | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
Index: knot-dns/src/utils/pykeymgr/pykeymgr.in
===================================================================
--- knot-dns.orig/src/utils/pykeymgr/pykeymgr.in
+++ knot-dns/src/utils/pykeymgr/pykeymgr.in
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# vim: et ts=4 sw=4 sts=4
#
# Manipulate LMDB-beckended KASP database (import from obsolete JSON KASP, list, modify...).
@@ -30,7 +30,7 @@ def lmdb_requirement():
lmdb = importlib.import_module('lmdb')
except ImportError:
print("Error: unable to import module LMDB.")
- print("Probably you need to 'pip install lmdb' or so.")
+ print("Probably you need to 'apt install python3-lmdb'.")
sys.exit(10)
# workarounding that python 2 doesn't have int.to_bytes()
@@ -84,7 +84,7 @@ def shuffle_unixtime(base_time, shuffle_
dt = datetime.datetime.fromtimestamp(base_time)
newmonth = (dt.month - 1 + rsm) % 12 + 1 # in python, % always returns [0, 11]
sameyear = dt.month + rsm % 12
- newyear = dt.year + rsm / 12 + (0 if sameyear in range(1, 13) else 1) # in python, (-1)/12 = -1
+ newyear = dt.year + rsm // 12 + (0 if sameyear in range(1, 13) else 1) # in python, (-1)//12 = -1
dt2 = dt.replace(month=newmonth, year=newyear)
print(dt2.month, "/", dt2.year)
ttuple = dt2.timetuple()
0001-use-python3-in-pykeymgr.patch
......@@ -7,7 +7,7 @@
# To enable all, uncomment following line
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_CFLAGS_MAINT_APPEND = -Wall -DNDEBUG
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed -latomic
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
export DPKG_GENSYMBOLS_CHECK_LEVEL := 4
......@@ -45,7 +45,6 @@ override_dh_auto_configure:
--enable-systemd=auto \
--enable-dnstap \
--with-module-dnstap=yes \
--with-bash-completions \
$(RECVMMSG) \
$(FASTPARSER) \
--disable-silent-rules
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment