1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-23 00:43:28 +00:00

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>
This commit is contained in:
Joe Marcus Clarke 2007-04-03 04:10:14 +00:00
parent ac450bb23d
commit dec8123ee0
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=189065
4 changed files with 73 additions and 9 deletions

View File

@ -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}

View File

@ -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() {

View File

@ -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

View File

@ -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