From 04348b98214d8ce1e369b54f43511ab3bf5fbe18 Mon Sep 17 00:00:00 2001 From: "Brian C. Ledbetter" Date: Tue, 14 May 2024 01:49:02 +0000 Subject: [PATCH 01/12] Initial commit of SDNS package (needs testing) --- build/sdns/build.sh | 58 +++++++++++++++ build/sdns/files/sdns-template.xml | 110 +++++++++++++++++++++++++++++ build/sdns/local.mog | 22 ++++++ 3 files changed, 190 insertions(+) create mode 100755 build/sdns/build.sh create mode 100644 build/sdns/files/sdns-template.xml create mode 100644 build/sdns/local.mog diff --git a/build/sdns/build.sh b/build/sdns/build.sh new file mode 100755 index 000000000..182123ec8 --- /dev/null +++ b/build/sdns/build.sh @@ -0,0 +1,58 @@ +#!/usr/bin/bash +# +# {{{ CDDL HEADER +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# }}} + +# Copyright 2022 OmniOS Community Edition (OmniOSce) Association. + +. ../../lib/build.sh + +PROG=sdns +VER=1.3.6 +PKG=ooce/network/sdns +SUMMARY="sdns" +DESC="Simple DNS Server" + +set_arch 64 +set_gover 1.22 + +# No configure +configure_amd64() { :; } + +MAKE_INSTALL_ARGS="prefix=$PREFIX" + +build() { + pushd $TMPDIR/$BUILDDIR > /dev/null + + logmsg "Building $PROG" + export CGO_ENABLED=0 + export GOOS=illumos + + logcmd go build || logerr "Unable to build $PROG" + + popd >/dev/null +} + +init +clone_go_source $PROG semihalev v$VER +patch_source +print_config +prep_build +build +install_go $PROG +xform files/$PROG-template.xml > $TMPDIR/$PROG.xml +install_smf network $PROG.xml +make_package +clean_up + +# Vim hints +# vim:ts=4:sw=4:et:fdm=marker diff --git a/build/sdns/files/sdns-template.xml b/build/sdns/files/sdns-template.xml new file mode 100644 index 000000000..e256ecf77 --- /dev/null +++ b/build/sdns/files/sdns-template.xml @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/sdns/local.mog b/build/sdns/local.mog new file mode 100644 index 000000000..6573210ae --- /dev/null +++ b/build/sdns/local.mog @@ -0,0 +1,22 @@ +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. + +# Copyright 2024 Guo-Rong Koh + +license LICENSE license=MIT + +dir path=$(CONFIG) owner=$(USER) group=$(GROUP) mode=0700 +dir path=$(DATA) owner=$(USER) group=$(GROUP) mode=0700 +dir path=var/log/$(PREFIX)/$(PROG) owner=$(USER) group=$(GROUP) mode=0755 + + set preserve true> + + \ + set restart_fmri svc:/network/sdns:default> From 1fc3504df3a75ff928f755d2e6d0b06f2ca3f327 Mon Sep 17 00:00:00 2001 From: "Brian C. Ledbetter" Date: Tue, 14 May 2024 01:56:56 +0000 Subject: [PATCH 02/12] Adding missing variables to manifest --- build/sdns/build.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/build/sdns/build.sh b/build/sdns/build.sh index 182123ec8..a5afa8672 100755 --- a/build/sdns/build.sh +++ b/build/sdns/build.sh @@ -28,7 +28,19 @@ set_gover 1.22 # No configure configure_amd64() { :; } -MAKE_INSTALL_ARGS="prefix=$PREFIX" +CONFIG=etc/${PREFIX#/}/$PROG +DATA=var/${PREFIX#/}/$PROG + +XFORM_ARGS=" + -DPREFIX=${PREFIX#/} + -DPROG=$PROG + -DVERSION=$VER + -DUSER=sdns -DGROUP=sdns + -DCONFIG=$CONFIG + -DDATA=$DATA + -DXDG_CONFIG=${CONFIG%/$PROG} + -DXDG_DATA=${DATA%/$PROG} +" build() { pushd $TMPDIR/$BUILDDIR > /dev/null From d4a168a5fa519e725af523d5419c91415e6fb49d Mon Sep 17 00:00:00 2001 From: "Brian C. Ledbetter" Date: Tue, 14 May 2024 13:28:03 +0000 Subject: [PATCH 03/12] Fixed package manifest; Added sdns user --- build/sdns/files/sdns-template.xml | 13 ++++--------- build/sdns/local.mog | 4 ++++ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/build/sdns/files/sdns-template.xml b/build/sdns/files/sdns-template.xml index e256ecf77..d5ef7ddc1 100644 --- a/build/sdns/files/sdns-template.xml +++ b/build/sdns/files/sdns-template.xml @@ -66,7 +66,7 @@ - - + name="stop" + exec=":kill" + timeout_seconds="60"> diff --git a/build/sdns/local.mog b/build/sdns/local.mog index 6573210ae..351a3bf54 100644 --- a/build/sdns/local.mog +++ b/build/sdns/local.mog @@ -16,6 +16,10 @@ dir path=$(CONFIG) owner=$(USER) group=$(GROUP) mode=0700 dir path=$(DATA) owner=$(USER) group=$(GROUP) mode=0700 dir path=var/log/$(PREFIX)/$(PROG) owner=$(USER) group=$(GROUP) mode=0755 +group groupname=$(PROG) gid=5353 +user ftpuser=false username=$(PROG) uid=5353 group=$(PROG) \ + gcos-field="SDNS User" home-dir=$(DATA) password=NP + set preserve true> \ From 1ed09f5e0cdff068fcd07d8ec995b988507a0fec Mon Sep 17 00:00:00 2001 From: Brian Ledbetter Date: Mon, 20 May 2024 21:07:25 -0400 Subject: [PATCH 04/12] Update copyright date --- build/sdns/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/sdns/build.sh b/build/sdns/build.sh index a5afa8672..00eaf902a 100755 --- a/build/sdns/build.sh +++ b/build/sdns/build.sh @@ -12,7 +12,7 @@ # http://www.illumos.org/license/CDDL. # }}} -# Copyright 2022 OmniOS Community Edition (OmniOSce) Association. +# Copyright 2024 OmniOS Community Edition (OmniOSce) Association. . ../../lib/build.sh From a6786fa29301dd74f6cbe340c16d7975eb150fb7 Mon Sep 17 00:00:00 2001 From: Brian Ledbetter Date: Mon, 20 May 2024 21:13:59 -0400 Subject: [PATCH 05/12] Updated copyright MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This file was based on other projects throughout the omnios-extra, tree - the authors of which I am very thankful for! 😁 --- build/sdns/local.mog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/sdns/local.mog b/build/sdns/local.mog index 351a3bf54..01a281045 100644 --- a/build/sdns/local.mog +++ b/build/sdns/local.mog @@ -8,7 +8,7 @@ # source. A copy of the CDDL is also available via the Internet at # http://www.illumos.org/license/CDDL. -# Copyright 2024 Guo-Rong Koh +# Copyright 2024 OmniOS Community Edition (OmniOSce) Association. license LICENSE license=MIT From 5cac1c9bc8203667b03edf8ea93a13f58588edfb Mon Sep 17 00:00:00 2001 From: Brian Ledbetter Date: Mon, 20 May 2024 21:16:49 -0400 Subject: [PATCH 06/12] Updated uid/gid Tentatively taking UID 35 (opposite of 53), unless there are objections. --- build/sdns/local.mog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/sdns/local.mog b/build/sdns/local.mog index 01a281045..5e72c3408 100644 --- a/build/sdns/local.mog +++ b/build/sdns/local.mog @@ -16,8 +16,8 @@ dir path=$(CONFIG) owner=$(USER) group=$(GROUP) mode=0700 dir path=$(DATA) owner=$(USER) group=$(GROUP) mode=0700 dir path=var/log/$(PREFIX)/$(PROG) owner=$(USER) group=$(GROUP) mode=0755 -group groupname=$(PROG) gid=5353 -user ftpuser=false username=$(PROG) uid=5353 group=$(PROG) \ +group groupname=$(PROG) gid=35 +user ftpuser=false username=$(PROG) uid=35 group=$(PROG) \ gcos-field="SDNS User" home-dir=$(DATA) password=NP set preserve true> From a2d5e5aa6ab8490d81df2544a691f6fa07f3261f Mon Sep 17 00:00:00 2001 From: Brian Ledbetter Date: Mon, 20 May 2024 21:19:26 -0400 Subject: [PATCH 07/12] Add sdns to idlist --- doc/idlist.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/idlist.md b/doc/idlist.md index 2a219142a..dc244b298 100644 --- a/doc/idlist.md +++ b/doc/idlist.md @@ -21,6 +21,7 @@ | omnios | 23 | chrony | omnios | 26 | dma | extra | 27 | postfix +| extra | 35 | sdns | illumos | 37 | listen | illumos | 50 | gdm | illumos | 51 | zfssnap From d01ccaeb1a07202dceb27f98f3fbb6972b4212aa Mon Sep 17 00:00:00 2001 From: "Brian C. Ledbetter" Date: Fri, 5 Jul 2024 01:38:09 +0000 Subject: [PATCH 08/12] sdns: version bump --- build/sdns/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/sdns/build.sh b/build/sdns/build.sh index 00eaf902a..854ff06de 100755 --- a/build/sdns/build.sh +++ b/build/sdns/build.sh @@ -17,7 +17,7 @@ . ../../lib/build.sh PROG=sdns -VER=1.3.6 +VER=1.3.7 PKG=ooce/network/sdns SUMMARY="sdns" DESC="Simple DNS Server" From 6c70d78d8fbda7d5ea5da82009b67fa98dc72de3 Mon Sep 17 00:00:00 2001 From: "Brian C. Ledbetter" Date: Fri, 5 Jul 2024 01:39:32 +0000 Subject: [PATCH 09/12] sdns: Moving group to bottom table per @citrus-it --- doc/idlist.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/idlist.md b/doc/idlist.md index dc244b298..dfbd714e3 100644 --- a/doc/idlist.md +++ b/doc/idlist.md @@ -21,7 +21,6 @@ | omnios | 23 | chrony | omnios | 26 | dma | extra | 27 | postfix -| extra | 35 | sdns | illumos | 37 | listen | illumos | 50 | gdm | illumos | 51 | zfssnap @@ -86,6 +85,7 @@ | illumos | 25 | smmsp | extra | 27 | postfix | extra | 28 | postdrop +| extra | 35 | sdns | extra | 45 | sasl | illumos | 50 | gdm | illumos | 52 | upnp From 04ad60daf060c398ad499d869c6b4c6c32ca9fa8 Mon Sep 17 00:00:00 2001 From: "Brian C. Ledbetter" Date: Fri, 5 Jul 2024 01:41:27 +0000 Subject: [PATCH 10/12] sdns: Fixed build.sh per @citrus-it --- build/sdns/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/sdns/build.sh b/build/sdns/build.sh index 854ff06de..dd7c801aa 100755 --- a/build/sdns/build.sh +++ b/build/sdns/build.sh @@ -26,7 +26,7 @@ set_arch 64 set_gover 1.22 # No configure -configure_amd64() { :; } +pre_configure() { false; } CONFIG=etc/${PREFIX#/}/$PROG DATA=var/${PREFIX#/}/$PROG From aee5923b0a57461ac86d6e0c36580dbf4c74ceca Mon Sep 17 00:00:00 2001 From: "Brian C. Ledbetter" Date: Fri, 5 Jul 2024 01:42:38 +0000 Subject: [PATCH 11/12] sdns: fixed per @citrus-it --- build/sdns/local.mog | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/sdns/local.mog b/build/sdns/local.mog index 5e72c3408..d9ff47e80 100644 --- a/build/sdns/local.mog +++ b/build/sdns/local.mog @@ -16,9 +16,9 @@ dir path=$(CONFIG) owner=$(USER) group=$(GROUP) mode=0700 dir path=$(DATA) owner=$(USER) group=$(GROUP) mode=0700 dir path=var/log/$(PREFIX)/$(PROG) owner=$(USER) group=$(GROUP) mode=0755 -group groupname=$(PROG) gid=35 -user ftpuser=false username=$(PROG) uid=35 group=$(PROG) \ - gcos-field="SDNS User" home-dir=$(DATA) password=NP +group groupname=$(GROUP) gid=35 +user ftpuser=false username=$(USER) uid=35 group=$(GROUP) \ + gcos-field="SDNS User" home-dir=/$(DATA) password=NP set preserve true> From 7f5ea846dc49972cccc73987be26167a72ab3e33 Mon Sep 17 00:00:00 2001 From: "Brian C. Ledbetter" Date: Fri, 5 Jul 2024 01:43:58 +0000 Subject: [PATCH 12/12] sdns: Fixed per @citrus-it --- build/sdns/files/sdns-template.xml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/build/sdns/files/sdns-template.xml b/build/sdns/files/sdns-template.xml index d5ef7ddc1..86a2ddc3a 100644 --- a/build/sdns/files/sdns-template.xml +++ b/build/sdns/files/sdns-template.xml @@ -68,11 +68,6 @@ name="start" exec="%{config/exec} --config %{config/file} &" timeout_seconds="60"> - - -