Date: 7 Oct 2012 04:15:46 -0000 From: Michael Gmelin <freebsd@grem.de> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/172434: [PATCH] textproc/xerces-c2: Converting port to new options framework Message-ID: <20121007041546.60535.qmail@mail.grem.de> Resent-Message-ID: <201210070420.q974KJen064277@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 172434 >Category: ports >Synopsis: [PATCH] textproc/xerces-c2: Converting port to new options framework >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: Sun Oct 07 04:20:19 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Michael Gmelin >Release: FreeBSD 9.0-RELEASE amd64 >Organization: Grem Equity GmbH >Environment: System: FreeBSD bsd64.grem.de 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Tue Jan 3 07:46:30 UTC >Description: The patch below converts the port to use the new options framework[1] and converts the Makefile header to the new format[2]. The patch is to be applied using: patch -p0 -E </path/to/patchfile No attempts have been made to fix any potential issues the port might have beyond this scope. I also didn't fix any indentation issues to keep the patch small and easy to audit, a future port maintainer might want to take care of this. See also: 1. http://lists.freebsd.org/pipermail/freebsd-ports/2012-October/078676.html 2. http://lists.freebsd.org/pipermail/freebsd-ports/2012-August/077801.html Removed file(s): - scripts/check-config-options Generated with FreeBSD Port Tools 0.99_6 (mode: change, diff: suffix) >How-To-Repeat: >Fix: --- xerces-c2-2.7.0_1.patch begins here --- diff -ruN --exclude=CVS ../xerces-c2.orig/Makefile ./Makefile --- ../xerces-c2.orig/Makefile 2012-10-06 22:13:15.243491103 +0200 +++ ./Makefile 2012-10-06 23:25:13.247047457 +0200 @@ -1,36 +1,34 @@ -# New ports collection makefile for: xerces-c2 -# Date created: 06 September 2002 -# Whom: "Bjoern A. Zeeb" (bzeeb+freebsdports@zabbadoz.net) -# -# $FreeBSD: ports/textproc/xerces-c2/Makefile,v 1.29 2012/01/09 04:01:17 eadler Exp $ -# - -PORTNAME= xerces-c2 -PORTVERSION= 2.7.0 -PORTREVISION= 1 -CATEGORIES= textproc -MASTER_SITES= ${MASTER_SITE_APACHE_XML} +# Created by: "Bjoern A. Zeeb" (bzeeb+freebsdports@zabbadoz.net) +# $FreeBSD: $ + +PORTNAME= xerces-c2 +PORTVERSION= 2.7.0 +PORTREVISION= 1 +CATEGORIES= textproc +MASTER_SITES= ${MASTER_SITE_APACHE_XML} MASTER_SITE_SUBDIR= xerces-c/source -DISTNAME= xerces-c-src_${PORTVERSION:S/./_/g} +DISTNAME= xerces-c-src_${PORTVERSION:S/./_/g} -MAINTAINER= ports@FreeBSD.org -COMMENT= Validating XML parser from the Apache XML Project +MAINTAINER= ports@FreeBSD.org +COMMENT= Validating XML parser from the Apache XML Project -OPTIONS= THREADS "Build a thread enabled shared library." on \ - DEBUG "Include debugging information, do not strip." off \ - ICONVFBSD "Use IconvFBSD transcoder." on \ - ICU "Use ICU transcoder." off \ - NATIVE "Use native transcoder." off +OPTIONS_DEFINE= DOCS DEBUG EXAMPLES THREADS +OPTIONS_SINGLE= TCODER +OPTIONS_SINGLE_TCODER= ICONVFBSD ICU NATIVE +OPTIONS_DEFAULT= ICONVFBSD THREADS +ICONVFBSD_DESC= Use IconvFBSD transcoder +ICU_DESC= Use ICU transcoder +NATIVE_DESC= Use native transcoder -.include <bsd.port.pre.mk> +.include <bsd.port.options.mk> -.if defined(WITH_NATIVE) +.if ${PORT_OPTIONS:MNATIVE} TRANSCODER= native .endif -.if defined(WITH_ICU) +.if ${PORT_OPTIONS:MICU} TRANSCODER= icu .endif -.if defined(WITH_ICONVFBSD) +.if ${PORT_OPTIONS:MICONVFBSD} TRANSCODER= IconvFBSD .endif @@ -84,7 +82,7 @@ CONFIGURE_ARGS+= -t ${TRANSCODER} -.if defined(WITH_DEBUG) +.if ${PORT_OPTIONS:MDEBUG} CONFIGURE_ARGS+= -d .endif @@ -96,7 +94,7 @@ SAMPLES_CONFIG_ARGS+= -b 64 .endif -.if defined(WITHOUT_THREADS) +.if !${PORT_OPTIONS:MTHREADS} CONFIGURE_ARGS+= -r none .else CONFIGURE_ENV+= PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" \ @@ -110,13 +108,13 @@ XERCESC_DEPDOM_LIB=${XERCESC_DEPDOM_LIB} \ XERCESC_LIB_VERSION=${XERCESC_LIB_VERSION} -.if !defined(NOPORTEXAMPLES) +.if ${PORT_OPTIONS:MEXAMPLES} ALL_TARGET?= all samples XERCES_BINS?= CreateDOMDocument DOMCount DOMPrint EnumVal MemParse PParse \ PSVIWriter Redirect SAX2Count SAX2Print SAXCount SAXPrint \ SCMPrint SEnumVal StdInParse SAMPLES_CONFIG_ARGS+= -p freebsd -c ${CC} -x ${CXX} -.if defined(WITHOUT_THREADS) +.if !${PORT_OPTIONS:MTHREADS} SAMPLES_CONFIG_ARGS+= -r none .else SAMPLES_CONFIG_ARGS+= -r pthread @@ -125,17 +123,10 @@ .endif .endif -.if !defined(NOPORTDOCS) +.if ${PORT_OPTIONS:MDOCS} PORTDOCS= * .endif -SCRIPTS_ENV= WITH_NATIVE="${WITH_NATIVE}" \ - WITH_ICU="${WITH_ICU}" \ - WITH_ICONVFBSD="${WITH_ICONVFBSD}" - -pre-extract: - @${SETENV} ${SCRIPTS_ENV} ${SH} ${SCRIPTDIR}/check-config-options - post-patch: @${REINPLACE_CMD} -e 's#CP = -cp -p#CP = -cp#' \ ${WRKSRC}/src/xercesc/Makefile.incl @@ -148,7 +139,7 @@ @${CHMOD} 700 ${CONFIGURE_WRKSRC}/configure post-configure: -.if !defined(NOPORTEXAMPLES) +.if ${PORT_OPTIONS:MEXAMPLES} .if defined(TRANSCODER) && (${TRANSCODER} == "icu") @(cd ${WRKSRC}/samples && \ ${SETENV} \ @@ -167,11 +158,11 @@ .endif post-install: -.if !defined(NOPORTDOCS) +.if ${PORT_OPTIONS:MDOCS} @${MKDIR} ${DOCSDIR} @${CP} -r ${WRKSRC}/doc/ ${DOCSDIR} .endif -.if !defined(NOPORTEXAMPLES) +.if ${PORT_OPTIONS:MEXAMPLES} @${MKDIR} ${EXAMPLESDIR} .for i in ${XERCES_BINS} data @${CP} -r ${WRKSRC}/samples/$i ${EXAMPLESDIR} @@ -181,4 +172,4 @@ .endfor .endif -.include <bsd.port.post.mk> +.include <bsd.port.mk> diff -ruN --exclude=CVS ../xerces-c2.orig/scripts/check-config-options ./scripts/check-config-options --- ../xerces-c2.orig/scripts/check-config-options 2012-10-06 22:13:15.225154136 +0200 +++ ./scripts/check-config-options 1970-01-01 01:00:00.000000000 +0100 @@ -1,24 +0,0 @@ -#!/bin/sh -# $FreeBSD: ports/textproc/xerces-c2/scripts/check-config-options,v 1.2 2004/10/27 11:06:27 vs Exp $ - -rc=0 - -if test -n "${WITH_NATIVE}"; then - rc=$(expr $rc + 1) -fi -if test -n "${WITH_ICU}"; then - rc=$(expr $rc + 1) -fi -if test -n "${WITH_ICONVFBSD}"; then - rc=$(expr $rc + 1) -fi - -if test ${rc} -gt 1; then - echo "ERROR: please re-run make config and" >&2 - echo "only select one of the three transcoders." >&2 - exit 254 -fi - -exit 0 - -# end --- xerces-c2-2.7.0_1.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20121007041546.60535.qmail>