[PATCH] www/rubygem-passenger in FreeBSD ports tree

Sergey A. Osokin osa at FreeBSD.ORG.ru
Sat Jan 9 11:53:25 MSK 2010


Hello,

here is the patch provide OPTIONS for enable/disable apache22 or nginx
for www/rubygem-passenger installation.

Also, patch update passenger distribution from 2.2.5 to 2.2.8.

Index: ports/www/rubygem-passenger/Makefile
===================================================================
RCS file: /home/pcvs/ports/www/rubygem-passenger/Makefile,v
retrieving revision 1.8
diff -u -r1.8 Makefile
--- ports/www/rubygem-passenger/Makefile	19 Sep 2009 11:29:26 -0000	1.8
+++ ports/www/rubygem-passenger/Makefile	9 Jan 2010 08:48:19 -0000
@@ -5,25 +5,39 @@
 # $FreeBSD: ports/www/rubygem-passenger/Makefile,v 1.8 2009/09/19 11:29:26 miwi Exp $
 
 PORTNAME=	passenger
-PORTVERSION=	2.2.5
+PORTVERSION=	2.2.8
 CATEGORIES=	www rubygems
 MASTER_SITES=	RF
-MASTER_SITE_SUBDIR=	gems
 
 MAINTAINER=	jatzen at gmail.com
-COMMENT=	Apache module for running Ruby on Rails and Rack applications
+COMMENT=	Modules for running Ruby on Rails and Rack applications
 
-BUILD_DEPENDS=	rubygem-fastthread>=1.0.1:${PORTSDIR}/devel/rubygem-fastthread \
-		rubygem-rack>=0.1.0:${PORTSDIR}/www/rubygem-rack
+OPTIONS=	APACHEPORT	"Use apache22"		on \
+		NGINXPORT	"Use nginx"		off
 
-SUB_LIST+=	GEM_LIB_DIR=${GEM_LIB_DIR} RUBY=${RUBY}
-SUB_FILES=	pkg-message
-
-USE_APACHE=	2.2+
 USE_RUBY=	yes
-USE_RUBYGEMS=	yes
 USE_RAKE=	yes
+USE_RUBYGEMS=	yes
 RUBYGEM_AUTOPLIST=	yes
+PKGNAMEPREFIX=	rubygem-
+
+.include <bsd.port.options.mk>
+
+.if !defined(WITHOUT_APACHEPORT)
+USE_APACHE=	2.2+
+.endif
+
+.if defined(WITH_NGINXPORT)
+BUILD_DEPENDS+=	nginx>=0.7.64:${PORTSDIR}/www/nginx
+.endif
+
+BUILD_DEPENDS+=	rubygem-fastthread>=1.0.1:${PORTSDIR}/devel/rubygem-fastthread \
+		rubygem-rack>=1.0.0:${PORTSDIR}/www/rubygem-rack \
+		rubygem-rails>=2.3.4:${PORTSDIR}/www/rubygem-rails
+
+SUB_LIST+=	GEM_LIB_DIR=${GEM_LIB_DIR} RUBY=${RUBY}
+SUB_FILES=	pkg-message
+
 PLIST_FILES=	bin/passenger-config \
 		bin/passenger-install-apache2-module \
 		bin/passenger-make-enterprisey \
@@ -33,8 +47,34 @@
 		bin/passenger-stress-test \
 		bin/passenger-install-nginx-module
 
+pre-patch:
+.if defined(WITH_NGINXPORT)
+	@${ECHO_CMD}
+	@${ECHO_CMD} "Do not forget compile www/nginx"
+	@${ECHO_CMD} "with PASSENGER_MODULE support"
+	@${ECHO_CMD}
+.endif
+
 post-install:
-	(${PREFIX}/bin/passenger-install-apache2-module --auto )
-	@${CAT}	${PKGMESSAGE}
+	${REINPLACE_CMD} 's!g++!${CXX}!; \
+		s!gcc!${CC}!;' \
+		${PREFIX}/${GEM_LIB_DIR}/Rakefile
+	${REINPLACE_CMD} '377s!-g!${CXXFLAGS}!; \
+		s!-lpthread!${PTHREAD_LIBS}!g' \
+		${PREFIX}/${GEM_LIB_DIR}/lib/phusion_passenger/platform_info.rb
+
+.if !defined(WITHOUT_APACHEPORT)
+	(${PREFIX}/bin/passenger-install-apache2-module --auto)
+	@${CAT} ${PKGMESSAGE}
+.endif
+
+.if defined(WITH_NGINXPORT)
+	${REINPLACE_CMD} '62d;65d' \
+		${PREFIX}/${GEM_LIB_DIR}/Rakefile
+	(cd ${PREFIX}/${GEM_LIB_DIR} && ${RAKE_BIN})
+.endif
+
+	${FIND} ${PREFIX}/${GEM_LIB_DIR} -name '*.o' -delete
+	${FIND} ${PREFIX}/${GEM_LIB_DIR} -name '*.bak' -delete
 
 .include <bsd.port.mk>
Index: ports/www/rubygem-passenger/distinfo
===================================================================
RCS file: /home/pcvs/ports/www/rubygem-passenger/distinfo,v
retrieving revision 1.7
diff -u -r1.7 distinfo
--- ports/www/rubygem-passenger/distinfo	19 Sep 2009 11:29:27 -0000	1.7
+++ ports/www/rubygem-passenger/distinfo	9 Jan 2010 08:48:19 -0000
@@ -1,3 +1,3 @@
-MD5 (rubygem/passenger-2.2.5.gem) = 912b76dabc68fd3a3393765255cb0a64
-SHA256 (rubygem/passenger-2.2.5.gem) = b16fe4e0d99d349450ddf572b36b388e7708da0817588764c44a93a21dc86834
-SIZE (rubygem/passenger-2.2.5.gem) = 1797120
+MD5 (rubygem/passenger-2.2.8.gem) = 68034acced5751d61d338eaacb3cbc3d
+SHA256 (rubygem/passenger-2.2.8.gem) = 1965b68c9771ee44ddf4b6507f7f5ac16c339308c8141876e8c3ad5da025f35c
+SIZE (rubygem/passenger-2.2.8.gem) = 1988096
Index: ports/www/rubygem-passenger/pkg-descr
===================================================================
RCS file: /home/pcvs/ports/www/rubygem-passenger/pkg-descr,v
retrieving revision 1.1
diff -u -r1.1 pkg-descr
--- ports/www/rubygem-passenger/pkg-descr	25 Dec 2008 19:49:33 -0000	1.1
+++ ports/www/rubygem-passenger/pkg-descr	9 Jan 2010 08:48:19 -0000
@@ -1,4 +1,4 @@
-Passenger is an Apache module allowing for simple deployment of Ruby on Rails 
-and Rack applications.
+Passenger are Apache and nginx modules allowing for simple deployment
+of Ruby on Rails and Rack applications.
 
 WWW: http://www.modrails.com/

-- 
Sergey A. Osokin,
osa at FreeBSD.ORG
osa at FreeBSD.ORG.ru



More information about the nginx mailing list