Skip to content
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

Fixed missing hexdump in SunOS/Smartos #383

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions security/dehydrated/distinfo
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ $NetBSD: distinfo,v 1.5 2023/04/23 17:45:42 nils Exp $
BLAKE2s (dehydrated-0.7.1.tar.gz) = 1ca1089411d9f07690dc52d1ea1d7806eed9acc58f3c535ac7f4c5421795e897
SHA512 (dehydrated-0.7.1.tar.gz) = 1d584c3876cdc1ef213b2feb02e15d2b47ef2b6504e8a837ad45d9d14929a82de28bee7395a75659721ae18bd8f26f4f2759ad8eaef66c671c7085c9859f6555
Size (dehydrated-0.7.1.tar.gz) = 120575 bytes
SHA1 (patch-hexdump) = 2a6883c7d260ad782b18cf79d62a5be93843dca6
29 changes: 29 additions & 0 deletions security/dehydrated/patches/patch-hexdump
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
--- dehydrated.orig Mon May 6 14:53:59 2024
+++ dehydrated Mon May 6 14:53:41 2024
@@ -260,7 +260,12 @@
# Check for script dependencies
check_dependencies() {
# look for required binaries
- for binary in grep mktemp diff sed awk curl cut head tail hexdump; do
+ if [[ $(uname -s | grep SunOS) ]]; then
+ hexdump="xxd"
+ else
+ hexdump="hexdump"
+ fi
+ for binary in grep mktemp diff sed awk curl cut head tail $hexdump; do
bin_path="$(command -v "${binary}" 2>/dev/null)" || _exiterr "This script requires ${binary}."
[[ -x "${bin_path}" ]] || _exiterr "${binary} found in PATH but it's not executable"
done
@@ -839,7 +844,11 @@

# Convert binary data to hex string
bin2hex() {
- hexdump -v -e '/1 "%02x"'
+ if [[ $(uname -s | grep SunOS) ]]; then
+ xxd -v -e '/1 "%02x"'
+ else
+ hexdump -v -e '/1 "%02x"'
+ fi
}

# OpenSSL writes to stderr/stdout even when there are no errors. So just
20 changes: 20 additions & 0 deletions www/freenginx-devel/DESCR
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Nginx (pronounced engine-x) is a free, open-source, high-performance HTTP
server and reverse proxy, as well as an IMAP/POP3 proxy server. Igor Sysoev
started development of Nginx in 2002, with the first public release in 2004.
Nginx now hosts nearly 12.18% (22.2M) of active sites across all domains.
Nginx is known for its high performance, stability, rich feature set, simple
configuration, and low resource consumption.

Nginx is one of a handful of servers written to address the C10K problem.
Unlike traditional servers, Nginx doesn't rely on threads to handle requests.
Instead it uses a much more scalable event-driven (asynchronous) architecture.
This architecture uses small, but more importantly, predictable amounts of
memory under load.
Even if you don't expect to handle thousands of simultaneous requests, you can
still benefit from Nginx's high-performance and small memory footprint.
Nginx scales in all directions: from the smallest VPS all the way up to
clusters of servers.

Nginx powers several high-visibility sites, such as Netflix, Hulu, Pinterest,
CloudFlare, Airbnb, WordPress.com, GitHub, SoundCloud, Zynga, Eventbrite,
Zappos, Media Temple, Heroku, RightScale, Engine Yard and NetDNA.
9 changes: 9 additions & 0 deletions www/freenginx-devel/MESSAGE
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
===========================================================================
$NetBSD: MESSAGE,v 1.3 2020/09/18 09:15:56 kim Exp $

Consider adding something like following lines to /etc/newsyslog.conf:

${NGINX_LOGDIR}/access.log ${NGINX_USER}:${NGINX_GROUP} 640 7 * 24 ZB ${NGINX_PIDDIR}/nginx.pid SIGUSR1
${NGINX_LOGDIR}/error.log ${NGINX_USER}:${NGINX_GROUP} 640 7 * 24 ZB ${NGINX_PIDDIR}/nginx.pid SIGUSR1

===========================================================================
139 changes: 139 additions & 0 deletions www/freenginx-devel/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
# $NetBSD: Makefile,v 1.149 2023/11/12 13:23:57 wiz Exp $

DISTNAME= freenginx-1.26.0
PKGNAME= ${DISTNAME:S/-/-devel-/1}
PKGREVISION= 1
CATEGORIES= www
MASTER_SITES= https://freenginx.org/download/
DISTFILES= ${DEFAULT_DISTFILES}

MAINTAINER= [email protected]
HOMEPAGE= https://nginx.org/
COMMENT= Lightweight HTTP server and mail proxy server
LICENSE= 2-clause-bsd

CONFLICTS= nginx-devel-[0-9]*
CONFLICTS+= nginx-[0-9]*
CONFLICTS+= freenginx-[0-9]*

.include "../../mk/bsd.prefs.mk"

NGINX_USER?= nginx
NGINX_GROUP?= nginx
NGINX_DATADIR?= ${VARBASE}/db/nginx
NGINX_LOGDIR?= ${VARBASE}/log/nginx
NGINX_PIDDIR?= ${VARBASE}/run

BUILD_DEFS+= NGINX_DATADIR NGINX_LOGDIR NGINX_PIDDIR VARBASE

PKG_USERS_VARS+= NGINX_USER
PKG_GROUPS_VARS+= NGINX_GROUP
PKG_GROUPS= ${NGINX_GROUP}
PKG_USERS= ${NGINX_USER}:${NGINX_GROUP}

PKG_GECOS.${NGINX_USER}= NGINX server user
PKG_HOME.${NGINX_USER}= ${NGINX_DATADIR}
PKG_SHELL.${NGINX_USER}= ${NOLOGIN}

USE_PKGLOCALEDIR= yes
HAS_CONFIGURE= yes
CONFIGURE_ARGS+= --user=${NGINX_USER}
CONFIGURE_ARGS+= --group=${NGINX_GROUP}
CONFIGURE_ARGS+= --with-ld-opt=-L${PREFIX}/lib\ -Wl,-R${PREFIX}/lib
CONFIGURE_ARGS+= --prefix=${PREFIX}
CONFIGURE_ARGS+= --sbin-path=${PREFIX}/sbin
CONFIGURE_ARGS+= --conf-path=${PKG_SYSCONFDIR}/nginx.conf
CONFIGURE_ARGS+= --pid-path=${NGINX_PIDDIR}/nginx.pid
CONFIGURE_ARGS+= --lock-path=${NGINX_DATADIR}/nginx.lock
CONFIGURE_ARGS+= --error-log-path=${NGINX_LOGDIR}/error.log
CONFIGURE_ARGS+= --http-log-path=${NGINX_LOGDIR}/access.log
CONFIGURE_ARGS+= --http-client-body-temp-path=${NGINX_DATADIR}/client_body_temp
CONFIGURE_ARGS+= --http-proxy-temp-path=${NGINX_DATADIR}/proxy_temp
CONFIGURE_ARGS+= --http-fastcgi-temp-path=${NGINX_DATADIR}/fstcgi_temp
CONFIGURE_ARGS+= --http-scgi-temp-path=${NGINX_DATADIR}/scgi_temp
CONFIGURE_ARGS+= --with-pcre

SUBST_CLASSES+= fix-pcre2
SUBST_STAGE.fix-pcre2= pre-configure
SUBST_FILES.fix-pcre2= auto/lib/pcre/conf
SUBST_SED.fix-pcre2= -e 's,/usr/pkg,${BUILDLINK_PREFIX.pcre2},g'
SUBST_NOOP_OK.fix-pcre2=yes

PKG_SYSCONFSUBDIR= nginx

.include "options.mk"

EGDIR= ${PREFIX}/share/examples/nginx
EGFILES+= fastcgi.conf fastcgi_params koi-utf koi-win \
mime.types nginx.conf win-utf

.for file in ${EGFILES}
CONF_FILES+= ${EGDIR}/conf/${file} ${PKG_SYSCONFDIR}/${file}
. if !empty(PKG_OPTIONS:Mnaxsi)
CONF_FILES+= ${EGDIR}/conf/naxsi_core.rules ${PKG_SYSCONFDIR}/naxsi_core.rules
. endif
.endfor

RCD_SCRIPTS= nginx

INSTALLATION_DIRS+= ${PKGMANDIR}/man8 sbin share/examples/nginx/conf \
share/examples/nginx/html
MAKE_DIRS+= ${NGINX_PIDDIR}
OWN_DIRS= ${NGINX_LOGDIR}
OWN_DIRS_PERMS+= ${NGINX_DATADIR} ${NGINX_USER} ${NGINX_GROUP} 0700

BUILD_TARGET= build

SUBST_CLASSES+= paths
SUBST_STAGE.paths= pre-configure
SUBST_FILES.paths= conf/nginx.conf
SUBST_SED.paths= -e 's,%%PKG_SYSCONFDIR%%,${PKG_SYSCONFDIR},g'
SUBST_SED.paths+= -e 's,%%NGINX_LOGDIR%%,${NGINX_LOGDIR},g'
SUBST_SED.paths+= -e 's,%%NGINX_PIDDIR%%,${NGINX_PIDDIR},g'
SUBST_SED.paths+= -e 's,%%NGINX_USER%%,${NGINX_USER},g'
SUBST_SED.paths+= -e 's,%%NGINX_GROUP%%,${NGINX_GROUP},g'

MESSAGE_SUBST+= NGINX_LOGDIR=${NGINX_LOGDIR}
MESSAGE_SUBST+= NGINX_PIDDIR=${NGINX_PIDDIR}
MESSAGE_SUBST+= NGINX_USER=${NGINX_USER}
MESSAGE_SUBST+= NGINX_GROUP=${NGINX_GROUP}

.if ${OPSYS} == "Darwin"
SOEXT= bundle
.else
SOEXT= so
.endif
PLIST_SUBST+= SOEXT=${SOEXT}

post-patch:
.if !empty(PKG_OPTIONS:Mgssapi)
${SED} -i.bak '4d;5d;6d' ${WRKDIR}/${GSSAPI_DISTNAME}/config
.endif

do-install:
${INSTALL_PROGRAM} ${WRKSRC}/objs/nginx ${DESTDIR}${PREFIX}/sbin/nginx
.for file in ${EGFILES}
${INSTALL_DATA} ${WRKSRC}/conf/${file} ${DESTDIR}${EGDIR}/conf/${file}
.endfor
${INSTALL_DATA} ${WRKSRC}/html/50x.html ${DESTDIR}${EGDIR}/html/50x.html
${INSTALL_DATA} ${WRKSRC}/html/index.html ${DESTDIR}${EGDIR}/html/index.html
${INSTALL_MAN} ${WRKSRC}/objs/nginx.8 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man8
.if !empty(PKG_OPTIONS:Mnaxsi)
${INSTALL_DATA} ${WRKDIR}/${NAXSI_DISTNAME}/naxsi_config/naxsi_core.rules ${DESTDIR}${EGDIR}/conf
.endif
.if !empty(PKG_OPTIONS:Mperl)
${INSTALL_LIB_DIR} ${DESTDIR}${PERL5_INSTALLVENDORARCH}/auto/nginx
${INSTALL_LIB} ${WRKSRC}/objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.${SOEXT} \
${DESTDIR}${PERL5_INSTALLVENDORARCH}/auto/nginx
${INSTALL_DATA} ${WRKSRC}/objs/src/http/modules/perl/blib/lib/nginx.pm \
${DESTDIR}${PERL5_INSTALLVENDORARCH}
.endif
.if !empty(PKG_OPTIONS:Mdso)
${INSTALL_LIB_DIR} ${DESTDIR}${PREFIX}/libexec/nginx
(cd ${WRKSRC}/objs/ && ${FIND} . -name '*.so' -maxdepth 1 -type f \
-exec ${INSTALL_PROGRAM} {} ${DESTDIR}${PREFIX}/libexec/nginx \;)
.endif

.include "../../devel/pcre2/buildlink3.mk"
.include "../../devel/zlib/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
42 changes: 42 additions & 0 deletions www/freenginx-devel/PLIST
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
@comment $NetBSD: PLIST,v 1.19 2023/04/24 16:34:38 osa Exp $
${PLIST.dso}${PLIST.arrayvar}libexec/nginx/ngx_http_array_var_module.so
${PLIST.dso}${PLIST.cprg}libexec/nginx/ngx_http_cache_purge_module.so
${PLIST.dso}${PLIST.dav}libexec/nginx/ngx_http_dav_ext_module.so
${PLIST.dso}${PLIST.echo}libexec/nginx/ngx_http_echo_module.so
${PLIST.dso}${PLIST.encses}libexec/nginx/ngx_http_encrypted_session_module.so
${PLIST.dso}${PLIST.forminput}libexec/nginx/ngx_http_form_input_module.so
${PLIST.dso}${PLIST.geoip2}libexec/nginx/ngx_http_geoip2_module.so
${PLIST.dso}${PLIST.geoip2}libexec/nginx/ngx_stream_geoip2_module.so
${PLIST.dso}${PLIST.gssapi}libexec/nginx/ngx_http_auth_spnego_module.so
${PLIST.dso}${PLIST.headmore}libexec/nginx/ngx_http_headers_more_filter_module.so
${PLIST.dso}${PLIST.imagefilter}libexec/nginx/ngx_http_image_filter_module.so
${PLIST.dso}${PLIST.lua}libexec/nginx/ngx_http_lua_module.so
${PLIST.dso}${PLIST.mail}libexec/nginx/ngx_mail_module.so
${PLIST.dso}${PLIST.naxsi}libexec/nginx/ngx_http_naxsi_module.so
${PLIST.dso}${PLIST.nchan}libexec/nginx/ngx_nchan_module.so
${PLIST.dso}${PLIST.ndk}libexec/nginx/ndk_http_module.so
${PLIST.dso}${PLIST.njs}libexec/nginx/ngx_http_js_module.so
${PLIST.dso}${PLIST.njs}libexec/nginx/ngx_stream_js_module.so
${PLIST.dso}${PLIST.perl}libexec/nginx/ngx_http_perl_module.so
${PLIST.dso}${PLIST.redis}libexec/nginx/ngx_http_redis_module.so
${PLIST.dso}${PLIST.rtmp}libexec/nginx/ngx_rtmp_module.so
${PLIST.dso}${PLIST.setmisc}libexec/nginx/ngx_http_set_misc_module.so
${PLIST.dso}${PLIST.stream}libexec/nginx/ngx_stream_module.so
${PLIST.dso}${PLIST.sts}libexec/nginx/ngx_http_stream_server_traffic_status_module.so
${PLIST.dso}${PLIST.upload}libexec/nginx/ngx_http_upload_module.so
${PLIST.dso}${PLIST.vts}libexec/nginx/ngx_http_vhost_traffic_status_module.so
${PLIST.perl}${PERL5_SUB_INSTALLVENDORARCH}/auto/nginx/nginx.${SOEXT}
${PLIST.perl}${PERL5_SUB_INSTALLVENDORARCH}/nginx.pm
man/man8/nginx.8
sbin/nginx
share/examples/nginx/conf/fastcgi.conf
share/examples/nginx/conf/fastcgi_params
share/examples/nginx/conf/koi-utf
share/examples/nginx/conf/koi-win
share/examples/nginx/conf/mime.types
${PLIST.naxsi}share/examples/nginx/conf/naxsi_core.rules
share/examples/nginx/conf/nginx.conf
${PLIST.uwsgi}share/examples/nginx/conf/uwsgi_params
share/examples/nginx/conf/win-utf
share/examples/nginx/html/50x.html
share/examples/nginx/html/index.html
8 changes: 8 additions & 0 deletions www/freenginx-devel/distinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
$NetBSD: distinfo,v 1.115 2023/10/25 16:04:47 osa Exp $

BLAKE2s (freenginx-1.26.0.tar.gz) = 5ec64f4a7b8073d89c14680b58b08e3622bb839176bff97900fd257a9eda4db3
SHA512 (freenginx-1.26.0.tar.gz) = 5804671c8195c00cb52440585dd84d3fb77964624a8154e2f8c523f859c3d2bd0e35872945acbb3b2edd53c6789938e059208cac8463ff87f1be07b17ca99164
Size (freenginx-1.26.0.tar.gz) = 1219500 bytes
SHA1 (patch-auto_cc_conf) = 5e6a479ba419cd16dedeb3b4c47dc685d126ef6a
SHA1 (patch-auto_install) = 3b3a0f9f4c005b707664554fa57a58c9e3b7de60
SHA1 (patch-conf_nginx.conf) = c87c76604a5aae64f8c039f90f9291e3134f64e0
33 changes: 33 additions & 0 deletions www/freenginx-devel/files/nginx.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!@RCD_SCRIPTS_SHELL@
#
# $NetBSD: nginx.sh,v 1.4 2021/11/08 01:02:01 khorben Exp $
#
# PROVIDE: nginx
# REQUIRE: DAEMON
#
# You will need to set some variables in @SYSCONFBASE@/rc.conf to start nginx:
#
# nginx=YES

$_rc_subr_loaded . @SYSCONFBASE@/rc.subr

name="nginx"
rcvar=${name}
command="@PREFIX@/sbin/${name}"
required_files="@PKG_SYSCONFDIR@/${name}.conf"
pidfile="@VARBASE@/run/${name}.pid"
start_precmd="ulimit -n 2048"
extra_commands="configtest reload"
configtest_cmd="nginx_configtest"

nginx_configtest()
{
if [ ! -f ${required_files} ]; then
warn "${required_files} does not exist."
return 1;
fi
${command} -t -c ${required_files}
}

load_rc_config $name
run_rc_command "$1"
34 changes: 34 additions & 0 deletions www/freenginx-devel/files/smf/manifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type="manifest" name="export">
<service name="@SMF_PREFIX@/@SMF_NAME@" type="service" version="1">
<create_default_instance enabled="false" />
<single_instance />
<dependency name='network' grouping='require_all' restart_on='error' type='service'>
<service_fmri value='svc:/milestone/network:default' />
</dependency>
<dependency name='filesystem-local' grouping='require_all' restart_on='none' type='service'>
<service_fmri value='svc:/system/filesystem/local:default' />
</dependency>
<method_context>
<method_environment>
<envvar name="LD_PRELOAD_32" value="/usr/lib/extendedFILE.so.1" />
</method_environment>
</method_context>
<exec_method type="method" name="start" exec="@PREFIX@/sbin/nginx -c %{config_file}" timeout_seconds="60" />
<exec_method type="method" name="stop" exec=":kill" timeout_seconds="60" />
<exec_method type="method" name="refresh" exec=":kill -HUP" timeout_seconds="60" />
<property_group name="startd" type="framework">
<propval name="duration" type="astring" value="contract" />
<propval name="ignore_error" type="astring" value="core,signal" />
</property_group>
<property_group name="application" type="application">
<propval name="config_file" type="astring" value="@PKG_SYSCONFDIR@/nginx.conf" />
</property_group>
<template>
<common_name>
<loctext xml:lang="C">Nginx HTTP daemon</loctext>
</common_name>
</template>
</service>
</service_bundle>
Loading