summaryrefslogtreecommitdiff
path: root/filesystems
diff options
context:
space:
mode:
authorjakllsch <jakllsch>2012-08-30 17:37:54 +0000
committerjakllsch <jakllsch>2012-08-30 17:37:54 +0000
commitdc21fbe3a905d30d5540fbd33e1feb00e204f041 (patch)
tree52178e2662346ce3e1ba613c41a8911d1bbebc74 /filesystems
parent2fbb4d49d6e8dbb53d53bad19e3ce6aa8b531c2f (diff)
downloadpkgsrc-dc21fbe3a905d30d5540fbd33e1feb00e204f041.tar.gz
Move net/openafs to filesystems/openafs-devel.
Re-add net/openafs as of 2012-05-01 as filesystems/openafs.
Diffstat (limited to 'filesystems')
-rw-r--r--filesystems/Makefile4
-rw-r--r--filesystems/openafs-devel/DESCR16
-rw-r--r--filesystems/openafs-devel/Makefile57
-rw-r--r--filesystems/openafs-devel/PLIST272
-rw-r--r--filesystems/openafs-devel/PLIST.pam3
-rw-r--r--filesystems/openafs-devel/distinfo26
-rw-r--r--filesystems/openafs-devel/files/bosserver.sh19
-rw-r--r--filesystems/openafs-devel/options.mk45
-rw-r--r--filesystems/openafs-devel/patches/patch-acinclude.m412
-rw-r--r--filesystems/openafs-devel/patches/patch-configure41
-rw-r--r--filesystems/openafs-devel/patches/patch-configure-libafs21
-rw-r--r--filesystems/openafs-devel/patches/patch-src-afs-NBSD-osi_crypto.c24
-rw-r--r--filesystems/openafs-devel/patches/patch-src-afs-NBSD-osi_kmod.c133
-rw-r--r--filesystems/openafs-devel/patches/patch-src-afs-NBSD-osi_vm.c19
-rw-r--r--filesystems/openafs-devel/patches/patch-src-afs-NBSD-osi_vnodeops.c39
-rw-r--r--filesystems/openafs-devel/patches/patch-src-bucoord-Makefile.n51
-rw-r--r--filesystems/openafs-devel/patches/patch-src-cf-osconf.m413
-rw-r--r--filesystems/openafs-devel/patches/patch-src-config-param.amd64_nbsd70.h27
-rw-r--r--filesystems/openafs-devel/patches/patch-src-config-param.i386_nbsd70.h25
-rw-r--r--filesystems/openafs-devel/patches/patch-src-config-param.nbsd60.h12
-rw-r--r--filesystems/openafs-devel/patches/patch-src-config-param.nbsd70.h174
-rw-r--r--filesystems/openafs-devel/patches/patch-src-config-shlib-build.in89
-rw-r--r--filesystems/openafs-devel/patches/patch-src-config-shlib-install.in12
-rw-r--r--filesystems/openafs-devel/patches/patch-src-crypto-hcrypto-kernel-config.h24
-rw-r--r--filesystems/openafs-devel/patches/patch-src-external-heimdal-roken-roken-common.h38
-rw-r--r--filesystems/openafs-devel/patches/patch-src-external-heimdal-roken-roken.h.in52
-rw-r--r--filesystems/openafs-devel/patches/patch-src-libafs-MakefileProto.NBSD.in341
-rw-r--r--filesystems/openafs-devel/patches/patch-src-rxkad-fcrypt.c12
-rw-r--r--filesystems/openafs-devel/patches/patch-sys-config-afs_sysnames.h13
-rw-r--r--filesystems/openafs/DESCR8
-rw-r--r--filesystems/openafs/Makefile57
-rw-r--r--filesystems/openafs/PLIST238
-rw-r--r--filesystems/openafs/PLIST.pam3
-rw-r--r--filesystems/openafs/distinfo10
-rw-r--r--filesystems/openafs/files/bosserver.sh19
-rw-r--r--filesystems/openafs/options.mk45
-rw-r--r--filesystems/openafs/patches/patch-aa61
-rw-r--r--filesystems/openafs/patches/patch-src_afsd_afsd.c17
-rw-r--r--filesystems/openafs/patches/patch-src_comerr_Makefile.in13
-rw-r--r--filesystems/openafs/patches/patch-src_config_param.nbsd30.h12
-rw-r--r--filesystems/openafs/patches/patch-src_config_param.nbsd40.h12
41 files changed, 2108 insertions, 1 deletions
diff --git a/filesystems/Makefile b/filesystems/Makefile
index 18582d94ce1..e49b66f630c 100644
--- a/filesystems/Makefile
+++ b/filesystems/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.33 2012/03/09 22:46:53 abs Exp $
+# $NetBSD: Makefile,v 1.34 2012/08/30 17:37:55 jakllsch Exp $
#
COMMENT= File systems, and file system related packages
@@ -31,6 +31,8 @@ SUBDIR+= fuse-unionfs
SUBDIR+= fuse-wdfs
SUBDIR+= fuse-wikipediafs
SUBDIR+= glusterfs
+SUBDIR+= openafs
+SUBDIR+= openafs-devel
SUBDIR+= perfuse
SUBDIR+= py-filesystem
SUBDIR+= py-fuse-bindings
diff --git a/filesystems/openafs-devel/DESCR b/filesystems/openafs-devel/DESCR
new file mode 100644
index 00000000000..ef187dcf2ce
--- /dev/null
+++ b/filesystems/openafs-devel/DESCR
@@ -0,0 +1,16 @@
+AFS is a distributed filesystem product, pioneered at Carnegie Mellon
+University and supported and developed as a product by Transarc
+Corporation (now IBM Pittsburgh Labs). It offers a client-server
+architecture for file sharing, providing location independence,
+scalability and transparent migration capabilities for data. IBM
+branched the source of the AFS product, and made a copy of the source
+available for community development and maintenance. They called the
+release OpenAFS.
+
+To build the kernel module
+ $ cd src/libafs
+ $ cp MakefileProto.NBSD Makefile
+ $ make obj && make && make install
+
+For instructions how to create a cell:
+ http://wiki.openafs.org/AFSLore/FedoraAFSInstall/
diff --git a/filesystems/openafs-devel/Makefile b/filesystems/openafs-devel/Makefile
new file mode 100644
index 00000000000..97cb61d0dd1
--- /dev/null
+++ b/filesystems/openafs-devel/Makefile
@@ -0,0 +1,57 @@
+# $NetBSD: Makefile,v 1.1 2012/08/30 17:37:55 jakllsch Exp $
+
+DISTNAME= openafs-1.7.11-src
+PKGNAME= ${DISTNAME:C/-src//}
+CATEGORIES= filesystems net sysutils
+MASTER_SITES= http://www.openafs.org/dl/openafs/1.7.11/
+EXTRACT_SUFX= .tar.bz2
+
+MAINTAINER= gendalia@NetBSD.org
+HOMEPAGE= http://www.openafs.org/
+COMMENT= File system for sharing, scalability and transparent data migration
+LICENSE= ibm-public-license-1.0
+
+PKG_DESTDIR_SUPPORT= user-destdir
+
+CONFLICTS+= arla-[0-9]*
+CONFLICTS+= heimdal-[0-9]*
+CONFLICTS+= rx-[0-9]*
+
+MAKE_JOBS_SAFE=no
+
+GNU_CONFIGURE= yes
+USE_TOOLS+= lex
+RCD_SCRIPTS+= bosserver
+
+.include "options.mk"
+
+CONFIGURE_ARGS+= --localstatedir=${VARBASE:Q}
+CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR:Q}
+CONFIGURE_ARGS+= --with-roken=internal
+
+USE_GNU_CONFIGURE_HOST= no
+
+WRKSRC= ${WRKDIR}/${PKGNAME_NOREV}
+
+PLIST_SRC+= ${.CURDIR}/PLIST
+OWN_DIRS+= ${PKG_SYSCONFDIR}/openafs
+OWN_DIRS_PERMS+= ${PKG_SYSCONFDIR}/openafs/server ${ROOT_USER} ${ROOT_GROUP} 775
+OWN_DIRS_PERMS+= ${VARBASE}/openafs ${ROOT_USER} ${ROOT_GROUP} 770
+OWN_DIRS+= ${VARBASE}/openafs/logs
+OWN_DIRS_PERMS+= ${VARBASE}/openafs/db ${ROOT_USER} ${ROOT_GROUP} 700
+
+FILES_SUBST+= HOSTNAME_CMD=${HOSTNAME_CMD:Q}
+
+BUILD_DEFS+= VARBASE
+
+#
+# Rename liblwp.a to libafslwp.a to avoid conflict with the lwp package.
+#
+pre-configure:
+ find ${WRKSRC} -name Makefile.in | while read f; do \
+ ${SED} -e 's|liblwp.a|libafslwp.a|g' \
+ -e 's|-llwp|-lafslwp|g' < $$f > $$f.tmp && \
+ ${MV} $$f.tmp $$f; done
+
+.include "../../mk/krb5.buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/filesystems/openafs-devel/PLIST b/filesystems/openafs-devel/PLIST
new file mode 100644
index 00000000000..829cc93d7d9
--- /dev/null
+++ b/filesystems/openafs-devel/PLIST
@@ -0,0 +1,272 @@
+@comment $NetBSD: PLIST,v 1.1 2012/08/30 17:37:55 jakllsch Exp $
+bin/afs_compile_et
+bin/afsio
+bin/afsmonitor
+bin/aklog
+bin/asetkey
+bin/bos
+bin/cmdebug
+bin/fs
+bin/klog
+bin/klog.krb
+bin/klog.krb5
+bin/knfs
+bin/kpasswd
+bin/kpwvalid
+bin/livesys
+bin/pagsh
+bin/pagsh.krb
+bin/pts
+bin/restorevol
+bin/rxgen
+bin/scout
+bin/sys
+bin/tokens
+bin/tokens.krb
+bin/translate_et
+bin/udebug
+bin/unlog
+bin/up
+bin/xstat_cm_test
+bin/xstat_fs_test
+include/afs/acl.h
+include/afs/afs.h
+include/afs/afs_args.h
+include/afs/afs_atomlist.h
+include/afs/afs_consts.h
+include/afs/afs_lhash.h
+include/afs/afs_stats.h
+include/afs/afs_sysnames.h
+include/afs/afscbint.h
+include/afs/afscp.h
+include/afs/afsint.h
+include/afs/afssyscalls.h
+include/afs/afsutil.h
+include/afs/afsutil_prototypes.h
+include/afs/audit.h
+include/afs/auth.h
+include/afs/bnode.h
+include/afs/bosint.h
+include/afs/bubasics.h
+include/afs/budb.h
+include/afs/budb_client.h
+include/afs/budb_errs.h
+include/afs/bumon.h
+include/afs/butc.h
+include/afs/butm.h
+include/afs/butx.h
+include/afs/cellconfig.h
+include/afs/cmd.h
+include/afs/cnvldb.h
+include/afs/com_err.h
+include/afs/daemon_com.h
+include/afs/dir.h
+include/afs/dirpath.h
+include/afs/error_table.h
+include/afs/errors.h
+include/afs/exporter.h
+include/afs/fileutil.h
+include/afs/fs_stats.h
+include/afs/fsprobe.h
+include/afs/fssync.h
+include/afs/gtxX11win.h
+include/afs/gtxcurseswin.h
+include/afs/gtxdumbwin.h
+include/afs/gtxframe.h
+include/afs/gtxinput.h
+include/afs/gtxkeymap.h
+include/afs/gtxlightobj.h
+include/afs/gtxobjdict.h
+include/afs/gtxobjects.h
+include/afs/gtxtextcb.h
+include/afs/gtxtextobj.h
+include/afs/gtxwindows.h
+include/afs/icl.h
+include/afs/ihandle.h
+include/afs/kaport.h
+include/afs/kauth.h
+include/afs/kautils.h
+include/afs/keys.h
+include/afs/ktc.h
+include/afs/ktime.h
+include/afs/mit-sipb-cr.h
+include/afs/namei_ops.h
+include/afs/netutils.h
+include/afs/nfs.h
+include/afs/nfsclient.h
+include/afs/osi_inode.h
+include/afs/pagcb.h
+include/afs/param.h
+include/afs/partition.h
+include/afs/prclient.h
+include/afs/prerror.h
+include/afs/print.h
+include/afs/procmgmt.h
+include/afs/prs_fs.h
+include/afs/prserver.h
+include/afs/ptclient.h
+include/afs/pterror.h
+include/afs/pthread_glock.h
+include/afs/pthread_nosigs.h
+include/afs/ptint.h
+include/afs/ptserver.h
+include/afs/ptuser.h
+include/afs/rxgen_consts.h
+include/afs/salvsync.h
+include/afs/softsig.h
+include/afs/stds.h
+include/afs/sysctl.h
+include/afs/tabular_output.h
+include/afs/tcdata.h
+include/afs/thread_pool.h
+include/afs/thread_pool_types.h
+include/afs/unified_afs.h
+include/afs/usd.h
+include/afs/venus.h
+include/afs/vice.h
+include/afs/viceinode.h
+include/afs/vioc.h
+include/afs/vl_opcodes.h
+include/afs/vldbint.h
+include/afs/vlserver.h
+include/afs/vnode.h
+include/afs/vnode_inline.h
+include/afs/voldefs.h
+include/afs/volint.h
+include/afs/volser.h
+include/afs/volume.h
+include/afs/volume_inline.h
+include/afs/vsutils_prototypes.h
+include/afs/work_queue.h
+include/afs/work_queue_types.h
+include/afs/xfsattrs.h
+include/afs/xstat_cm.h
+include/afs/xstat_fs.h
+include/kopenafs.h
+include/lock.h
+include/lwp.h
+include/preempt.h
+include/rx/fcrypt.h
+include/rx/rx.h
+include/rx/rx_clock.h
+include/rx/rx_event.h
+include/rx/rx_globals.h
+include/rx/rx_lwp.h
+include/rx/rx_misc.h
+include/rx/rx_multi.h
+include/rx/rx_null.h
+include/rx/rx_opaque.h
+include/rx/rx_packet.h
+include/rx/rx_prototypes.h
+include/rx/rx_pthread.h
+include/rx/rx_queue.h
+include/rx/rx_user.h
+include/rx/rxkad.h
+include/rx/rxkad_prototypes.h
+include/rx/rxstat.h
+include/rx/xdr.h
+include/rx/xdr_prototypes.h
+include/timer.h
+include/ubik.h
+include/ubik_int.h
+lib/afs/libacl.a
+lib/afs/libafscom_err.a
+lib/afs/libafsint.a
+lib/afs/libafsutil.a
+lib/afs/libafsutil_pic.a
+lib/afs/libaudit.a
+lib/afs/libauth.a
+lib/afs/libauth.krb.a
+lib/afs/libbos.a
+lib/afs/libbubasics.a
+lib/afs/libbudb.a
+lib/afs/libbutm.a
+lib/afs/libbxdb.a
+lib/afs/libcmd.a
+lib/afs/libcmd_pic.a
+lib/afs/libdir.a
+lib/afs/libfsprobe.a
+lib/afs/libgtx.a
+lib/afs/libkauth.a
+lib/afs/libkauth.krb.a
+lib/afs/libprocmgmt.a
+lib/afs/libprot.a
+lib/afs/libsys.a
+lib/afs/libusd.a
+lib/afs/libvldb.a
+lib/afs/libvlib.a
+lib/afs/libvolser.a
+lib/afs/libxstat_cm.a
+lib/afs/libxstat_fs.a
+lib/afs/util.a
+lib/afs/vlib.a
+lib/libafsauthent.a
+lib/libafsauthent.so
+lib/libafsauthent.so.1
+lib/libafsauthent.so.1.1
+lib/libafsauthent_pic.a
+lib/libafsauthent_pic.a
+lib/libafscp.a
+lib/libafshcrypto.a
+lib/libafshcrypto.so
+lib/libafshcrypto.so.1
+lib/libafshcrypto.so.1.1
+lib/libafsrpc.a
+lib/libafsrpc.so
+lib/libafsrpc.so.1
+lib/libafsrpc.so.1.4
+lib/libafsrpc_pic.a
+lib/libkopenafs.a
+lib/libkopenafs.so
+lib/libkopenafs.so.1
+lib/libkopenafs.so.1.1
+lib/libafslwp.a
+lib/libopr.a
+lib/librokenafs.a
+lib/librokenafs.so
+lib/librokenafs.so.1
+lib/librokenafs.so.1.1
+lib/librx.a
+lib/librxkad.a
+lib/librxstat.a
+lib/libubik.a
+lib/libubik_pthread.a
+libexec/openafs/buserver
+libexec/openafs/dafileserver
+libexec/openafs/fileserver
+libexec/openafs/kaserver
+libexec/openafs/ptserver
+libexec/openafs/salvager
+libexec/openafs/upclient
+libexec/openafs/upserver
+libexec/openafs/vlserver
+libexec/openafs/volserver
+sbin/afsd
+sbin/afs-backup
+sbin/bos_util
+sbin/bosserver
+sbin/butc
+sbin/fms
+sbin/fssync-debug
+sbin/fstrace
+sbin/ka-forwarder
+sbin/kadb_check
+sbin/kas
+sbin/kdb
+sbin/kpwvalid
+sbin/prdb_check
+sbin/pt_util
+sbin/read_tape
+sbin/rmtsysd
+sbin/rxdebug
+sbin/state_analyzer
+sbin/uss
+sbin/vldb_check
+sbin/vldb_convert
+sbin/voldump
+sbin/volinfo
+sbin/vos
+sbin/vsys
+share/examples/rc.d/bosserver
+share/openafs/C/afszcm.cat
+@pkgdir lib/openafs
diff --git a/filesystems/openafs-devel/PLIST.pam b/filesystems/openafs-devel/PLIST.pam
new file mode 100644
index 00000000000..0472102b2cc
--- /dev/null
+++ b/filesystems/openafs-devel/PLIST.pam
@@ -0,0 +1,3 @@
+@comment $NetBSD: PLIST.pam,v 1.1 2012/08/30 17:37:55 jakllsch Exp $
+lib/pam_afs.krb.so.1
+lib/pam_afs.so.1
diff --git a/filesystems/openafs-devel/distinfo b/filesystems/openafs-devel/distinfo
new file mode 100644
index 00000000000..f236c3480b4
--- /dev/null
+++ b/filesystems/openafs-devel/distinfo
@@ -0,0 +1,26 @@
+$NetBSD: distinfo,v 1.1 2012/08/30 17:37:55 jakllsch Exp $
+
+SHA1 (openafs-1.7.11-src.tar.bz2) = 7baa664ea521520a3355c6d8ab7cafff004e7d97
+RMD160 (openafs-1.7.11-src.tar.bz2) = 4e6c61496989b69544d0039a9fd6ca8627fc4df0
+Size (openafs-1.7.11-src.tar.bz2) = 14774648 bytes
+SHA1 (patch-acinclude.m4) = 52c764ebe648864f13a6708a6eda512b8e9bb390
+SHA1 (patch-configure) = d36eb7024759f7ab3008def440a118ae9c303927
+SHA1 (patch-configure-libafs) = a46ceef332e9c12a9708228d16cb2d0c658a3370
+SHA1 (patch-src-afs-NBSD-osi_crypto.c) = 2cf24b1670b588a120168098aea49d6d56d77f9a
+SHA1 (patch-src-afs-NBSD-osi_kmod.c) = 299bb92ab74093c5cdc8b0ea08733bbc254eee74
+SHA1 (patch-src-afs-NBSD-osi_vm.c) = afcd53f5e0ae530f223bf69b9f0ecbb02586ae90
+SHA1 (patch-src-afs-NBSD-osi_vnodeops.c) = fb804b3519bb4da71ca5f17bdb2befbbd67024f2
+SHA1 (patch-src-bucoord-Makefile.n) = afc534dc174efc9e8a966c32a6b85c0feb776900
+SHA1 (patch-src-cf-osconf.m4) = e3b6488cc2e8891c03014c6774a55f04106cb25a
+SHA1 (patch-src-config-param.amd64_nbsd70.h) = 045a2cc33103c53e3141ad02074e12482069fcb2
+SHA1 (patch-src-config-param.i386_nbsd70.h) = f72c6cc7dc2b8f27971fac7978392a921befed22
+SHA1 (patch-src-config-param.nbsd60.h) = 5fd8fb7b9250cd00e47f4f971fd076daff08b592
+SHA1 (patch-src-config-param.nbsd70.h) = 9879d7484c9951d972c599f048451ee3f30c6391
+SHA1 (patch-src-config-shlib-build.in) = 7f9665b966fde23540724ce4b7c08690618cf564
+SHA1 (patch-src-config-shlib-install.in) = 5ccbc19116d09f6bb42eba8be6811d7f72345dee
+SHA1 (patch-src-crypto-hcrypto-kernel-config.h) = 6bb549f6d2ac09faa7a3f5f74396d379c37387b7
+SHA1 (patch-src-external-heimdal-roken-roken-common.h) = 6a2113aaaf4ba5a31888b2f00176961fff49078d
+SHA1 (patch-src-external-heimdal-roken-roken.h.in) = 59c4ca254b533643ca213c28061219848b13a680
+SHA1 (patch-src-libafs-MakefileProto.NBSD.in) = 97b4dba8b2b6bc33dc3af3e2164f5295610f904f
+SHA1 (patch-src-rxkad-fcrypt.c) = 7e626426baceb392e58082f087dbd61ae6eb8c63
+SHA1 (patch-sys-config-afs_sysnames.h) = 371ea77eb6fd7ecf6a254631e2b734069e09761e
diff --git a/filesystems/openafs-devel/files/bosserver.sh b/filesystems/openafs-devel/files/bosserver.sh
new file mode 100644
index 00000000000..864cc3724f0
--- /dev/null
+++ b/filesystems/openafs-devel/files/bosserver.sh
@@ -0,0 +1,19 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: bosserver.sh,v 1.1 2012/08/30 17:37:55 jakllsch Exp $
+#
+# PROVIDE: bosserver
+# BEFORE: afsd
+# REQUIRE: NETWORK
+
+. /etc/rc.subr
+
+name="bosserver"
+rcvar=$name
+hostname=$(@HOSTNAME_CMD@)
+command="@PREFIX@/sbin/$name"
+start_precmd="ulimit -S -d 1048576;ulimit -S -c unlimited"
+stop_precmd="@PREFIX@/bin/bos shutdown $hostname -local -wait"
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/filesystems/openafs-devel/options.mk b/filesystems/openafs-devel/options.mk
new file mode 100644
index 00000000000..e284f24927e
--- /dev/null
+++ b/filesystems/openafs-devel/options.mk
@@ -0,0 +1,45 @@
+# $NetBSD: options.mk,v 1.1 2012/08/30 17:37:55 jakllsch Exp $
+
+.include "../../mk/bsd.prefs.mk"
+
+PKG_OPTIONS_VAR= PKG_OPTIONS.openafs
+PKG_SUPPORTED_OPTIONS+= server bitmap-later bos-new-config fast-restart
+PKG_SUPPORTED_OPTIONS+= largefile kernel-module supergroups namei
+.if ${MACHINE_ARCH} != "x86_64"
+PKG_SUPPORTED_OPTIONS+= pam
+.endif
+PKG_SUGGESTED_OPTIONS= server bitmap-later bos-new-config fast-restart
+PKG_SUGGESTED_OPTIONS+= namei largefile -kernel-module supergroups
+
+.include "../../mk/bsd.options.mk"
+
+.if !empty(PKG_OPTIONS:Msupergroups)
+CONFIGURE_ARGS+= --enable-supergroups
+.endif
+.if !empty(PKG_OPTIONS:Mbitmap-later)
+CONFIGURE_ARGS+= --enable-bitmap-later
+.endif
+.if !empty(PKG_OPTIONS:Mbos-new-config)
+CONFIGURE_ARGS+= --enable-bos-new-config
+.endif
+.if !empty(PKG_OPTIONS:Mfast-restart)
+CONFIGURE_ARGS+= --enable-fast-restart
+.endif
+.if !empty(PKG_OPTIONS:Mlargefile)
+CONFIGURE_ARGS+= --enable-largefile-fileserver
+.endif
+.if !empty(PKG_OPTIONS:Mkernel-module)
+CONFIGURE_ARGS+= --enable-kernel-module
+.else
+CONFIGURE_ARGS+= --disable-kernel-module
+.endif
+.if !empty(PKG_OPTIONS:Mnamei)
+CONFIGURE_ARGS+= --enable-namei-fileserver
+.endif
+.if !empty(PKG_OPTIONS:Mpam)
+CONFIGURE_ARGS+= --enable-pam
+.include "../../mk/pam.buildlink3.mk"
+PLIST_SRC+= ${.CURDIR}/PLIST.pam
+.else
+CONFIGURE_ARGS+= --disable-pam
+.endif
diff --git a/filesystems/openafs-devel/patches/patch-acinclude.m4 b/filesystems/openafs-devel/patches/patch-acinclude.m4
new file mode 100644
index 00000000000..b7f562841a9
--- /dev/null
+++ b/filesystems/openafs-devel/patches/patch-acinclude.m4
@@ -0,0 +1,12 @@
+$NetBSD: patch-acinclude.m4,v 1.1 2012/08/30 17:37:55 jakllsch Exp $
+
+--- acinclude.m4.orig 2012-04-22 23:40:23.000000000 -0400
++++ acinclude.m4 2012-04-28 19:04:26.000000000 -0400
+@@ -723,6 +723,7 @@
+ *_nbsd40) AFS_PARAM_COMMON=param.nbsd40.h ;;
+ *_nbsd50) AFS_PARAM_COMMON=param.nbsd50.h ;;
+ *_nbsd60) AFS_PARAM_COMMON=param.nbsd60.h ;;
++ *_nbsd70) AFS_PARAM_COMMON=param.nbsd70.h ;;
+ *_obsd31) AFS_PARAM_COMMON=param.obsd31.h ;;
+ *_obsd32) AFS_PARAM_COMMON=param.obsd32.h ;;
+ *_obsd33) AFS_PARAM_COMMON=param.obsd33.h ;;
diff --git a/filesystems/openafs-devel/patches/patch-configure b/filesystems/openafs-devel/patches/patch-configure
new file mode 100644
index 00000000000..dbc3ea0bad7
--- /dev/null
+++ b/filesystems/openafs-devel/patches/patch-configure
@@ -0,0 +1,41 @@
+$NetBSD: patch-configure,v 1.1 2012/08/30 17:37:55 jakllsch Exp $
+
+- add netbsd7
+- fix spelling of 'internal' in roken test
+
+--- configure.orig 2012-04-23 11:35:46.000000000 +0000
++++ configure
+@@ -7260,6 +7260,7 @@ case $AFS_SYSNAME in
+ *_nbsd40) AFS_PARAM_COMMON=param.nbsd40.h ;;
+ *_nbsd50) AFS_PARAM_COMMON=param.nbsd50.h ;;
+ *_nbsd60) AFS_PARAM_COMMON=param.nbsd60.h ;;
++ *_nbsd70) AFS_PARAM_COMMON=param.nbsd70.h ;;
+ *_obsd31) AFS_PARAM_COMMON=param.obsd31.h ;;
+ *_obsd32) AFS_PARAM_COMMON=param.obsd32.h ;;
+ *_obsd33) AFS_PARAM_COMMON=param.obsd33.h ;;
+@@ -7900,14 +7901,14 @@ case $AFS_SYSNAME in
+ XCFLAGS="-O2 -pipe -fPIC"
+ ;;
+
+- *nbsd2*|*nbsd3*|*nbsd4*|*nbsd5*|*nbsd6*)
++ *nbsd2*|*nbsd3*|*nbsd4*|*nbsd5*|*nbsd6*|*nbsd7*)
+ MT_CFLAGS='-pthread -D_REENTRANT'
+ PAM_OPTMZ=-O2
+ PAM_CFLAGS="-pipe -fPIC"
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_LDFLAGS="-shared -Xlinker -x"
+ SHLIB_LINKER="${MT_CC} -shared"
+- XCFLAGS="-pipe"
++ XCFLAGS="-pipe -I/usr/include/krb5 -DHAVE_NO_KRB5_524"
+ ;;
+
+ *nbsd15|*nbsd16)
+@@ -19663,7 +19664,7 @@ fi
+ fi
+
+
+- if test x"$roken_root" = xinteral; then :
++ if test x"$roken_root" = xinternal; then :
+
+ DIR_roken=roken
+ CPPFLAGS_roken=
diff --git a/filesystems/openafs-devel/patches/patch-configure-libafs b/filesystems/openafs-devel/patches/patch-configure-libafs
new file mode 100644
index 00000000000..c239b597f98
--- /dev/null
+++ b/filesystems/openafs-devel/patches/patch-configure-libafs
@@ -0,0 +1,21 @@
+$NetBSD: patch-configure-libafs,v 1.1 2012/08/30 17:37:55 jakllsch Exp $
+
+--- configure-libafs.orig 2012-04-23 07:35:47.000000000 -0400
++++ configure-libafs 2012-04-28 19:07:36.000000000 -0400
+@@ -6442,6 +6442,7 @@
+ *_nbsd40) AFS_PARAM_COMMON=param.nbsd40.h ;;
+ *_nbsd50) AFS_PARAM_COMMON=param.nbsd50.h ;;
+ *_nbsd60) AFS_PARAM_COMMON=param.nbsd60.h ;;
++ *_nbsd70) AFS_PARAM_COMMON=param.nbsd70.h ;;
+ *_obsd31) AFS_PARAM_COMMON=param.obsd31.h ;;
+ *_obsd32) AFS_PARAM_COMMON=param.obsd32.h ;;
+ *_obsd33) AFS_PARAM_COMMON=param.obsd33.h ;;
+@@ -7082,7 +7083,7 @@
+ XCFLAGS="-O2 -pipe -fPIC"
+ ;;
+
+- *nbsd2*|*nbsd3*|*nbsd4*|*nbsd5*|*nbsd6*)
++ *nbsd2*|*nbsd3*|*nbsd4*|*nbsd5*|*nbsd6*|*nbsd7*)
+ MT_CFLAGS='-pthread -D_REENTRANT'
+ PAM_OPTMZ=-O2
+ PAM_CFLAGS="-pipe -fPIC"
diff --git a/filesystems/openafs-devel/patches/patch-src-afs-NBSD-osi_crypto.c b/filesystems/openafs-devel/patches/patch-src-afs-NBSD-osi_crypto.c
new file mode 100644
index 00000000000..530c8175212
--- /dev/null
+++ b/filesystems/openafs-devel/patches/patch-src-afs-NBSD-osi_crypto.c
@@ -0,0 +1,24 @@
+$NetBSD: patch-src-afs-NBSD-osi_crypto.c,v 1.1 2012/08/30 17:37:55 jakllsch Exp $
+
+--- src/afs/NBSD/osi_crypto.c.orig 2012-04-22 23:40:23.000000000 -0400
++++ src/afs/NBSD/osi_crypto.c 2012-04-30 16:48:16.000000000 -0400
+@@ -25,10 +25,19 @@
+ #include <afsconfig.h>
+ #include "afs/param.h"
+
++#ifdef AFS_NBSD70_ENV
++#include <sys/cprng.h>
++#else
+ #include <sys/rnd.h>
++#endif
++
+
+ int
+ osi_readRandom(void *data, afs_size_t len) {
++#ifdef AFS_NBSD70_ENV
++ cprng_fast(data, len);
++#else
+ rnd_extract_data(data, len, RND_EXTRACT_ANY);
++#endif
+ return 0;
+ }
diff --git a/filesystems/openafs-devel/patches/patch-src-afs-NBSD-osi_kmod.c b/filesystems/openafs-devel/patches/patch-src-afs-NBSD-osi_kmod.c
new file mode 100644
index 00000000000..fe413bc563b
--- /dev/null
+++ b/filesystems/openafs-devel/patches/patch-src-afs-NBSD-osi_kmod.c
@@ -0,0 +1,133 @@
+$NetBSD: patch-src-afs-NBSD-osi_kmod.c,v 1.1 2012/08/30 17:37:55 jakllsch Exp $
+
+--- src/afs/NBSD/osi_kmod.c.orig 2012-04-22 23:40:23.000000000 -0400
++++ src/afs/NBSD/osi_kmod.c 2012-05-03 22:11:02.000000000 -0400
+@@ -64,6 +64,63 @@
+ static sy_call_t *old_setgroups;
+ static sy_call_t *old_ioctl;
+
++static int
++afs_syscall_establish(struct sysent *se)
++{
++ if (old_ioctl != NULL)
++ return EBUSY;
++
++ old_sysent = se[AFS_SYSCALL];
++ old_setgroups = se[SYS_setgroups].sy_call;
++ old_ioctl = se[SYS_ioctl].sy_call;
++
++ if (
++#if defined(AFS_NBSD60_ENV)
++# define LOCK() kernconfig_lock()
++# define UNLOCK() kernconfig_unlock()
++# ifndef RUMP
++ old_sysent.sy_call != sys_nosys &&
++ old_sysent.sy_call != sys_nomodule
++# else
++ false
++# endif
++#else
++# define LOCK()
++# define UNLOCK()
++ old_sysent.sy_call != sys_lkmnosys
++#endif
++ ) {
++ old_ioctl = NULL;
++ return EBUSY;
++ }
++
++ LOCK();
++ se[AFS_SYSCALL] = openafs_sysent;
++ se[SYS_setgroups].sy_call = Afs_xsetgroups;
++ se[SYS_ioctl].sy_call = afs_xioctl;
++ UNLOCK();
++
++ return 0;
++}
++
++static int
++afs_syscall_disestablish(struct sysent *se)
++{
++ if (old_ioctl == NULL)
++ return EINVAL;
++
++ /* XXX: Need to do more work here like the kernel function does */
++
++ LOCK();
++ se[SYS_ioctl].sy_call = old_ioctl;
++ se[SYS_setgroups].sy_call = old_setgroups;
++ se[AFS_SYSCALL] = old_sysent;
++ UNLOCK();
++
++ old_ioctl = NULL;
++ return 0;
++}
++
+ MODULE(MODULE_CLASS_VFS, openafs, NULL);
+
+ static int
+@@ -80,53 +137,21 @@
+
+ switch (cmd) {
+ case MODULE_CMD_INIT:
++ if ((error = afs_syscall_establish(se)) != 0)
++ return error;
+ error = vfs_attach(&afs_vfsops);
+- if (error != 0)
+- break;
+- old_sysent = se[AFS_SYSCALL];
+- old_setgroups = se[SYS_setgroups].sy_call;
+- old_ioctl = se[SYS_ioctl].sy_call;
+-#if defined(AFS_NBSD60_ENV)
+-# ifndef RUMP
+- if (old_sysent.sy_call == sys_nosys) {
+-# else
+- if (true) {
+-# endif
+-#else
+- if (old_sysent.sy_call == sys_lkmnosys) {
+-#endif
+-#if defined(AFS_NBSD60_ENV)
+- kernconfig_lock();
+-#endif
+- se[AFS_SYSCALL] = openafs_sysent;
+- se[SYS_setgroups].sy_call = Afs_xsetgroups;
+- se[SYS_ioctl].sy_call = afs_xioctl;
+-#if defined(AFS_NBSD60_ENV)
+- kernconfig_unlock();
+-#endif
+- } else {
+- error = EBUSY;
++ if (error != 0) {
++ afs_syscall_disestablish(se);
++ return error;
+ }
+- if (error != 0)
+- break;
+- break;
++ return 0;
+ case MODULE_CMD_FINI:
+-#if defined(AFS_NBSD60_ENV)
+- kernconfig_lock();
+-#endif
+- se[SYS_ioctl].sy_call = old_ioctl;
+- se[SYS_setgroups].sy_call = old_setgroups;
+- se[AFS_SYSCALL] = old_sysent;
+-#if defined(AFS_NBSD60_ENV)
+- kernconfig_unlock();
+-#endif
+- error = vfs_detach(&afs_vfsops);
+- if (error != 0)
+- break;
+- break;
++ if ((error = vfs_detach(&afs_vfsops)) != 0)
++ return error;
++ return afs_syscall_disestablish(se);
++
+ default:
+- error = ENOTTY;
+- break;
++ return ENOTTY;
+ }
+
+ return error;
diff --git a/filesystems/openafs-devel/patches/patch-src-afs-NBSD-osi_vm.c b/filesystems/openafs-devel/patches/patch-src-afs-NBSD-osi_vm.c
new file mode 100644
index 00000000000..3f9a7efce4a
--- /dev/null
+++ b/filesystems/openafs-devel/patches/patch-src-afs-NBSD-osi_vm.c
@@ -0,0 +1,19 @@
+$NetBSD: patch-src-afs-NBSD-osi_vm.c,v 1.1 2012/08/30 17:37:55 jakllsch Exp $
+
+--- src/afs/NBSD/osi_vm.c.orig 2012-04-22 23:40:23.000000000 -0400
++++ src/afs/NBSD/osi_vm.c 2012-04-30 16:47:34.000000000 -0400
+@@ -84,7 +84,13 @@
+ ReleaseWriteLock(&avc->lock);
+ AFS_GUNLOCK();
+ vp = AFSTOV(avc);
+- mutex_enter(&vp->v_interlock);
++#ifdef AFS_NBSD70_ENV
++#define AMP
++#else
++#define AMP &
++#endif
++
++ mutex_enter(AMP vp->v_interlock);
+ VOP_PUTPAGES(vp, 0, 0, PGO_ALLPAGES|PGO_CLEANIT|PGO_SYNCIO);
+ AFS_GLOCK();
+ ObtainWriteLock(&avc->lock, 94);
diff --git a/filesystems/openafs-devel/patches/patch-src-afs-NBSD-osi_vnodeops.c b/filesystems/openafs-devel/patches/patch-src-afs-NBSD-osi_vnodeops.c
new file mode 100644
index 00000000000..ffa14e4041d
--- /dev/null
+++ b/filesystems/openafs-devel/patches/patch-src-afs-NBSD-osi_vnodeops.c
@@ -0,0 +1,39 @@
+$NetBSD: patch-src-afs-NBSD-osi_vnodeops.c,v 1.1 2012/08/30 17:37:55 jakllsch Exp $
+
+--- src/afs/NBSD/osi_vnodeops.c.orig 2012-04-22 23:40:23.000000000 -0400
++++ src/afs/NBSD/osi_vnodeops.c 2012-04-30 16:47:20.000000000 -0400
+@@ -274,7 +274,14 @@
+ struct nbvdata *vd;
+
+ KASSERT(AFSTOV(tvc) == NULL);
+- while (getnewvnode(VT_AFS, afs_globalVFS, afs_vnodeop_p, &AFSTOV(tvc))) {
++ while (getnewvnode(VT_AFS, afs_globalVFS, afs_vnodeop_p,
++#ifdef AFS_NBSD70_ENV
++ NULL,
++#define AMP
++#else
++#define AMP &
++#endif
++ &AFSTOV(tvc))) {
+ /* no vnodes available, force an alloc (limits be damned)! */
+ printf("afs: upping desiredvnodes\n");
+ desiredvnodes++;
+@@ -282,15 +289,15 @@
+
+ vd = kmem_zalloc(sizeof(*vd), KM_SLEEP);
+ #ifdef AFS_NBSD50_ENV
+- mutex_enter(&AFSTOV(tvc)->v_interlock);
++ mutex_enter(AMP AFSTOV(tvc)->v_interlock);
+ #else
+- simple_lock(&AFSTOV(tvc)->v_interlock);
++ simple_lock(AMP AFSTOV(tvc)->v_interlock);
+ #endif
+ vd->afsvc = tvc;
+ AFSTOV(tvc)->v_data = vd;
+ genfs_node_init(AFSTOV(tvc), &afs_genfsops);
+ #ifdef AFS_NBSD50_ENV
+- mutex_exit(&AFSTOV(tvc)->v_interlock);
++ mutex_exit(AMP AFSTOV(tvc)->v_interlock);
+ #else
+ simple_unlock(&AFSTOV(tvc)->v_interlock);
+ #endif
diff --git a/filesystems/openafs-devel/patches/patch-src-bucoord-Makefile.n b/filesystems/openafs-devel/patches/patch-src-bucoord-Makefile.n
new file mode 100644
index 00000000000..c1f3b8d1d17
--- /dev/null
+++ b/filesystems/openafs-devel/patches/patch-src-bucoord-Makefile.n
@@ -0,0 +1,51 @@
+$NetBSD: patch-src-bucoord-Makefile.n,v 1.1 2012/08/30 17:37:55 jakllsch Exp $
+
+--- src/bucoord/Makefile.in.orig 2012-04-22 23:40:23.000000000 -0400
++++ src/bucoord/Makefile.in 2012-04-28 23:27:02.000000000 -0400
+@@ -23,7 +23,7 @@
+ $(TOP_LIBDIR)/libopr.a \
+ ${TOP_LIBDIR}/libafshcrypto_lwp.a
+
+-all: ${TOP_LIBDIR}/libbxdb.a ${TOP_INCDIR}/afs/bucoord_prototypes.h ${TOP_INCDIR}/afs/bc.h backup
++all: ${TOP_LIBDIR}/libbxdb.a ${TOP_INCDIR}/afs/bucoord_prototypes.h ${TOP_INCDIR}/afs/bc.h afs-backup
+
+ generated: bucoord_errs.c bc.h
+
+@@ -66,7 +66,7 @@
+
+ $(BACKOBJS): bc.h ${TOP_INCDIR}/afs/butc.h
+
+-backup: $(BACKOBJS) ${LIBS}
++afs-backup: $(BACKOBJS) ${LIBS}
+ $(AFS_LDRULE) $(BACKOBJS) ${LIBS} $(LIB_roken) ${XLIBS}
+
+ bc.h: bucoord_errs.c
+@@ -84,23 +84,23 @@
+ # Install targets
+ #
+
+-install: libbxdb.a backup
++install: libbxdb.a afs-backup
+ ${INSTALL} -d ${DESTDIR}${libdir}/afs
+ ${INSTALL} -d ${DESTDIR}${sbindir}
+ ${INSTALL_DATA} libbxdb.a ${DESTDIR}${libdir}/afs/libbxdb.a
+- ${INSTALL_PROGRAM} backup ${DESTDIR}${sbindir}/backup
++ ${INSTALL_PROGRAM} afs-backup ${DESTDIR}${sbindir}/afs-backup
+
+-dest: libbxdb.a backup
++dest: libbxdb.a afs-backup
+ ${INSTALL} -d ${DEST}/lib/afs
+ ${INSTALL} -d ${DEST}/etc
+ ${INSTALL_DATA} libbxdb.a ${DEST}/lib/afs/libbxdb.a
+- ${INSTALL_PROGRAM} backup ${DEST}/etc/backup
++ ${INSTALL_PROGRAM} afs-backup ${DEST}/etc/afs-backup
+
+ #
+ # Misc targets
+ #
+
+ clean:
+- $(RM) -f *.o backup convert *.ss.c *.cs.c *.xdr.c *.a core btest ttest AFS_component_version_number.c bc.h bucoord_errs.c
++ $(RM) -f *.o afs-backup convert *.ss.c *.cs.c *.xdr.c *.a core btest ttest AFS_component_version_number.c bc.h bucoord_errs.c
+
+ include ../config/Makefile.version
diff --git a/filesystems/openafs-devel/patches/patch-src-cf-osconf.m4 b/filesystems/openafs-devel/patches/patch-src-cf-osconf.m4
new file mode 100644
index 00000000000..4e475a96491
--- /dev/null
+++ b/filesystems/openafs-devel/patches/patch-src-cf-osconf.m4
@@ -0,0 +1,13 @@
+$NetBSD: patch-src-cf-osconf.m4,v 1.1 2012/08/30 17:37:55 jakllsch Exp $
+
+--- src/cf/osconf.m4.orig 2012-04-22 23:40:23.000000000 -0400
++++ src/cf/osconf.m4 2012-04-28 19:01:31.000000000 -0400
+@@ -191,7 +191,7 @@
+ XCFLAGS="-O2 -pipe -fPIC"
+ ;;
+
+- *nbsd2*|*nbsd3*|*nbsd4*|*nbsd5*|*nbsd6*)
++ *nbsd2*|*nbsd3*|*nbsd4*|*nbsd5*|*nbsd6*|*nbsd7*)
+ MT_CFLAGS='-pthread -D_REENTRANT'
+ PAM_OPTMZ=-O2
+ PAM_CFLAGS="-pipe -fPIC"
diff --git a/filesystems/openafs-devel/patches/patch-src-config-param.amd64_nbsd70.h b/filesystems/openafs-devel/patches/patch-src-config-param.amd64_nbsd70.h
new file mode 100644
index 00000000000..e7991b6808c
--- /dev/null
+++ b/filesystems/openafs-devel/patches/patch-src-config-param.amd64_nbsd70.h
@@ -0,0 +1,27 @@
+$NetBSD: patch-src-config-param.amd64_nbsd70.h,v 1.1 2012/08/30 17:37:55 jakllsch Exp $
+
+--- src/config/param.amd64_nbsd70.h.orig 2012-04-28 19:05:18.000000000 -0400
++++ src/config/param.amd64_nbsd70.h 2012-04-28 19:06:51.000000000 -0400
+@@ -0,0 +1,22 @@
++#ifndef AFS_AMD64_PARAM_H
++#define AFS_AMD64_PARAM_H
++
++#define AFS_X86_XBSD_ENV 1
++#define AFS_X86_ENV 1
++#define AFSLITTLE_ENDIAN 1
++
++#define SYS_NAME "amd64_nbsd70"
++#define SYS_NAME_ID SYS_NAME_ID_amd64_nbsd70
++
++#define AFS_64BITPOINTER_ENV 1
++#define AFS_64BITUSERPOINTER_ENV 1
++#ifndef UKERNEL
++/* This section for kernel libafs compiles only */
++
++#else /* !defined(UKERNEL) */
++
++/* This section for user space compiles only */
++
++#endif /* !defined(UKERNEL) */
++
++#endif /* AFS_AMD64_PARAM_H */
diff --git a/filesystems/openafs-devel/patches/patch-src-config-param.i386_nbsd70.h b/filesystems/openafs-devel/patches/patch-src-config-param.i386_nbsd70.h
new file mode 100644
index 00000000000..e26a59f046d
--- /dev/null
+++ b/filesystems/openafs-devel/patches/patch-src-config-param.i386_nbsd70.h
@@ -0,0 +1,25 @@
+$NetBSD: patch-src-config-param.i386_nbsd70.h,v 1.1 2012/08/30 17:37:55 jakllsch Exp $
+
+--- src/config/param.i386_nbsd70.h.orig 2012-04-28 19:05:37.000000000 -0400
++++ src/config/param.i386_nbsd70.h 2012-04-28 19:05:59.000000000 -0400
+@@ -0,0 +1,20 @@
++#ifndef AFS_I386_PARAM_H
++#define AFS_I386_PARAM_H
++
++#define AFS_X86_XBSD_ENV 1
++#define AFS_X86_ENV 1
++#define AFSLITTLE_ENDIAN 1
++
++#define SYS_NAME "i386_nbsd70"
++#define SYS_NAME_ID SYS_NAME_ID_i386_nbsd70
++
++#ifndef UKERNEL
++/* This section for kernel libafs compiles only */
++
++#else /* !defined(UKERNEL) */
++
++/* This section for user space compiles only */
++
++#endif /* !defined(UKERNEL) */
++
++#endif /* AFS_I386_PARAM_H */
diff --git a/filesystems/openafs-devel/patches/patch-src-config-param.nbsd60.h b/filesystems/openafs-devel/patches/patch-src-config-param.nbsd60.h
new file mode 100644
index 00000000000..f3deaec1f75
--- /dev/null
+++ b/filesystems/openafs-devel/patches/patch-src-config-param.nbsd60.h
@@ -0,0 +1,12 @@
+$NetBSD: patch-src-config-param.nbsd60.h,v 1.1 2012/08/30 17:37:55 jakllsch Exp $
+
+--- src/config/param.nbsd60.h.orig 2012-04-22 23:40:23.000000000 -0400
++++ src/config/param.nbsd60.h 2012-04-28 19:34:45.000000000 -0400
+@@ -34,6 +34,7 @@
+ #define AFS_NBSD30_ENV 1
+ #define AFS_NBSD40_ENV 1
+ #define AFS_NBSD50_ENV 1
++#define AFS_NBSD60_ENV 1
+ #undef AFS_NONFSTRANS
+ #define AFS_NONFSTRANS 1
+
diff --git a/filesystems/openafs-devel/patches/patch-src-config-param.nbsd70.h b/filesystems/openafs-devel/patches/patch-src-config-param.nbsd70.h
new file mode 100644
index 00000000000..6145bb38088
--- /dev/null
+++ b/filesystems/openafs-devel/patches/patch-src-config-param.nbsd70.h
@@ -0,0 +1,174 @@
+$NetBSD: patch-src-config-param.nbsd70.h,v 1.1 2012/08/30 17:37:55 jakllsch Exp $
+
+--- src/config/param.nbsd70.h.orig 2012-04-28 19:35:22.000000000 -0400
++++ src/config/param.nbsd70.h 2012-04-28 19:35:13.000000000 -0400
+@@ -0,0 +1,169 @@
++/* NetBSD shared section */
++
++#ifndef AFS_PARAM_COMMON_H
++#define AFS_PARAM_COMMON_H 1
++
++#define AFS_NAMEI_ENV 1 /* User space interface to file system */
++#define AFS_64BIT_IOPS_ENV 1 /* Needed for NAMEI */
++#define AFS_64BIT_CLIENT 1
++
++#define AFS_MOUNT_AFS "afs" /* The name of the filesystem type. */
++#define AFS_SYSCALL 210
++
++#define AFS_KALLOC(n) kmem_alloc(n, KM_SLEEP)
++#define AFS_KALLOC_NOSLEEP(n) kmem_alloc(n, KM_NOSLEEP)
++#define AFS_KFREE kmem_free
++#define VATTR_NULL vattr_null
++
++#if 0
++/* including this file before sysincludes.h is canonical, but
++ * NBSD40's mount.h defines MOUNT_AFS */
++
++#ifndef MOUNT_AFS
++#define MOUNT_AFS AFS_MOUNT_AFS
++#endif
++
++#endif /* 0 */
++
++#define AFS_XBSD_ENV 1 /* {Free,Open,Net}BSD */
++
++#define AFS_NBSD_ENV 1
++#define AFS_NBSD15_ENV 1
++#define AFS_NBSD16_ENV 1
++#define AFS_NBSD20_ENV 1
++#define AFS_NBSD30_ENV 1
++#define AFS_NBSD40_ENV 1
++#define AFS_NBSD50_ENV 1
++#define AFS_NBSD60_ENV 1
++#define AFS_NBSD70_ENV 1
++#undef AFS_NONFSTRANS
++#define AFS_NONFSTRANS 1
++
++#define AFS_VFSINCL_ENV 1
++
++#define AFS_HAVE_FFS 1 /* Use system's ffs. */
++
++#if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) && !defined(IGNORE_STDS_H)
++#define AFS_HAVE_STATVFS 1 /* System supports statvfs */
++#endif
++
++#ifndef UKERNEL
++
++#if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) && !defined(IGNORE_STDS_H)
++#include <sys/param.h>
++#endif
++
++#define FTRUNC O_TRUNC
++
++#define IUPD 0x0010
++#define IACC 0x0020
++#define ICHG 0x0040
++#define IMOD 0x0080
++
++#define RXK_LISTENER_ENV 1
++
++#include <afs/afs_sysnames.h>
++
++#define AFS_VM_RDWR_ENV 1
++#define AFS_VFS_ENV 1
++#define AFS_GREEDY43_ENV 1
++
++#define AFS_GCPAGS 0 /* if nonzero, garbage collect PAGs */
++#define AFS_USE_GETTIMEOFDAY 1 /* use gettimeofday to implement rx clock */
++#define AFS_GLOBAL_SUNLOCK 1
++
++/* Extra kernel definitions (from kdefs file) */
++#ifdef _KERNEL_DEPRECATED
++#define AFS_VFS34 1 /* What is VFS34??? */
++#define AFS_SHORTGID 1 /* are group id's short? */
++#define afsio_iov uio_iov
++#define afsio_iovcnt uio_iovcnt
++#define afsio_offset uio_offset
++#define afsio_seg uio_segflg
++#define afsio_resid uio_resid
++#define AFS_UIOSYS UIO_SYSSPACE
++#define AFS_UIOUSER UIO_USERSPACE
++#define AFS_CLBYTES CLBYTES
++#define osi_GetTime(x) microtime(x)
++#define AFS_KALLOC(x) kalloc(x)
++#define AFS_KFREE(x,y) kfree(x,y)
++#define v_count v_usecount
++#define v_vfsp v_mount
++#define vfs_bsize mnt_stat.f_bsize
++#define vfs_fsid mnt_stat.f_fsid
++#define va_nodeid va_fileid
++#define vfs_vnodecovered mnt_vnodecovered
++#define direct dirent
++
++#ifndef MUTEX_DEFAULT
++#define MUTEX_DEFAULT 0
++#endif /* MUTEX_DEFAULT */
++
++#ifndef SSYS
++#define SSYS 0x00002
++#endif /* SSYS */
++
++#define p_rcred p_ucred
++
++#define VN_RELE(vp) vrele(((struct vnode *)(vp)))
++#define VN_HOLD(vp) VREF(((struct vnode *)(vp)))
++
++#if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) && !defined(IGNORE_STDS_H)
++enum vcexcl { NONEXCL, EXCL };
++
++#ifdef KERNEL
++#ifndef MIN
++#define MIN(A,B) ((A) < (B) ? (A) : (B))
++#endif
++#ifndef MAX
++#define MAX(A,B) ((A) > (B) ? (A) : (B))
++#endif
++#endif /* KERNEL */
++
++#endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ && !defined(IGNORE_STDS_H) */
++#endif /* _KERNEL_DEPRECATED */
++
++#else /* !defined(UKERNEL) */
++
++
++/* This section for user space compiles only */
++
++#define UKERNEL 1 /* user space kernel */
++
++#include <afs/afs_sysnames.h>
++
++#define AFS_USERSPACE_IP_ADDR 1
++#define RXK_LISTENER_ENV 1
++#define AFS_GCPAGS 0 /* if nonzero, garbage collect PAGs */
++
++#define afsio_iov uio_iov
++#define afsio_iovcnt uio_iovcnt
++#define afsio_offset uio_offset
++#define afsio_seg uio_segflg
++#define afsio_fmode uio_fmode
++#define afsio_resid uio_resid
++#define AFS_UIOSYS UIO_SYSSPACE
++#define AFS_UIOUSER UIO_USERSPACE
++#define AFS_CLBYTES MCLBYTES
++#define AFS_MINCHANGE 2
++#define VATTR_NULL usr_vattr_null
++
++#define AFS_DIRENT
++#ifndef CMSERVERPREF
++#define CMSERVERPREF
++#endif
++
++#if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) && !defined(IGNORE_STDS_H) && !defined()
++#include <limits.h>
++#include <sys/param.h>
++#include <sys/types.h>
++#include <sys/mount.h>
++#include <sys/fcntl.h>
++#include <netinet/in.h>
++#include <sys/uio.h>
++#include <sys/socket.h>
++#endif
++
++#endif /* !defined(UKERNEL) */
++
++#endif /* AFS_PARAM_COMMON_H */
diff --git a/filesystems/openafs-devel/patches/patch-src-config-shlib-build.in b/filesystems/openafs-devel/patches/patch-src-config-shlib-build.in
new file mode 100644
index 00000000000..0246773c648
--- /dev/null
+++ b/filesystems/openafs-devel/patches/patch-src-config-shlib-build.in
@@ -0,0 +1,89 @@
+$NetBSD: patch-src-config-shlib-build.in,v 1.1 2012/08/30 17:37:55 jakllsch Exp $
+
+--- src/config/shlib-build.in.orig 2012-04-22 23:40:23.000000000 -0400
++++ src/config/shlib-build.in 2012-04-28 22:09:59.000000000 -0400
+@@ -77,6 +77,15 @@
+ exit 1
+ fi
+
++RUNPATH=
++for i in @LDFLAGS@
++do
++ case "$i" in
++ -Wl,-R*)
++ RUNPATH="${RUNPATH} $i"
++ esac
++done
++
+ # Print out what we're doing while we do it for debugging.
+ export=
+ if [ -z "$filename" ] ; then
+@@ -98,8 +107,8 @@
+ > $library.exp
+ export="-bE:$library.exp"
+ fi
+- echo "$linker $export -o $filename $*"
+- $linker $export -o "$filename" "$@"
++ echo "$linker $export -o $filename $RUNPATH $*"
++ $linker $export -o "$filename" $RUNPATH "$@"
+ ;;
+ sun*_5*)
+ if [ -z "$plain" ] && [ -f "$srcdir/$library.map" ] ; then
+@@ -114,11 +123,11 @@
+ fi
+ fi
+ if [ -z "$soname" ] ; then
+- echo "$linker $export -o $filename $*"
+- $linker $export -o "$filename" "$@"
++ echo "$linker $export -o $filename $RUNPATH $*"
++ $linker $export -o "$filename" $RUNPATH "$@"
+ else
+- echo "$linker $export -h $soname -o $filename $*"
+- $linker $export -h "$soname" -o "$filename" "$@"
++ echo "$linker $export -h $soname -o $filename $RUNPATH $*"
++ $linker $export -h "$soname" -o "$filename" $RUNPATH "$@"
+ fi
+ ;;
+ *_linux*)
+@@ -126,19 +135,19 @@
+ export="-Wl,--version-script=$srcdir/$library.map"
+ fi
+ if [ -z "$soname" ] ; then
+- echo "$linker $export -o $filename $*"
+- $linker $export -o "$filename" "$@"
++ echo "$linker $export -o $filename $RUNPATH $*"
++ $linker $export -o "$filename" $RUNPATH "$@"
+ else
+- echo "$linker $export -Wl,-h,$soname -o $filename $*"
+- $linker $export -Wl,-h,"$soname" -o "$filename" "$@"
++ echo "$linker $export -Wl,-h,$soname -o $filename $RUNPATH $*"
++ $linker $export -Wl,-h,"$soname" -o "$filename" $RUNPATH "$@"
+ fi
+ ;;
+ hp_ux*)
+ if [ -z "$plain" ] && [ -f "$srcdir/$library.hp" ] ; then
+ export="-c $srcdir/$library.hp"
+ fi
+- echo "$linker $export -o $filename $*"
+- $linker $export -o "$filename" "$@"
++ echo "$linker $export -o $filename $RUNPATH $*"
++ $linker $export -o "$filename" "$RUNPATH $@"
+ ;;
+ *darwin*)
+ if [ -z "$plain" ] && [ -f "$srcdir/$library.map" ] ; then
+@@ -155,11 +164,11 @@
+ export="$export,-flat_namespace,-undefined,suppress"
+ fi
+ fi
+- echo "$linker $export -o $filename $*"
+- $linker $export -o "$filename" "$@"
++ echo "$linker $export -o $filename $RUNPATH $*"
++ $linker $export -o "$filename" $RUNPATH "$@"
+ ;;
+ *)
+- echo "$linker -o $filename $*"
+- $linker -o "$filename" "$@"
++ echo "$linker -o $filename $RUNPATH $*"
++ $linker -o "$filename" $RUNPATH "$@"
+ ;;
+ esac
diff --git a/filesystems/openafs-devel/patches/patch-src-config-shlib-install.in b/filesystems/openafs-devel/patches/patch-src-config-shlib-install.in
new file mode 100644
index 00000000000..95e6a8ce286
--- /dev/null
+++ b/filesystems/openafs-devel/patches/patch-src-config-shlib-install.in
@@ -0,0 +1,12 @@
+$NetBSD: patch-src-config-shlib-install.in,v 1.1 2012/08/30 17:37:55 jakllsch Exp $
+
+--- src/config/shlib-install.in.orig 2012-04-22 23:40:23.000000000 -0400
++++ src/config/shlib-install.in 2012-04-28 22:12:34.000000000 -0400
+@@ -56,6 +56,7 @@
+ filename="$library.$suffix"
+ else
+ filename="$library.$suffix.$major.$minor"
++ install="$INSTALL -m 755"
+ fi
+ case $sysname in
+ rs_aix*)
diff --git a/filesystems/openafs-devel/patches/patch-src-crypto-hcrypto-kernel-config.h b/filesystems/openafs-devel/patches/patch-src-crypto-hcrypto-kernel-config.h
new file mode 100644
index 00000000000..3233c3fb6ff
--- /dev/null
+++ b/filesystems/openafs-devel/patches/patch-src-crypto-hcrypto-kernel-config.h
@@ -0,0 +1,24 @@
+$NetBSD: patch-src-crypto-hcrypto-kernel-config.h,v 1.1 2012/08/30 17:37:55 jakllsch Exp $
+
+--- src/crypto/hcrypto/kernel/config.h.orig 2012-04-22 23:40:23.000000000 -0400
++++ src/crypto/hcrypto/kernel/config.h 2012-05-02 14:38:14.000000000 -0400
+@@ -46,15 +46,19 @@
+ #define calloc _afscrypto_calloc
+ void * _afscrypto_calloc(int, size_t);
+
++#undef malloc
+ #define malloc _afscrypto_malloc
+ void * _afscrypto_malloc(size_t);
+
++#undef free
+ #define free _afscrypto_free
+ void _afscrypto_free(void *);
+
++#undef strdup
+ #define strdup _afscrypto_strdup
+ char * _afscrypto_strdup(const char *);
+
++#undef realloc
+ #define realloc _afscrypto_realloc
+ void * _afscrypto_realloc(void *, size_t);
+
diff --git a/filesystems/openafs-devel/patches/patch-src-external-heimdal-roken-roken-common.h b/filesystems/openafs-devel/patches/patch-src-external-heimdal-roken-roken-common.h
new file mode 100644
index 00000000000..3fb8f373407
--- /dev/null
+++ b/filesystems/openafs-devel/patches/patch-src-external-heimdal-roken-roken-common.h
@@ -0,0 +1,38 @@
+$NetBSD: patch-src-external-heimdal-roken-roken-common.h,v 1.1 2012/08/30 17:37:55 jakllsch Exp $
+
+--- src/external/heimdal/roken/roken-common.h.orig 2012-04-30 16:41:30.000000000 -0400
++++ src/external/heimdal/roken/roken-common.h 2012-04-30 17:45:23.000000000 -0400
+@@ -335,9 +335,11 @@
+ wait_for_process_timed(pid_t, time_t (*)(void *),
+ void *, time_t);
+
++#ifndef _KERNEL
+ #define pipe_execv rk_pipe_execv
+ ROKEN_LIB_FUNCTION int ROKEN_LIB_CALL
+ pipe_execv(FILE**, FILE**, FILE**, const char*, ...);
++#endif
+
+ #define print_version rk_print_version
+ ROKEN_LIB_FUNCTION void ROKEN_LIB_CALL
+@@ -361,6 +363,7 @@
+ ROKEN_LIB_FUNCTION void ROKEN_LIB_CALL
+ esetenv(const char *, const char *, int);
+
++struct sockaddr;
+ #define socket_set_address_and_port rk_socket_set_address_and_port
+ ROKEN_LIB_FUNCTION void ROKEN_LIB_CALL
+ socket_set_address_and_port (struct sockaddr *, const void *, int);
+@@ -481,11 +484,13 @@
+ ROKEN_LIB_FUNCTION void ROKEN_LIB_CALL
+ rk_cloexec(int);
+
++#ifndef _KERNEL
+ ROKEN_LIB_FUNCTION void ROKEN_LIB_CALL
+ rk_cloexec_file(FILE *);
+
+ ROKEN_LIB_FUNCTION void ROKEN_LIB_CALL
+ rk_cloexec_dir(DIR *);
++#endif
+
+ ROKEN_LIB_FUNCTION int ROKEN_LIB_CALL
+ ct_memcmp(const void *, const void *, size_t);
diff --git a/filesystems/openafs-devel/patches/patch-src-external-heimdal-roken-roken.h.in b/filesystems/openafs-devel/patches/patch-src-external-heimdal-roken-roken.h.in
new file mode 100644
index 00000000000..aad6dde340b
--- /dev/null
+++ b/filesystems/openafs-devel/patches/patch-src-external-heimdal-roken-roken.h.in
@@ -0,0 +1,52 @@
+$NetBSD: patch-src-external-heimdal-roken-roken.h.in,v 1.1 2012/08/30 17:37:55 jakllsch Exp $
+
+--- src/external/heimdal/roken/roken.h.in.orig 2012-04-30 16:41:30.000000000 -0400
++++ src/external/heimdal/roken/roken.h.in 2012-05-02 12:38:31.000000000 -0400
+@@ -278,6 +278,7 @@
+ #define rk_PATH_DELIM '\\'
+ #endif
+
++#ifndef _KERNEL
+ #ifndef HAVE_SSIZE_T
+ #ifndef SSIZE_T_DEFINED
+ #ifdef ssize_t
+@@ -291,6 +292,7 @@
+ #define SSIZE_T_DEFINED
+ #endif /* SSIZE_T_DEFINED */
+ #endif /* HAVE_SSIZE_T */
++#endif
+
+ #include <roken-common.h>
+
+@@ -614,6 +616,7 @@
+ #endif
+
+ #ifndef HAVE_LSTAT
++struct stat;
+ #define lstat rk_lstat
+ ROKEN_LIB_FUNCTION int ROKEN_LIB_CALL lstat(const char *, struct stat *);
+ #endif
+@@ -689,6 +692,7 @@
+ #endif
+
+ #ifndef HAVE_WRITEV
++struct iovec;
+ #define writev rk_writev
+ ROKEN_LIB_FUNCTION ssize_t ROKEN_LIB_CALL
+ writev(int, const struct iovec *, int);
+@@ -747,6 +751,7 @@
+ #endif
+ #endif
+
++struct tm;
+ ROKEN_LIB_FUNCTION time_t ROKEN_LIB_CALL tm2time (struct tm, int);
+
+ ROKEN_LIB_FUNCTION int ROKEN_LIB_CALL unix_verify_user(char *, char *);
+@@ -888,6 +893,7 @@
+ };
+ #endif
+
++struct addrinfo;
+ #ifndef HAVE_GETADDRINFO
+ #define getaddrinfo rk_getaddrinfo
+ ROKEN_LIB_FUNCTION int ROKEN_LIB_CALL
diff --git a/filesystems/openafs-devel/patches/patch-src-libafs-MakefileProto.NBSD.in b/filesystems/openafs-devel/patches/patch-src-libafs-MakefileProto.NBSD.in
new file mode 100644
index 00000000000..e368f7a8338
--- /dev/null
+++ b/filesystems/openafs-devel/patches/patch-src-libafs-MakefileProto.NBSD.in
@@ -0,0 +1,341 @@
+$NetBSD: patch-src-libafs-MakefileProto.NBSD.in,v 1.1 2012/08/30 17:37:55 jakllsch Exp $
+
+--- src/libafs/MakefileProto.NBSD.in.orig 2012-04-22 23:40:23.000000000 -0400
++++ src/libafs/MakefileProto.NBSD.in 2012-05-02 12:04:41.000000000 -0400
+@@ -1,122 +1,216 @@
+-# Copyright 2000, International Business Machines Corporation and others.
+-# All Rights Reserved.
+-#
+-# This software has been released under the terms of the IBM Public
+-# License. For details, see the LICENSE file in the top-level source
+-# directory or online at http://www.openafs.org/dl/license10.html
+-#
+-srcdir=@srcdir@
+-include @TOP_OBJDIR@/src/config/Makefile.config
+-INSTALL = @INSTALL@
+-INSTALL_DATA = @INSTALL_DATA@
+-INSTALL_PROGRAM = @INSTALL_PROGRAM@
+-INSTALL_SCRIPT = @INSTALL_SCRIPT@
+-
+-
+-# OS specific object files:
+-AFS_OS_OBJS = \
+- osi_crypto.o \
+- osi_gcpags.o \
+- osi_groups.o \
+- osi_file.o \
+- osi_inode.o \
+- osi_misc.o \
+- osi_sleep.o \
+- osi_vcache.o \
+- osi_vm.o \
+- osi_vnodeops.o
+-
+-AFS_OS_NFSOBJS = \
+- osi_vfsops_nfs.o
+-
+-AFS_OS_NONFSOBJS = \
+- osi_vfsops.o
+-
+-
+-# System specific build commands and flags
+-KSRC = @BSD_KERNEL_PATH@
+-KBLD = @BSD_KERNEL_BUILD@
+-KARCHFLAGS = -Di386 -march=pentiumpro -mtune=pentiumpro
+-KOPTFLAGS = -D_KERNEL -DLKM -D_LKM -DDEBUG -DLOCKDEBUG
+-KDEFS=-Wall -ansi -nostdinc -I/usr/include \
+- ${KARCHFLAGS} ${KOPTFLAGS} \
+- -ffreestanding -Wno-pointer-sign -Wno-strict-aliasing \
+-<i386_nbsd50>
+- -std=gnu99 \
+-<all>
+- -I${KSRC} -I${KSRC}/sys \
+- -I${KBLD} -I../afs
+-DBUG = -O2 -g3
++# NetBSD: patch-src-libafs-MakefileProto.NBSD.in,v 1.1 2012/05/02 23:19:25 christos Exp
++
++.include <bsd.own.mk>
++
++S=${NETBSDSRCDIR}/sys
++
++KMOD= openafs
++
++.PATH.c: \
++ ${.CURDIR}/../afs/NBSD \
++ ${.CURDIR}/../afs/VNOPS \
++ ${.CURDIR}/../afs \
++ ${.CURDIR}/../auth \
++ ${.CURDIR}/../dir \
++ ${.CURDIR}/../fsint \
++ ${.CURDIR}/../opr \
++ ${.CURDIR}/../util \
++ ${.CURDIR}/../rx/NBSD \
++ ${.CURDIR}/../rx \
++ ${.CURDIR}/../rxkad \
++ ${.CURDIR}/../rxstat \
++ ${.CURDIR}/../vlserver \
++ ${.CURDIR}/../crypto/hcrypto/kernel \
++ ${.CURDIR}/../crypto/rfc3961/kernel \
++ ${.CURDIR}/../crypto/rfc3961 \
++ ${.CURDIR}/../external/heimdal/hcrypto \
++ ${.CURDIR}/../external/heimdal/krb5 \
++ ${.CURDIR}/../external/heimdal/roken
++
+ DEFINES= -DAFSDEBUG -DKERNEL -DAFS -DVICE -DNFS -DUFS -DINET -DQUOTA -DGETMOUNT
+-OPTF=${OPT}
+-OPTF2=${OPT2}
+-CFLAGS=-I. -I.. -I${TOP_OBJDIR}/src/config ${FSINCLUDES} $(DEFINES) $(KDEFS) $(KOPTS) ${DBUG}
+-
+-
+-# Name of directory to hold object files and libraries.
+-KOBJ = MODLOAD
+-
+-# This tells Makefile.common to use it's single directory build target.
+-COMPDIRS = single_compdir
+-INSTDIRS = single_instdir
+-DESTDIRS = single_destdir
+-
+-include Makefile.common
+-
+-setup:
+- -mkdir $(KOBJ)
+- -$(RM) $(KOBJ)/Makefile $(KOBJ)/Makefile.common $(KOBJ)/config
+- ln -fs ../Makefile $(KOBJ)/Makefile
+- ln -fs ../Makefile.common $(KOBJ)/Makefile.common
+- ln -fs ../config $(KOBJ)/config
+- -$(RM) -f h net netinet rpc ufs nfs machine sys vm
+- -ln -fs ${KSRC}/net net
+- -ln -fs ${KSRC}/i386/include machine
+- -ln -fs ${KSRC}/netinet netinet
+- -ln -fs ${KSRC}/nfs nfs
+- -ln -fs /usr/include/rpc rpc
+- -ln -fs ${KSRC}/sys sys
+- -ln -fs ${KSRC}/ufs/ufs ufs
+- -ln -fs ${KSRC}/sys h
+- -ln -fs ${KSRC}/vm vm
+- -ln -fs ${KSRC}/arch/x86/include/via_padlock.h /usr/include/x86/via_padlock.h
+- -ln -fs ${KSRC}/arch/x86/include/cpufunc.h /usr/include/x86/cpufunc.h
+- -ln -fs ${KSRC}/arch/x86/include/pic.h /usr/include/machine/pic.h
+- -touch $(KOBJ)/sec_net.h
+-
+-
+-# Below this line are targets when in the COMMON directory:
+-LIBAFS = libafs.o
+-LIBAFSNONFS = libafs.nonfs.o
+-
+-INST_LIBAFS = ${DESTDIR}${afskerneldir}/${LIBAFS}
+-INST_LIBAFSNONFS = ${DESTDIR}${afskerneldir}/${LIBAFSNONFS}
+-
+-DEST_LIBAFS = ${DEST}/root.client/bin/${LIBAFS}
+-DEST_LIBAFSNONFS = ${DEST}/root.client/bin/${LIBAFSNONFS}
+-
+-<i386_nbsd40 i386_nbsd50>
+-# libafs: $(LIBAFS) $(LIBAFSNONFS)
+-libafs: $(LIBAFSNONFS)
+-# install_libafs: $(INST_LIBAFS) $(INST_LIBAFSNONFS)
+-#install_libafs: $(INST_LIBAFSNONFS)
+-install_libafs:
+-# dest_libafs: $(DEST_LIBAFS) $(DEST_LIBAFSNONFS)
+-dest_libafs: $(DEST_LIBAFSNONFS)
+-<all -i386_nbsd40 -i386_nbsd50>
+-libafs:
+- echo WARNING: No kernel module for ${SYS_NAME}
+-
+-install_libafs:
+- echo WARNING: No kernel module for ${SYS_NAME}
+-
+-dest_libafs:
+- echo WARNING: No kernel module for ${SYS_NAME}
+-<all>
+-
+-# for now, just skip it
+-#${LIBAFS}: $(AFSAOBJS) $(AFSNFSOBJS)
+-# $(LD) -r -z muldefs -o ${LIBAFS} ${AFSAOBJS} ${AFSNFSOBJS}
++DEFINES+=-DHAVE_CONFIG_H
+
+-${LIBAFSNONFS}: $(AFSAOBJS) $(AFSNONFSOBJS)
+- $(LD) -r -z muldefs -o ${LIBAFSNONFS} ${AFSAOBJS} ${AFSNONFSOBJS}
++CPPFLAGS+= ${DEFINES} \
++ -I${.CURDIR}/../afs/NBSD \
++ -I${.CURDIR}/../afs \
++ -I${.CURDIR}/../rx/NBSD \
++ -I${.CURDIR}/../rx \
++ -I${.CURDIR}/../rxkad \
++ -I${.CURDIR}/../fsint \
++ -I${.CURDIR}/../config \
++ -I${.CURDIR}/../crypto/rfc3961 \
++ -I${.CURDIR}/../crypto/hcrypto/kernel \
++ -I${.CURDIR}/../external/heimdal/krb5 \
++ -I${.CURDIR}/../../include \
++ -I${.CURDIR}/../../include/afs \
++ -I${.CURDIR}/../../include/hcrypto \
++ -I${.CURDIR}/.. \
++ -I${S}/sys
++
++AFS_SRCS=\
++ afs_atomlist.c \
++ afs_lhash.c \
++ afs_analyze.c \
++ afs_axscache.c \
++ afs_buffer.c \
++ afs_bypasscache.c \
++ afs_callback.c \
++ afs_cbqueue.c \
++ afs_cell.c \
++ afs_chunk.c \
++ afs_conn.c \
++ afs_daemons.c \
++ afs_dcache.c \
++ dir.c \
++ afs_disconnected.c \
++ afs_dynroot.c \
++ afs_error.c \
++ afs_icl.c \
++ afs_init.c \
++ afs_lock.c \
++ afs_mariner.c \
++ afs_memcache.c \
++ afs_fetchstore.c \
++ afs_osi.c \
++ afs_osidnlc.c \
++ afs_osi_alloc.c \
++ afs_osi_pag.c \
++ afs_osi_uio.c \
++ afs_osi_vget.c \
++ afs_osi_vm.c \
++ afs_segments.c \
++ afs_server.c \
++ afs_stat.c \
++ afs_syscall.c \
++ afs_tokens.c \
++ afs_user.c \
++ afs_util.c \
++ afs_vcache.c \
++ afs_vnop_access.c \
++ afs_vnop_attrs.c \
++ afs_vnop_create.c \
++ afs_vnop_dirops.c \
++ afs_vnop_fid.c \
++ afs_vnop_flock.c \
++ afs_vnop_link.c \
++ afs_vnop_lookup.c \
++ afs_vnop_open.c \
++ afs_vnop_read.c \
++ afs_vnop_readdir.c \
++ afs_vnop_remove.c \
++ afs_vnop_rename.c \
++ afs_vnop_strategy.c \
++ afs_vnop_symlink.c \
++ afs_vnop_write.c \
++ afs_volume.c \
++ afs_warn.c \
++ afsaux.c \
++ Kvice.xdr.c \
++ xdr_arrayn.c \
++ xdr_array.c \
++ xdr_int32.c \
++ xdr_int64.c \
++ Kvice.cs.c \
++ fcrypt.c \
++ rx.c \
++ rx_call.c \
++ rx_conn.c \
++ rx_peer.c \
++ rx_rdwr.c \
++ rx_clock.c \
++ rx_event.c \
++ rx_globals.c \
++ rx_identity.c \
++ rx_kmutex.c \
++ rx_knet.c \
++ rx_kcommon.c \
++ rx_misc.c \
++ rx_null.c \
++ rx_opaque.c \
++ rx_getaddr.c \
++ rx_packet.c \
++ rx_multi.c \
++ rx_stats.c \
++ rbtree.c \
++ xdr_rx.c \
++ xdr_mem.c \
++ xdr_len.c \
++ Kvldbint.cs.c \
++ Kvldbint.xdr.c \
++ Kcallback.ss.c \
++ Krxstat.ss.c \
++ Krxstat.xdr.c \
++ rxstat.c \
++ md5.c \
++ crypt_conn.c \
++ AFS_component_version_number.c\
++ afs_exporter.c \
++ rxkad_client.c \
++ rxkad_common.c \
++ xdr_afsuuid.c \
++ xdr.c \
++ Ktoken.xdr.c \
++ evp.c \
++ evp-algs.c \
++ rand.c \
++ alloc.c \
++ aes.c \
++ rijndael-alg-fst.c \
++ sha.c \
++ n-fold.c \
++ crypto.c \
++ algs.c \
++ crypto-aes.c \
++ context.c \
++ copy.c \
++ ct.c \
++ crypto-evp.c \
++ data.c \
++ keyblock.c \
++ store-int.c \
++ random.c \
++ uuid.c
++
++AFS_NFS_SRCS = \
++ afs_nfsclnt.c \
++ afs_nfsdisp.c \
++ afs_call_nfs.c \
++ afs_pioctl_nfs.c \
++ Kpagcb.cs.c \
++ Kpagcb.xdr.c \
++ osi_vfsops_nfs.c
++
++AFS_NO_NFS_SRCS = \
++ afs_call.c \
++ afs_pioctl.c \
++ osi_vfsops.c
++
++SRCS= \
++ ${AFS_SRCS} \
++ ${AFS_NO_NFS_SRCS} \
++ osi_crypto.c \
++ osi_gcpags.c \
++ osi_groups.c \
++ osi_file.c \
++ osi_inode.c \
++ osi_misc.c \
++ osi_sleep.c \
++ osi_vcache.c \
++ osi_vm.c \
++ osi_vnodeops.c \
++ osi_kmod.c \
++
++FAKE= err.h grp.h netdb.h pwd.h resolv.h
++FAKE+= h rpc/types.h arpa/inet.h arpa/nameser.h
++CLEANFILES += ${FAKE}
++
++.include <bsd.kmodule.mk>
++
++.if !make(obj) && !make(clean) && !make(cleandir)
++${OBJS}: ${FAKE}
++
++${FAKE}:
++ mkdir -p arpa rpc
++ ln -s $S/sys h
++ for i in ${FAKE}; do if [ ! -f $$i ]; then touch $$i; fi; done
++.endif
diff --git a/filesystems/openafs-devel/patches/patch-src-rxkad-fcrypt.c b/filesystems/openafs-devel/patches/patch-src-rxkad-fcrypt.c
new file mode 100644
index 00000000000..f32141ef19e
--- /dev/null
+++ b/filesystems/openafs-devel/patches/patch-src-rxkad-fcrypt.c
@@ -0,0 +1,12 @@
+$NetBSD: patch-src-rxkad-fcrypt.c,v 1.1 2012/08/30 17:37:55 jakllsch Exp $
+
+--- src/rxkad/fcrypt.c.orig 2012-04-22 23:40:23.000000000 -0400
++++ src/rxkad/fcrypt.c 2012-05-02 14:45:51.000000000 -0400
+@@ -16,7 +16,6 @@
+ #include <afs/param.h>
+ #include <afs/stds.h>
+
+-#define DEBUG 0
+ #ifdef KERNEL
+ #ifndef UKERNEL
+ #if defined(AFS_AIX_ENV) || defined(AFS_AUX_ENV) || defined(AFS_SUN5_ENV)
diff --git a/filesystems/openafs-devel/patches/patch-sys-config-afs_sysnames.h b/filesystems/openafs-devel/patches/patch-sys-config-afs_sysnames.h
new file mode 100644
index 00000000000..be29c357af5
--- /dev/null
+++ b/filesystems/openafs-devel/patches/patch-sys-config-afs_sysnames.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-sys-config-afs_sysnames.h,v 1.1 2012/08/30 17:37:55 jakllsch Exp $
+
+--- src/config/afs_sysnames.h.orig 2012-04-22 23:40:23.000000000 -0400
++++ src/config/afs_sysnames.h 2012-04-28 19:03:43.000000000 -0400
+@@ -250,6 +250,8 @@
+ #define SYS_NAME_ID_macppc_nbsd50 2541
+ #define SYS_NAME_ID_amd64_nbsd60 2542
+ #define SYS_NAME_ID_i386_nbsd60 2543
++#define SYS_NAME_ID_amd64_nbsd70 2544
++#define SYS_NAME_ID_i386_nbsd70 2545
+
+ #define SYS_NAME_ID_i386_obsd31 2600
+ #define SYS_NAME_ID_i386_obsd32 2601
diff --git a/filesystems/openafs/DESCR b/filesystems/openafs/DESCR
new file mode 100644
index 00000000000..c546dc9592e
--- /dev/null
+++ b/filesystems/openafs/DESCR
@@ -0,0 +1,8 @@
+AFS is a distributed filesystem product, pioneered at Carnegie Mellon
+University and supported and developed as a product by Transarc
+Corporation (now IBM Pittsburgh Labs). It offers a client-server
+architecture for file sharing, providing location independence,
+scalability and transparent migration capabilities for data. IBM
+branched the source of the AFS product, and made a copy of the source
+available for community development and maintenance. They called the
+release OpenAFS.
diff --git a/filesystems/openafs/Makefile b/filesystems/openafs/Makefile
new file mode 100644
index 00000000000..03a0ca2d049
--- /dev/null
+++ b/filesystems/openafs/Makefile
@@ -0,0 +1,57 @@
+# $NetBSD: Makefile,v 1.1 2012/08/30 17:37:55 jakllsch Exp $
+
+DISTNAME= openafs-1.4.14-src
+PKGNAME= ${DISTNAME:C/-src//}
+CATEGORIES= filesystems net sysutils
+MASTER_SITES= http://www.openafs.org/dl/openafs/1.4.14/
+EXTRACT_SUFX= .tar.bz2
+
+MAINTAINER= gendalia@NetBSD.org
+HOMEPAGE= http://www.openafs.org/
+COMMENT= File system for sharing, scalability and transparent data migration
+LICENSE= ibm-public-license-1.0
+
+PREV_PKGPATH= net/openafs
+
+PKG_DESTDIR_SUPPORT= user-destdir
+
+CONFLICTS+= arla-[0-9]*
+CONFLICTS+= heimdal-[0-9]*
+CONFLICTS+= lwp-[0-9]*
+CONFLICTS+= rx-[0-9]*
+
+MAKE_JOBS_SAFE=no
+
+GNU_CONFIGURE= yes
+USE_TOOLS+= lex
+RCD_SCRIPTS+= bosserver
+
+.include "options.mk"
+
+CONFIGURE_ARGS+= --localstatedir=${VARBASE:Q}
+CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR:Q}
+
+USE_GNU_CONFIGURE_HOST= no
+
+WRKSRC= ${WRKDIR}/${PKGNAME_NOREV}
+
+PLIST_SRC+= ${.CURDIR}/PLIST
+OWN_DIRS+= ${PKG_SYSCONFDIR}/openafs
+OWN_DIRS_PERMS+= ${PKG_SYSCONFDIR}/openafs/server ${ROOT_USER} ${ROOT_GROUP} 775
+OWN_DIRS_PERMS+= ${VARBASE}/openafs ${ROOT_USER} ${ROOT_GROUP} 770
+OWN_DIRS+= ${VARBASE}/openafs/logs
+OWN_DIRS_PERMS+= ${VARBASE}/openafs/db ${ROOT_USER} ${ROOT_GROUP} 700
+
+FILES_SUBST+= HOSTNAME_CMD=${HOSTNAME_CMD:Q}
+
+BUILD_DEFS+= VARBASE
+
+# attempt to future-proof configuration
+pre-build:
+ cd ${WRKSRC}/src/config && for i in 50 60 70 80 90; do \
+ ${SED} -e 's|nbsd40|nbsd'$$i'|g' param.i386_nbsd40.h > param.i386_nbsd$$i.h; \
+ ${SED} -e 's|nbsd40|nbsd'$$i'|g' param.amd64_nbsd40.h > param.amd64_nbsd$$i.h; \
+ ${CP} param.nbsd40.h param.nbsd$$i.h; \
+ done
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/filesystems/openafs/PLIST b/filesystems/openafs/PLIST
new file mode 100644
index 00000000000..a76a1719b2d
--- /dev/null
+++ b/filesystems/openafs/PLIST
@@ -0,0 +1,238 @@
+@comment $NetBSD: PLIST,v 1.1 2012/08/30 17:37:55 jakllsch Exp $
+bin/afs_compile_et
+bin/afsmonitor
+bin/bos
+bin/cmdebug
+bin/dlog
+bin/dpass
+bin/fs
+bin/klog
+bin/klog.krb
+bin/knfs
+bin/kpasswd
+bin/kpwvalid
+bin/livesys
+bin/pagsh
+bin/pagsh.krb
+bin/pts
+bin/rxgen
+bin/scout
+bin/sys
+bin/tokens
+bin/tokens.krb
+bin/translate_et
+bin/udebug
+bin/unlog
+bin/up
+bin/xstat_cm_test
+bin/xstat_fs_test
+include/afs/acl.h
+include/afs/afs.h
+include/afs/afs_args.h
+include/afs/afs_atomlist.h
+include/afs/afs_lhash.h
+include/afs/afs_stats.h
+include/afs/afs_sysnames.h
+include/afs/afscbint.h
+include/afs/afsint.h
+include/afs/afssyscalls.h
+include/afs/afsutil.h
+include/afs/afsutil_prototypes.h
+include/afs/assert.h
+include/afs/audit.h
+include/afs/auth.h
+include/afs/bnode.h
+include/afs/bosint.h
+include/afs/bubasics.h
+include/afs/budb.h
+include/afs/budb_client.h
+include/afs/budb_errs.h
+include/afs/bumon.h
+include/afs/butc.h
+include/afs/butm.h
+include/afs/butx.h
+include/afs/cellconfig.h
+include/afs/cmd.h
+include/afs/cnvldb.h
+include/afs/com_err.h
+include/afs/debug.h
+include/afs/dir.h
+include/afs/dirpath.h
+include/afs/error_table.h
+include/afs/errors.h
+include/afs/exporter.h
+include/afs/fileutil.h
+include/afs/fs_stats.h
+include/afs/fsprobe.h
+include/afs/fssync.h
+include/afs/gtxX11win.h
+include/afs/gtxcurseswin.h
+include/afs/gtxdumbwin.h
+include/afs/gtxframe.h
+include/afs/gtxinput.h
+include/afs/gtxkeymap.h
+include/afs/gtxlightobj.h
+include/afs/gtxobjdict.h
+include/afs/gtxobjects.h
+include/afs/gtxtextcb.h
+include/afs/gtxtextobj.h
+include/afs/gtxwindows.h
+include/afs/icl.h
+include/afs/ihandle.h
+include/afs/kaport.h
+include/afs/kauth.h
+include/afs/kautils.h
+include/afs/keys.h
+include/afs/ktc.h
+include/afs/ktime.h
+include/afs/mit-sipb-cr.h
+include/afs/namei_ops.h
+include/afs/netutils.h
+include/afs/nfs.h
+include/afs/nfsclient.h
+include/afs/osi_inode.h
+include/afs/packages.h
+include/afs/param.h
+include/afs/partition.h
+include/afs/prclient.h
+include/afs/prerror.h
+include/afs/print.h
+include/afs/procmgmt.h
+include/afs/prs_fs.h
+include/afs/prserver.h
+include/afs/ptclient.h
+include/afs/pterror.h
+include/afs/pthread_glock.h
+include/afs/pthread_nosigs.h
+include/afs/ptint.h
+include/afs/ptserver.h
+include/afs/ptuser.h
+include/afs/remote.h
+include/afs/rxgen_consts.h
+include/afs/softsig.h
+include/afs/stds.h
+include/afs/sysctl.h
+include/afs/tcdata.h
+include/afs/unified_afs.h
+include/afs/usd.h
+include/afs/venus.h
+include/afs/vice.h
+include/afs/viceinode.h
+include/afs/vl_opcodes.h
+include/afs/vldbint.h
+include/afs/vlserver.h
+include/afs/vnode.h
+include/afs/voldefs.h
+include/afs/volint.h
+include/afs/volser.h
+include/afs/volume.h
+include/afs/xfsattrs.h
+include/afs/xstat_cm.h
+include/afs/xstat_fs.h
+include/des.h
+include/des_conf.h
+include/des_odd.h
+include/des_prototypes.h
+include/lock.h
+include/lwp.h
+include/mit-cpyright.h
+include/potpourri.h
+include/preempt.h
+include/rx/fcrypt.h
+include/rx/rx.h
+include/rx/rx_clock.h
+include/rx/rx_event.h
+include/rx/rx_globals.h
+include/rx/rx_lwp.h
+include/rx/rx_misc.h
+include/rx/rx_multi.h
+include/rx/rx_null.h
+include/rx/rx_packet.h
+include/rx/rx_prototypes.h
+include/rx/rx_pthread.h
+include/rx/rx_queue.h
+include/rx/rx_user.h
+include/rx/rxkad.h
+include/rx/rxkad_prototypes.h
+include/rx/rxstat.h
+include/rx/xdr.h
+include/rx/xdr_prototypes.h
+include/timer.h
+include/ubik.h
+include/ubik_int.h
+lib/afs/libacl.a
+lib/afs/libafsint.a
+lib/afs/libafsutil.a
+lib/afs/libaudit.a
+lib/afs/libauth.a
+lib/afs/libauth.krb.a
+lib/afs/libbos.a
+lib/afs/libbubasics.a
+lib/afs/libbudb.a
+lib/afs/libbutm.a
+lib/afs/libbxdb.a
+lib/afs/libcmd.a
+lib/afs/libcom_err.a
+lib/afs/libdir.a
+lib/afs/libfsprobe.a
+lib/afs/libgtx.a
+lib/afs/libkauth.a
+lib/afs/libkauth.krb.a
+lib/afs/libnull.a
+lib/afs/libprocmgmt.a
+lib/afs/libprot.a
+lib/afs/libsys.a
+lib/afs/libusd.a
+lib/afs/libvldb.a
+lib/afs/libvlib.a
+lib/afs/libvolser.a
+lib/afs/libxstat_cm.a
+lib/afs/libxstat_fs.a
+lib/afs/util.a
+lib/afs/vlib.a
+lib/libafssetpag.so
+lib/libafssetpag.so.1
+lib/libafssetpag.so.1.0
+lib/libdes.a
+lib/liblwp.a
+lib/librx.a
+lib/librxkad.a
+lib/librxstat.a
+lib/libubik.a
+libexec/openafs/buserver
+libexec/openafs/fileserver
+libexec/openafs/kaserver
+libexec/openafs/ptserver
+libexec/openafs/salvager
+libexec/openafs/upclient
+libexec/openafs/upserver
+libexec/openafs/vlserver
+libexec/openafs/volserver
+sbin/afsd
+sbin/backup
+sbin/bos_util
+sbin/bosserver
+sbin/butc
+sbin/fms
+sbin/fstrace
+sbin/kadb_check
+sbin/kas
+sbin/ka-forwarder
+sbin/kdb
+sbin/kdump
+sbin/kpwvalid
+sbin/prdb_check
+sbin/pt_util
+sbin/read_tape
+sbin/restorevol
+sbin/rmtsysd
+sbin/rxdebug
+sbin/uss
+sbin/vldb_check
+sbin/vldb_convert
+sbin/voldump
+sbin/volinfo
+sbin/vos
+sbin/vsys
+share/examples/rc.d/bosserver
+@pkgdir lib/openafs
diff --git a/filesystems/openafs/PLIST.pam b/filesystems/openafs/PLIST.pam
new file mode 100644
index 00000000000..0472102b2cc
--- /dev/null
+++ b/filesystems/openafs/PLIST.pam
@@ -0,0 +1,3 @@
+@comment $NetBSD: PLIST.pam,v 1.1 2012/08/30 17:37:55 jakllsch Exp $
+lib/pam_afs.krb.so.1
+lib/pam_afs.so.1
diff --git a/filesystems/openafs/distinfo b/filesystems/openafs/distinfo
new file mode 100644
index 00000000000..e4d85f23256
--- /dev/null
+++ b/filesystems/openafs/distinfo
@@ -0,0 +1,10 @@
+$NetBSD: distinfo,v 1.1 2012/08/30 17:37:55 jakllsch Exp $
+
+SHA1 (openafs-1.4.14-src.tar.bz2) = 2b4e7c839bbf8f577fdd4831e7a3b3ebb9c41926
+RMD160 (openafs-1.4.14-src.tar.bz2) = ecc038d7f9068d420cf1c94f9c01db5ecd1accac
+Size (openafs-1.4.14-src.tar.bz2) = 11813993 bytes
+SHA1 (patch-aa) = 3dde7848f9773fd8398156149368748146564eee
+SHA1 (patch-src_afsd_afsd.c) = ccc518675fc4b4fa594bb6b3a9f2c36e03df2ea6
+SHA1 (patch-src_comerr_Makefile.in) = f325c813dab0dc62592abead6d112ce15df086c9
+SHA1 (patch-src_config_param.nbsd30.h) = 64bbe81ef7208b6e3f70af4eddcb9d535e8a9c34
+SHA1 (patch-src_config_param.nbsd40.h) = ddfb69d2255629946e6df8416e6e2fcbfc0ffabb
diff --git a/filesystems/openafs/files/bosserver.sh b/filesystems/openafs/files/bosserver.sh
new file mode 100644
index 00000000000..88b80877775
--- /dev/null
+++ b/filesystems/openafs/files/bosserver.sh
@@ -0,0 +1,19 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: bosserver.sh,v 1.1 2012/08/30 17:37:55 jakllsch Exp $
+#
+# PROVIDE: bosserver
+# BEFORE: arlad
+# REQUIRE: NETWORK
+
+. /etc/rc.subr
+
+name="bosserver"
+rcvar=$name
+hostname=`@HOSTNAME_CMD@`
+command="@PREFIX@/sbin/$name"
+start_precmd="ulimit -S -d 1048576;ulimit -S -c unlimited"
+stop_precmd="@PREFIX@/bin/bos shutdown $hostname -local -wait"
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/filesystems/openafs/options.mk b/filesystems/openafs/options.mk
new file mode 100644
index 00000000000..918f46320ce
--- /dev/null
+++ b/filesystems/openafs/options.mk
@@ -0,0 +1,45 @@
+# $NetBSD: options.mk,v 1.1 2012/08/30 17:37:55 jakllsch Exp $
+
+.include "../../mk/bsd.prefs.mk"
+
+PKG_OPTIONS_VAR= PKG_OPTIONS.openafs
+PKG_SUPPORTED_OPTIONS+= server bitmap-later bos-new-config fast-restart
+PKG_SUPPORTED_OPTIONS+= largefile kernel-module supergroups namei
+.if ${MACHINE_ARCH} != "x86_64"
+PKG_SUPPORTED_OPTIONS+= pam
+.endif
+PKG_SUGGESTED_OPTIONS= server bitmap-later bos-new-config fast-restart
+PKG_SUGGESTED_OPTIONS+= namei largefile -kernel-module supergroups
+
+.include "../../mk/bsd.options.mk"
+
+.if !empty(PKG_OPTIONS:Msupergroups)
+CONFIGURE_ARGS+= --enable-supergroups
+.endif
+.if !empty(PKG_OPTIONS:Mbitmap-later)
+CONFIGURE_ARGS+= --enable-bitmap-later
+.endif
+.if !empty(PKG_OPTIONS:Mbos-new-config)
+CONFIGURE_ARGS+= --enable-bos-new-config
+.endif
+.if !empty(PKG_OPTIONS:Mfast-restart)
+CONFIGURE_ARGS+= --enable-fast-restart
+.endif
+.if !empty(PKG_OPTIONS:Mlargefile)
+CONFIGURE_ARGS+= --enable-largefile-fileserver
+.endif
+.if !empty(PKG_OPTIONS:Mkernel-module)
+CONFIGURE_ARGS+= --enable-kernel-module
+.else
+CONFIGURE_ARGS+= --disable-kernel-module
+.endif
+.if !empty(PKG_OPTIONS:Mnamei)
+CONFIGURE_ARGS+= --enable-namei-fileserver
+.endif
+.if !empty(PKG_OPTIONS:Mpam)
+CONFIGURE_ARGS+= --enable-pam
+.include "../../mk/pam.buildlink3.mk"
+PLIST_SRC+= ${.CURDIR}/PLIST.pam
+.else
+CONFIGURE_ARGS+= --disable-pam
+.endif
diff --git a/filesystems/openafs/patches/patch-aa b/filesystems/openafs/patches/patch-aa
new file mode 100644
index 00000000000..592402654d4
--- /dev/null
+++ b/filesystems/openafs/patches/patch-aa
@@ -0,0 +1,61 @@
+$NetBSD: patch-aa,v 1.1 2012/08/30 17:37:55 jakllsch Exp $
+
+--- configure.orig 2010-12-17 16:06:16.000000000 +0000
++++ configure
+@@ -5999,6 +5999,22 @@ echo $ECHO_N "checking your AFS sysname.
+ AFS_PARAM_COMMON=param.nbsd40.h
+ AFS_SYSNAME="i386_nbsd40"
+ ;;
++ i?86-*-netbsd*5.[0-8]*)
++ AFS_PARAM_COMMON=param.nbsd50.h
++ AFS_SYSNAME="i386_nbsd50"
++ ;;
++ x86_64-*-netbsd*5.[0-8]*)
++ AFS_PARAM_COMMON=param.nbsd50.h
++ AFS_SYSNAME="amd64_nbsd50"
++ ;;
++ i?86-*-netbsd*5.99*)
++ AFS_PARAM_COMMON=param.nbsd60.h
++ AFS_SYSNAME="i386_nbsd60"
++ ;;
++ x86_64-*-netbsd*5.99*)
++ AFS_PARAM_COMMON=param.nbsd60.h
++ AFS_SYSNAME="amd64_nbsd60"
++ ;;
+ hppa*-hp-hpux11.0*)
+ AFS_SYSNAME="hp_ux110"
+ ;;
+@@ -24555,7 +24571,7 @@ case $AFS_SYSNAME in
+ YACC="byacc"
+ ;;
+
+- *nbsd2*|*nbsd3*|*nbsd4*)
++ *nbsd2*|*nbsd3*|*nbsd4*|*nbsd5*|*nbsd6*)
+ LEX="flex -l"
+ MT_CFLAGS='${XCFLAGS} -DAFS_PTHREAD_ENV -D_REENTRANT '
+ MT_LIBS="-lpthread" # XXX -pthread soon
+@@ -24563,7 +24579,14 @@ case $AFS_SYSNAME in
+ SHLIB_LDFLAGS="-shared -Xlinker -x"
+ SHLIB_LINKER="${MT_CC} -shared"
+ TXLIBS="/usr/lib/libcurses.so"
+- XCFLAGS="-O2 -pipe"
++ case $AFS_SYSNAME in
++ amd64_nbsd*)
++ XCFLAGS="-O2 -pipe -fPIC"
++ ;;
++ *_nbsd*)
++ XCFLAGS="-O2 -pipe"
++ ;;
++ esac
+ YACC="yacc"
+ ;;
+
+@@ -25490,6 +25513,8 @@ if test "x$enable_optimize_lwp" = "xno";
+ LWP_OPTMZ=
+ fi
+
++XCFLAGS="${XCFLAGS} ${CFLAGS}"
++
+ if test "x$enable_strip_binaries" != "xno"; then
+ if test "x$enable_strip_binaries" = "xmaybe" -a "x$enable_debug" = "xyes"; then
+ NO_STRIP_BIN=-ns
diff --git a/filesystems/openafs/patches/patch-src_afsd_afsd.c b/filesystems/openafs/patches/patch-src_afsd_afsd.c
new file mode 100644
index 00000000000..13ae39e9e12
--- /dev/null
+++ b/filesystems/openafs/patches/patch-src_afsd_afsd.c
@@ -0,0 +1,17 @@
+$NetBSD: patch-src_afsd_afsd.c,v 1.1 2012/08/30 17:37:55 jakllsch Exp $
+
+--- src/afsd/afsd.c.orig 2010-12-17 15:58:42.000000000 +0000
++++ src/afsd/afsd.c
+@@ -2382,8 +2382,12 @@ mainproc(struct cmd_syndesc *as, void *a
+ if ((mount("AFS", cacheMountDir, MOUNT_AFS, 0, NULL)) < 0) {
+ #else
+ /* This is the standard mount used by the suns and rts */
++#if defined(__NetBSD__) && __NetBSD_Prereq__(4,99,24)
++ if (1) {
++#else
+ if ((mount(MOUNT_AFS, cacheMountDir, mountFlags, (caddr_t) 0)) < 0) {
+ #endif
++#endif
+ printf("%s: Can't mount AFS on %s(%d)\n", rn, cacheMountDir,
+ errno);
+ exit(1);
diff --git a/filesystems/openafs/patches/patch-src_comerr_Makefile.in b/filesystems/openafs/patches/patch-src_comerr_Makefile.in
new file mode 100644
index 00000000000..beb5a5783fa
--- /dev/null
+++ b/filesystems/openafs/patches/patch-src_comerr_Makefile.in
@@ -0,0 +1,13 @@
+$NetBSD: patch-src_comerr_Makefile.in,v 1.1 2012/08/30 17:37:55 jakllsch Exp $
+
+--- src/comerr/Makefile.in.orig 2010-12-17 15:58:42.000000000 +0000
++++ src/comerr/Makefile.in
+@@ -11,7 +11,7 @@ all: compile_et ${TOP_INCDIR}/afs/com_er
+
+ et_lex.lex.c: et_lex.lex.l
+ $(RM) -f et_lex.lex.c
+- $(LEX) -t $(srcdir)/et_lex.lex.l > et_lex.lex.c
++ $(LEX) -l -t $(srcdir)/et_lex.lex.l > et_lex.lex.c
+
+ compile_et: compile_et.o error_table.o
+ case $(SYS_NAME) in \
diff --git a/filesystems/openafs/patches/patch-src_config_param.nbsd30.h b/filesystems/openafs/patches/patch-src_config_param.nbsd30.h
new file mode 100644
index 00000000000..3d0b79169a3
--- /dev/null
+++ b/filesystems/openafs/patches/patch-src_config_param.nbsd30.h
@@ -0,0 +1,12 @@
+$NetBSD: patch-src_config_param.nbsd30.h,v 1.1 2012/08/30 17:37:55 jakllsch Exp $
+
+--- src/config/param.nbsd30.h.orig 2010-12-17 15:58:42.000000000 +0000
++++ src/config/param.nbsd30.h
+@@ -23,7 +23,6 @@
+ #define AFS_NBSD20_ENV 1
+ #define AFS_NBSD30_ENV 1
+ #define AFS_NONFSTRANS 1
+-#define AFS_KERBEROS_ENV 1
+
+ #define AFS_VFSINCL_ENV 1
+
diff --git a/filesystems/openafs/patches/patch-src_config_param.nbsd40.h b/filesystems/openafs/patches/patch-src_config_param.nbsd40.h
new file mode 100644
index 00000000000..84649616e10
--- /dev/null
+++ b/filesystems/openafs/patches/patch-src_config_param.nbsd40.h
@@ -0,0 +1,12 @@
+$NetBSD: patch-src_config_param.nbsd40.h,v 1.1 2012/08/30 17:37:55 jakllsch Exp $
+
+--- src/config/param.nbsd40.h.orig 2010-12-17 15:58:42.000000000 +0000
++++ src/config/param.nbsd40.h
+@@ -24,7 +24,6 @@
+ #define AFS_NBSD30_ENV 1
+ #define AFS_NBSD40_ENV 1
+ #define AFS_NONFSTRANS 1
+-#define AFS_KERBEROS_ENV 1
+
+ #define AFS_VFSINCL_ENV 1
+