Date: Sat, 8 Sep 2012 17:26:49 GMT From: Olli Hauer <ohauer@FreeBSD.org> To: FreeBSD-gnats-submit@FreeBSD.org Cc: wen@FreeBSD.org Subject: ports/171468: [patch] graphics/mapserver port use already options NG so use PORT_OPTIONS:M instead WITH_... Message-ID: <201209081726.q88HQnR4080342@freefall.freebsd.org> Resent-Message-ID: <201209081730.q88HU6Rk065475@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 171468 >Category: ports >Synopsis: [patch] graphics/mapserver port use already options NG so use PORT_OPTIONS:M instead WITH_... >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sat Sep 08 17:30:06 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Olli Hauer >Release: >Organization: >Environment: >Description: 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. >How-To-Repeat: >Fix: --- mapserver.diff begins here --- Index: Makefile =================================================================== --- Makefile (revision 303916) +++ Makefile (working copy) @@ -42,6 +42,25 @@ .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,42 +127,23 @@ 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="" +PLIST_SUB+= PERL="" .else -PLIST_SUB+= WITH_PERL="@comment " +PLIST_SUB+= 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} -.else -PLIST_SUB+= WITH_PYTHON="@comment " -.endif - .if ${PORT_OPTIONS:MCURL} 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 @@ 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 @@ ${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.pre.mk> Index: pkg-plist =================================================================== --- pkg-plist (revision 303916) +++ pkg-plist (working copy) @@ -6,17 +6,17 @@ 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 --- mapserver.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201209081726.q88HQnR4080342>