Index: Makefile
===================================================================
--- Makefile	(revision 350348)
+++ Makefile	(working copy)
@@ -11,7 +11,7 @@
 MAINTAINER=		umq@ueo.co.jp
 COMMENT=		DKIM library and milter implementation
 
-LICENSE=		BSD SENDMAIL
+LICENSE=		BSD3CLAUSE SENDMAIL
 LICENSE_COMB=		multi
 
 LICENSE_FILE_SENDMAIL=	${WRKSRC}/LICENSE.Sendmail
@@ -21,18 +21,17 @@
 
 GNU_CONFIGURE=	yes
 NO_OPTIONS_SORT=yes
-USES=		pkgconfig:build
+USES=		pkgconfig:build shebangfix
+SHEBANG_FILES=	opendkim/opendkim-genkey* reputation/opendkim-* stats/opendkim-*
 USE_OPENSSL=	yes
 USE_LDCONFIG=	yes
 
-MAN8=		opendkim-genkey.8 opendkim-genzone.8 opendkim-testadsp.8 \
-		opendkim-testkey.8 opendkim-testmsg.8
 PORTDOCS=	*
 
 OPTIONS_SINGLE=		RESOLV
 OPTIONS_SINGLE_RESOLV=	STOCK_RESOLVER UNBOUND
 OPTIONS_DEFINE=		FILTER GNUTLS LUA MEMCACHED BDB_BASE OPENDBX OPENLDAP \
-			POPAUTH QUERY_CACHE STATS
+			POPAUTH QUERY_CACHE STATS DEBUG
 OPTIONS_DEFAULT=	FILTER LUA UNBOUND
 
 STOCK_RESOLVER_DESC=	Use the stock resolver library
@@ -47,17 +46,15 @@
 POPAUTH_DESC=		Use POP authentication DB
 QUERY_CACHE_DESC=	Cache DNS query results locally
 STATS_DESC=		Setup statistics tools
+DEBUG_DESC=		Build with debug symbols
 
 MAKE_ARGS+=	pkgconfigdir="${PREFIX}/libdata/pkgconfig"
 
-NO_STAGE=	yes
 .include "${.CURDIR}/Makefile.options"
 .include <bsd.port.options.mk>
 
 .if ${PORT_OPTIONS:MFILTER}
 USE_RC_SUBR=		milter-opendkim
-MAN5+=			opendkim.conf.5
-MAN8+=			opendkim.8
 PLIST_SUB+=		FILTER=""
 SUB_FILES=		pkg-message
 WITHOUT_MILTER_CFLAGS=	yes
@@ -70,7 +67,7 @@
 .endif
 
 .if ${PORT_OPTIONS:MGNUTLS}
-LIB_DEPENDS+=		gnutls:${PORTSDIR}/security/gnutls
+LIB_DEPENDS+=		libgnutls.so:${PORTSDIR}/security/gnutls
 CONFIGURE_ARGS+=	--with-gnutls=${LOCALBASE}
 .else
 CONFIGURE_ARGS+=	--with-openssl=${OPENSSLBASE}
@@ -88,12 +85,6 @@
 
 .if ${PORT_OPTIONS:MSTATS}
 CONFIGURE_ARGS+=	--enable-stats
-MAN8+=			opendkim-expire.8 opendkim-gengraphs.8 \
-			opendkim-genstats.8 opendkim-stats.8
-. if ${PORT_OPTIONS:MOPENDBX}
-MAN1+=			opendkim-spam.1
-MAN8+=			opendkim-importstats.8
-. endif
 PLIST_SUB+=		STATS=""
 .else
 PLIST_SUB+=		STATS="@comment "
@@ -114,7 +105,7 @@
 .endif
 .if ${PORT_OPTIONS:MUNBOUND}
 CONFIGURE_ARGS+=	--with-unbound
-LIB_DEPENDS+=		unbound:${PORTSDIR}/dns/unbound
+LIB_DEPENDS+=		libunbound.so:${PORTSDIR}/dns/unbound
 .endif
 .if ${PORT_OPTIONS:MPOPAUTH}
 CONFIGURE_ARGS+=	--enable-popauth
