Index: net/netatalk/files/patch-etc__afpd__afp_options.c
===================================================================
RCS file: net/netatalk/files/patch-etc__afpd__afp_options.c
diff -N net/netatalk/files/patch-etc__afpd__afp_options.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ net/netatalk/files/patch-etc__afpd__afp_options.c 25 Aug 2011 17:11:29 -0000
@@ -0,0 +1,13 @@
+--- ./etc/afpd/afp_options.c.orig 2011-07-27 04:55:39.000000000 -0700
++++ ./etc/afpd/afp_options.c 2011-08-19 14:43:45.034785568 -0700
+@@ -240,6 +240,10 @@
+ options->flags |= OPTION_ANNOUNCESSH;
+ if (strstr(buf, " -noacl2maccess"))
+ options->flags &= ~OPTION_ACL2MACCESS;
++ if (strstr(buf, " -keepsessions")) {
++ default_options.flags |= OPTION_KEEPSESSIONS;
++ options->flags |= OPTION_KEEPSESSIONS;
++ }
+
+ /* passwd bits */
+ if (strstr(buf, " -nosavepassword"))
Index: net/netatalk/files/patch-etc__afpd__main.c
===================================================================
RCS file: net/netatalk/files/patch-etc__afpd__main.c
diff -N net/netatalk/files/patch-etc__afpd__main.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ net/netatalk/files/patch-etc__afpd__main.c 25 Aug 2011 17:11:29 -0000
@@ -0,0 +1,139 @@
+--- ./etc/afpd/main.c.orig 2011-07-27 04:55:39.000000000 -0700
++++ ./etc/afpd/main.c 2011-08-19 14:43:45.042815401 -0700
+@@ -52,11 +52,11 @@
+ #endif /* TRU64 */
+
+ unsigned char nologin = 0;
+-
+ struct afp_options default_options;
+ static AFPConfig *configs;
+ static server_child *server_children;
+ static sig_atomic_t reloadconfig = 0;
++static sig_atomic_t gotsigchld = 0;
+
+ /* Two pointers to dynamic allocated arrays which store pollfds and associated data */
+ static struct pollfd *fdset;
+@@ -94,7 +94,11 @@
+ continue;
+ fdset_add_fd(&fdset, &polldata, &fdset_used, &fdset_size, config->fd, LISTEN_FD, config);
+ }
+- fdset_add_fd(&fdset, &polldata, &fdset_used, &fdset_size, disasociated_ipc_fd, DISASOCIATED_IPC_FD, NULL);
++
++ if (default_options.flags & OPTION_KEEPSESSIONS) {
++ LOG(log_note, logtype_afpd, "Activating continous service");
++ fdset_add_fd(&fdset, &polldata, &fdset_used, &fdset_size, disasociated_ipc_fd, DISASOCIATED_IPC_FD, NULL);
++ }
+ }
+
+ static void fd_reset_listening_sockets(void)
+@@ -106,7 +110,9 @@
+ continue;
+ fdset_del_fd(&fdset, &polldata, &fdset_used, &fdset_size, config->fd);
+ }
+- fdset_del_fd(&fdset, &polldata, &fdset_used, &fdset_size, disasociated_ipc_fd);
++
++ if (default_options.flags & OPTION_KEEPSESSIONS)
++ fdset_del_fd(&fdset, &polldata, &fdset_used, &fdset_size, disasociated_ipc_fd);
+ }
+
+ /* ------------------ */
+@@ -127,7 +133,12 @@
+ LOG(log_note, logtype_afpd, "AFP Server shutting down on SIGTERM");
+ break;
+ case SIGQUIT:
+- LOG(log_note, logtype_afpd, "AFP Server shutting down on SIGQUIT, NOT disconnecting clients");
++ if (default_options.flags & OPTION_KEEPSESSIONS) {
++ LOG(log_note, logtype_afpd, "AFP Server shutting down on SIGQUIT, NOT disconnecting clients");
++ } else {
++ LOG(log_note, logtype_afpd, "AFP Server shutting down on SIGQUIT");
++ sig = SIGTERM;
++ }
+ break;
+ }
+ if (server_children)
+@@ -154,13 +165,18 @@
+ reloadconfig = 1;
+ break;
+
++ case SIGCHLD:
++ /* w/ a configuration file, we can force a re-read if we want */
++ gotsigchld = 1;
++ break;
++
+ default :
+ LOG(log_error, logtype_afpd, "afp_goaway: bad signal" );
+ }
+ return;
+ }
+
+-static void child_handler(int sig _U_)
++static void child_handler(void)
+ {
+ int fd;
+ int status, i;
+@@ -273,7 +289,8 @@
+ }
+ #endif
+
+- sv.sa_handler = child_handler;
++ sv.sa_handler = afp_goaway; /* handler for all sigs */
++
+ sigemptyset( &sv.sa_mask );
+ sigaddset(&sv.sa_mask, SIGALRM);
+ sigaddset(&sv.sa_mask, SIGHUP);
+@@ -286,7 +303,6 @@
+ exit(EXITERR_SYS);
+ }
+
+- sv.sa_handler = afp_goaway;
+ sigemptyset( &sv.sa_mask );
+ sigaddset(&sv.sa_mask, SIGALRM);
+ sigaddset(&sv.sa_mask, SIGTERM);
+@@ -374,6 +390,7 @@
+ afp_child_t *child;
+ int fd[2]; /* we only use one, but server_child_add expects [2] */
+ pid_t pid;
++ int saveerrno;
+
+ /* wait for an appleshare connection. parent remains in the loop
+ * while the children get handled by afp_over_{asp,dsi}. this is
+@@ -386,7 +403,13 @@
+ pthread_sigmask(SIG_UNBLOCK, &sigs, NULL);
+ ret = poll(fdset, fdset_used, -1);
+ pthread_sigmask(SIG_BLOCK, &sigs, NULL);
+- int saveerrno = errno;
++ saveerrno = errno;
++
++ if (gotsigchld) {
++ gotsigchld = 0;
++ child_handler();
++ continue;
++ }
+
+ if (reloadconfig) {
+ nologin++;
+@@ -441,11 +464,11 @@
+ child = (afp_child_t *)polldata[i].data;
+ LOG(log_debug, logtype_afpd, "main: IPC request from child[%u]", child->pid);
+
+- if ((ret = ipc_server_read(server_children, child->ipc_fds[0])) == 0) {
++ if (ipc_server_read(server_children, child->ipc_fds[0]) != 0) {
+ fdset_del_fd(&fdset, &polldata, &fdset_used, &fdset_size, child->ipc_fds[0]);
+ close(child->ipc_fds[0]);
+ child->ipc_fds[0] = -1;
+- if (child->disasociated) {
++ if ((default_options.flags & OPTION_KEEPSESSIONS) && child->disasociated) {
+ LOG(log_note, logtype_afpd, "main: removing reattached child[%u]", child->pid);
+ server_child_remove(server_children, CHILD_DSIFORK, child->pid);
+ }
+@@ -461,8 +484,9 @@
+ if (readt(fd[0], &pid, sizeof(pid_t), 0, 1) != sizeof(pid_t)) {
+ LOG(log_error, logtype_afpd, "main: readt: %s", strerror(errno));
+ close(fd[0]);
++ break;
+ }
+- LOG(log_note, logtype_afpd, "main: IPC reconnect from [%u]", pid);
++ LOG(log_note, logtype_afpd, "main: IPC reconnect from pid [%u]", pid);
+ if ((child = server_child_add(server_children, CHILD_DSIFORK, pid, fd)) == NULL) {
+ LOG(log_error, logtype_afpd, "main: server_child_add");
+ close(fd[0]);
Index: net/netatalk/files/patch-include__atalk__globals.h
===================================================================
RCS file: net/netatalk/files/patch-include__atalk__globals.h
diff -N net/netatalk/files/patch-include__atalk__globals.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ net/netatalk/files/patch-include__atalk__globals.h 25 Aug 2011 17:11:29 -0000
@@ -0,0 +1,39 @@
+--- ./include/atalk/globals.h.orig 2011-07-27 04:55:39.000000000 -0700
++++ ./include/atalk/globals.h 2011-08-19 14:43:45.046204676 -0700
+@@ -43,6 +43,7 @@
+ #define OPTION_UUID (1 << 7)
+ #define OPTION_ACL2MACCESS (1 << 8)
+ #define OPTION_NOZEROCONF (1 << 9)
++#define OPTION_KEEPSESSIONS (1 << 10) /* preserve sessions across master afpd restart with SIGQUIT */
+
+ #ifdef FORCE_UIDGID
+ /* set up a structure for this */
+@@ -127,18 +128,16 @@
+ /* typedef for AFP functions handlers */
+ typedef int (*AFPCmd)(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen);
+
+-/* afp_dsi.c */
+-extern AFPObj *AFPobj;
+-
+-extern int afp_version;
+-extern int afp_errno;
+-extern unsigned char nologin;
+-extern struct dir *curdir;
+-extern char getwdbuf[];
+-
+-/* FIXME CNID */
+-extern const char *Cnid_srv;
+-extern const char *Cnid_port;
++/* Global variables */
++extern AFPObj *AFPobj;
++extern int afp_version;
++extern int afp_errno;
++extern unsigned char nologin;
++extern struct dir *curdir;
++extern char getwdbuf[];
++extern struct afp_options default_options;
++extern const char *Cnid_srv;
++extern const char *Cnid_port;
+
+ extern int get_afp_errno (const int param);
+ extern void afp_options_init (struct afp_options *);
Index: net/netatalk/files/patch-libatalk__util__server_child.c
===================================================================
RCS file: net/netatalk/files/patch-libatalk__util__server_child.c
diff -N net/netatalk/files/patch-libatalk__util__server_child.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ net/netatalk/files/patch-libatalk__util__server_child.c 25 Aug 2011 17:11:29 -0000
@@ -0,0 +1,14 @@
+--- ./libatalk/util/server_child.c.orig 2011-07-27 04:55:39.000000000 -0700
++++ ./libatalk/util/server_child.c 2011-08-19 14:42:28.704028827 -0700
+@@ -135,8 +135,10 @@
+
+ /* it's possible that the child could have already died before the
+ * pthread_sigmask. we need to check for this. */
+- if (kill(pid, 0) < 0)
++ if (kill(pid, 0) < 0) {
++ LOG(log_error, logtype_default, "server_child_add: no such process pid [%d]", pid);
+ goto exit;
++ }
+
+ fork = (server_child_fork *) children->fork + forkid;
+
Index: net/netatalk/files/patch-libatalk__util__server_ipc.c
===================================================================
RCS file: net/netatalk/files/patch-libatalk__util__server_ipc.c
diff -N net/netatalk/files/patch-libatalk__util__server_ipc.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ net/netatalk/files/patch-libatalk__util__server_ipc.c 25 Aug 2011 17:11:29 -0000
@@ -0,0 +1,61 @@
+--- ./libatalk/util/server_ipc.c.orig 2011-07-27 04:55:39.000000000 -0700
++++ ./libatalk/util/server_ipc.c 2011-08-19 14:42:28.728518099 -0700
+@@ -214,21 +214,27 @@
+ /*!
+ * Read a IPC message from a child
+ *
++ * This is using an fd with non-blocking IO, so EAGAIN is not an error
++ *
+ * @args children (rw) pointer to our structure with all childs
+ * @args fd (r) IPC socket with child
+ *
+- * @returns number of bytes transfered, -1 on error, 0 on EOF
++ * @returns -1 on error, 0 on success
+ */
+ int ipc_server_read(server_child *children, int fd)
+ {
+- int ret = 0;
++ int ret;
+ struct ipc_header ipc;
+ char buf[IPC_MAXMSGSIZE], *p;
+
+ if ((ret = read(fd, buf, IPC_HEADERLEN)) != IPC_HEADERLEN) {
+- LOG(log_error, logtype_afpd, "Reading IPC header failed (%i of %u bytes read): %s",
+- ret, IPC_HEADERLEN, strerror(errno));
+- return ret;
++ if (ret != 0) {
++ if (errno == EAGAIN)
++ return 0;
++ LOG(log_error, logtype_afpd, "Reading IPC header failed (%i of %u bytes read): %s",
++ ret, IPC_HEADERLEN, strerror(errno));
++ }
++ return -1;
+ }
+
+ p = buf;
+@@ -255,7 +261,7 @@
+ if ((ret = read(fd, buf, ipc.len)) != (int) ipc.len) {
+ LOG(log_info, logtype_afpd, "Reading IPC message failed (%u of %u bytes read): %s",
+ ret, ipc.len, strerror(errno));
+- return ret;
++ return -1;
+ }
+ }
+ ipc.msg = buf;
+@@ -271,6 +277,7 @@
+ if (readt(fd, &ipc.DSI_requestID, 2, 0, 2) != 2) {
+ LOG (log_error, logtype_afpd, "ipc_read(%s:child[%u]): couldnt read DSI id: %s",
+ ipc_cmd_str[ipc.command], ipc.child_pid, strerror(errno));
++ return -1;
+ }
+ if ((ipc.afp_socket = recv_fd(fd, 1)) == -1) {
+ LOG (log_error, logtype_afpd, "ipc_read(%s:child[%u]): recv_fd: %s",
+@@ -296,7 +303,7 @@
+ return -1;
+ }
+
+- return ret;
++ return 0;
+ }
+
+ /* ----------------- */
Index: net/netatalk/files/patch-etc_afpd_acls.c
===================================================================
RCS file: net/netatalk/files/patch-etc_afpd_acls.c
diff -N net/netatalk/files/patch-etc_afpd_acls.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ net/netatalk/files/patch-etc_afpd_acls.c 25 Aug 2011 17:08:39 -0000
@@ -0,0 +1,63 @@
+--- etc/afpd/acls.c.orig 2011-07-30 18:08:35.000000000 -0400
++++ etc/afpd/acls.c 2011-07-30 18:19:19.000000000 -0400
+@@ -1060,7 +1060,59 @@ static int set_acl(const struct vol *vol
+ #ifdef HAVE_ACL_FROM_MODE
+ EC_NULL_LOG_ERR(acc_acl = acl_from_mode(st.st_mode), AFPERR_MISC);
+ #else
+-#error "Missing acl_from_mode() replacement"
++ /* Implement the non POSIX.1e function acl_from_mode
++ *
++ * Taken from http://people.freebsd.org/~markus/stuff/kacl.diff
++ */
++ {
++ acl_t new_acl = acl_init( 3 );
++ acl_entry_t entry;
++ acl_permset_t permset = 0;
++ int error = 0;
++
++ /* Add owner entry */
++ if ( ( error = acl_create_entry( &new_acl, &entry ) ) == 0 ) {
++ /* Set owner permissions */
++ acl_set_tag_type( entry, ACL_USER_OBJ );
++ acl_get_permset( entry, &permset );
++ acl_clear_perms( permset );
++ if ( st.st_mode & S_IRUSR ) acl_add_perm( permset, ACL_READ );
++ if ( st.st_mode & S_IWUSR ) acl_add_perm( permset, ACL_WRITE );
++ if ( st.st_mode & S_IXUSR ) acl_add_perm( permset, ACL_EXECUTE );
++ acl_set_permset( entry, permset );
++
++ /* Add group entry */
++ if ( ( error = acl_create_entry( &new_acl, &entry ) ) == 0 ) {
++ /* Set group permissions */
++ acl_set_tag_type( entry, ACL_GROUP_OBJ );
++ acl_get_permset( entry, &permset );
++ acl_clear_perms( permset );
++ if ( st.st_mode & S_IRGRP ) acl_add_perm( permset, ACL_READ );
++ if ( st.st_mode & S_IWGRP ) acl_add_perm( permset, ACL_WRITE );
++ if ( st.st_mode & S_IXGRP ) acl_add_perm( permset, ACL_EXECUTE );
++ acl_set_permset( entry, permset );
++
++ /* Add other entry */
++ if ( ( error = acl_create_entry( &new_acl, &entry ) ) == 0 ) {
++ /* Set other permissions */
++ acl_set_tag_type( entry, ACL_OTHER );
++ acl_get_permset( entry, &permset );
++ acl_clear_perms( permset );
++ if ( st.st_mode & S_IROTH ) acl_add_perm( permset, ACL_READ );
++ if ( st.st_mode & S_IWOTH ) acl_add_perm( permset, ACL_WRITE );
++ if ( st.st_mode & S_IXOTH ) acl_add_perm( permset, ACL_EXECUTE );
++ acl_set_permset( entry, permset );
++ }
++ }
++ }
++
++ if ( error ) {
++ acl_free( &new_acl );
++ EC_NULL_LOG_ERR(acc_acl = NULL, AFPERR_MISC);
++ }
++ else
++ acc_acl = new_acl;
++ }
+ #endif
+ /* adds the clients aces */
+ EC_ZERO_ERR(map_aces_darwin_to_posix(daces, &def_acl, &acc_acl, ace_count), AFPERR_MISC);
Index: net/netatalk/files/patch-etc_afpd_afp_asp.c
===================================================================
RCS file: net/netatalk/files/patch-etc_afpd_afp_asp.c
diff -N net/netatalk/files/patch-etc_afpd_afp_asp.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ net/netatalk/files/patch-etc_afpd_afp_asp.c 25 Aug 2011 17:08:39 -0000
@@ -0,0 +1,13 @@
+--- etc/afpd/afp_asp.c.orig 2011-07-30 23:13:47.000000000 -0400
++++ etc/afpd/afp_asp.c 2011-07-30 23:14:22.000000000 -0400
+@@ -31,9 +31,9 @@
+ #include <atalk/atp.h>
+ #include <atalk/asp.h>
+ #include <atalk/compat.h>
++#include <atalk/globals.h>
+ #include <atalk/util.h>
+
+-#include "globals.h"
+ #include "switch.h"
+ #include "auth.h"
+ #include "fork.h"
Index: net/netatalk/files/patch-etc_cnid_dbd_cnid_metad.c
===================================================================
RCS file: net/netatalk/files/patch-etc_cnid_dbd_cnid_metad.c
diff -N net/netatalk/files/patch-etc_cnid_dbd_cnid_metad.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ net/netatalk/files/patch-etc_cnid_dbd_cnid_metad.c 25 Aug 2011 17:08:39 -0000
@@ -0,0 +1,10 @@
+--- etc/cnid_dbd/cnid_metad.c.orig 2011-07-30 18:28:32.000000000 -0400
++++ etc/cnid_dbd/cnid_metad.c 2011-07-30 18:29:01.000000000 -0400
+@@ -39,6 +39,7 @@
+ #include <string.h>
+ #include <signal.h>
+ #include <sys/types.h>
++#include <sys/resource.h>
+ #include <sys/time.h>
+ #include <sys/wait.h>
+ #include <sys/uio.h>
Index: net/netatalk/files/patch-etc_cnid_dbd_comm.c
===================================================================
RCS file: net/netatalk/files/patch-etc_cnid_dbd_comm.c
diff -N net/netatalk/files/patch-etc_cnid_dbd_comm.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ net/netatalk/files/patch-etc_cnid_dbd_comm.c 25 Aug 2011 17:08:39 -0000
@@ -0,0 +1,12 @@
+--- etc/cnid_dbd/comm.c.orig 2011-07-30 18:27:55.000000000 -0400
++++ etc/cnid_dbd/comm.c 2011-07-30 18:28:04.000000000 -0400
+@@ -9,9 +9,6 @@
+ #include "config.h"
+ #endif
+
+-#ifndef _XOPEN_SOURCE
+-# define _XOPEN_SOURCE 600
+-#endif
+ #ifndef __EXTENSIONS__
+ # define __EXTENSIONS__
+ #endif
Index: net/netatalk/files/netatalk.in
===================================================================
RCS file: /home/ncvs/ports/net/netatalk/files/netatalk.in,v
retrieving revision 1.3
diff -u -r1.3 netatalk.in
--- net/netatalk/files/netatalk.in 27 Mar 2010 00:13:49 -0000 1.3
+++ net/netatalk/files/netatalk.in 25 Aug 2011 17:08:39 -0000
@@ -3,7 +3,7 @@
# $FreeBSD: ports/net/netatalk/files/netatalk.in,v 1.3 2010/03/27 00:13:49 dougb Exp $
#
# PROVIDE: atalkd papd cnid_metad timelord afpd
-# REQUIRE: DAEMON %%SRVLOC%%
+# REQUIRE: DAEMON %%SRVLOC%% avahi_dnsconfd
# KEYWORD: shutdown
#
# AppleTalk daemons. Make sure not to start atalkd in the background:
@@ -11,16 +11,6 @@
# 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"}
@@ -33,6 +23,7 @@
name=netatalk
rcvar=`set_rcvar`
hostname=`hostname -s`
+pidfile="/var/run/afpd.pid"
start_cmd=netatalk_start
stop_cmd=netatalk_stop
@@ -46,19 +37,20 @@
checkyesno papd_enable && %%PREFIX%%/sbin/papd
checkyesno cnid_metad_enable && %%PREFIX%%/sbin/cnid_metad
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}
+ checkyesno afpd_enable && %%PREFIX%%/sbin/afpd -P ${pidfile} -F /etc/afpd.conf
}
netatalk_stop() {
checkyesno timelord_enable && killall timelord
- checkyesno afpd_enable && killall afpd
- checkyesno cnid_metad_enable && killall cnid_metad
+ if [ -f ${pidfile} ]; then
+ kill `cat ${pidfile}`
+ if [ $? -ne 0 ]; then
+ kill -9 `cat ${pidfile}`
+ fi
+ else
+ killall afpd
+ fi
+ killall cnid_metad
checkyesno papd_enable && killall papd
checkyesno atalkd_enable && killall atalkd
}
Index: net/netatalk/files/patch-config_netatalk.conf
===================================================================
RCS file: /home/ncvs/ports/net/netatalk/files/patch-config_netatalk.conf,v
retrieving revision 1.3
diff -u -r1.3 patch-config_netatalk.conf
--- net/netatalk/files/patch-config_netatalk.conf 30 May 2010 17:03:17 -0000 1.3
+++ net/netatalk/files/patch-config_netatalk.conf 25 Aug 2011 17:08:39 -0000
@@ -1,43 +1,20 @@
---- config/netatalk.conf.orig 2010-04-19 11:35:26.000000000 +0000
-+++ config/netatalk.conf 2010-05-20 19:14:32.000000000 +0000
+--- config/netatalk.conf.orig 2011-07-22 00:30:42.000000000 -0400
++++ config/netatalk.conf 2011-07-30 18:01:04.000000000 -0400
@@ -1,4 +1,5 @@
-# Netatalk configuration
+# netatalk configuration
+# For details see man netatalk.conf
- # Change this to increase the maximum number of clients that can connect:
- AFPD_MAX_CLIENTS=20
-@@ -6,7 +7,7 @@
- # NOTE: if your zone has spaces in it, you're better off specifying
- # it in afpd.conf
- #ATALK_ZONE=@zone
--ATALK_NAME=`echo ${HOSTNAME}|cut -d. -f1`
-+ATALK_NAME=`/bin/hostname -s`
+ #########################################################################
+ # Global configuration
+@@ -21,8 +22,8 @@ export ATALK_MAC_CHARSET
- # specify the Mac and unix charsets to be used
- ATALK_MAC_CHARSET='MAC_ROMAN'
-@@ -20,24 +21,5 @@
- # Change this to set the id of the guest user
- AFPD_GUEST=nobody
-
--# Set which daemons to run.
--# If you need legacy AppleTalk, run atalkd.
--# papd, timelord and a2boot are dependent upon atalkd.
--# If you use "AFP over TCP" server only, run only cnid_metad and afpd.
--ATALKD_RUN=no
--PAPD_RUN=no
--TIMELORD_RUN=no
--A2BOOT_RUN=no
+ #### Set which daemons to run.
+ #### If you use AFP file server, run both cnid_metad and afpd.
-CNID_METAD_RUN=yes
-AFPD_RUN=yes
--
--# Control whether the daemons are started in the background.
--# If it is dissatisfied that atalkd starts slowly, set "yes".
--ATALK_BGROUND=no
--
--# export the charsets, read form ENV by apps
--export ATALK_MAC_CHARSET
--export ATALK_UNIX_CHARSET
--
- # config for cnid_metad. Default log config:
- # CNID_CONFIG="-l log_note"
++#CNID_METAD_RUN=yes
++#AFPD_RUN=yes
+
+ #### maximum number of clients that can connect:
+ #AFPD_MAX_CLIENTS=20
Index: net/netatalk/files/patch-configure
===================================================================
RCS file: /home/ncvs/ports/net/netatalk/files/patch-configure,v
retrieving revision 1.17
diff -u -r1.17 patch-configure
--- net/netatalk/files/patch-configure 25 Jul 2010 01:37:08 -0000 1.17
+++ net/netatalk/files/patch-configure 25 Aug 2011 17:08:39 -0000
@@ -1,11 +1,37 @@
---- configure.orig 2010-07-10 06:18:22.000000000 -0400
-+++ configure 2010-07-24 21:33:50.000000000 -0400
-@@ -30958,7 +30958,7 @@ if test "x$bdb_required" = "xyes"; then
+--- configure.orig 2011-07-27 07:59:28.000000000 -0400
++++ configure 2011-08-01 03:26:25.000000000 -0400
+@@ -27039,6 +27039,7 @@ fi
+
+ savedcflags="$CFLAGS"
+ savedldflags="$LDFLAGS"
++ saved_CPPFLAGS="$CPPFLAGS"
+ ICONV_CFLAGS=""
+ ICONV_LIBS=""
+
+@@ -28265,6 +28266,8 @@ echo "$as_me: error: internal error, ata
+ if test "x$zeroconf" != "xno"; then
+ savedcppflags="$CPPFLAGS"
+ savedldflags="$LDFLAGS"
++ CPPFLAGS="-I%%LOCALBASE%%/include $CPPFLAGS"
++ LDFLAGS="-L%%LOCALBASE%%/lib $LDFLAGS"
+
+ if test "x$zeroconf" = "xyes" -o "x$zeroconf" = "xtry"; then
+ zeroconf_dir="/usr"
+@@ -31357,7 +31360,7 @@ if test "x$bdb_required" = "xyes"; then
trybdbdir=""
dobdbsearch=yes
bdb_search_dirs="/usr/local /usr"
-- search_subdirs="/ /db5 /db5.0 /db50 /db4.8 /db48 /db4.7 /db47 /db4.6 /db46 /db4"
-+ search_subdirs="/%%DB_NAME%% / /db5 /db5.0 /db50 /db4.8 /db48 /db4.7 /db47 /db4.6 /db46 /db4"
+- search_subdirs="/ /db5 /db5.1 /db51 /db5.0 /db50 /db4.8 /db48 /db4.7 /db47 /db4.6 /db46 /db4"
++ search_subdirs="/%%DB_NAME%% / /db5 /db5.1 /db51 /db5.0 /db50 /db4.8 /db48 /db4.7 /db47 /db4.6 /db46 /db4"
bdbfound=no
savedcflags="$CFLAGS"
+@@ -33387,7 +33390,7 @@ rm -f core conftest.err conftest.$ac_obj
+ fi
+ { echo "$as_me:$LINENO: result: $netatalk_cv_HAVE_ACL_GET_PERM_NP" >&5
+ echo "${ECHO_T}$netatalk_cv_HAVE_ACL_GET_PERM_NP" >&6; }
+- if test x"netatalk_cv_HAVE_ACL_GET_PERM_NP" = x"yes"; then
++ if test x"$netatalk_cv_HAVE_ACL_GET_PERM_NP" = x"yes"; then
+
+ cat >>confdefs.h <<\_ACEOF
+ #define HAVE_ACL_GET_PERM_NP 1
Index: net/netatalk/files/patch-etc_apfd_Makefile.in
===================================================================
RCS file: /home/ncvs/ports/net/netatalk/files/patch-etc_apfd_Makefile.in,v
retrieving revision 1.1
diff -u -r1.1 patch-etc_apfd_Makefile.in
--- net/netatalk/files/patch-etc_apfd_Makefile.in 8 May 2011 23:08:21 -0000 1.1
+++ net/netatalk/files/patch-etc_apfd_Makefile.in 25 Aug 2011 17:08:39 -0000
@@ -1,11 +1,11 @@
---- etc/afpd/Makefile.in.orig 2011-05-08 19:04:22.000000000 -0400
-+++ etc/afpd/Makefile.in 2011-05-08 19:04:34.000000000 -0400
-@@ -295,7 +295,7 @@ afpd_SOURCES = unix.c ofork.c main.c swi
- afp_dsi.c messages.c afp_config.c nfsquota.c quota.c uam.c \
- afs.c uid.c afp_util.c catsearch.c afprun.c hash.c extattrs.c \
- $(am__append_1)
--afpd_LDADD = $(top_builddir)/libatalk/cnid/libcnid.la $(top_builddir)/libatalk/libatalk.la @QUOTA_LIBS@ @SLP_LIBS@ @WRAP_LIBS@ @LIBADD_DL@
-+afpd_LDADD = $(top_builddir)/libatalk/cnid/libcnid.la $(top_builddir)/libatalk/libatalk.la @QUOTA_LIBS@ @SLP_LIBS@ @WRAP_LIBS@ @LIBADD_DL@ @PAM_LIBS@
+--- etc/afpd/Makefile.in.orig 2011-07-27 07:59:24.000000000 -0400
++++ etc/afpd/Makefile.in 2011-07-30 18:03:30.000000000 -0400
+@@ -317,7 +317,7 @@ afpd_SOURCES = afp_asp.c afp_avahi.c afp
+ afpd_LDADD = \
+ $(top_builddir)/libatalk/cnid/libcnid.la \
+ $(top_builddir)/libatalk/libatalk.la \
+- @LIBGCRYPT_LIBS@ @ZEROCONF_LIBS@ @QUOTA_LIBS@ @SLP_LIBS@ @WRAP_LIBS@ @LIBADD_DL@ @ACL_LIBS@ @PTHREAD_LIBS@
++ @LIBGCRYPT_LIBS@ @ZEROCONF_LIBS@ @QUOTA_LIBS@ @SLP_LIBS@ @WRAP_LIBS@ @LIBADD_DL@ @ACL_LIBS@ @PTHREAD_LIBS@ @PAM_LIBS@
+
afpd_LDFLAGS = -export-dynamic
- afpd_CFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/sys \
- @SLP_CFLAGS@ \
+ afpd_CFLAGS = \
Index: net/netatalk/Makefile
===================================================================
RCS file: /home/ncvs/ports/net/netatalk/Makefile,v
retrieving revision 1.96
diff -u -r1.96 Makefile
--- net/netatalk/Makefile 3 Jul 2011 11:40:45 -0000 1.96
+++ net/netatalk/Makefile 25 Aug 2011 17:11:29 -0000
@@ -2,15 +2,15 @@
# Date created: 23 Jul 1997
# Whom: stb
#
-# $FreeBSD: ports/net/netatalk/Makefile,v 1.96 2011/07/03 11:40:45 swills Exp $
+# $FreeBSD: ports/net/netatalk/Makefile,v 1.101 2011/08/14 17:17:28 marcus Exp $
#
PORTNAME= netatalk
-PORTVERSION= 2.1.5
-PORTREVISION= 2
+PORTVERSION= 2.2.0
+PORTREVISION= 4
PORTEPOCH= 1
CATEGORIES= net print
-MASTER_SITES= SF
+MASTER_SITES= SF/netatalk/netatalk/2.2
MAINTAINER= marcus@FreeBSD.org
COMMENT= File server for Mac OS X
@@ -24,6 +24,7 @@
GNU_CONFIGURE= yes
USE_GMAKE= yes
USE_PERL5= yes
+WANT_GNOME= yes
USE_RC_SUBR= netatalk
CONFIGURE_ARGS+= --with-tcp-wrappers \
@@ -37,24 +38,21 @@
SRVLOC "Enable Service Location Protocol support" off \
PAM "Enable PAM support" off \
TIMELORD "Enable Timelord network time service" off \
- KRB5 "Enable Kerberos V UAM" off
+ KRB5 "Enable Kerberos V UAM" off \
+ ZEROCONF "Enable Zeroconf (Bonjour) support" on
FILES= AppleVolumes.default AppleVolumes.system afpd.conf \
atalkd.conf papd.conf netatalk.conf
LINKS= unbin unhex unsingle hqx2bin single2bin macbinary \
binheader nadheader
-MAN1= achfile.1 ad.1 aecho.1 afile.1 afppasswd.1 apple_cp.1 \
- apple_dump.1 apple_mv.1 apple_rm.1 asip-status.pl.1 dbd.1 \
- getzones.1 hqx2bin.1 macbinary.1 megatron.1 nbp.1 nbplkup.1 \
- nbprgstr.1 nbpunrgstr.1 netatalk-config.1 pap.1 papstatus.1 \
- psorder.1 single2bin.1 unbin.1 unhex.1 uniconv.1 unsingle.1
-MAN3= atalk_aton.3 nbp_name.3
-MAN4= atalk.4
+MAN1= ad.1 afpldaptest.1 afppasswd.1 apple_dump.1 asip-status.pl.1 \
+ dbd.1 hqx2bin.1 macbinary.1 megatron.1 \
+ netatalk-config.1 single2bin.1 unbin.1 unhex.1 uniconv.1 \
+ unsingle.1
MAN5= AppleVolumes.5 AppleVolumes.default.5 \
AppleVolumes.system.5 afp_ldap.conf.5 afp_signature.conf.5 \
- afpd.conf.5 atalkd.conf.5 netatalk.conf.5 papd.conf.5
-MAN8= afp_acls.8 afpd.8 atalkd.8 cnid_dbd.8 cnid_metad.8 papd.8 \
- papstatus.8 psf.8 timelord.8
+ afp_voluuid.conf.5 afpd.conf.5 netatalk.conf.5
+MAN8= afpd.8 cnid_dbd.8 cnid_metad.8 timelord.8
CONFLICTS= bigloo-2.* cap-6.0.* tct-1.* netatalk-1* yudit-[0-9]*
@@ -68,9 +66,16 @@
.endif
.if defined(WITH_APPLETALK)
-CONFIGURE_ARGS+= --with-ddp
+CONFIGURE_ARGS+= --enable-ddp
+PLIST_SUB+= APPLETALK=""
+MAN1+= aecho.1 getzones.1 nbp.1 nbplkup.1 nbprgstr.1 \
+ nbpunrgstr.1 pap.1 papstatus.1 psorder.1
+MAN3+= atalk_aton.3 nbp_name.3
+MAN4+= atalk.4
+MAN5+= atalkd.conf.5 papd.conf.5
+MAN8+= atalkd.8 papd.8 papstatus.8 psf.8
.else
-CONFIGURE_ARGS+= --without-ddp
+PLIST_SUB+= APPLETALK="@comment "
.endif
.if defined(WITH_PAM)
@@ -96,9 +101,25 @@
PLIST_SUB+= TIMELORD="@comment "
.endif
+.if defined (WITH_ZEROCONF)
+CONFIGURE_ARGS+= --enable-zeroconf=${LOCALBASE}
+LIB_DEPENDS+= avahi-client.3:${PORTSDIR}/net/avahi-app
+USE_GNOME+= pkgconfig
+SUB_LIST+= ZEROCONF="avahi_daemon"
+.else
+SUB_LIST+= ZEROCONF=""
+.endif
+
+.if ${OSVERSION} < 800031
+PLIST_SUB+= ATFUNCS="@comment "
+.else
+PLIST_SUB+= ATFUNCS=""
+.endif
+
post-patch:
@${REINPLACE_CMD} -e 's|%%DB_NAME%%|${BDB_INCLUDE_DIR:T}| ; \
- s|%%DB_LIB%%|-l${BDB_LIB_NAME}|g' \
+ s|%%DB_LIB%%|-l${BDB_LIB_NAME}|g ; \
+ s|%%LOCALBASE%%|${LOCALBASE}|g' \
${WRKSRC}/configure
post-install:
Index: net/netatalk/distinfo
===================================================================
RCS file: /home/ncvs/ports/net/netatalk/distinfo,v
retrieving revision 1.30
diff -u -r1.30 distinfo
--- net/netatalk/distinfo 29 Dec 2010 04:36:17 -0000 1.30
+++ net/netatalk/distinfo 25 Aug 2011 17:08:39 -0000
@@ -1,2 +1,2 @@
-SHA256 (netatalk-2.1.5.tar.bz2) = 11fcce36cc5179de60c5c0b10032ff9e042ed8b8c6e0b99d2d7200c8d0749038
-SIZE (netatalk-2.1.5.tar.bz2) = 1125946
+SHA256 (netatalk-2.2.0.tar.bz2) = 31bf7c1ea311f876d9be6d4be9faed24d170a89e6ce692304fc2cb525f25143b
+SIZE (netatalk-2.2.0.tar.bz2) = 1216174
Index: net/netatalk/pkg-plist
===================================================================
RCS file: /home/ncvs/ports/net/netatalk/pkg-plist,v
retrieving revision 1.31
diff -u -r1.31 pkg-plist
--- net/netatalk/pkg-plist 2 Jun 2010 14:46:42 -0000 1.31
+++ net/netatalk/pkg-plist 25 Aug 2011 17:08:39 -0000
@@ -1,20 +1,15 @@
-bin/achfile
-bin/ad
+%%ATFUNCS%%bin/ad
bin/add_netatalk_printer
bin/adv1tov2
-bin/aecho
-bin/afile
+%%APPLETALK%%bin/aecho
+bin/afpldaptest
bin/afppasswd
-bin/apple_cp
bin/apple_dump
-bin/apple_mv
-bin/apple_rm
bin/binheader
bin/asip-status.pl
bin/cnid2_create
bin/dbd
-bin/getzones
-bin/logger_test
+%%APPLETALK%%bin/getzones
bin/macusers
bin/megatron
@exec cd %B && ln -s megatron hqx2bin
@@ -31,14 +26,13 @@
@unexec rm -f %B/unbin
@unexec rm -f %B/unhex
@unexec rm -f %B/unsingle
-bin/nbplkup
-bin/nbprgstr
-bin/nbpunrgstr
-bin/netacnv
+%%APPLETALK%%bin/nbplkup
+%%APPLETALK%%bin/nbprgstr
+%%APPLETALK%%bin/nbpunrgstr
bin/netatalk-config
-bin/pap
-bin/papstatus
-bin/psorder
+%%APPLETALK%%bin/pap
+%%APPLETALK%%bin/papstatus
+%%APPLETALK%%bin/psorder
bin/showppd
bin/uniconv
@unexec if cmp -s %D/etc/AppleVolumes.default %D/etc/AppleVolumes.default.dist; then rm -f %D/etc/AppleVolumes.default; fi
@@ -50,15 +44,18 @@
@unexec if cmp -s %D/etc/afpd.conf %D/etc/afpd.conf.dist; then rm -f %D/etc/afpd.conf; fi
etc/afpd.conf.dist
@exec [ ! -f %B/afpd.conf ] && cp %B/%f %B/afpd.conf
-@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/afp_ldap.conf %D/etc/afp_ldap.conf.dist; then rm -f %D/etc/afp_ldap.conf; fi
+etc/afp_ldap.conf.dist
+@exec [ ! -f %B/afp_ldap.conf ] && cp %B/%f %B/afp_ldap.conf
+%%APPLETALK%%@unexec if cmp -s %D/etc/atalkd.conf %D/etc/atalkd.conf.dist; then rm -f %D/etc/atalkd.conf; fi
+%%APPLETALK%%etc/atalkd.conf.dist
+%%APPLETALK%%@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
+%%APPLETALK%%etc/papd.conf.dist
+%%APPLETALK%%@exec [ ! -f %B/papd.conf ] && cp %B/%f %B/papd.conf
libexec/netatalk-uams/uams_clrtxt.so
libexec/netatalk-uams/uams_dhx.so
libexec/netatalk-uams/uams_dhx2.so
@@ -108,6 +105,7 @@
include/atalk/logger.h
include/atalk/nbp.h
include/atalk/netddp.h
+include/atalk/queue.h
include/atalk/pap.h
include/atalk/paths.h
include/atalk/rtmp.h
@@ -146,7 +144,7 @@
libexec/ofwmpap
libexec/ofwpap
libexec/psa
-libexec/psf
+%%APPLETALK%%libexec/psf
libexec/tfmpap
libexec/tfmpaprev
libexec/tfpap
@@ -156,10 +154,10 @@
libexec/tfwpap
libexec/tfwpaprev
sbin/afpd
-sbin/atalkd
+%%APPLETALK%%sbin/atalkd
sbin/cnid_dbd
sbin/cnid_metad
-sbin/papd
+%%APPLETALK%%sbin/papd
%%TIMELORD%%sbin/timelord
share/aclocal/netatalk.m4
%%DATADIR%%/pagecount.ps