Bug 171468

Summary: [patch] graphics/mapserver port use already options NG so use PORT_OPTIONS:M instead WITH_...
Product: Ports & Packages Reporter: Olli Hauer <ohauer>
Component: Individual Port(s)Assignee: Wen Heping <wen>
Status: Closed FIXED    
Severity: Affects Only Me CC: wen
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
mapserver.diff none

Description Olli Hauer freebsd_committer freebsd_triage 2012-09-08 18:30:06 UTC
The port use already options NG framework, so WITH_(PERL|PHP|...) should be replaced
by PORT_OPTIONS:M...

Additional use bsd.port.pre.mk so there is no need to use
- .include <../../Mk/bsd.python.mk>
- .include "${PORTSDIR}/Mk/bsd.apache.mk"

Seems the port use apache only during runtime to serve a cgi script so
replace USE_APACHE with USE_APACHE_RUN (not verified by testing the port)

Patch is only a suggestion, please review.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2012-09-08 18:30:19 UTC
Responsible Changed
From-To: freebsd-ports-bugs->wen

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 dfilter service freebsd_committer freebsd_triage 2012-09-09 16:00:36 UTC
Author: wen
Date: Sun Sep  9 15:00:21 2012
New Revision: 303968
URL: http://svn.freebsd.org/changeset/ports/303968

Log:
  - Replace WITH_(PERL|PHP|...) with PORT_OPTIONS:M
  - Replace USE_APACHE with USE_APACHE_RUN
  
  PR:		171468
  Submitted by:	ohauer@

Modified:
  head/graphics/mapserver/Makefile
  head/graphics/mapserver/pkg-plist

Modified: head/graphics/mapserver/Makefile
==============================================================================
--- head/graphics/mapserver/Makefile	Sun Sep  9 13:56:00 2012	(r303967)
+++ head/graphics/mapserver/Makefile	Sun Sep  9 15:00:21 2012	(r303968)
@@ -42,6 +42,25 @@ MAPSERV_DESC=		Mapserv cgi interface sup
 
 .include <bsd.port.options.mk>
 