@@ -124,13 +115,13 @@
 .endif
 .if ${PORT_OPTIONS:MMEMCACHED}
 CONFIGURE_ARGS+=	--with-libmemcached
-LIB_DEPENDS+=		memcached:${PORTSDIR}/databases/libmemcached
+LIB_DEPENDS+=		libmemcached.so:${PORTSDIR}/databases/libmemcached
 .else
 CONFIGURE_ARGS+=	--without-libmemcached
 .endif
 .if ${PORT_OPTIONS:MOPENDBX}
 CONFIGURE_ARGS+=	--with-odbx
-LIB_DEPENDS+=		opendbx:${PORTSDIR}/databases/opendbx
+LIB_DEPENDS+=		libopendbx.so:${PORTSDIR}/databases/opendbx
 PLIST_SUB+=		ODBX=""
 .else
 CONFIGURE_ARGS+=	--without-odbx
@@ -138,7 +129,7 @@
 .endif
 .if ${PORT_OPTIONS:MOPENLDAP}
 CONFIGURE_ARGS+=	--with-openldap
-LIB_DEPENDS+=		ldap:${PORTSDIR}/net/openldap24-sasl-client
+LIB_DEPENDS+=		libldap.so:${PORTSDIR}/net/openldap24-sasl-client
 USE_OPENLDAP=		yes
 .else
 CONFIGURE_ARGS+=	--without-openldap
@@ -145,10 +136,6 @@
 .endif
 .if ${PORT_OPTIONS:MLUA}
 CONFIGURE_ARGS+=	--with-lua
-. if ${PORT_OPTIONS:MFILTER}
-MAN3+=			opendkim-lua.3
-. endif
-MAN8+=			miltertest.8
 PLIST_SUB+=		LUA=""
 USE_LUA=		5.1
 .else
@@ -169,13 +156,10 @@
 
 post-install:
 .if ! ${PORT_OPTIONS:MDEBUG} && ${PORT_OPTIONS:MFILTER}
-	@${STRIP_CMD} ${PREFIX}/sbin/opendkim
+	@${STRIP_CMD} ${STAGEDIR}${PREFIX}/sbin/opendkim
 .endif
-	@${MKDIR} ${PREFIX}/etc/mail
-	${INSTALL_DATA} ${WRKSRC}/opendkim/opendkim.conf.sample ${PREFIX}/etc/mail/
-.if ${PORT_OPTIONS:MFILTER}
-	@${CAT} ${PKGMESSAGE}
-.endif
+	@${MKDIR} ${STAGEDIR}${PREFIX}/etc/mail
+	${INSTALL_DATA} ${WRKSRC}/opendkim/opendkim.conf.sample ${STAGEDIR}${PREFIX}/etc/mail/
 
 regression-test: build
 	cd ${WRKSRC} ; ${MAKE} check
Index: pkg-plist
===================================================================
--- pkg-plist	(revision 350348)
+++ pkg-plist	(working copy)
@@ -68,3 +68,18 @@
 @dirrm include/opendkim
 %%DKIMREP%%@dirrm include/dkim-rep
 @dirrmtry etc/mail
+%%FILTER%%man/man5/opendkim.conf.5.gz
+%%LUA%%man/man8/miltertest.8.gz
+man/man8/opendkim-genkey.8.gz
+man/man8/opendkim-genzone.8.gz
+man/man8/opendkim-testadsp.8.gz
+man/man8/opendkim-testkey.8.gz
+man/man8/opendkim-testmsg.8.gz
+%%FILTER%%man/man8/opendkim.8.gz
+%%LUA%%%%FILTER%%man/man3/opendkim-lua.3.gz
+%%STATS%%man/man8/opendkim-expire.8.gz
+%%STATS%%man/man8/opendkim-gengraphs.8.gz
+%%STATS%%man/man8/opendkim-genstats.8.gz
+%%STATS%%man/man8/opendkim-stats.8.gz
+%%STATS%%%%ODBX%%man/man1/opendkim-spam.1.gz
+%%STATS%%%%ODBX%%man/man8/opendkim-importstats.8.gz