summaryrefslogtreecommitdiff
path: root/net/netatalk30
diff options
context:
space:
mode:
authorhauke <hauke@pkgsrc.org>2014-06-11 11:03:56 +0000
committerhauke <hauke@pkgsrc.org>2014-06-11 11:03:56 +0000
commit8d8bed93c8e88a26c2938988091115ca827b0394 (patch)
tree65be7d5e89da949f325e838a58709c426a9ca2ed /net/netatalk30
parentaf7d622713edef2476bedaca545e80c2c54953a3 (diff)
downloadpkgsrc-8d8bed93c8e88a26c2938988091115ca827b0394.tar.gz
Rename net/netatalk to net/netatalk22. This is the last version to
support the AppleTalk ddp protocol, and here to stay while NetBSD ships with AppleTalk support. Add Netatalk 3.0.8 wip package as net/netatalk30. "Netatalk 3 is a freely-available implementation of the Apple Filesharing Protocol Suite (AFP) over TCP/IP. Using Netatalk's AFP 3.1 compliant file-server leads to significantly higher transmissions speeds compared with Macs accessing a server via SMB or NFS, while providing clients with the best user experience (full support for Macintosh metadata, flawlessly supporting mixed environments of classic MacOS and MacOS X clients)."
Diffstat (limited to 'net/netatalk30')
-rw-r--r--net/netatalk30/DESCR8
-rw-r--r--net/netatalk30/MESSAGE15
-rw-r--r--net/netatalk30/MESSAGE.pam8
-rw-r--r--net/netatalk30/Makefile89
-rw-r--r--net/netatalk30/PLIST74
-rw-r--r--net/netatalk30/distinfo18
-rw-r--r--net/netatalk30/files/netatalk_smf.sh32
-rw-r--r--net/netatalk30/options.mk58
-rw-r--r--net/netatalk30/patches/patch-bin_ad_ad__cp.c13
-rw-r--r--net/netatalk30/patches/patch-bin_afppasswd_afppasswd.c40
-rw-r--r--net/netatalk30/patches/patch-config.h.in25
-rw-r--r--net/netatalk30/patches/patch-config_Makefile.in34
-rw-r--r--net/netatalk30/patches/patch-config_pam_Makefile.in33
-rw-r--r--net/netatalk30/patches/patch-distrib_initscripts_Makefile.in22
-rw-r--r--net/netatalk30/patches/patch-distrib_initscripts_netatalk.xml.tmpl15
-rw-r--r--net/netatalk30/patches/patch-etc_afpd_quota.c161
-rw-r--r--net/netatalk30/patches/patch-etc_cnid__dbd_cnid__metad.c13
-rw-r--r--net/netatalk30/patches/patch-etc_uams_uams__randnum.c13
-rw-r--r--net/netatalk30/patches/patch-include_atalk_util.h13
-rw-r--r--net/netatalk30/patches/patch-libatalk_util_getiface.c45
-rw-r--r--net/netatalk30/patches/patch-macros_quota-check.m421
21 files changed, 750 insertions, 0 deletions
diff --git a/net/netatalk30/DESCR b/net/netatalk30/DESCR
new file mode 100644
index 00000000000..2d28c181a81
--- /dev/null
+++ b/net/netatalk30/DESCR
@@ -0,0 +1,8 @@
+Netatalk 3 is a freely-available implementation of the Apple
+Filesharing Protocol Suite (AFP) over TCP/IP.
+
+Using Netatalk's AFP 3.1 compliant file-server leads to significantly
+higher transmissions speeds compared with Macs accessing a server via
+SMB or NFS, while providing clients with the best user experience (full
+support for Macintosh metadata, flawlessly supporting mixed
+environments of classic MacOS and MacOS X clients).
diff --git a/net/netatalk30/MESSAGE b/net/netatalk30/MESSAGE
new file mode 100644
index 00000000000..25fe384f8e7
--- /dev/null
+++ b/net/netatalk30/MESSAGE
@@ -0,0 +1,15 @@
+===========================================================================
+$NetBSD: MESSAGE,v 1.1 2014/06/11 11:03:56 hauke Exp $
+
+For users migrating from Netatalk 2.x, version 3.x comes with
+substantial changes, like an all-new config file format, and the loss
+of AppleTalk (ddp) support. You are advised to familiarize yourself
+with the changes in advance; use
+<http://netatalk.sourceforge.net/3.0/htmldocs/upgrade.html> as a
+starting point.
+
+In addition, 3.x appears to only work reliably with the Berkeley
+Database v5, so you either have to manually upgrade the existing
+CNID database(s), or discard them.
+
+===========================================================================
diff --git a/net/netatalk30/MESSAGE.pam b/net/netatalk30/MESSAGE.pam
new file mode 100644
index 00000000000..73982f19553
--- /dev/null
+++ b/net/netatalk30/MESSAGE.pam
@@ -0,0 +1,8 @@
+===========================================================================
+$NetBSD: MESSAGE.pam,v 1.1 2014/06/11 11:03:56 hauke Exp $
+
+A netatalk PAM configuration file needs to be installed in the pam.d
+directory. An example file can be found at
+${PREFIX}/share/examples/netatalk/netatalk.pam
+
+===========================================================================
diff --git a/net/netatalk30/Makefile b/net/netatalk30/Makefile
new file mode 100644
index 00000000000..32f80284899
--- /dev/null
+++ b/net/netatalk30/Makefile
@@ -0,0 +1,89 @@
+# $NetBSD: Makefile,v 1.1 2014/06/11 11:03:56 hauke Exp $
+
+DISTNAME= netatalk-3.0.8
+PKGNAME= ${DISTNAME:C/-/30-/}
+CATEGORIES= net
+MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=netatalk/}
+EXTRACT_SUFX= .tar.bz2
+
+MAINTAINER= hauke@NetBSD.org
+HOMEPAGE= http://netatalk.sourceforge.net/
+COMMENT= Netatalk AFP file services
+LICENSE= gnu-gpl-v2
+
+USE_LIBTOOL= yes
+USE_OLD_DES_API= yes
+USE_TOOLS+= gmake perl:run
+GNU_CONFIGURE= yes
+PKG_CONFIG= yes
+
+PKG_SYSCONFSUBDIR= netatalk
+
+EGDIR= ${PREFIX}/share/examples/netatalk
+CONF_FILES= ${EGDIR}/afp.conf ${PKG_SYSCONFDIR}/afp.conf
+CONF_FILES+= ${EGDIR}/extmap.conf ${PKG_SYSCONFDIR}/extmap.conf
+
+RCD_SCRIPTS= netatalk
+RCD_SCRIPT_SRC.netatalk= ${WRKSRC}/distrib/initscripts/rc.netbsd
+SMF_SRCDIR= ${WRKSRC}/distrib/initscripts
+SMF_METHODS= netatalk_smf
+SMF_MANIFEST= netatalk.xml
+
+CONFLICTS= netatalk22-[0-9]* netatalk-[0-9]*
+CONFLICTS+= netatalk-asun-[0-9]* netatalk-umich-[0-9]*
+
+.include "../../mk/bsd.prefs.mk"
+
+BUILD_DEFS+= VARBASE
+OWN_DIRS+= ${VARBASE}/db/netatalk/CNID ${ROOT_USER} ${ROOT_GROUP}
+
+CONFIGURE_ARGS+= --enable-overwrite
+CONFIGURE_ARGS+= --enable-quota
+CONFIGURE_ARGS+= --libexecdir=${PREFIX}/libexec/netatalk
+CONFIGURE_ARGS+= --sbindir=${PREFIX}/libexec/netatalk
+CONFIGURE_ARGS+= --with-pkgconfdir=${PKG_SYSCONFDIR}
+CONFIGURE_ARGS+= --with-message-dir=${PKG_SYSCONFDIR}/msg
+CONFIGURE_ARGS+= --localstatedir=${VARBASE}/db
+CONFIGURE_ARGS+= --with-uams-path=${PREFIX}/libexec/netatalk/uams
+CONFIGURE_ARGS+= --with-bdb=${BUILDLINK_PREFIX.db5}
+CONFIGURE_ARGS+= --with-ssl-dir=${BUILDLINK_PREFIX.openssl}
+CONFIGURE_ENV+= MACHINE_ARCH=${MACHINE_ARCH}
+
+# Upstream bug, was supposed to be fixed in 3.0.8?
+CFLAGS.SunOS+= -I/usr/include/kerberosv5
+
+MAKE_DIRS+= ${PKG_SYSCONFDIR}/msg
+
+REPLACE_PYTHON+= contrib/shell_utils/afpstats
+REPLACE_PYTHON+= libevent/event_rpcgen.py
+
+SUBST_CLASSES+= paths
+SUBST_MESSAGE.paths= Fixing hardcoded paths.
+SUBST_STAGE.paths= pre-configure
+SUBST_FILES.paths= distrib/initscripts/Makefile.in
+SUBST_SED.paths= -e "s,^\\(DVIPS=\\)\\(/usr/local/tex\\)\\(/bin\\),\\1${PREFIX}\\3,"
+
+PLIST_VARS+= ea
+.if ${OPSYS} == "SunOS" || ${OPSYS} == "DragonFly" || ${OPSYS} == "Linux" || \
+ (${OPSYS} == "NetBSD" && empty(OS_VERSION:M[0-6].[0-8]*))
+PLIST.ea= yes
+.endif
+
+.include "options.mk"
+
+INSTALLATION_DIRS= libexec/psffilters etc/netatalk
+
+post-configure:
+ ${CP} ${FILESDIR}/netatalk_smf.sh ${SMF_SRCDIR}
+
+.if !empty(PKG_OPTIONS:Mpam)
+post-install:
+ ${INSTALL_DATA} ${WRKSRC}/config/pam/netatalk ${DESTDIR}${EGDIR}/netatalk.pam
+.endif
+
+.include "../../lang/python/application.mk"
+.include "../../security/libgcrypt/buildlink3.mk"
+.include "../../security/openssl/buildlink3.mk"
+.include "../../security/tcp_wrappers/buildlink3.mk"
+.include "../../databases/db5/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/net/netatalk30/PLIST b/net/netatalk30/PLIST
new file mode 100644
index 00000000000..41bb26b878d
--- /dev/null
+++ b/net/netatalk30/PLIST
@@ -0,0 +1,74 @@
+@comment $NetBSD: PLIST,v 1.1 2014/06/11 11:03:56 hauke Exp $
+bin/afpldaptest
+bin/afppasswd
+bin/afpstats
+bin/apple_dump
+bin/asip-status.pl
+bin/cnid2_create
+bin/dbd
+bin/macusers
+bin/netatalk-config
+bin/uniconv
+include/atalk/acl.h
+include/atalk/adouble.h
+include/atalk/afp.h
+include/atalk/bstrlib.h
+include/atalk/cnid.h
+include/atalk/compat.h
+include/atalk/dictionary.h
+include/atalk/ea.h
+include/atalk/globals.h
+include/atalk/hash.h
+include/atalk/iniparser.h
+include/atalk/list.h
+include/atalk/logger.h
+include/atalk/netatalk_conf.h
+include/atalk/paths.h
+include/atalk/standards.h
+include/atalk/uam.h
+include/atalk/unicode.h
+include/atalk/unix.h
+include/atalk/util.h
+include/atalk/vfs.h
+include/atalk/volume.h
+lib/libatalk.la
+libexec/netatalk/afpd
+libexec/netatalk/cnid_dbd
+libexec/netatalk/cnid_metad
+libexec/netatalk/netatalk
+libexec/netatalk/uams/uams_clrtxt.so
+libexec/netatalk/uams/uams_dhx.so
+libexec/netatalk/uams/uams_dhx2.so
+${PLIST.pam}libexec/netatalk/uams/uams_dhx2_pam.la
+libexec/netatalk/uams/uams_dhx2_passwd.la
+${PLIST.pam}libexec/netatalk/uams/uams_dhx_pam.la
+libexec/netatalk/uams/uams_dhx_passwd.la
+${PLIST.gssapi}libexec/netatalk/uams/uams_gss.la
+libexec/netatalk/uams/uams_guest.la
+${PLIST.pam}libexec/netatalk/uams/uams_pam.la
+libexec/netatalk/uams/uams_passwd.la
+libexec/netatalk/uams/uams_randnum.la
+man/man1/ad.1
+man/man1/afpldaptest.1
+man/man1/afppasswd.1
+man/man1/afpstats.1
+man/man1/apple_dump.1
+man/man1/asip-status.pl.1
+man/man1/dbd.1
+man/man1/macusers.1
+man/man1/netatalk-config.1
+man/man1/uniconv.1
+man/man5/afp.conf.5
+man/man5/afp_signature.conf.5
+man/man5/afp_voluuid.conf.5
+man/man5/extmap.conf.5
+man/man8/afpd.8
+man/man8/cnid_dbd.8
+man/man8/cnid_metad.8
+man/man8/netatalk.8
+share/aclocal/netatalk.m4
+share/examples/netatalk/afp.conf
+share/examples/netatalk/extmap.conf
+${PLIST.pam}share/examples/netatalk/netatalk.pam
+@pkgdir libexec/psffilters
+@pkgdir etc/netatalk
diff --git a/net/netatalk30/distinfo b/net/netatalk30/distinfo
new file mode 100644
index 00000000000..d222ce3f0bb
--- /dev/null
+++ b/net/netatalk30/distinfo
@@ -0,0 +1,18 @@
+$NetBSD: distinfo,v 1.1 2014/06/11 11:03:56 hauke Exp $
+
+SHA1 (netatalk-3.0.8.tar.bz2) = 4956d0991ae09e6c5336980b0c9d92afe8153f5f
+RMD160 (netatalk-3.0.8.tar.bz2) = 61b8b5a43985b8a5441867cb96b9de5aeba324fb
+Size (netatalk-3.0.8.tar.bz2) = 1707057 bytes
+SHA1 (patch-bin_ad_ad__cp.c) = ef65d56186d38c0c2d7082c379bbab8c8ebd0cdb
+SHA1 (patch-bin_afppasswd_afppasswd.c) = e029893d8f109c59a44ab1fb68aec7069278b7e6
+SHA1 (patch-config.h.in) = 10f56744d91d4119c5f20f90a300126427a1787e
+SHA1 (patch-config_Makefile.in) = 56ef4e7133c098fa84a6daef4571ee839a38f189
+SHA1 (patch-config_pam_Makefile.in) = c75df43f3905035d690eed198ee4abde12f3a940
+SHA1 (patch-distrib_initscripts_Makefile.in) = b954a1e2b52a998e87721148082ec247ca8aaff9
+SHA1 (patch-distrib_initscripts_netatalk.xml.tmpl) = dd7591e12eca3c1e7d7bc768cd1e060979dc383e
+SHA1 (patch-etc_afpd_quota.c) = 90025824fd513788c167108e4c388b453ab75ee6
+SHA1 (patch-etc_cnid__dbd_cnid__metad.c) = 06a97387594f386d3e049ba1e25d4626ac96195f
+SHA1 (patch-etc_uams_uams__randnum.c) = 0226d1aa382cffea454adf6bc0dc6e6fa1800dcc
+SHA1 (patch-include_atalk_util.h) = 5fe41720bf82980f6d5965f76d34e1703e541047
+SHA1 (patch-libatalk_util_getiface.c) = fe4aba6080f6308866bedb3d96ccc2b034836d3e
+SHA1 (patch-macros_quota-check.m4) = aa8a053b83bc4579ca0a8f66f43226ead8e79696
diff --git a/net/netatalk30/files/netatalk_smf.sh b/net/netatalk30/files/netatalk_smf.sh
new file mode 100644
index 00000000000..885bafbf7f5
--- /dev/null
+++ b/net/netatalk30/files/netatalk_smf.sh
@@ -0,0 +1,32 @@
+#!@SMF_METHOD_SHELL@
+#
+# SunOS SMF start/stop/refresh "methods" script for Netatalk 3
+
+# $NetBSD: netatalk_smf.sh,v 1.1 2014/06/11 11:03:56 hauke Exp $
+
+PIDFILE=@VARBASE@/run/netatalk.pid
+
+case $1 in
+'start')
+ @PREFIX@/libexec/netatalk/netatalk
+ ;;
+
+'stop')
+ if [ -f "$PIDFILE" ]; then
+ /usr/bin/kill `/usr/bin/head -1 $PIDFILE`
+ fi
+ ;;
+
+'refresh')
+ if [ -f "$PIDFILE" ]; then
+ /usr/bin/kill -HUP `/usr/bin/head -1 $PIDFILE`
+ fi
+ ;;
+
+*)
+ echo "Usage: $0 { start | stop | refresh }"
+ exit 1
+ ;;
+esac
+
+exit $?
diff --git a/net/netatalk30/options.mk b/net/netatalk30/options.mk
new file mode 100644
index 00000000000..49500597405
--- /dev/null
+++ b/net/netatalk30/options.mk
@@ -0,0 +1,58 @@
+# $NetBSD: options.mk,v 1.1 2014/06/11 11:03:56 hauke Exp $
+#
+PKG_OPTIONS_VAR= PKG_OPTIONS.netatalk
+PKG_SUPPORTED_OPTIONS= cups debug dnssd kerberos ldap pam
+
+.include "../../mk/bsd.options.mk"
+
+.if !empty(PKG_OPTIONS:Mcups)
+.include "../../print/cups/buildlink3.mk"
+CONFIGURE_ARGS+= --enable-cups
+.else
+CONFIGURE_ARGS+= --disable-cups
+.endif
+
+PLIST_VARS+= debug
+.if !empty(PKG_OPTIONS:Mdebug)
+# Debugging
+CONFIGURE_ARGS+= --enable-debug1
+CONFIGURE_ARGS+= --enable-debug
+CONFIGURE_ARGS+= --enable-debugging
+CFLAGS+= -g3
+INSTALL_UNSTRIPPED= yes
+.endif
+
+PLIST_VARS+= dnssd
+.if !empty(PKG_OPTIONS:Mdnssd)
+.include "../../net/mDNSResponder/buildlink3.mk"
+CONFIGURE_ARGS+= --enable-zeroconf
+.else
+# configure patched to zeroconf="no"
+.endif
+
+PLIST_VARS+= gssapi
+.if !empty(PKG_OPTIONS:Mkerberos)
+.include "../../mk/krb5.buildlink3.mk"
+CONFIGURE_ARGS+= --with-gssapi --enable-krbV-uam
+CONFIGURE_ENV+= GSSAPI_LIBS="-lkrb5 -lroken -lasn1 -lcrypto -lcom_err"
+PLIST.gssapi= yes
+.else
+CONFIGURE_ARGS+= --without-gssapi
+.endif
+
+.if !empty(PKG_OPTIONS:Mldap)
+.include "../../databases/openldap-client/buildlink3.mk"
+CONFIGURE_ARGS+= --with-ldap=yes
+.else
+CONFIGURE_ARGS+= --with-ldap=no
+.endif
+
+PLIST_VARS+= pam
+.if !empty(PKG_OPTIONS:Mpam)
+.include "../../mk/pam.buildlink3.mk"
+CONFIGURE_ARGS+= --with-pam
+PLIST.pam= yes
+MESSAGE_SRC+= MESSAGE MESSAGE.pam
+.else
+CONFIGURE_ARGS+= --without-pam
+.endif
diff --git a/net/netatalk30/patches/patch-bin_ad_ad__cp.c b/net/netatalk30/patches/patch-bin_ad_ad__cp.c
new file mode 100644
index 00000000000..03c520940a8
--- /dev/null
+++ b/net/netatalk30/patches/patch-bin_ad_ad__cp.c
@@ -0,0 +1,13 @@
+$NetBSD: patch-bin_ad_ad__cp.c,v 1.1 2014/06/11 11:03:57 hauke Exp $
+
+--- bin/ad/ad_cp.c.orig 2014-01-27 07:37:46.000000000 +0000
++++ bin/ad/ad_cp.c
+@@ -821,7 +821,7 @@ static int setfile(const struct stat *fs
+ islink = !fdval && S_ISLNK(fs->st_mode);
+ mode = fs->st_mode & (S_ISUID | S_ISGID | S_ISVTX | S_IRWXU | S_IRWXG | S_IRWXO);
+
+-#if defined(__FreeBSD__)
++#if defined(__FreeBSD__) || defined(__NetBSD__)
+ TIMESPEC_TO_TIMEVAL(&tv[0], &fs->st_atimespec);
+ TIMESPEC_TO_TIMEVAL(&tv[1], &fs->st_mtimespec);
+ #else
diff --git a/net/netatalk30/patches/patch-bin_afppasswd_afppasswd.c b/net/netatalk30/patches/patch-bin_afppasswd_afppasswd.c
new file mode 100644
index 00000000000..0b7660f502a
--- /dev/null
+++ b/net/netatalk30/patches/patch-bin_afppasswd_afppasswd.c
@@ -0,0 +1,40 @@
+$NetBSD: patch-bin_afppasswd_afppasswd.c,v 1.1 2014/06/11 11:03:57 hauke Exp $
+
+--- bin/afppasswd/afppasswd.c.orig 2013-04-09 12:56:17.000000000 +0000
++++ bin/afppasswd/afppasswd.c
+@@ -35,7 +35,7 @@
+ #include <pwd.h>
+ #include <arpa/inet.h>
+
+-#include <des.h>
++#include <openssl/des.h>
+
+ #ifdef USE_CRACKLIB
+ #include <crack.h>
+@@ -65,7 +65,7 @@ static char buf[MAXPATHLEN + 1];
+ static void convert_passwd(char *buf, char *newpwd, const int keyfd)
+ {
+ uint8_t key[HEXPASSWDLEN];
+- Key_schedule schedule;
++ DES_key_schedule schedule;
+ unsigned int i, j;
+
+ if (!newpwd) {
+@@ -84,14 +84,14 @@ static void convert_passwd(char *buf, ch
+ key[j] = (unhex(key[i]) << 4) | unhex(key[i + 1]);
+ if (j <= DES_KEY_SZ)
+ memset(key + j, 0, sizeof(key) - j);
+- key_sched((C_Block *) key, schedule);
++ DES_key_sched((DES_cblock *) key, &schedule);
+ memset(key, 0, sizeof(key));
+ if (newpwd) {
+- ecb_encrypt((C_Block *) newpwd, (C_Block *) newpwd, schedule,
++ DES_ecb_encrypt((DES_cblock *) newpwd, (DES_cblock *) newpwd, &schedule,
+ DES_ENCRYPT);
+ } else {
+ /* decrypt the password */
+- ecb_encrypt((C_Block *) buf, (C_Block *) buf, schedule, DES_DECRYPT);
++ DES_ecb_encrypt((DES_cblock *) buf, (DES_cblock *) buf, &schedule, DES_DECRYPT);
+ }
+ memset(&schedule, 0, sizeof(schedule));
+ }
diff --git a/net/netatalk30/patches/patch-config.h.in b/net/netatalk30/patches/patch-config.h.in
new file mode 100644
index 00000000000..81ccd58cd37
--- /dev/null
+++ b/net/netatalk30/patches/patch-config.h.in
@@ -0,0 +1,25 @@
+$NetBSD: patch-config.h.in,v 1.1 2014/06/11 11:03:57 hauke Exp $
+
+--- config.h.in.orig 2014-01-30 09:48:27.000000000 +0000
++++ config.h.in
+@@ -250,8 +250,8 @@
+ /* Define to 1 if you have the `getproplist' function. */
+ #undef HAVE_GETPROPLIST
+
+-/* Define to 1 if you have the `getusershell' function. */
+-#undef HAVE_GETUSERSHELL
++/* Define to 1 if you have the `getifaddrs' function. */
++#undef HAVE_GETIFADDRS
+
+ /* Define to 1 if you have the `getxattr' function. */
+ #undef HAVE_GETXATTR
+@@ -430,6 +430,9 @@
+ /* Define to 1 if you have the `renameat' function. */
+ #undef HAVE_RENAMEAT
+
++/* Define to 1 if you have the NetBSD quota library */
++#undef HAVE_LIBQUOTA
++
+ /* Define to 1 if you have the <rpcsvc/rquota.h> header file. */
+ #undef HAVE_RPCSVC_RQUOTA_H
+
diff --git a/net/netatalk30/patches/patch-config_Makefile.in b/net/netatalk30/patches/patch-config_Makefile.in
new file mode 100644
index 00000000000..ba4e158b0b4
--- /dev/null
+++ b/net/netatalk30/patches/patch-config_Makefile.in
@@ -0,0 +1,34 @@
+$NetBSD: patch-config_Makefile.in,v 1.1 2014/06/11 11:03:57 hauke Exp $
+
+--- config/Makefile.in.orig 2014-02-01 17:03:51.000000000 +0000
++++ config/Makefile.in
+@@ -783,20 +783,22 @@ uninstall-local:
+ rm -f $(DESTDIR)$(localstatedir)/netatalk/CNID/README
+ @USE_DEBIAN_TRUE@ rm -f $(DESTDIR)/etc/default/netatalk
+
++egconfdir = @prefix@/share/examples/netatalk
++
+ install-config-files: $(CONFFILES) $(GENFILES)
+- $(mkinstalldirs) $(DESTDIR)$(pkgconfdir)
++ $(mkinstalldirs) $(DESTDIR)$(egconfdir)
+ for f in $(CONFFILES) ; do \
+- if test "x$(OVERWRITE_CONFIG)" = "xyes" -o ! -f $(DESTDIR)$(pkgconfdir)/$$f; then \
+- echo "$(INSTALL_DATA) $$f $(DESTDIR)$(pkgconfdir)"; \
+- $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)$(pkgconfdir); \
++ if test "x$(OVERWRITE_CONFIG)" = "xyes" -o ! -f $(DESTDIR)$(egconfdir)/$$f; then \
++ echo "$(INSTALL_DATA) $$f $(DESTDIR)$(egconfdir)"; \
++ $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)$(egconfdir); \
+ else \
+ echo "not overwriting $$f"; \
+ fi; \
+ done
+ for f in $(GENFILES); do \
+- if test "x$(OVERWRITE_CONFIG)" = "xyes" -o ! -f $(DESTDIR)$(pkgconfdir)/$$f; then \
+- echo "$(INSTALL_DATA) $$f $(DESTDIR)$(pkgconfdir)"; \
+- $(INSTALL_DATA) $$f $(DESTDIR)$(pkgconfdir); \
++ if test "x$(OVERWRITE_CONFIG)" = "xyes" -o ! -f $(DESTDIR)$(egconfdir)/$$f; then \
++ echo "$(INSTALL_DATA) $$f $(DESTDIR)$(egconfdir)"; \
++ $(INSTALL_DATA) $$f $(DESTDIR)$(egconfdir); \
+ else \
+ echo "not overwriting $$f"; \
+ fi; \
diff --git a/net/netatalk30/patches/patch-config_pam_Makefile.in b/net/netatalk30/patches/patch-config_pam_Makefile.in
new file mode 100644
index 00000000000..b0b3c67d664
--- /dev/null
+++ b/net/netatalk30/patches/patch-config_pam_Makefile.in
@@ -0,0 +1,33 @@
+$NetBSD: patch-config_pam_Makefile.in,v 1.1 2014/06/11 11:03:57 hauke Exp $
+
+Do not mess with the base system, we install the pam config to
+examples/netatalk instead.
+
+--- config/pam/Makefile.in.orig 2014-02-01 17:03:51.000000000 +0000
++++ config/pam/Makefile.in
+@@ -384,25 +384,9 @@ clean-libtool:
+ -rm -rf .libs _libs
+ install-pamDATA: $(pam_DATA)
+ @$(NORMAL_INSTALL)
+- @list='$(pam_DATA)'; test -n "$(pamdir)" || list=; \
+- if test -n "$$list"; then \
+- echo " $(MKDIR_P) '$(DESTDIR)$(pamdir)'"; \
+- $(MKDIR_P) "$(DESTDIR)$(pamdir)" || exit 1; \
+- fi; \
+- for p in $$list; do \
+- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+- echo "$$d$$p"; \
+- done | $(am__base_list) | \
+- while read files; do \
+- echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pamdir)'"; \
+- $(INSTALL_DATA) $$files "$(DESTDIR)$(pamdir)" || exit $$?; \
+- done
+
+ uninstall-pamDATA:
+ @$(NORMAL_UNINSTALL)
+- @list='$(pam_DATA)'; test -n "$(pamdir)" || list=; \
+- files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+- dir='$(DESTDIR)$(pamdir)'; $(am__uninstall_files_from_dir)
+ tags: TAGS
+ TAGS:
+
diff --git a/net/netatalk30/patches/patch-distrib_initscripts_Makefile.in b/net/netatalk30/patches/patch-distrib_initscripts_Makefile.in
new file mode 100644
index 00000000000..4c3bc2234dc
--- /dev/null
+++ b/net/netatalk30/patches/patch-distrib_initscripts_Makefile.in
@@ -0,0 +1,22 @@
+$NetBSD: patch-distrib_initscripts_Makefile.in,v 1.1 2014/06/11 11:03:57 hauke Exp $
+
+--- distrib/initscripts/Makefile.in.orig 2014-02-01 17:03:51.000000000 +0000
++++ distrib/initscripts/Makefile.in
+@@ -601,7 +601,7 @@ info: info-am
+
+ info-am:
+
+-install-data-am: install-serviceDATA install-sysvSCRIPTS
++install-data-am: install-serviceDATA
+ @$(NORMAL_INSTALL)
+ $(MAKE) $(AM_MAKEFLAGS) install-data-hook
+ install-dvi: install-dvi-am
+@@ -717,7 +717,7 @@ uninstall: uninstall-startup
+ @USE_SUSE_SYSV_TRUE@ rm -f $(DESTDIR)$(sysvdir)/$(sysv_SCRIPTS)
+
+ @USE_NETBSD_TRUE@netatalk: rc.netbsd
+-@USE_NETBSD_TRUE@ cp -f $< $@
++@USE_NETBSD_TRUE@ cp -f $? $@
+ @USE_NETBSD_TRUE@ chmod a+x $@
+
+ @USE_NETBSD_TRUE@install-data-hook:
diff --git a/net/netatalk30/patches/patch-distrib_initscripts_netatalk.xml.tmpl b/net/netatalk30/patches/patch-distrib_initscripts_netatalk.xml.tmpl
new file mode 100644
index 00000000000..3b789377621
--- /dev/null
+++ b/net/netatalk30/patches/patch-distrib_initscripts_netatalk.xml.tmpl
@@ -0,0 +1,15 @@
+$NetBSD: patch-distrib_initscripts_netatalk.xml.tmpl,v 1.1 2014/06/11 11:03:57 hauke Exp $
+
+pkgsrc-installed SMF manifests default to /pkgsrc FMRI
+
+--- distrib/initscripts/netatalk.xml.tmpl.orig 2013-04-09 12:56:17.000000000 +0000
++++ distrib/initscripts/netatalk.xml.tmpl
+@@ -2,7 +2,7 @@
+ <!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
+ <service_bundle type="manifest" name="netatalk">
+
+- <service name="network/netatalk" type="service" version="1">
++ <service name="pkgsrc/netatalk" type="service" version="1">
+
+ <create_default_instance enabled="false"/>
+
diff --git a/net/netatalk30/patches/patch-etc_afpd_quota.c b/net/netatalk30/patches/patch-etc_afpd_quota.c
new file mode 100644
index 00000000000..bf2407013ca
--- /dev/null
+++ b/net/netatalk30/patches/patch-etc_afpd_quota.c
@@ -0,0 +1,161 @@
+$NetBSD: patch-etc_afpd_quota.c,v 1.1 2014/06/11 11:03:57 hauke Exp $
+
+--- etc/afpd/quota.c.orig 2013-04-09 12:56:18.000000000 +0000
++++ etc/afpd/quota.c
+@@ -36,10 +36,13 @@
+
+ static int
+ getfreespace(const AFPObj *obj, struct vol *vol, VolSpace *bfree, VolSpace *btotal,
+- uid_t uid, const char *classq)
++ id_t id, int idtype)
+ {
+- int retq;
+- struct ufs_quota_entry ufsq[QUOTA_NLIMITS];
++ uid_t prevuid;
++ const char *msg;
++ struct quotahandle *qh;
++ struct quotakey qk;
++ struct quotaval qv;
+ time_t now;
+
+ if (time(&now) == -1) {
+@@ -48,64 +51,102 @@ getfreespace(const AFPObj *obj, struct v
+ return -1;
+ }
+
++ prevuid = geteuid();
++ if (prevuid == -1) {
++ LOG(log_info, logtype_afpd, "geteuid(): %s",
++ strerror(errno));
++ return -1;
++ }
++
+ become_root();
+
+- if ((retq = getfsquota(obj, vol, ufsq, uid, classq)) < 0) {
+- LOG(log_info, logtype_afpd, "getfsquota(%s, %s): %s",
+- vol->v_path, classq, strerror(errno));
+- }
+-
+- unbecome_root();
+-
+- if (retq < 1)
+- return retq;
+-
+- switch(QL_STATUS(quota_check_limit(ufsq[QUOTA_LIMIT_BLOCK].ufsqe_cur, 1,
+- ufsq[QUOTA_LIMIT_BLOCK].ufsqe_softlimit,
+- ufsq[QUOTA_LIMIT_BLOCK].ufsqe_hardlimit,
+- ufsq[QUOTA_LIMIT_BLOCK].ufsqe_time, now))) {
+- case QL_S_DENY_HARD:
+- case QL_S_DENY_GRACE:
++ /*
++ * In a tidier world we might keep the quotahandle open for longer...
++ */
++ qh = quota_open(vol->v_path);
++ if (qh == NULL) {
++ if (errno == EOPNOTSUPP || errno == ENXIO) {
++ /* no quotas on this volume */
++ seteuid( prevuid );
++ return 0;
++ }
++
++ LOG(log_info, logtype_afpd, "quota_open(%s): %s", vol->v_path,
++ strerror(errno));
++ seteuid( prevuid );
++ return -1;
++ }
++ qk.qk_idtype = idtype;
++ qk.qk_id = id;
++ qk.qk_objtype = QUOTA_OBJTYPE_BLOCKS;
++ if (quota_get(qh, &qk, &qv) < 0) {
++ if (errno == ENOENT) {
++ /* no quotas for this id */
++ quota_close(qh);
++ seteuid( prevuid );
++ return 0;
++ }
++ msg = strerror(errno);
++ LOG(log_info, logtype_afpd, "quota_get(%s, %s): %s",
++ vol->v_path, quota_idtype_getname(qh, idtype), msg);
++ quota_close(qh);
++ seteuid( prevuid );
++ return -1;
++ }
++
++ quota_close(qh);
++
++ seteuid( prevuid );
++
++ if (qv.qv_usage >= qv.qv_hardlimit ||
++ (qv.qv_usage >= qv.qv_softlimit && now > qv.qv_expiretime)) {
++
+ *bfree = 0;
+- *btotal = dbtob(ufsq[QUOTA_LIMIT_BLOCK].ufsqe_cur);
+- break;
+- default:
+- *bfree = dbtob(ufsq[QUOTA_LIMIT_BLOCK].ufsqe_hardlimit -
+- ufsq[QUOTA_LIMIT_BLOCK].ufsqe_cur);
+- *btotal = dbtob(ufsq[QUOTA_LIMIT_BLOCK].ufsqe_hardlimit);
+- break;
++ *btotal = dbtob(qv.qv_usage);
++ }
++ else {
++ *bfree = dbtob(qv.qv_hardlimit - qv.qv_usage);
++ *btotal = dbtob(qv.qv_hardlimit);
++ }
++
+ }
+ return 1;
+ }
+
+ int uquota_getvolspace(const AFPObj *obj, struct vol *vol, VolSpace *bfree, VolSpace *btotal, const u_int32_t bsize)
+ {
+- int uretq, gretq;
++ int uret, gret;
+ VolSpace ubfree, ubtotal;
+ VolSpace gbfree, gbtotal;
++ uret = getfreespace(vol, &ubfree, &ubtotal,
++ uuid, QUOTA_IDTYPE_USER);
++ if (uret == 1) {
++ LOG(log_info, logtype_afpd, "quota_get(%s, user): %d %d",
++ vol->v_path, (int)ubfree, (int)ubtotal);
++ }
+
+- uretq = getfreespace(obj, vol, &ubfree, &ubtotal,
+- uuid, QUOTADICT_CLASS_USER);
+- LOG(log_info, logtype_afpd, "getfsquota(%s): %d %d",
+- vol->v_path, (int)ubfree, (int)ubtotal);
+ if (obj->ngroups >= 1) {
+- gretq = getfreespace(vol, &ubfree, &ubtotal,
+- obj->groups[0], QUOTADICT_CLASS_GROUP);
++ gret = getfreespace(vol, &gbfree, &gbtotal,
++ groups[0], QUOTA_IDTYPE_GROUP);
++ if (gret == 1) {
++ LOG(log_info, logtype_afpd, "quota_get(%s, group): %d %d",
++ vol->v_path, (int)gbfree, (int)gbtotal);
++ }
+ } else
+- gretq = -1;
+- if (uretq < 1 && gretq < 1) { /* no quota for this fs */
++ gret = 0;
++ if (uret < 1 && gret < 1) { /* no quota for this fs */
+ return AFPERR_PARAM;
+ }
+- if (uretq < 1) {
+- /* use group quotas */
++ if (uret < 1) {
++ /* no user quotas, but group quotas; use them */
+ *bfree = gbfree;
+ *btotal = gbtotal;
+- } else if (gretq < 1) {
+- /* use user quotas */
++ } else if (gret < 1) {
++ /* no group quotas, but user quotas; use them */
+ *bfree = ubfree;
+ *btotal = ubtotal;
+ } else {
+- /* return smallest remaining space of user and group */
++ /* both; return smallest remaining space of user and group */
+ if (ubfree < gbfree) {
+ *bfree = ubfree;
+ *btotal = ubtotal;
diff --git a/net/netatalk30/patches/patch-etc_cnid__dbd_cnid__metad.c b/net/netatalk30/patches/patch-etc_cnid__dbd_cnid__metad.c
new file mode 100644
index 00000000000..8695093aeb1
--- /dev/null
+++ b/net/netatalk30/patches/patch-etc_cnid__dbd_cnid__metad.c
@@ -0,0 +1,13 @@
+$NetBSD: patch-etc_cnid__dbd_cnid__metad.c,v 1.1 2014/06/11 11:03:57 hauke Exp $
+
+--- etc/cnid_dbd/cnid_metad.c.orig 2014-01-27 07:37:46.000000000 +0000
++++ etc/cnid_dbd/cnid_metad.c
+@@ -504,7 +504,7 @@ int main(int argc, char *argv[])
+ while (1) {
+ rqstfd = usockfd_check(srvfd, &set);
+ /* Collect zombie processes and log what happened to them */
+- if (sigchild) while ((pid = waitpid(-1, &status, WNOHANG)) > 0) {
++ while ((pid = waitpid(-1, &status, WNOHANG)) > 0) {
+ for (i = 0; i < maxvol; i++) {
+ if (srv[i].pid == pid) {
+ srv[i].pid = 0;
diff --git a/net/netatalk30/patches/patch-etc_uams_uams__randnum.c b/net/netatalk30/patches/patch-etc_uams_uams__randnum.c
new file mode 100644
index 00000000000..a628012223e
--- /dev/null
+++ b/net/netatalk30/patches/patch-etc_uams_uams__randnum.c
@@ -0,0 +1,13 @@
+$NetBSD: patch-etc_uams_uams__randnum.c,v 1.1 2014/06/11 11:03:57 hauke Exp $
+
+--- etc/uams/uams_randnum.c.orig 2014-01-04 15:42:35.000000000 +0000
++++ etc/uams/uams_randnum.c
+@@ -25,7 +25,7 @@
+ #include <atalk/uam.h>
+
+
+-#include <des.h>
++#include <openssl/des.h>
+
+ #ifdef USE_CRACKLIB
+ #include <crack.h>
diff --git a/net/netatalk30/patches/patch-include_atalk_util.h b/net/netatalk30/patches/patch-include_atalk_util.h
new file mode 100644
index 00000000000..d5aa5640bec
--- /dev/null
+++ b/net/netatalk30/patches/patch-include_atalk_util.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-include_atalk_util.h,v 1.1 2014/06/11 11:03:57 hauke Exp $
+
+--- include/atalk/util.h.orig 2014-01-27 07:37:46.000000000 +0000
++++ include/atalk/util.h
+@@ -109,7 +109,7 @@ extern void mod_close (void *);
+ * OpenBSD currently does not use the second arg for dlopen(). For
+ * future compatibility we define DL_LAZY */
+ #ifdef __NetBSD__
+-#define mod_open(a) dlopen(a, RTLD_LAZY)
++#define mod_open(a) dlopen(a, RTLD_LAZY|RTLD_GLOBAL)
+ #elif defined(__OpenBSD__)
+ #define mod_open(a) dlopen(a, DL_LAZY)
+ #else /* ! __NetBSD__ && ! __OpenBSD__ */
diff --git a/net/netatalk30/patches/patch-libatalk_util_getiface.c b/net/netatalk30/patches/patch-libatalk_util_getiface.c
new file mode 100644
index 00000000000..da2a14cfa13
--- /dev/null
+++ b/net/netatalk30/patches/patch-libatalk_util_getiface.c
@@ -0,0 +1,45 @@
+$NetBSD: patch-libatalk_util_getiface.c,v 1.1 2014/06/11 11:03:57 hauke Exp $
+
+--- libatalk/util/getiface.c.orig 2013-04-09 12:56:18.000000000 +0000
++++ libatalk/util/getiface.c
+@@ -12,6 +12,11 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <stdint.h>
++
++#ifdef HAVE_GETIFADDRS
++#include <ifaddrs.h>
++#endif
++
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <sys/ioctl.h>
+@@ -70,6 +75,28 @@ static int getifaces(const int sockfd, c
+ *list = new;
+ return i;
+
++#elif defined(HAVE_GETIFADDRS)
++ struct ifaddrs *ifa, *a;
++ int i;
++ char **new;
++
++ if (!list)
++ return 0;
++ if (getifaddrs(&ifa) == -1)
++ return 0;
++ for (i = 0, a = ifa; a != NULL; a = a->ifa_next, i++)
++ continue;
++ new = malloc((i + 1) * sizeof(char *));
++ if (new == NULL) {
++ freeifaddrs(ifa);
++ return 0;
++ }
++ for (i = 0, a = ifa; a != NULL; a = a->ifa_next)
++ if (addname(new, &i, a->ifa_name) < 0)
++ break;
++ freeifaddrs(ifa);
++ *list = new;
++ return i;
+ #else
+ struct ifconf ifc;
+ struct ifreq ifrs[ 64 ], *ifr, *nextifr;
diff --git a/net/netatalk30/patches/patch-macros_quota-check.m4 b/net/netatalk30/patches/patch-macros_quota-check.m4
new file mode 100644
index 00000000000..6419a6d57e9
--- /dev/null
+++ b/net/netatalk30/patches/patch-macros_quota-check.m4
@@ -0,0 +1,21 @@
+$NetBSD: patch-macros_quota-check.m4,v 1.1 2014/06/11 11:03:57 hauke Exp $
+
+--- macros/quota-check.m4.orig 2013-06-24 16:47:02.000000000 +0000
++++ macros/quota-check.m4
+@@ -9,13 +9,9 @@ AC_DEFUN([AC_NETATALK_CHECK_QUOTA], [
+ QUOTA_LIBS=""
+ netatalk_cv_quotasupport="yes"
+ AC_CHECK_LIB(rpcsvc, main, [QUOTA_LIBS="-lrpcsvc"])
+- AC_CHECK_HEADERS([rpc/rpc.h rpc/pmap_prot.h rpcsvc/rquota.h],[],[
+- QUOTA_LIBS=""
+- netatalk_cv_quotasupport="no"
+- AC_DEFINE(NO_QUOTA_SUPPORT, 1, [Define if quota support should not compiled])
+- ])
+- AC_CHECK_LIB(quota, getfsquota, [QUOTA_LIBS="-lquota -lprop -lrpcsvc"
+- AC_DEFINE(HAVE_LIBQUOTA, 1, [define if you have libquota])], [], [-lprop -lrpcsvc])
++ AC_CHECK_HEADERS([rpc/rpc.h rpc/pmap_prot.h rpcsvc/rquota.h],[],[])
++ AC_CHECK_LIB(quota, quota_open, [QUOTA_LIBS="-lquota -lrpcsvc"
++ AC_DEFINE(HAVE_LIBQUOTA, 1, [define if you have libquota])], [], [-lrpcsvc])
+ else
+ netatalk_cv_quotasupport="no"
+ AC_DEFINE(NO_QUOTA_SUPPORT, 1, [Define if quota support should not compiled])