pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

knot-resolver: optimizing Makefile



Module Name:	pkgsrc-wip
Committed By:	Marcin Gondek <drixter%e-utp.net@localhost>
Pushed By:	drixter
Date:		Fri Jan 24 21:20:43 2025 +0100
Changeset:	4b365b736bc32152ef91ca3356911be9af464d8b

Modified Files:
	knot-resolver/Makefile
	knot-resolver/TODO
Added Files:
	knot-resolver/files/kresd.sh
Removed Files:
	knot-resolver/files/knot-resolver.sh

Log Message:
knot-resolver: optimizing Makefile

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=4b365b736bc32152ef91ca3356911be9af464d8b

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 knot-resolver/Makefile               |  8 ++++++--
 knot-resolver/TODO                   |  6 +++---
 knot-resolver/files/knot-resolver.sh | 13 -------------
 knot-resolver/files/kresd.sh         | 24 ++++++++++++++++++++++++
 4 files changed, 33 insertions(+), 18 deletions(-)

diffs:
diff --git a/knot-resolver/Makefile b/knot-resolver/Makefile
index b4df67ce51..31378b99b6 100644
--- a/knot-resolver/Makefile
+++ b/knot-resolver/Makefile
@@ -14,20 +14,24 @@ USE_LANGUAGES=	c c++
 
 CMAKE_ARGS+=		-DINSTALL_BINDIR="bin"
 CMAKE_ARGS+=		-DINSTALL_INFODIR="${PKGINFODIR}"
-CMAKE_ARGS+=		-DINSTALL_LIBDIR="lib"
+CMAKE_ARGS+=		-DINSTALL_LIBDIR="${PKGLIBDIR}"
 CMAKE_ARGS+=		-DINSTALL_MANDIR="${PKGMANDIR}"
 CMAKE_ARGS+=		-DCMAKE_INSTALL_SYSCONFDIR=${PKG_SYSCONFDIR}
 CMAKE_ARGS+=		-DINSTALL_SBINDIR="sbin"
 CMAKE_ARGS+=		-DINSTALL_SCRIPTDIR="bin"
 
+MESON_ARGS+=		-Dinstall_kresd_conf=enabled
+
 PKG_SYSCONFVAR=		knot-resolver
 
+MAKE_DIRS+=             ${LOCALBASE}/var/cache/knot-resovler
+
 .include "../../mk/bsd.prefs.mk"
 
 USE_LIBTOOL=	yes
 USE_TOOLS+=	cmake pkg-config
 
-RCD_SCRIPTS=	knot-resolver
+RCD_SCRIPTS=	kresd
 
 .include "../../net/knot/buildlink3.mk"
 .include "../../devel/libuv/buildlink3.mk"
diff --git a/knot-resolver/TODO b/knot-resolver/TODO
index 63993cfb95..4f7447c1ef 100644
--- a/knot-resolver/TODO
+++ b/knot-resolver/TODO
@@ -1,9 +1,9 @@
 # $NetBSD$
 
-[ ] Update Makefile
+[.] Update Makefile
 [ ] Create start-up script
-[ ] Ensure that all LUA points to proper folder after installation
-[ ] Create folder for cache
+[X] Ensure that all LUA points to proper folder after installation
+[X] Create folder for cache
 [ ] Sanity check of everything
 [ ] Run it it somewhere for test
 
diff --git a/knot-resolver/files/knot-resolver.sh b/knot-resolver/files/knot-resolver.sh
deleted file mode 100644
index 7c0c363759..0000000000
--- a/knot-resolver/files/knot-resolver.sh
+++ /dev/null
@@ -1,13 +0,0 @@
-# $NetBSD$
-#
-# PROVIDE: knot-resolver
-# REQUIRE: DAEMON
-# KEYWORD: shutdown
-#
-# You will need to set some variables in @SYSCONFBASE@/rc.conf to start knot-resolver:
-#
-# knot-resolver=YES
-
-name="knot-resolver"
-
-# TO BE CREATED
\ No newline at end of file
diff --git a/knot-resolver/files/kresd.sh b/knot-resolver/files/kresd.sh
new file mode 100644
index 0000000000..ccdaa8c12f
--- /dev/null
+++ b/knot-resolver/files/kresd.sh
@@ -0,0 +1,24 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD$
+#
+# PROVIDE: knot-resolver
+# REQUIRE: DAEMON
+
+if [ -f /etc/rc.subr ]; then
+	. /etc/rc.subr
+fi
+
+name="kresd"
+rcvar=$name
+command="@PREFIX@/sbin/daemonize "
+command_args="-p ${pidfile} @PREFIX@/sbin/${name} -c @PKG_SYSCONFDIR@/knot-resolver/${name}.conf -c @PKG_SYSCONFDIR@/../lib/knot-resolver/distro-preconfig.lua -n"
+required_files="@PKG_SYSCONFDIR@/knot-resolver/${name}.conf"
+
+if [ -f /etc/rc.subr ]; then
+	load_rc_config $name
+	run_rc_command "$1"
+else
+	@ECHO@ -n " ${name}"
+	${command} ${command_args}
+fi


Home | Main Index | Thread Index | Old Index