Index: Makefile
===================================================================
--- Makefile	(revision 351202)
+++ Makefile	(working copy)
@@ -3,7 +3,7 @@
 
 PORTNAME=	passenger
 PORTVERSION=	4.0.41
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	www rubygems
 MASTER_SITES=	RG
 PKGNAMEPREFIX=	rubygem-
@@ -11,6 +11,8 @@
 MAINTAINER=	osa@FreeBSD.org
 COMMENT=	Modules for running Ruby on Rails and Rack applications
 
+LICENSE=	MIT
+
 OPTIONS_DEFINE=	DEBUG SYMLINK
 OPTIONS_SINGLE=	SERVER
 OPTIONS_SINGLE_SERVER=	APACHE22 NGINX
@@ -39,9 +41,9 @@
 .endif
 .endif
 
-LIB_DEPENDS+=	eio:${PORTSDIR}/devel/libeio \
-		ev:${PORTSDIR}/devel/libev \
-		curl:${PORTSDIR}/ftp/curl
+LIB_DEPENDS+=	libeio.so:${PORTSDIR}/devel/libeio \
+		libev.so:${PORTSDIR}/devel/libev \
+		libcurl.so:${PORTSDIR}/ftp/curl
 BUILD_DEPENDS+=	rubygem-fastthread>=1.0.1:${PORTSDIR}/devel/rubygem-fastthread \
 		rubygem-rack>=0:${PORTSDIR}/www/rubygem-rack \
 		rubygem-daemon_controller>=1.2.0:${PORTSDIR}/devel/rubygem-daemon_controller
@@ -48,7 +50,13 @@
 RUN_DEPENDS:=	${BUILD_DEPENDS}
 
 SUB_LIST+=	GEM_LIB_DIR=${GEM_LIB_DIR} RUBY=${RUBY}
-SUB_FILES=	pkg-message
+.if ${PORT_OPTIONS:MNGINX}
+SUB_FILES+=	pkg-message-nginx
+PKGMESSAGE=	pkg-message-nginx
+.elif defined(WITH_APACHEPORT)
+SUB_FILES+=	pkg-message-apache
+PKGMESSAGE=	pkg-message-apache
+.endif
 
 PLIST_FILES=	bin/passenger \
 		bin/passenger-config \
@@ -101,19 +109,25 @@
 		's!-lpthread!${PTHREAD_LIBS}!g' \
 		${WRKSRC}/lib/phusion_passenger/platform_info/cxx_portability.rb
 
-post-build:
+post-install:
 .if ${PORT_OPTIONS:MAPACHE22}
-	(CC=${CC} CXX=${CXX} ${WRKSRC}/bin/passenger-install-apache2-module --auto)
+	(cd ${STAGEDIR}${PREFIX}/${GEMS_DIR}/${GEM_NAME} && CC=${CC} CXX=${CXX} ${RAKE_BIN} apache2)
 .endif
 
 .if ${PORT_OPTIONS:MNGINX}
-	(cd ${WRKSRC} && CC=${CC} CXX=${CXX} ${RAKE_BIN} nginx)
+	(cd ${STAGEDIR}${PREFIX}/${GEMS_DIR}/${GEM_NAME} && CC=${CC} CXX=${CXX} ${RAKE_BIN} nginx)
 .endif
+
 .if ${PORT_OPTIONS:MSYMLINK}
-	${LN} -s ${GEM_LIB_DIR} ${STAGE}${PREFIX}/${GEMS_DIR}/${PORTNAME}
+	(cd ${STAGEDIR}${PREFIX}/${GEMS_DIR} && ${LN} -s ${GEM_NAME} ${PORTNAME})
 .endif
 
-	${FIND} ${WRKSRC} -name '*.o' -delete
-	${FIND} ${WRKSRC} -name '*.bak' -delete
+	${FIND} ${STAGEDIR} -name '*.o' -delete
+	${FIND} ${STAGEDIR} -name '*.bak' -delete
+	${FIND} ${STAGEDIR} -name '*.log' -delete
+	${RM} -rf ${STAGEDIR}${PREFIX}/${GEMS_DIR}/${GEM_NAME}/buildout/common
+	${RM} -rf ${STAGEDIR}${PREFIX}/${GEMS_DIR}/${GEM_NAME}/buildout/cache
+	${FIND} ${STAGEDIR}${PREFIX}/${GEMS_DIR}/${GEM_NAME}/buildout/ruby/ -name Makefile -delete
+	${TOUCH} ${STAGEDIR}${PREFIX}/${GEMS_DIR}/${GEM_NAME}/download_cache/.keep_me
 
 .include <bsd.port.mk>
Index: files/pkg-message-apache.in
===================================================================
--- files/pkg-message-apache.in	(revision 351202)
+++ files/pkg-message-apache.in	(working copy)
@@ -2,8 +2,8 @@
 
 Please edit your Apache configuration file, and add these lines:
 
-   LoadModule passenger_module %%PREFIX%%/%%GEM_LIB_DIR%%/buildout/apache2/mod_passenger.so
-   PassengerRoot %%PREFIX%%/%%GEM_LIB_DIR%%
+   LoadModule passenger_module %%PASSENGER_INSTALL_DIR%%/buildout/apache2/mod_passenger.so
+   PassengerRoot %%PASSENGER_INSTALL_DIR%%
    PassengerRuby %%RUBY%%
 
 After you restart Apache, you are ready to deploy any number of Ruby on Rails
Index: files/pkg-message-nginx.in
===================================================================
--- files/pkg-message-nginx.in	(revision 0)
+++ files/pkg-message-nginx.in	(working copy)
@@ -0,0 +1,12 @@
+#####################################################################
+
+Please edit your nginx configuration file, and add these lines:
+
+   passenger_root %%PASSENGER_INSTALL_DIR%%
+   passenger_ruby %%RUBY%%
+
+After you restart nginx, you are ready to deploy any number of Ruby on Rails
+applications on nginx, without any further Ruby on Rails-specific
+configuration!
+
+#####################################################################

Property changes on: files/pkg-message-nginx.in
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Index: files/pkg-message.in
===================================================================
--- files/pkg-message.in	(revision 351202)
+++ files/pkg-message.in	(working copy)
@@ -1,13 +0,0 @@
-#####################################################################
-
-Please edit your Apache configuration file, and add these lines:
-
-   LoadModule passenger_module %%PREFIX%%/%%GEM_LIB_DIR%%/buildout/apache2/mod_passenger.so
-   PassengerRoot %%PREFIX%%/%%GEM_LIB_DIR%%
-   PassengerRuby %%RUBY%%
-
-After you restart Apache, you are ready to deploy any number of Ruby on Rails
-applications on Apache, without any further Ruby on Rails-specific
-configuration!
-
-#####################################################################
