summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorschmonz <schmonz@pkgsrc.org>2019-01-11 23:09:53 +0000
committerschmonz <schmonz@pkgsrc.org>2019-01-11 23:09:53 +0000
commitab77c06b53f16708dfcc7a33b2b1900418d07a73 (patch)
tree9cbfb63ffe69aaea8851155671fb1b1d627ea012 /net
parent87b54a7666dfe92d5db3ae157f4301bb2908aec0 (diff)
downloadpkgsrc-ab77c06b53f16708dfcc7a33b2b1900418d07a73.tar.gz
Support PKG_SYSCONFDIR and VARBASE. Add SNIPROXY_{USER,GROUP}, both
defaulting to "sniproxy." Add rc.d script. Bump PKGREVISION.
Diffstat (limited to 'net')
-rw-r--r--net/sniproxy/Makefile18
-rw-r--r--net/sniproxy/distinfo6
-rw-r--r--net/sniproxy/files/sniproxy.sh17
-rw-r--r--net/sniproxy/patches/patch-man_sniproxy.815
-rw-r--r--net/sniproxy/patches/patch-man_sniproxy.conf.520
-rw-r--r--net/sniproxy/patches/patch-sniproxy.conf48
-rw-r--r--net/sniproxy/patches/patch-src_sniproxy.c15
7 files changed, 137 insertions, 2 deletions
diff --git a/net/sniproxy/Makefile b/net/sniproxy/Makefile
index 8bd94b370f7..273386caf9b 100644
--- a/net/sniproxy/Makefile
+++ b/net/sniproxy/Makefile
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.7 2019/01/08 14:41:16 wiedi Exp $
+# $NetBSD: Makefile,v 1.8 2019/01/11 23:09:53 schmonz Exp $
DISTNAME= sniproxy-0.6.0
+PKGREVISION= 1
CATEGORIES= net
MASTER_SITES= ${MASTER_SITE_GITHUB:=dlundquist/}
@@ -22,6 +23,21 @@ CONF_FILES= ${EGDIR}/sniproxy.conf ${PKG_SYSCONFDIR}/sniproxy.conf
CPPFLAGS.SunOS+= -D__EXTENSIONS__ -D_XOPEN_SOURCE=600
LDFLAGS.SunOS+= -lsocket -lnsl
+SUBST_CLASSES+= pkgvars
+SUBST_STAGE.pkgvars= do-configure
+SUBST_FILES.pkgvars= src/sniproxy.c sniproxy.conf \
+ man/sniproxy.8 man/sniproxy.conf.5
+SUBST_VARS.pkgvars= PKG_SYSCONFDIR VARBASE SNIPROXY_USER SNIPROXY_GROUP
+
+PKG_USERS_VARS+= SNIPROXY_USER
+PKG_GROUPS_VARS+= SNIPROXY_GROUP
+PKG_GROUPS+= ${SNIPROXY_GROUP}
+PKG_USERS+= ${SNIPROXY_USER}:${SNIPROXY_GROUP}
+
+RCD_SCRIPTS= sniproxy
+
+BUILD_DEFS+= VARBASE PKG_SYSCONFBASE
+
pre-configure:
cd ${WRKSRC} && autoreconf --install && automake --add-missing --copy
diff --git a/net/sniproxy/distinfo b/net/sniproxy/distinfo
index b2f5c134f91..408c964aabb 100644
--- a/net/sniproxy/distinfo
+++ b/net/sniproxy/distinfo
@@ -1,6 +1,10 @@
-$NetBSD: distinfo,v 1.7 2019/01/08 14:41:16 wiedi Exp $
+$NetBSD: distinfo,v 1.8 2019/01/11 23:09:53 schmonz Exp $
SHA1 (sniproxy-0.6.0.tar.gz) = 26ff187c46eb4f98f9f1731cd26f341383ea6454
RMD160 (sniproxy-0.6.0.tar.gz) = 24e9126e100bdc6a04a4dd5fbe7379b642e04ff2
SHA512 (sniproxy-0.6.0.tar.gz) = 8a99573673bdd57e528c5781cb166d39c80daed699382b24c3fa18a6011d074a1d9e470fee404d24b4450cf067c9995125910b2941b5216d88d189a1d79ebf73
Size (sniproxy-0.6.0.tar.gz) = 78515 bytes
+SHA1 (patch-man_sniproxy.8) = 6c23fd3a826cfdd37b656e235392263995f0bad0
+SHA1 (patch-man_sniproxy.conf.5) = d18a997fe2d3bf570c3c3e8530ec2c6487e35ba0
+SHA1 (patch-sniproxy.conf) = 7a7c596ec2947cc94271dbd7298dd3e9896260f7
+SHA1 (patch-src_sniproxy.c) = d3aa00bd393ceaeba81ce9d15cdafd24ab63eaf1
diff --git a/net/sniproxy/files/sniproxy.sh b/net/sniproxy/files/sniproxy.sh
new file mode 100644
index 00000000000..b5aa960b00c
--- /dev/null
+++ b/net/sniproxy/files/sniproxy.sh
@@ -0,0 +1,17 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: sniproxy.sh,v 1.1 2019/01/11 23:09:53 schmonz Exp $
+
+# PROVIDE: sniproxy
+# REQUIRE: NETWORKING
+
+. /etc/rc.subr
+
+name="sniproxy"
+rcvar=${name}
+command="@PREFIX@/sbin/${name}"
+required_files="@PKG_SYSCONFDIR@/sniproxy.conf"
+pidfile="@VARBASE@/run/${name}.pid"
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/net/sniproxy/patches/patch-man_sniproxy.8 b/net/sniproxy/patches/patch-man_sniproxy.8
new file mode 100644
index 00000000000..9f766b28ef9
--- /dev/null
+++ b/net/sniproxy/patches/patch-man_sniproxy.8
@@ -0,0 +1,15 @@
+$NetBSD: patch-man_sniproxy.8,v 1.1 2019/01/11 23:09:54 schmonz Exp $
+
+Support PKG_SYSCONFDIR.
+
+--- man/sniproxy.8.orig 2018-12-06 04:14:58.000000000 +0000
++++ man/sniproxy.8
+@@ -20,7 +20,7 @@ proxy machine\&.
+
+ .TP
+ -c \fIconfig\fR
+-Specify configuration file to use. The default is /etc/sniproxy\&.conf\&.
++Specify configuration file to use. The default is @PKG_SYSCONFDIR@/sniproxy\&.conf\&.
+
+ .TP
+ -f
diff --git a/net/sniproxy/patches/patch-man_sniproxy.conf.5 b/net/sniproxy/patches/patch-man_sniproxy.conf.5
new file mode 100644
index 00000000000..a2f2a3bdf0d
--- /dev/null
+++ b/net/sniproxy/patches/patch-man_sniproxy.conf.5
@@ -0,0 +1,20 @@
+$NetBSD: patch-man_sniproxy.conf.5,v 1.1 2019/01/11 23:09:54 schmonz Exp $
+
+Support PKG_SYSCONFDIR.
+
+--- man/sniproxy.conf.5.orig 2018-12-06 04:14:58.000000000 +0000
++++ man/sniproxy.conf.5
+@@ -6,11 +6,11 @@ sniproxy.conf - sniproxy configuration f
+
+ .SH SYNOPSIS
+
+-/etc/sniproxy.conf
++@PKG_SYSCONFDIR@/sniproxy.conf
+
+ .SH DESCRIPTION
+
+-/etc/sniproxy.conf is the configuration file for sniproxy. Statements are
++@PKG_SYSCONFDIR@/sniproxy.conf is the configuration file for sniproxy. Statements are
+ separated by either a new line or semi-colon. Lines starting with \&# are
+ comments. The configuration is broken down into stanzas delimited by curly
+ braces. Characters may be escaped using \&\\. Configuration directives may may
diff --git a/net/sniproxy/patches/patch-sniproxy.conf b/net/sniproxy/patches/patch-sniproxy.conf
new file mode 100644
index 00000000000..d438e3b88d6
--- /dev/null
+++ b/net/sniproxy/patches/patch-sniproxy.conf
@@ -0,0 +1,48 @@
+$NetBSD: patch-sniproxy.conf,v 1.1 2019/01/11 23:09:54 schmonz Exp $
+
+Support VARBASE and pkgsrc-configurable user and group.
+
+--- sniproxy.conf.orig 2018-12-06 04:14:58.000000000 +0000
++++ sniproxy.conf
+@@ -2,11 +2,11 @@
+ # lines that start with # are comments
+ # lines with only white space are ignored
+
+-user nobody
+-group nogroup
++user @SNIPROXY_USER@
++group @SNIPROXY_GROUP@
+
+ # PID file, needs to be placed in directory writable by user
+-pidfile /var/run/sniproxy.pid
++pidfile @VARBASE@/run/sniproxy.pid
+
+ # The DNS resolver is required for tables configured using wildcard or hostname
+ # targets. If no resolver is specified, the nameserver and search domain are
+@@ -38,7 +38,7 @@ error_log {
+ syslog daemon
+
+ # Alternatively we could log to file
+- #filename /var/log/sniproxy.log
++ #filename @VARBASE@/log/sniproxy.log
+
+ # Control the verbosity of the log
+ priority notice
+@@ -109,7 +109,7 @@ listen [2001:0db8::10]:80 {
+ # this will use default table
+ }
+
+-listen unix:/var/run/proxy.sock {
++listen unix:@VARBASE@/run/proxy.sock {
+ protocol http
+ # this will use default table
+ }
+@@ -143,7 +143,7 @@ table https_hosts {
+ # When proxying to local sockets you should use different tables since the
+ # local socket server most likely will not detect which protocol is being
+ # used
+- example.org unix:/var/run/server.sock
++ example.org unix:@VARBASE@/run/server.sock
+ }
+
+ # if no table specified the default 'default' table is defined
diff --git a/net/sniproxy/patches/patch-src_sniproxy.c b/net/sniproxy/patches/patch-src_sniproxy.c
new file mode 100644
index 00000000000..b4c8e07a939
--- /dev/null
+++ b/net/sniproxy/patches/patch-src_sniproxy.c
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_sniproxy.c,v 1.1 2019/01/11 23:09:54 schmonz Exp $
+
+Support PKG_SYSCONFDIR.
+
+--- src/sniproxy.c.orig 2018-12-06 04:14:58.000000000 +0000
++++ src/sniproxy.c
+@@ -66,7 +66,7 @@ static struct ev_signal sigterm_watcher;
+
+ int
+ main(int argc, char **argv) {
+- const char *config_file = "/etc/sniproxy.conf";
++ const char *config_file = "@PKG_SYSCONFDIR@/sniproxy.conf";
+ int background_flag = 1;
+ rlim_t max_nofiles = 65536;
+ int opt;