diff -ruN /usr/ports/audio/portaudio2/Makefile ./portaudio2/Makefile
--- /usr/ports/audio/portaudio2/Makefile	2012-12-05 00:40:59.000000000 +0100
+++ ./portaudio2/Makefile	2012-12-30 22:53:43.000000000 +0100
@@ -6,44 +6,95 @@
 #
 
 PORTNAME=	portaudio
-DISTVERSION=	19_20071207
+PORTVERSION=	19.20111121
 CATEGORIES=	audio
 MASTER_SITES=	http://www.portaudio.com/archives/
-DISTNAME=	pa_stable_v${DISTVERSION}
+DISTNAME=	pa_stable_v${DISTVERSION:S/./_/}
+EXTRACT_SUFX=	.tgz
 
-MAINTAINER=	ports@FreeBSD.org
+MAINTAINER=	nemysis@gmx.ch
 COMMENT=	Portable cross-platform Audio API
 
-USE_GMAKE=	yes
-GNU_CONFIGURE=	yes
-CONFIGURE_ARGS=	--without-alsa	\
-		--libdir=${PREFIX}/lib/${PORTNAME}2 --includedir=${PREFIX}/include/${PORTNAME}2
-CONFIGURE_TARGET=	--build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
-USE_LDCONFIG=	${PREFIX}/lib/${PORTNAME}2
+LICENSE=	MIT
 
-LATEST_LINK=	${PORTNAME}2
 WRKSRC=		${WRKDIR}/${PORTNAME}
 
-.include <bsd.port.pre.mk>
+GNU_CONFIGURE=	yes
+CONFIGURE_ARGS+=PKG_CONFIG_LIBDIR=${PREFIX}/libdata/pkgconfig \
+			--without-alsa \
+			--libdir=${PREFIX}/lib/${PORTNAME}2 \
+			--includedir=${PREFIX}/include/${PORTNAME}2
+
+USE_GMAKE=	yes
+USE_DOS2UNIX=	yes
+USE_PKGCONFIG=	build
+USE_LDCONFIG=	yes
+
+CPPFLAGS+=	-I${LOCALBASE}/include ${PTHREAD_CFLAGS}
+LDFLAGS+=	-L${LOCALBASE}/lib ${PTHREAD_LIBS}
+
+PORTDOCS=	*
+
+DOCSDIR=	${PREFIX}/share/doc/${PORTNAME}2
+
+DOCSRCDIR1=	${WRKSRC}
+DOC_FILES1=	README.txt index.html
+
+OPTIONS_DEFINE=	JACK PATEST DOXYGEN
+
+OPTIONS_DEFAULT=	PATEST DOXYGEN
+
+PATEST_DESC=	PortAudio Test Programs
 
-.if exists(${LOCALBASE}/lib/libjack.so)
-WITH_JACK=	yes
+.include <bsd.port.options.mk>
+
+.if ${PORT_OPTIONS:MDOXYGEN}
+BUILD_DEPENDS+=	doxygen:${PORTSDIR}/devel/doxygen
+.endif
+
+.if ${PORT_OPTIONS:MJACK}
+CONFIGURE_ARGS+=--with-jack
+LIB_DEPENDS+=	jack:${PORTSDIR}/audio/jack
+.else
+CONFIGURE_ARGS+=--without-jack
 .endif
-.if !defined(WITH_JACK)
-CONFIGURE_ARGS+=	--without-jack
+
+.if defined(WITH_PATEST)
+PLIST_SUB+=	PATEST=""
 .else
