Index: Mk/bsd.port.mk =================================================================== RCS file: /home/ncvs/ports/Mk/bsd.port.mk,v retrieving revision 1.462 diff -u -r1.462 bsd.port.mk --- Mk/bsd.port.mk 15 Aug 2003 22:57:58 -0000 1.462 +++ Mk/bsd.port.mk 20 Aug 2003 18:30:25 -0000 @@ -729,6 +746,8 @@ # PATCH_DEBUG - If set, print out more information about the patches as # it attempts to apply them. # PKG_DBDIR - Where package installation is recorded (default: /var/db/pkg) +# PORT_DBDIR - Where port configuration options are recorded +# (default: /var/db/ports) # NO_PKG_REGISTER - Don't register a port installation as a package. # FORCE_PKG_REGISTER - If set, it will overwrite any existing package # registration information in ${PKG_DBDIR}/${PKGNAME}. @@ -775,6 +794,7 @@ CP?= /bin/cp CUT?= /usr/bin/cut DC?= /usr/bin/dc +DIALOG?= /usr/bin/dialog EGREP?= /usr/bin/egrep EXPR?= /bin/expr FALSE?= false # Shell builtin @@ -881,6 +901,17 @@ USE_SUBMAKE= yes .endif +# where 'make config' records user configuration options +PORT_DBDIR?= /var/db/ports + +OPTIONSFILE?=${PORT_DBDIR}/${PORTNAME}/options +.if exists(${OPTIONSFILE}) +.include "${OPTIONSFILE}" +.endif +.if exists(${OPTIONSFILE}.local) +.include "${OPTIONSFILE}.local" +.endif + .if !defined(PORTNAME) || !defined(PORTVERSION) || defined(PKGNAME) .BEGIN: @${ECHO_CMD} "${PKGNAME}: You need to define PORTNAME and PORTVERSION instead of PKGNAME." @@ -2552,6 +2583,18 @@ .endif ################################################################ +# +# Do preliminary work to detect if we need to run the config +# target or not. +# +################################################################ +.if (!defined(OPTIONS) || defined(CONFIG_DONE) || \ + defined(PACKAGE_BUILDING) || defined(BATCH) || \ + exists(${OPTIONSFILE}) || exists(${OPTIONSFILE}.local)) +_OPTIONS_OK=yes +.endif + +################################################################ # The following are used to create easy dummy targets for # disabling some bit of default target behavior you don't want. # They still check to see if the target exists, and if so don't @@ -2561,25 +2604,25 @@ ################################################################ # Disable checksum -.if defined(NO_CHECKSUM) && !target(checksum) +.if defined(NO_CHECKSUM) && !target(checksum) && defined(_OPTIONS_OK) checksum: fetch @${DO_NADA} .endif # Disable build -.if defined(NO_BUILD) && !target(build) +.if defined(NO_BUILD) && !target(build) && defined(_OPTIONS_OK) build: configure @${TOUCH} ${TOUCH_FLAGS} ${BUILD_COOKIE} .endif # Disable install -.if defined(NO_INSTALL) && !target(install) +.if defined(NO_INSTALL) && !target(install) && defined(_OPTIONS_OK) install: build @${TOUCH} ${TOUCH_FLAGS} ${INSTALL_COOKIE} .endif # Disable package -.if defined(NO_PACKAGE) && !target(package) +.if defined(NO_PACKAGE) && !target(package) && defined(_OPTIONS_OK) package: .if defined(IGNORE_SILENT) @${DO_NADA} @@ -2891,7 +2934,7 @@ .if defined(USE_GMAKE) @(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${ALL_TARGET}) .else - @(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${ALL_TARGET}) + (cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${ALL_TARGET}) .endif .endif @@ -3252,8 +3295,12 @@ .for target in extract patch configure build install package -.if !target(${target}) +.if !target(${target}) && defined(_OPTIONS_OK) ${target}: ${${target:U}_COOKIE} +.elif !target(${target}) +${target}: config + @cd ${.CURDIR} && ${MAKE} CONFIG_DONE=1 ${__softMAKEFLAGS} ${${target:U}_COOKIE} +.elif target(${target}) && defined(IGNORE) .endif .if !exists(${${target:U}_COOKIE}) @@ -4398,6 +4445,88 @@ OSVERSION="${OSVERSION:S/"/"'"'"/g:S/\$/\$\$/g:S/\\/\\\\/g}" \ PORTOBJFORMAT="${PORTOBJFORMAT:S/"/"'"'"/g:S/\$/\$\$/g:S/\\/\\\\/g}" \ SYSTEMVERSION="${SYSTEMVERSION:S/"/"'"'"/g:S/\$/\$\$/g:S/\\/\\\\/g}" +.endif + +.if !target(config) +config: + @${MKDIR} ${WRKDIR} +.if !defined(OPTIONS) + @${ECHO_MSG} "==> No options to configure" +.else + @(${MKDIR} ${PORT_DBDIR}/${PORTNAME} 2> /dev/null) || \ + (${ECHO_MSG} "==> Cannot create ${PORT_DBDIR}/${PORTNAME}, check permissions"; exit 1) + -@if [ -e ${OPTIONSFILE} ]; then \ + . ${OPTIONSFILE}; \ + fi; \ + set ${OPTIONS} XXX; \ + while [ $$# -gt 3 ]; do \ + OPTIONSLIST="$${OPTIONSLIST} $$1"; \ + defaultval=$$3; \ + withvar=WITH_$$1; \ + withoutvar=WITHOUT_$$1; \ + withval=$$(eval echo $$\{$${withvar}\}); \ + withoutval=$$(eval echo $$\{$${withoutvar}\}); \ + echo $${withval}; \ + if [ ! -z "$${withval}" ]; then \ + val=on; \ + elif [ ! -z "$${withoutval}" ]; then \ + val=off; \ + else \ + val=$$3; \ + fi; \ + DEFOPTIONS="$${DEFOPTIONS} $$1 \"$$2\" $${val}"; \ + shift 3; \ + done > /dev/null; \ + TMPOPTIONSFILE=$$(mktemp -t portoptions); \ + trap "rm -f $${TMPOPTIONSFILE}; exit 1" 1 2 3 5 10 13 15; \ + ${SH} -c "${DIALOG} --checklist \"Options for ${PORTNAME} ${PORTVERSION}\" 21 70 15 $${DEFOPTIONS} 2> $${TMPOPTIONSFILE}"; \ + status=$$?; \ + if [ $${status} -ne 0 ] ; then \ + ${RM} -f $${TMPOPTIONSFILE}; \ + ${ECHO_MSG} "==> Options unchanged"; \ + exit 0; \ + fi; \ + if [ ! -e ${TMPOPTIONSFILE} ]; then \ + ${ECHO_MSG} "==> No user-specified options to save for ${PORTNAME}"; \ + exit 0; \ + fi; \ + SELOPTIONS=$$(cat $${TMPOPTIONSFILE}); \ + ${RM} -f $${TMPOPTIONSFILE}; \ + ${ECHO_MSG} "# This file is auto-generated by 'make config'. No user-servicable parts" > ${OPTIONSFILE}; \ + ${ECHO_MSG} "# inside!" >> ${OPTIONSFILE}; \ + for i in $${OPTIONSLIST}; do \ + ${ECHO_CMD} $${SELOPTIONS} | grep -qw $${i}; \ + if [ $$? -eq 0 ]; then \ + ${ECHO_CMD} WITH_$${i}=true >> ${OPTIONSFILE}; \ + else \ + ${ECHO_CMD} WITHOUT_$${i}=true >> ${OPTIONSFILE}; \ + fi; \ + done +.endif +.endif + +.if !target(showconfig) +showconfig: +.if exists(${OPTIONSFILE}) + @${ECHO_MSG} "==> The following configuration options are set for ${PORTNAME}"; \ + ${GREP} -v ^# ${OPTIONSFILE} +.else + @${ECHO_MSG} "==> No configuration options are set for this port" +.if defined(OPTIONS) + @${ECHO_MSG} " Use 'make config' to set default values" +.endif +.endif +.endif + +.if !target(rmconfig) +rmconfig: +.if exists(${OPTIONSFILE}) + -@${ECHO_MSG} "==> Removing user-configured options for ${PORTNAME}"; \ + ${RM} -f ${OPTIONSFILE}; \ + ${RMDIR} ${PORT_DBDIR}/${PORTNAME} +.else + @${ECHO_MSG} "==> No user-specified options configured for ${PORTNAME}" +.endif .endif .endif Index: security/snort/Makefile =================================================================== RCS file: /home/ncvs/ports/security/snort/Makefile,v retrieving revision 1.36 diff -u -r1.36 Makefile --- security/snort/Makefile 4 Aug 2003 01:30:47 -0000 1.36 +++ security/snort/Makefile 7 Aug 2003 14:28:54 -0000 @@ -17,6 +17,13 @@ CONFIGURE_ARGS= --with-mysql=no --with-odbc=no --with-postgresql=no MAN8= snort.8 +OPTIONS= FLEXRESP "Flexible response to events" off \ + MYSQL "Mysql logging" off \ + ODBC "ODBC logging" off \ + POSTGRES "Postgresql logging" off + +.include + .if defined(WITH_FLEXRESP) BUILD_DEPENDS+= ${LOCALBASE}/lib/libnet.a:${PORTSDIR}/net/libnet CONFIGURE_ARGS+=--enable-flexresp @@ -87,4 +94,4 @@ ${PREFIX}/etc/snort.conf; \ fi -.include +.include Index: games/moonlander/Makefile =================================================================== RCS file: /home/ncvs/ports/games/moonlander/Makefile,v retrieving revision 1.1 diff -u -r1.1 Makefile --- games/moonlander/Makefile 27 Jun 2003 08:37:09 -0000 1.1 +++ games/moonlander/Makefile 7 Aug 2003 14:28:54 -0000 @@ -22,6 +22,10 @@ WRKSRC= ${WRKDIR}/moon-lander +OPTIONS= SOUND "Sound support" on + +.include + install_dirs= fonts images .if defined(WITHOUT_SOUND) CFLAGS+= -DNOSOUND @@ -45,4 +49,4 @@ post-install: @find ${PREFIX}/share/moonlander -type f -print0 |xargs -0 ${CHMOD} 444 -.include +.include