Index: bsd.port.mk =================================================================== RCS file: /c/pcvs/ports/Mk/bsd.port.mk,v retrieving revision 1.511 diff -u -r1.511 bsd.port.mk --- bsd.port.mk 17 Mar 2005 23:22:07 -0000 1.511 +++ bsd.port.mk 20 May 2005 21:35:12 -0000 @@ -140,23 +140,107 @@ # obsolete. # # Set these if your port should not be built under certain circumstances. -# These are string variables; you should set them to the reason why -# they are necessary. +# These are boolean (yes|no) variables. It is very important that you: +# +# *** READ THE SOFTWARE LICENSE CAREFULLY BEFORE SETTING THEM, TO *** +# *** AVOID POSSIBLE LEGAL PROBLEMS! *** +# +# If the license does not explicitly allow redistribution or resale, +# or if the license is missing or inconsistent, the variables must +# be set to 'no'. +# +# PERMIT_DISTFILE_DISTRIB - Source files may be redistributed by +# non-profit means (e.g. on the FreeBSD FTP +# site) +# PERMIT_DISTFILE_SALE - Source files may be resold for profit +# (e.g. on a commercial DVD) +# PERMIT_PACKAGE_DISTRIB - Packages may be redistributed by non-profit +# means (e.g. on the FreeBSD FTP site) +# PERMIT_PACKAGE_SALE - Packages may be resold for profit (e.g. +# on a commercial CDROM/DVD) +# +# These variables refer to *unrestricted* redistribution rights. If +# the license says that you can only redistribute the software under +# certain conditions (e.g. to members of an educational institution, +# not to citizens of certain countries, may only be sold for the +# distribution cost of the media, etc) then you must set the variable +# to "no", since we cannot enforce these restrictions when packages +# are provided on the FTP sites or are resold on CDROM/DVD. +# +# The following string variables may be used to explain the license +# restrictions to the user; you should set them to the reason why the +# restrictions are necessary. +# +# NO_DISTRIB_MSG - Reason why the distfiles/packages may not be +# redistributed by non-profit means +# +# NO_SALE_MSG - Reason why the distfiles/packages may not be sold +# for profit +# +# If only a subset of distfiles or patchfiles have redistribution +# restrictions, set PERMIT_DISTFILE_(SALE|DISTRIB)=yes and set the +# following variable(s) to the list of such files. +# +# NO_DISTRIB_FILES - List of files that cannot be freely redistributed +# (default: "${DISTFILES} ${PATCHFILES}" if +# PERMIT_DISTFILE_DISTRIB=no, empty otherwise). +# NO_SALE_FILES - List of files that cannot be resold for profit +# (default: "${DISTFILES} ${PATCHFILES}" if +# PERMIT_DISTFILE_SALE=no, empty otherwise). +# +# For ports that are buildable and redistributable, a copy of the +# ${DISTFILES} and ${PATCHFILES} are periodically collected for +# transfer to ftp.FreeBSD.org. This is mostly done for convenience +# (i.e., so that stable mirrors of the distfiles exist). However, +# some ports *require* that we distribute copies of the source +# together with the binary packages compiled from them (e.g. ports of +# software licensed under the GPL). +# +# ALWAYS_KEEP_DISTFILES - A copy of the distfiles will be collected +# for transfer to ftp.freebsd.org with +# every successful package build on the +# package build cluster. +# +# For ports that repackage binary data licensed under the GPL +# (e.g. the linux-* ports), you should add the corresponding source +# files (e.g. SRPMs) to the DISTFILES list in the PACKAGE_BUILDING +# case, so that the distfiles are collected by the automated package +# build cluster to satisfy the GPL, but users do not have to download +# them. +# +# Other variables that control whether ports may be built: # -# RESTRICTED - Prevent the distribution of distfiles and packages to -# the FTP sites or on CDROM (e.g. forbidden by license -# considerations). -# NO_CDROM - Packages and distfiles may not go on CDROM (e.g. must -# not be re-sold) but can go on FTP sites. -# NO_PACKAGE - Port should not be packaged for ftp sites or CDROMs, -# but distfiles can be put on ftp sites and CDROMs. # FORBIDDEN - Package build should not be attempted because of # security vulnerabilities. +# BROKEN - Port is believed to be broken. Package builds will +# still be periodically attempted on the automated +# package clusters to test this assumption. # IGNORE - Package build should be skipped entirely (e.g. # because of serious unfixable problems in the build, # because it cannot be manually fetched, etc). Error -# logs will not appear on pointyhat, so this should be -# used sparingly. +# logs will not appear on the automated package build +# clusters, so this should be used sparingly. +# +# The following variables control package building: +# +# PREVENT_PACKAGE_BUILD - The port is not designed to be packaged. Set +# to a string to be displayed to the user +# explaining why. +# +# MANUAL_PACKAGE_BUILD - The package build should not be attempted on +# the automated package build clusters, but it +# may be built by users (e.g. the package relies +# on details of the build host and will not work +# on another system, or requires manual +# configuration before packageing). Set to a +# string to be displayed to the user as an +# advisory about limitations of the package. +# +# NOTE: Do not use the preceding two variables to disable package +# building due to license restrictions. The +# PERMIT_PACKAGE_(DISTRIB|SALE) variables described above are to be +# used in this case. +# # BROKEN - Port is believed to be broken. Package builds will # still be attempted on the pointyhat package cluster to # test this assumption. @@ -169,14 +253,6 @@ # DISABLE_VULNERABILITIES # - If set, do not check if the port is listed in the # vulnerabilities database. -# In addition to RESTRICTED or NO_CDROM, if only a subset of distfiles -# or patchfiles have redistribution restrictions, set the following -# to the list of such files. -# -# RESTRICTED_FILES -# - List of files that cannot be redistributed. -# Default: "${DISTFILES} ${PATCHFILES}" if RESTRICTED -# or NO_CDROM is set, empty otherwise. # # These variables are booleans, so you don't need to set them to the reason. # @@ -663,10 +739,12 @@ # Note that there are no NO_PATCH or NO_CONFIGURE variables because # those steps are empty by default. NO_EXTRACT is not allowed anymore # since we need to at least create ${WRKDIR}. Also, NO_CHECKSUM is a user -# variable and is not to be set in a port's Makefile. See above for NO_PACKAGE. +# variable and is not to be set in a port's Makefile (set IGNOREFILES +# to skip recording a checksum for a set of distfiles). # # NO_BUILD - Use a dummy (do-nothing) build target. # NO_INSTALL - Use a dummy (do-nothing) install target. +# # # Here are some variables used in various stages. # @@ -1381,6 +1459,8 @@ SUB_LIST+= PREFIX=${PREFIX} LOCALBASE=${LOCALBASE} X11BASE=${X11BASE} \ DATADIR=${DATADIR} DOCSDIR=${DOCSDIR} EXAMPLESDIR=${EXAMPLESDIR} +# Allow ports (e.g. cross-compilers) to strip out the default +# _CPUFLAGS that will otherwise cause the build to fail. .if defined(WITHOUT_CPU_CFLAGS) .if defined(_CPUCFLAGS) .if !empty(_CPUCFLAGS) @@ -2005,12 +2085,6 @@ MAKE_ENV+= ${INSTALL_MACROS} SCRIPTS_ENV+= ${INSTALL_MACROS} -# The user can override the NO_PACKAGE by specifying this from -# the make command line -.if defined(FORCE_PACKAGE) -.undef NO_PACKAGE -.endif - COMMENTFILE?= ${PKGDIR}/pkg-comment DESCR?= ${PKGDIR}/pkg-descr PLIST?= ${PKGDIR}/pkg-plist @@ -2548,11 +2622,6 @@ .endfor .endif -.if !target(check-makevars) -check-makevars: - @${DO_NADA} -.endif - .if !target(check-depends) check-depends: @${DO_NADA} @@ -2581,7 +2650,7 @@ .endif CONFIGURE_SCRIPT?= configure -CONFIGURE_TARGET?= ${MACHINE_ARCH}-portbld-freebsd${OSREL} +CONFIGURE_TARGET?= ${ARCH}-portbld-freebsd${OSREL} CONFIGURE_LOG?= config.log # A default message to print if do-configure fails. @@ -2738,15 +2807,13 @@ # overnight, then come back in the morning and do _only_ the # interactive ones that required your intervention. # -# Ignore ports that can't be resold if building for a CDROM. +# Ignore ports that can't be resold or redistributed if building a +# for-sale or for-distribution build. # # Don't build a port if it's restricted and we don't want to get # into that. # -# Don't build a port on an ELF machine if it's broken for ELF. -# -# Don't build a port if it's broken, unless we're running a parallel -# build (in case it's fixed). +# Don't build a port if it's broken, unless we ask for it. # # Don't build a port if it's forbidden for whatever reason. # @@ -2754,13 +2821,13 @@ ################################################################ .if ${OSVERSION} < 420000 -# You need an upgrade kit or make world newer than this -IGNORE= ": Your system is too old to use this bsd.port.mk. You need a fresh make world or an upgrade kit. Please go to http://www.FreeBSD.org/ports/ or a mirror site and follow the instructions" +# You need to update your system +IGNORE= ": Your system is too old to use this bsd.port.mk. You need to update to a supported version of FreeBSD. Please see http://www.FreeBSD.org/ports/ or a mirror site for more information." .endif .if defined(ONLY_FOR_ARCHS) .for __ARCH in ${ONLY_FOR_ARCHS} -.if ${MACHINE_ARCH:M${__ARCH}} != "" +.if ${ARCH:M${__ARCH}} != "" __ARCH_OK?= 1 .endif .endfor @@ -2770,7 +2837,7 @@ .if defined(NOT_FOR_ARCHS) .for __NARCH in ${NOT_FOR_ARCHS} -.if ${MACHINE_ARCH:M${__NARCH}} != "" +.if ${ARCH:M${__NARCH}} != "" .undef __ARCH_OK .endif .endfor @@ -2785,15 +2852,65 @@ IGNORE+= "and you are running ${ARCH}" .endif +# Default to assume that everything is redistributable and resellable. +# Over time, the default will first change to warn if these variables +# are not set by a port, and eventually to become fatal if they are +# not. The intent is to encourage maintainers to explicitly verify +# the software license so we don't accidentally violate license terms. + +PERMIT_DISTFILE_DISTRIB?=yes +PERMIT_PACKAGE_DISTRIB?=yes +PERMIT_DISTFILE_SALE?=yes +PERMIT_PACKAGE_SALE?=yes + +.if defined(RESTRICTED) +PERMIT_DISTFILE_DISTRIB=no +PERMIT_PACKAGE_DISTRIB=no +PERMIT_DISTFILE_SALE=no +PERMIT_PACKAGE_SALE=no +NO_DISTRIB_MSG=${RESTRICTED} +check-makevars:: + @${ECHO_MSG} "Warning: RESTRICTED is deprecated; verify the software license and set PERMIT_(DISTFILE|PACKAGE)_(DISTRIB|SALE) as appropriate." +.endif + +.if defined(NO_CDROM) +PERMIT_DISTFILE_SALE=no +PERMIT_PACKAGE_SALE=no +NO_SALE_MSG=${NO_CDROM} +check-makevars:: + @${ECHO_MSG} "Warning: NO_CDROM is deprecated; verify the software license and set PERMIT_(DISTFILE|PACKAGE)_SALE as appropriate." +.endif + +.if defined(NO_PACKAGE) +PERMIT_PACKAGE_SALE=no +PERMIT_PACKAGE_DISTRIB=no +NO_SALE_MSG=${NO_PACKAGE} +NO_DISTRIB_MSG=${NO_PACKAGE} +check-makevars:: + @${ECHO_MSG} "Warning: NO_PACKAGE is deprecated: verify the software license and set PERMIT_PACKAGE_(SALE|DISTRIB) as appropriate." +.endif + +.if defined(FOR_CDROM) +.error FOR_CDROM is deprecated, use BUILD_FOR_SALE instead to specify a build intended for resale for profit. +.endif + +.if defined(NO_RESTRICTED) +.error NO_RESTRICTED is deprecated, use BUILD_FOR_DISTRIB instead to specify a build intended for redistribution without profit (e.g. FTP). +.endif + +.if defined(MANUAL_PACKAGE_BUILD) && defined(PARALLEL_PACKAGE_BUILD) +IGNORE= "has to be packaged manually: ${MANUAL_PACKAGE_BUILD}" +.endif + .if !defined(NO_IGNORE) .if (defined(IS_INTERACTIVE) && defined(BATCH)) IGNORE= "is an interactive port" .elif (!defined(IS_INTERACTIVE) && defined(INTERACTIVE)) IGNORE= "is not an interactive port" -.elif (defined(NO_CDROM) && defined(FOR_CDROM)) -IGNORE= "may not be placed on a CDROM: ${NO_CDROM}" -.elif (defined(RESTRICTED) && defined(NO_RESTRICTED)) -IGNORE= "is restricted: ${RESTRICTED}" +.elif (defined(BUILD_FOR_SALE) && (${PERMIT_PACKAGE_SALE:L} == "no" || ${PERMIT_DISTFILE_SALE:L} == "no")) +IGNORE= "may not be sold for profit: ${NO_SALE_MSG}" +.elif (defined(BUILD_FOR_DISTRIB) && (${PERMIT_PACKAGE_DISTRIB:L} == "no" || ${PERMIT_DISTFILE_DISTRIB:L} == "no")) +IGNORE= "may not be redistributed: ${NO_DISTRIB_MSG}" .elif defined(BROKEN) .if !defined(TRYBROKEN) IGNORE= "is marked as broken: ${BROKEN}" @@ -2802,12 +2919,6 @@ IGNORE= "is forbidden: ${FORBIDDEN}" .endif -.if (defined(MANUAL_PACKAGE_BUILD) && defined(PACKAGE_BUILDING) && !defined(PARALLEL_PACKAGE_BUILD)) -IGNORE= "has to be built manually: ${MANUAL_PACKAGE_BUILD}" -clean: - @${IGNORECMD} -.endif - .if defined(IGNORE) .if defined(IGNORE_SILENT) IGNORECMD= ${DO_NADA} @@ -2827,34 +2938,53 @@ .endif -.if defined(IGNORE) || defined(NO_PACKAGE) +.if defined(IGNORE) || defined(PREVENT_PACKAGE_BUILD) ignorelist: package-name .else ignorelist: @${DO_NADA} .endif +.if !target(check-makevars) +check-makevars: + @${DO_NADA} +.endif + ################################################################ -# Clean directories for ftp or CDROM. +# Clean directories for redistribution or resale ################################################################ -.if defined(RESTRICTED) -clean-restricted: delete-distfiles delete-package -clean-restricted-list: delete-distfiles-list delete-package-list -RESTRICTED_FILES?= ${_DISTFILES} ${_PATCHFILES} -.else -clean-restricted: -clean-restricted-list: -.endif - -.if defined(NO_CDROM) -clean-for-cdrom: delete-distfiles delete-package -clean-for-cdrom-list: delete-distfiles-list delete-package-list -RESTRICTED_FILES?= ${_DISTFILES} ${_PATCHFILES} -.else -clean-for-cdrom: -clean-for-cdrom-list: +.if (${PERMIT_PACKAGE_DISTRIB:L} == "no" || ${PERMIT_DISTFILE_DISTRIB:L} == "no") +clean-for-distrib: delete-distfiles delete-package +clean-for-distrib-list: delete-distfiles-list delete-package-list +NO_DISTRIB_FILES?= ${_DISTFILES} ${_PATCHFILES} +_REMOVE_FILES= ${NO_DISTRIB_FILES} +.else +clean-for-distrib: +clean-for-distrib-list: +.endif +# XXX compat +.if defined(RESTRICTED_FILES) +NO_DISTRIB_FILES= ${RESTRICTED_FILES} +.endif +clean-restricted: clean-for-distrib +clean-restricted-list: clean-for-distrib-list + +.if (${PERMIT_PACKAGE_SALE:L} == "no" || ${PERMIT_DISTFILE_SALE:L} == "no") +clean-for-sale: delete-distfiles delete-package +clean-for-sale-list: delete-distfiles-list delete-package-list +NO_SALE_FILES?= ${_DISTFILES} ${_PATCHFILES} +_REMOVE_FILES= ${NO_SALE_FILES} +.else +clean-for-sale: +clean-for-sale-list: +.endif +# XXX compat +.if defined(RESTRICTED_FILES) +NO_SALE_FILES= ${RESTRICTED_FILES} .endif +clean-for-cdrom: clean-for-sale +clean-for-cdrom-list: clean-for-sale-list .if defined(ALL_HOOK) all: @@ -2929,16 +3059,17 @@ @${TOUCH} ${TOUCH_FLAGS} ${INSTALL_COOKIE} .endif -# Disable package -.if defined(NO_PACKAGE) && !target(package) && defined(_OPTIONS_OK) +# Disable package building for un-packageable ports +.if defined(PREVENT_PACKAGE_BUILD) && !target(package) && defined(_OPTIONS_OK) package: .if defined(IGNORE_SILENT) @${DO_NADA} .else - @${ECHO_MSG} "===> ${PKGNAME} may not be packaged: ${NO_PACKAGE}." + @${ECHO_MSG} "===> ${PKGNAME} may not be packaged: ${PREVENT_PACKAGE_BUILD}." .endif .endif +# XXX deprecate NO_DESCRIBE? # Disable describe .if defined(NO_DESCRIBE) && !target(describe) describe: @@ -3803,6 +3934,9 @@ @${ECHO_MSG} "===> Installing for ${PKGNAME}" package-message: @${ECHO_MSG} "===> Building package for ${PKGNAME}" +.if defined(MANUAL_PACKAGE_BUILD) + @${ECHO_MSG} "===> Note: ${MANUAL_PACKAGE_BUILD}" +.endif # Empty pre-* and post-* targets @@ -3964,15 +4098,15 @@ .if !target(distclean) distclean: pre-distclean clean - @cd ${.CURDIR} && ${MAKE} delete-distfiles RESTRICTED_FILES="${_DISTFILES} ${_PATCHFILES}" + @cd ${.CURDIR} && ${MAKE} delete-distfiles _REMOVE_FILES="${_DISTFILES} ${_PATCHFILES}" .endif .if !target(delete-distfiles) delete-distfiles: @${ECHO_MSG} "===> Deleting distfiles for ${PKGNAME}" - @(if [ "X${RESTRICTED_FILES}" != "X" -a -d ${_DISTDIR} ]; then \ + @(if [ "X${_REMOVE_FILES}" != "X" -a -d ${_DISTDIR} ]; then \ cd ${_DISTDIR}; \ - for file in ${RESTRICTED_FILES}; do \ + for file in ${_REMOVE_FILES}; do \ ${RM} -f $${file}; \ dir=$${file%/*}; \ if [ "$${dir}" != "$${file}" ]; then \ @@ -3988,8 +4122,8 @@ .if !target(delete-distfiles-list) delete-distfiles-list: @${ECHO_CMD} "# ${PKGNAME}" - @if [ "X${RESTRICTED_FILES}" != "X" ]; then \ - for file in ${RESTRICTED_FILES}; do \ + @if [ "X${_REMOVE_FILES}" != "X" ]; then \ + for file in ${_REMOVE_FILES}; do \ ${ECHO_CMD} "[ -f ${_DISTDIR}/$$file ] && (${ECHO_CMD} deleting ${_DISTDIR}/$$file; ${RM} -f ${_DISTDIR}/$$file)"; \ dir=$${file%/*}; \ if [ "$${dir}" != "$${file}" ]; then \