/Makefile
/build-aux
/missing
+/src/scripts/dnsbl
/tmp
/*.tar.bz2
/*.tar.gz
# keep itermediate files
.SECONDARY:
+
+CLEANFILES =
+EXTRA_DIST =
+
+# ------------------------------------------------------------------------------
+
+SED_PROCESS = \
+ $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(SED) \
+ -e 's,@PYTHON\@,$(PYTHON),g' \
+ -e 's,@VERSION\@,$(VERSION),g' \
+ -e 's,@prefix\@,$(prefix),g' \
+ -e 's,@exec_prefix\@,$(exec_prefix),g' \
+ -e 's,@bindir\@,$(bindir),g' \
+ -e 's,@libdir\@,$(libdir),g' \
+ < $< > $@
+
+%: %.in Makefile
+ $(SED_PROCESS)
+
+# ------------------------------------------------------------------------------
+
+dist_pkgpython_PYTHON = \
+ src/dnsbl/__init__.py \
+ src/dnsbl/i18n.py
+
+# ------------------------------------------------------------------------------
+
+CLEANFILES += \
+ src/scripts/dnsbl
+
+EXTRA_DIST += \
+ src/scripts/dnsbl.in
+
+bin_SCRIPTS = \
+ src/scripts/dnsbl
# ------------------------------------------------------------------------------
+AC_PROG_SED
+AC_PROG_MKDIR_P
+
+# ------------------------------------------------------------------------------
+
# Python
AM_PATH_PYTHON([3.13])
--- /dev/null
+###############################################################################
+# #
+# dnsbl - A DNS Blacklist Compositor For IPFire #
+# Copyright (C) 2025 IPFire Development Team #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
+
+import configparser
+
+class Backend(object):
+ def __init__(self, config=None):
+ # Parse the configuration file
+ self.config = self.parse_config(config)
+
+ def parse_config(self, config=None):
+ """
+ Reads the configuration file
+ """
+ # Create a new configuration object
+ c = configparser.ConfigParser(interpolation=None)
+
+ # Parse the file
+ if config:
+ c.read_file(config)
+
+ return c
--- /dev/null
+###############################################################################
+# #
+# dnsbl - A DNS Blacklist Compositor For IPFire #
+# Copyright (C) 2025 IPFire Development Team #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
+
+import gettext
+
+def _(singular, plural=None, n=None):
+ if plural:
+ return gettext.dngettext("dnsbl", singular, plural, n)
+
+ return gettext.dgettext("dnsbl", singular)
--- /dev/null
+#!@PYTHON@
+###############################################################################
+# #
+# dnsbl - A DNS Blacklist Compositor For IPFire #
+# Copyright (C) 2025 IPFire Development Team #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
+
+import argparse
+import dnsbl
+import sys
+
+# i18n
+from dnsbl.i18n import _
+
+class CLI(object):
+ def parse_cli(self):
+ """
+ Main Function.
+ """
+ parser = argparse.ArgumentParser(
+ description=_("DNS Blocklist Command Line Interface"),
+ )
+ subparsers = parser.add_subparsers()
+
+ # Global Configuration Flags
+ parser.add_argument("--debug", action="store_true", help=_("Enable debug output"))
+ parser.add_argument("--config",
+ type=argparse.FileType("r"), help=_("Configuration File"))
+
+ # Show Version
+ parser.add_argument("--version", action="version", version="%(prog)s @VERSION@")
+
+ # Parse all arguments
+ args = parser.parse_args()
+
+ # Print usage if no action was given
+ if not "func" in args:
+ parser.print_usage()
+ sys.exit(2)
+
+ def run(self):
+ # Parse the command line
+ args = self.parse_cli()
+
+ # XXX Configure logging
+
+ # Initialize the backend
+ backend = dnsbl.Backend(args.config)
+
+ # XXX TODO
+
+def main():
+ c = CLI()
+ c.run()
+
+if __name__ == "__main__":
+ main()