-# Avoid a circular dependency
-CONFIGURE_ARGS+=	--with-jack
-#LIB_DEPENDS+=	jack.0:${PORTSDIR}/audio/jack
+PLIST_SUB+=	PATEST="@comment "
+.endif
+
+post-patch:
+	@${REINPLACE_CMD} -e 's|#include <malloc.h>|#include <stdlib.h>|' ${WRKSRC}/ltmain.sh
+	@${REINPLACE_CMD} -e 's|machine/soundcard.h|sys/soundcard.h|' ${WRKSRC}/configure.in \
+		${WRKSRC}/src/hostapi/oss/pa_unix_oss.c ${WRKSRC}/src/SConscript
+	@${REINPLACE_CMD} -e 's|PACKAGE_NAME=|PACKAGE_NAME=portaudio2|' ${WRKSRC}/configure
+	@${REINPLACE_CMD} -e 's|$$(DESTDIR)$$(libdir)/pkgconfig|$$(prefix)/libdata/pkgconfig|g' \
+		${WRKSRC}/Makefile.in
+
+post-install:
+.if ${PORT_OPTIONS:MPATEST}
+	@(cd ${WRKSRC}/bin && for i in *; do ${MV} "$$i" "$${i}"-2; done)
+#.for i in ${WRKSRC}/bin/*
+#	${MV} $i $i-2
+#	${MV} "$$i" "$$i"-2
+#.endfor
+	${INSTALL_SCRIPT} ${WRKSRC}/bin/* ${PREFIX}/bin
+.endif
+
+.if ${PORT_OPTIONS:MDOCS}
+	${MKDIR} ${DOCSDIR}
+	${INSTALL_DATA} ${DOC_FILES1:S|^|${DOCSRCDIR1}/|} ${DOCSDIR}
 .endif
 
-pre-configure:
-# replace obsolete headers, and fix up thread library
-	${FIND} ${WRKSRC} -type f \
-		| ${XARGS} -x -n 10 \
-			${REINPLACE_CMD} -E \
-				-e 's|malloc.h|stdlib.h|' \
-				-e 's|-lpthread|${PTHREAD_LIBS}|'
-	${REINPLACE_CMD} -e '/pkgconfig/s|$$[(]libdir[)]|${PREFIX}/libdata|' ${WRKSRC}/Makefile.in
+.if ${PORT_OPTIONS:MDOXYGEN}
+	@cd ${WRKSRC} && doxygen
+	@(cd ${WRKSRC}/doc && ${COPYTREE_SHARE} html ${DOCSDIR})
+.endif
+
+.if ${PORT_OPTIONS:MEXAMPLES}
+	@cd ${WRKSRC}/examples && ${COPYTREE_SHARE} \* ${EXAMPLESDIR}
+.endif
 
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
diff -ruN /usr/ports/audio/portaudio2/distinfo ./portaudio2/distinfo
--- /usr/ports/audio/portaudio2/distinfo	2012-12-05 00:40:59.000000000 +0100
+++ ./portaudio2/distinfo	2012-12-22 15:29:25.000000000 +0100
@@ -1,2 +1,2 @@
-SHA256 (pa_stable_v19_20071207.tar.gz) = 06a17727d56d382a69036de2ed9aee9a15cac0329b995b8cfcd69b357f47bf2b
-SIZE (pa_stable_v19_20071207.tar.gz) = 1113282
+SHA256 (pa_stable_v19_20111121.tgz) = 9c26d1330d506496789edafe55b0386f20d83c4aa2c0e3f81fbeb0f114ab1b99
+SIZE (pa_stable_v19_20111121.tgz) = 1422825
diff -ruN /usr/ports/audio/portaudio2/pkg-descr ./portaudio2/pkg-descr
--- /usr/ports/audio/portaudio2/pkg-descr	2012-12-05 00:40:59.000000000 +0100
+++ ./portaudio2/pkg-descr	2012-10-09 19:05:26.000000000 +0200
@@ -1,9 +1,12 @@
-PortAudio is a free, cross platform, open-source, audio I/O library.
-It lets you write simple audio programs in 'C' that will compile
-and run on many platforms including Windows, Macintosh (8,9,X),
-Unix (OSS), SGI, and BeOS. PortAudio is intended to promote the
-exchange of audio synthesis software between developers on different
-platforms, and was recently selected as the audio component of a
-larger PortMusic project that includes MIDI and sound file support.
+PortAudio is a free, cross-platform, open-source, audio I/O library.
+It lets you write simple audio programs in 'C' or C++ that will compile and run
+on many platforms including Windows, Macintosh OS X, and Unix (OSS/ALSA).
+It is intended to promote the exchange of audio software between developers
+on different platforms. Many applications use PortAudio for Audio I/O.
+
+PortAudio provides a very simple API for recording and/or playing sound using
+a simple callback function or a blocking read/write interface.
+Example programs are included that play sine waves, process audio input
+(guitar fuzz), record and playback audio, list available audio devices, etc.
 
 WWW: http://www.portaudio.com/
diff -ruN /usr/ports/audio/portaudio2/pkg-plist ./portaudio2/pkg-plist
--- /usr/ports/audio/portaudio2/pkg-plist	2012-12-05 00:40:59.000000000 +0100
+++ ./portaudio2/pkg-plist	2012-12-30 20:29:13.000000000 +0100
@@ -1,8 +1,63 @@
+%%PATEST%%bin/pa_devs-2
+%%PATEST%%bin/pa_fuzz-2
+%%PATEST%%bin/pa_minlat-2
+%%PATEST%%bin/paex_pink-2
+%%PATEST%%bin/paex_read_write_wire-2
+%%PATEST%%bin/paex_record-2
+%%PATEST%%bin/paex_saw-2
+%%PATEST%%bin/paex_sine-2
+%%PATEST%%bin/paex_write_sine-2
+%%PATEST%%bin/paex_write_sine_nonint-2
+%%PATEST%%bin/paqa_devs-2
+%%PATEST%%bin/paqa_errs-2
+%%PATEST%%bin/paqa_latency-2
+%%PATEST%%bin/patest1-2
+%%PATEST%%bin/patest_buffer-2
+%%PATEST%%bin/patest_callbackstop-2
+%%PATEST%%bin/patest_clip-2
+%%PATEST%%bin/patest_dither-2
+%%PATEST%%bin/patest_hang-2
+%%PATEST%%bin/patest_in_overflow-2
+%%PATEST%%bin/patest_latency-2
+%%PATEST%%bin/patest_leftright-2
+%%PATEST%%bin/patest_longsine-2
+%%PATEST%%bin/patest_many-2
+%%PATEST%%bin/patest_maxsines-2
+%%PATEST%%bin/patest_mono-2
+%%PATEST%%bin/patest_multi_sine-2
+%%PATEST%%bin/patest_out_underflow-2
+%%PATEST%%bin/patest_prime-2
+%%PATEST%%bin/patest_ringmix-2
+%%PATEST%%bin/patest_sine8-2
+%%PATEST%%bin/patest_sine_channelmaps-2
+%%PATEST%%bin/patest_sine_formats-2
+%%PATEST%%bin/patest_sine_srate-2
+%%PATEST%%bin/patest_sine_time-2
+%%PATEST%%bin/patest_start_stop-2
+%%PATEST%%bin/patest_stop-2
+%%PATEST%%bin/patest_stop_playout-2
+%%PATEST%%bin/patest_toomanysines-2
+%%PATEST%%bin/patest_two_rates-2
+%%PATEST%%bin/patest_underflow-2
+%%PATEST%%bin/patest_wire-2
 include/portaudio2/portaudio.h
 lib/portaudio2/libportaudio.a
 lib/portaudio2/libportaudio.la
 lib/portaudio2/libportaudio.so
 lib/portaudio2/libportaudio.so.2
 libdata/pkgconfig/portaudio-2.0.pc
-@dirrm include/portaudio2
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/pa_devs.c
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/pa_fuzz.c
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/paex_mono_asio_channel_select.c
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/paex_pink.c
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/paex_read_write_wire.c
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/paex_record.c
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/paex_saw.c
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/paex_sine.c
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/paex_wmme_ac3.c
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/paex_wmme_surround.c
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/paex_write_sine.c
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/paex_write_sine_nonint.c
+%%PORTEXAMPLES%%@dirrm %%EXAMPLESDIR%%
 @dirrm lib/portaudio2
+@dirrm include/portaudio2