aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authormarcus <marcus@FreeBSD.org>2007-04-03 12:10:14 +0800
committermarcus <marcus@FreeBSD.org>2007-04-03 12:10:14 +0800
commita2cff15fd5b6c30320898120c8e6c3390d393f92 (patch)
treeb1a9bf1bf6e800c5e98c4579b29e4c637fa427b9 /net
parent72dbfe63e1861b1ddb195fadcbdefb6d0e2bea03 (diff)
downloadfreebsd-ports-gnome-a2cff15fd5b6c30320898120c8e6c3390d393f92.tar.gz
freebsd-ports-gnome-a2cff15fd5b6c30320898120c8e6c3390d393f92.tar.zst
freebsd-ports-gnome-a2cff15fd5b6c30320898120c8e6c3390d393f92.zip
Refactor the rc.d script to add support for the netatalk.conf daemon
configuration file (see netatalk.conf(5) for more information). Reasonable defaults have been included as well as a sample ${PREFIX}/etc/netatalk.conf.dist file. Configuration options include AppleTalk zone, node name, and maximum number of afpd clients. Submitted by: Böhme Ralph <ralph.boehme@supported.de>
Diffstat (limited to 'net')
-rw-r--r--net/netatalk/Makefile6
-rw-r--r--net/netatalk/files/netatalk.in26
-rw-r--r--net/netatalk/files/patch-config_netatalk.conf47
-rw-r--r--net/netatalk/pkg-plist3
4 files changed, 73 insertions, 9 deletions
diff --git a/net/netatalk/Makefile b/net/netatalk/Makefile
index 5e706d342a1a..0fb443f3f387 100644
--- a/net/netatalk/Makefile
+++ b/net/netatalk/Makefile
@@ -7,7 +7,7 @@
PORTNAME= netatalk
PORTVERSION= 2.0.3
-PORTREVISION= 3
+PORTREVISION= 4
PORTEPOCH= 1
CATEGORIES= net print
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
@@ -52,7 +52,7 @@ CONFIGURE_TARGET=--build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
USE_GMAKE= yes
USE_PERL5= yes
FILES= AppleVolumes.default AppleVolumes.system afpd.conf \
- atalkd.conf papd.conf
+ atalkd.conf papd.conf netatalk.conf
LINKS= unbin unhex unsingle hqx2bin single2bin macbinary \
binheader nadheader
MAN1= achfile.1 aecho.1 afile.1 afppasswd.1 getzones.1 \
@@ -94,7 +94,7 @@ post-patch:
post-install:
@${RM} -f ${PREFIX}/bin/nu ${PREFIX}/bin/lp2pap.sh \
${PREFIX}/bin/test_parse_mtab \
- ${PREFIX}/bin/afpd-mtab.pl ${PREFIX}/etc/netatalk.conf.dist
+ ${PREFIX}/bin/afpd-mtab.pl
${INSTALL_SCRIPT} ${WRKSRC}/contrib/macusers/macusers \
${PREFIX}/bin/macusers
.for i in ${FILES}
diff --git a/net/netatalk/files/netatalk.in b/net/netatalk/files/netatalk.in
index 67d514d2e965..7aa75ae1ae10 100644
--- a/net/netatalk/files/netatalk.in
+++ b/net/netatalk/files/netatalk.in
@@ -2,7 +2,7 @@
#
# $FreeBSD$
#
-# PROVIDE: atalkd papd cnid_metad afpd timelord
+# PROVIDE: atalkd papd cnid_metad timelord afpd
# REQUIRE: DAEMON %%SRVLOC%%
# KEYWORD: shutdown
#
@@ -11,6 +11,16 @@
# other processes.
#
+# Set defaults. Please overide these in %%PREFIX%%/etc/netatalk.conf
+ATALK_ZONE=
+ATALK_NAME="`/bin/hostname -s`"
+AFPD_UAMLIST=
+AFPD_MAX_CLIENTS=50
+AFPD_GUEST=nobody
+
+# Load user config
+if [ -f %%PREFIX%%/etc/netatalk.conf ]; then . %%PREFIX%%/etc/netatalk.conf; fi
+
netatalk_enable=${netatalk_enable-"NO"}
atalkd_enable=${atalkd_enable-"NO"}
papd_enable=${papd_enable-"NO"}
@@ -30,15 +40,19 @@ stop_cmd=netatalk_stop
netatalk_start() {
checkyesno atalkd_enable && %%PREFIX%%/sbin/atalkd
checkyesno atalkd_enable && \
- %%PREFIX%%/bin/nbprgstr -p 4 ${hostname}:Workstation &
+ %%PREFIX%%/bin/nbprgstr -p 4 "${ATALK_NAME}:Workstation${ATALK_ZONE}" &
checkyesno atalkd_enable && \
- %%PREFIX%%/bin/nbprgstr -p 4 ${hostname}:netatalk &
+ %%PREFIX%%/bin/nbprgstr -p 4 "${ATALK_NAME}:netatalk${ATALK_ZONE}" &
checkyesno papd_enable && %%PREFIX%%/sbin/papd
checkyesno cnid_metad_enable && %%PREFIX%%/sbin/cnid_metad
- checkyesno afpd_enable && \
- %%PREFIX%%/sbin/afpd -s %%PREFIX%%/etc/AppleVolumes.system \
- -f %%PREFIX%%/etc/AppleVolumes.default
checkyesno timelord_enable && %%PREFIX%%/sbin/timelord
+ checkyesno afpd_enable && \
+ %%PREFIX%%/sbin/afpd -n "${ATALK_NAME}${ATALK_ZONE}" \
+ -s %%PREFIX%%/etc/AppleVolumes.system \
+ -f %%PREFIX%%/etc/AppleVolumes.default \
+ -g ${AFPD_GUEST} \
+ -c ${AFPD_MAX_CLIENTS} \
+ ${AFPD_UAMLIST}
}
netatalk_stop() {
diff --git a/net/netatalk/files/patch-config_netatalk.conf b/net/netatalk/files/patch-config_netatalk.conf
new file mode 100644
index 000000000000..25519924ce17
--- /dev/null
+++ b/net/netatalk/files/patch-config_netatalk.conf
@@ -0,0 +1,47 @@
+--- config/netatalk.conf.org Sun Apr 1 07:26:37 2007
++++ config/netatalk.conf Sun Apr 1 07:31:49 2007
+@@ -1,4 +1,5 @@
+-# Appletalk configuration
++# netatalk configuration
++# For details see man netatalk.conf
+ # Change this to increase the maximum number of clients that can connect:
+ AFPD_MAX_CLIENTS=50
+
+@@ -8,17 +9,8 @@
+ # NOTE: If Netatalk should register AppleTalk services in the standard zone
+ # then you need not to specify a zone name here.
+ #
+-# If your zone has spaces in it, you're better off specifying
+-# it in afpd.conf if you realize that your distribution doesn't
+-# handle spaces correctly in the startup script. Remember to use
+-# quotes here if the zone name contains spaces.
+-#
+ #ATALK_ZONE="@some zone"
+-ATALK_NAME=`echo ${HOSTNAME}|cut -d. -f1`
+-
+-# specify the Mac and unix charsets to be used
+-ATALK_MAC_CHARSET='MAC_ROMAN'
+-ATALK_UNIX_CHARSET='LOCALE'
++ATALK_NAME=`/bin/hostname -s`
+
+ # specify this if you don't want guest, clrtxt, and dhx
+ # available options: uams_guest.so, uams_clrtxt.so, uams_dhx.so,
+@@ -27,18 +19,3 @@
+
+ # Change this to set the id of the guest user
+ AFPD_GUEST=nobody
+-
+-# Set which daemons to run (papd is dependent upon atalkd):
+-ATALKD_RUN=yes
+-PAPD_RUN=yes
+-CNID_METAD_RUN=yes
+-AFPD_RUN=yes
+-TIMELORD_RUN=no
+-A2BOOT_RUN=no
+-
+-# Control whether the daemons are started in the background
+-ATALK_BGROUND=no
+-
+-# export the charsets, read form ENV by apps
+-export ATALK_MAC_CHARSET
+-export ATALK_UNIX_CHARSET
diff --git a/net/netatalk/pkg-plist b/net/netatalk/pkg-plist
index 457bfdcf16de..270bb8a6ea8c 100644
--- a/net/netatalk/pkg-plist
+++ b/net/netatalk/pkg-plist
@@ -53,6 +53,9 @@ etc/afpd.conf.dist
@unexec if cmp -s %D/etc/atalkd.conf %D/etc/atalkd.conf.dist; then rm -f %D/etc/atalkd.conf; fi
etc/atalkd.conf.dist
@exec [ ! -f %B/atalkd.conf ] && cp %B/%f %B/atalkd.conf
+@unexec if cmp -s %D/etc/netatalk.conf %D/etc/netatalk.conf.dist; then rm -f %D/etc/netatalk.conf; fi
+etc/netatalk.conf.dist
+@exec [ ! -f %B/netatalk.conf ] && cp %B/%f %B/netatalk.conf
@unexec if cmp -s %D/etc/papd.conf %D/etc/papd.conf.dist; then rm -f %D/etc/papd.conf; fi
etc/papd.conf.dist
@exec [ ! -f %B/papd.conf ] && cp %B/%f %B/papd.conf