-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sdns: Add new package to repo #1457
base: master
Are you sure you want to change the base?
Changes from 3 commits
04348b9
1fc3504
d4a168a
1ed09f5
a6786fa
5cac1c9
c05abaf
a2d5e5a
d01ccae
6c70d78
04ad60d
aee5923
7f5ea84
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
#!/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() { :; } | ||
justledbetter marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
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 | ||
|
||
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this looks like a leftover from another build.sh |
||
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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
<?xml version="1.0"?> | ||
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1"> | ||
<!-- | ||
|
||
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 OmniOS Community Edition (OmniOSce) Association. | ||
|
||
--> | ||
<service_bundle type="manifest" | ||
name="network:sdns"> | ||
|
||
<service name="network/sdns" | ||
type="service" | ||
version="1"> | ||
|
||
<instance name="default" | ||
enabled="false"> | ||
|
||
<dependency name="loopback" | ||
grouping="require_any" | ||
restart_on="error" | ||
type="service"> | ||
<service_fmri value="svc:/network/loopback" /> | ||
</dependency> | ||
|
||
<dependency name="network" | ||
grouping="optional_all" | ||
restart_on="error" | ||
type="service"> | ||
<service_fmri value="svc:/milestone/network" /> | ||
</dependency> | ||
|
||
<dependency name="filesystem_local" | ||
grouping="require_all" | ||
restart_on="none" | ||
type="service"> | ||
<service_fmri value="svc:/system/filesystem/local:default" /> | ||
</dependency> | ||
|
||
<dependent name="sdns_multi-user" | ||
grouping="optional_all" | ||
restart_on="none"> | ||
<service_fmri value="svc:/milestone/multi-user" /> | ||
</dependent> | ||
<method_context security_flags="aslr"> | ||
<method_credential user="$(USER)" | ||
group="$(GROUP)" | ||
limit_privileges="basic,net_privaddr,!proc_info,!file_link_any" /> | ||
<method_environment> | ||
<envvar name="HOME" | ||
value="/$(DATA)" /> | ||
<envvar name="XDG_CONFIG_HOME" | ||
value="/$(XDG_CONFIG)" /> | ||
<envvar name="XDG_DATA_HOME" | ||
value="/$(XDG_DATA)" /> | ||
</method_environment> | ||
</method_context> | ||
|
||
<exec_method type="method" | ||
name="start" | ||
exec="%{config/exec} --config %{config/file} &" | ||
timeout_seconds="60"> | ||
<method_context security_flags="aslr"> | ||
<method_credential user="$(USER)" | ||
group="$(GROUP)" | ||
privileges="basic,net_privaddr,!proc_info,!proc_session,!file_link_any" /> | ||
</method_context> | ||
justledbetter marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</exec_method> | ||
|
||
<exec_method type="method" | ||
name="stop" | ||
exec=":kill" | ||
timeout_seconds="60"></exec_method> | ||
|
||
<property_group name="config" | ||
type="application"> | ||
<propval name="file" | ||
type="astring" | ||
value="/$(CONFIG)/sdns.conf" /> | ||
<propval name="exec" | ||
type="astring" | ||
value="/$(PREFIX)/bin/$(PROG)" /> | ||
</property_group> | ||
|
||
<template> | ||
<common_name> | ||
<loctext xml:lang="C">sdns $(VERSION)</loctext> | ||
</common_name> | ||
</template> | ||
|
||
</instance> | ||
|
||
<stability value="External" /> | ||
|
||
</service> | ||
|
||
</service_bundle> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# | ||
# 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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, I don't remember writing this 😂 |
||
|
||
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 | ||
|
||
group groupname=$(PROG) gid=5353 | ||
user ftpuser=false username=$(PROG) uid=5353 group=$(PROG) \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. system UIDs should be below |
||
gcos-field="SDNS User" home-dir=$(DATA) password=NP | ||
|
||
<transform file path=$(CONFIG)/ -> set preserve true> | ||
|
||
<transform file path=$(PREFIX)/bin/$(PROG) -> \ | ||
set restart_fmri svc:/network/sdns:default> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you please update the year to
2024