+.if ${PORT_OPTIONS:MMAPSERV}
+USE_APACHE_RUN=		22+
+PLIST_SUB+=		MAPSERV=""
+PLIST_DIRSTRY=		www/cgi-bin
+.else
+PLIST_SUB+=		MAPSERV="@comment "
+.endif
+
+.if ${PORT_OPTIONS:MPYTHON}
+USE_PYTHON=		2.6
+PLIST_SUB+=		PYTHON=""
+MAP_EGG=		MapScript-${PORTVERSION}-${PYTHON_VERSION:S/thon//}
+PLIST_SUB+=		MAP_EGG=${MAP_EGG}
+.else
+PLIST_SUB+=		PYTHON="@comment "
+.endif
+
+.include <bsd.port.pre.mk>
+
 .if ${PORT_OPTIONS:MAGG}
 LIB_DEPENDS+=		agg:${PORTSDIR}/graphics/agg
 CONFIGURE_ARGS+=	--with-agg=${LOCALBASE} --with-freetype=${LOCALBASE}
@@ -108,26 +127,16 @@ RUN_BUILDS=		${BUILD_DEPENDS}
 CONFIGURE_ARGS+=	--with-php=${LOCALBASE}/include/php/
 PHP_EXTENSION_DIR!=	${LOCALBASE}/bin/php-config --extension-dir | ${SED} -e 's,/usr/local/,,'
 PLIST_SUB+=		PHP_EXTENSION_DIR=${PHP_EXTENSION_DIR}
-PLIST_SUB+=		WITH_PHP=""
+PLIST_SUB+=		PHP=""
 .else
-PLIST_SUB+=		WITH_PHP="@comment "
+PLIST_SUB+=		PHP="@comment "
 .endif
 
 .if ${PORT_OPTIONS:MPERL}
 USE_PERL5=yes
-PLIST_SUB+=		WITH_PERL=""
-.else
-PLIST_SUB+=		WITH_PERL="@comment "
-.endif
-
-.if ${PORT_OPTIONS:MPYTHON}
-BUILD_DEPENDS+=		${LOCALBASE}/bin/python:${PORTSDIR}/lang/python26
-PLIST_SUB+=		WITH_PYTHON=""
-.include <../../Mk/bsd.python.mk>
-MAP_EGG=		MapScript-${PORTVERSION}-${PYTHON_VERSION:S/thon//}
-PLIST_SUB+=		MAP_EGG=${MAP_EGG}
+PLIST_SUB+=		PERL=""
 .else
-PLIST_SUB+=		WITH_PYTHON="@comment "
+PLIST_SUB+=		PERL="@comment "
 .endif
 
 .if ${PORT_OPTIONS:MCURL}
@@ -135,15 +144,6 @@ LIB_DEPENDS+=		curl:${PORTSDIR}/ftp/curl
 CONFIGURE_ARGS+=	--with-curl=${LOCALBASE}
 .endif
 
-.if ${PORT_OPTIONS:MMAPSERV}
-USE_APACHE=		22+
-.include "${PORTSDIR}/Mk/bsd.apache.mk"
-PLIST_SUB+=		WITH_MAPSERV=""
-PLIST_DIRSTRY=		www/cgi-bin
-.else
-PLIST_SUB+=		WITH_MAPSERV="@comment "
-.endif
-
 .if ${PORT_OPTIONS:MFASTCGI}
 BUILD_DEPENDS+=		${LOCALBASE}/bin/cgi-fcgi:${PORTSDIR}/www/fcgi
 CONFIGURE_ARGS+=	--with-fastcgi=${LOCALBASE}
@@ -156,13 +156,13 @@ CONFIGURE_ARGS+=	--enable-debug
 PROG_FILES=		legend scalebar shp2img shptree shptreetst shptreevis sortshp
 
 post-patch:
-.if defined(WITH_MING)
+.if ${PORT_OPTIONS:MMING}
 	${REINPLACE_CMD} -e 's#with_ming/include#with_ming/include/ming#g' \
 		${WRKSRC}/configure
 .endif
 
 post-build:
-.if defined(WITH_PERL)
+.if ${PORT_OPTIONS:MPERL}
 	(cd ${WRKSRC}/mapscript/perl && ${PERL5} Makefile.PL && make)
 .endif
 
@@ -171,27 +171,27 @@ do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/${f} ${PREFIX}/bin
 .endfor
 	${INSTALL_SCRIPT} ${WRKSRC}/shp2mysql.pl ${PREFIX}/bin/shp2mysql
-.if defined(WITH_MAPSERV)
+.if ${PORT_OPTIONS:MMAPSERV}
 	${MKDIR} ${LOCALBASE}/www/cgi-bin/
 	${INSTALL_PROGRAM} ${WRKSRC}/mapserv ${LOCALBASE}/www/cgi-bin/mapserv
 .endif
 
-.if defined(WITH_PHP)
+.if ${PORT_OPTIONS:MPHP}
 	@${MKDIR} ${LOCALBASE}/${PHP_EXTENSION_DIR}
 	${INSTALL_PROGRAM} ${WRKSRC}/mapscript/php/php_mapscript.so ${LOCALBASE}/${PHP_EXTENSION_DIR}/
 .endif
 
-.if defined(WITH_PERL)
+.if ${PORT_OPTIONS:MPERL}
 	(cd ${WRKSRC}/mapscript/perl && make install)
 .endif
 
-.if defined(WITH_PYTHON)
+.if ${PORT_OPTIONS:MPYTHON}
 	(cd ${WRKSRC}/mapscript/python && ${SETENV} ${MAKE_ENV} ${PYTHON_CMD} setup.py install)
 .endif
 
 post-install:
-.if defined(WITH_PHP)
+.if ${PORT_OPTIONS:MPHP}
 	@${ECHO_MSG} "Please add the line extension=php_mapscript.so to ${LOCALBASE}/etc/php/extensions.ini"
 .endif
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>

Modified: head/graphics/mapserver/pkg-plist
==============================================================================
--- head/graphics/mapserver/pkg-plist	Sun Sep  9 13:56:00 2012	(r303967)
+++ head/graphics/mapserver/pkg-plist	Sun Sep  9 15:00:21 2012	(r303968)
@@ -6,17 +6,17 @@ bin/shptree
 bin/shptreetst
 bin/shptreevis
 bin/sortshp
-%%WITH_MAPSERV%%www/cgi-bin/mapserv
-%%WITH_PERL%%%%SITE_PERL%%/%%PERL_ARCH%%/auto/mapscript/mapscript.so
-%%WITH_PERL%%%%SITE_PERL%%/%%PERL_ARCH%%/auto/mapscript/mapscript.bs
-%%WITH_PERL%%%%SITE_PERL%%/%%PERL_ARCH%%/auto/mapscript/.packlist
-%%WITH_PERL%%%%SITE_PERL%%/%%PERL_ARCH%%/mapscript.pm
-%%WITH_PERL%%lib/perl5/%%PERL_VER%%/%%PERL_ARCH%%/perllocal.pod
-%%WITH_PERL%%@dirrm %%SITE_PERL%%/%%PERL_ARCH%%/auto/mapscript
-%%WITH_PHP%%%%PHP_EXTENSION_DIR%%/php_mapscript.so
-%%WITH_PHP%%@dirrmtry %%PHP_EXTENSION_DIR%%
-%%WITH_PHP%%@dirrmtry etc/php
-%%WITH_PYTHON%%%%PYTHON_SITELIBDIR%%/mapscript.py
-%%WITH_PYTHON%%%%PYTHON_SITELIBDIR%%/mapscript.pyc
-%%WITH_PYTHON%%%%PYTHON_SITELIBDIR%%/_mapscript.so
-%%WITH_PYTHON%%%%PYTHON_SITELIBDIR%%/%%MAP_EGG%%.egg-info
+%%MAPSERV%%www/cgi-bin/mapserv
+%%PERL%%%%SITE_PERL%%/%%PERL_ARCH%%/auto/mapscript/mapscript.so
+%%PERL%%%%SITE_PERL%%/%%PERL_ARCH%%/auto/mapscript/mapscript.bs
+%%PERL%%%%SITE_PERL%%/%%PERL_ARCH%%/auto/mapscript/.packlist
+%%PERL%%%%SITE_PERL%%/%%PERL_ARCH%%/mapscript.pm
+%%PERL%%lib/perl5/%%PERL_VER%%/%%PERL_ARCH%%/perllocal.pod
+%%PERL%%@dirrm %%SITE_PERL%%/%%PERL_ARCH%%/auto/mapscript
+%%PHP%%%%PHP_EXTENSION_DIR%%/php_mapscript.so
+%%PHP%%@dirrmtry %%PHP_EXTENSION_DIR%%
+%%PHP%%@dirrmtry etc/php
+%%PYTHON%%%%PYTHON_SITELIBDIR%%/mapscript.py
+%%PYTHON%%%%PYTHON_SITELIBDIR%%/mapscript.pyc
+%%PYTHON%%%%PYTHON_SITELIBDIR%%/_mapscript.so
+%%PYTHON%%%%PYTHON_SITELIBDIR%%/%%MAP_EGG%%.egg-info
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 3 Wen Heping freebsd_committer freebsd_triage 2012-09-09 16:02:41 UTC
State Changed
From-To: open->closed

Committed, with minor changes. Thanks!