View | Details | Raw Unified | Return to bug 247626 | Differences between
and this patch

Collapse All | Expand All

(-)b/net/py-wsdd/Makefile (-1 / +4 lines)
Lines 2-8 Link Here
2
2
3
PORTNAME=	wsdd
3
PORTNAME=	wsdd
4
DISTVERSIONPREFIX=	v
4
DISTVERSIONPREFIX=	v
5
DISTVERSION=	0.6
5
DISTVERSION=	0.6.1
6
CATEGORIES=	net python
6
CATEGORIES=	net python
7
PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
7
PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
8
8
Lines 23-28 PLIST_FILES= bin/${PORTNAME} \ Link Here
23
		etc/rc.d/${PORTNAME} \
23
		etc/rc.d/${PORTNAME} \
24
		man/man1/${PORTNAME}.1.gz
24
		man/man1/${PORTNAME}.1.gz
25
25
26
post-patch:
27
	${REINPLACE_CMD} 's|PYTHON|${PYTHON_CMD}|' ${WRKSRC}/etc/rc.d/${PORTNAME}
28
26
do-install:
29
do-install:
27
	${INSTALL_SCRIPT} ${WRKSRC}/src/${PORTNAME}.py \
30
	${INSTALL_SCRIPT} ${WRKSRC}/src/${PORTNAME}.py \
28
		${STAGEDIR}${PREFIX}/bin/${PORTNAME}
31
		${STAGEDIR}${PREFIX}/bin/${PORTNAME}
(-)b/net/py-wsdd/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1591589990
1
TIMESTAMP = 1593428212
2
SHA256 (christgau-wsdd-v0.6_GH0.tar.gz) = 9e6caedfa92bc73b3bca2ff22fbb793254160197466a03bc1660fa2bd0bc0b15
2
SHA256 (christgau-wsdd-v0.6.1_GH0.tar.gz) = 930dbe2059db29b422a1d433cd4984056064b29fc768ef80cd17dfa69a35c50e
3
SIZE (christgau-wsdd-v0.6_GH0.tar.gz) = 27067
3
SIZE (christgau-wsdd-v0.6.1_GH0.tar.gz) = 27254
(-)b/net/py-wsdd/files/patch-etc_rc.d_wsdd (+74 lines)
Added Link Here
1
--- etc/rc.d/wsdd.orig	2020-06-28 19:10:44 UTC
2
+++ etc/rc.d/wsdd
3
@@ -5,25 +5,61 @@
4
 # BEFORE: login
5
 # KEYWORD: shutdown
6
 
7
+# Add the following line in /etc/rc.conf to enable wsdd:
8
+#
9
+# wsdd_enable="YES"
10
+# wsdd_flags="<set as needed>"
11
+# wsdd_domain="<set if your host is an AD member>"
12
+# wsdd_group="<set if you want to set the workgroup manually>"
13
+#
14
+# Do not specify -d DOMAIN or -w WORKGROUP in wsdd_flags. Instead, set
15
+# wsdd_domain="DOMAIN" or wsdd_group="WORKGROUP", otherwise it will be
16
+# overridden by automatically detected workgroup.
17
+#
18
+
19
 . /etc/rc.subr
20
 
21
 name=wsdd
22
 rcvar=wsdd_enable
23
-wsdd_group=$(/usr/local/bin/testparm -s --parameter-name workgroup 2>/dev/null)
24
 
25
-: ${wsdd_smb_config_file="/usr/local/etc/smb4.conf"}
26
+load_rc_config ${name}
27
 
28
-# try to manually extract workgroup from samba configuration if testparm failed
29
-if [ -z "$wsdd_group" ] && [ -r $wsdd_smb_config_file ]; then
30
-	wsdd_group="$(grep -i '^[[:space:]]*workgroup[[:space:]]*=' $wsdd_smb_config_file | cut -f2 -d= | tr -d '[:blank:]')"
31
+: ${wsdd_enable:="NO"}
32
+: ${wsdd_flags:=""}
33
+: ${wsdd_domain:=""}
34
+: ${wsdd_group:=""}
35
+: ${wsdd_smb_config_file:="/usr/local/etc/smb4.conf"}
36
+
37
+if [ -z "${wsdd_group}" ]; then
38
+	# automatic detection of workgroup
39
+	wsdd_group=$(/usr/local/bin/testparm -s --parameter-name workgroup 2>/dev/null)
40
+
41
+	# try to manually extract workgroup from samba configuration if testparm failed
42
+	if [ -z "$wsdd_group" ] && [ -r $wsdd_smb_config_file ]; then
43
+		wsdd_group="$(grep -i '^[[:space:]]*workgroup[[:space:]]*=' $wsdd_smb_config_file | cut -f2 -d= | tr -d '[:blank:]')"
44
+	fi
45
 fi
46
 
47
-if [ -n "$wsdd_group" ]; then
48
-	wsdd_opts="-w ${wsdd_group}"
49
+wsdd_opts=""
50
+if [ -n "${wsdd_suppflags}" ]; then
51
+	wsdd_opts="${wsdd_flags}"
52
 fi
53
+if [ -n "$wsdd_domain" ]; then
54
+	wsdd_opts="${wsdd_opts} -d ${wsdd_domain}"
55
+elif [ -n "$wsdd_group" ]; then
56
+	wsdd_opts="${wsdd_opts} -w ${wsdd_group}"
57
+fi
58
 
59
-command="/usr/sbin/daemon"
60
-command_args="-u daemon -S /usr/local/bin/wsdd $wsdd_opts"
61
+command="/usr/local/bin/wsdd"
62
+procname="PYTHON"
63
+pidfile="/var/run/${name}.pid"
64
 
65
-load_rc_config $name
66
+start_cmd="${name}_start"
67
+
68
+wsdd_start()
69
+{
70
+	echo -n "Starting ${name}."
71
+	/usr/sbin/daemon -u daemon -S -p ${pidfile} ${command} ${wsdd_opts}
72
+}
73
+
74
 run_rc_command "$1"

Return to bug 247626