Index: Mk/bsd.port.mk =================================================================== RCS file: /home/pcvs/ports/Mk/bsd.port.mk,v retrieving revision 1.687 diff -u -r1.687 bsd.port.mk --- Mk/bsd.port.mk 3 Jul 2011 15:51:18 -0000 1.687 +++ Mk/bsd.port.mk 3 Jul 2011 23:34:03 -0000 @@ -544,6 +544,12 @@ # # USE_NCURSES - If set, this port relies on the ncurses package. # +# USE_SVN +# USE_SVN_(LIB||BUILD|RUN) +# - If set, this port relies on devel/subversion or +# devel/subversion-freebsd. +# For more information see bsd.svn.mk! +# # Conflict checking. Use if your port cannot be installed at the same time as # another package. # @@ -1589,6 +1595,10 @@ .include "${PORTSDIR}/Mk/bsd.ncurses.mk" .endif +.if defined(USE_SVN) || defined(USE_SVN_LIB) || defined(USE_SVN_BUILD) || defined(USE_SVN_RUN) +.include "${PORTSDIR}/Mk/bsd.svn.mk" +.endif + # You can force skipping these test by defining IGNORE_PATH_CHECKS .if !defined(IGNORE_PATH_CHECKS) .if (${PREFIX:C,(^.).*,\1,} != "/") @@ -2168,6 +2178,10 @@ .include "${PORTSDIR}/Mk/bsd.cmake.mk" .endif +.if defined(USE_SVN) || defined(USE_SVN_LIB) || defined(USE_SVN_BUILD) || defined(USE_SVN_RUN) +.include "${PORTSDIR}/Mk/bsd.svn.mk" +.endif + .if exists(${PORTSDIR}/../Makefile.inc) .include "${PORTSDIR}/../Makefile.inc" USE_SUBMAKE= yes Index: Mk/bsd.svn.mk =================================================================== RCS file: Mk/bsd.svn.mk diff -N Mk/bsd.svn.mk --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ Mk/bsd.svn.mk 3 Jul 2011 23:34:03 -0000 @@ -0,0 +1,209 @@ +#-*- mode: makefile; tab-width: 4; -*- +# ex:ts=4 +# +# $FreeBSD$ +# +# bsd.svn.mk - macros for ports which have a dependency on subversion +# Author: Olli Hauer +# +# Please view me with 4 column tabs! + +# ============================================================== +# Note for End Users: +# To choose devel/subversion-freebsd instead devel/subversion +# define one of the following parameters in /etc/make.conf +# +# - SVN_PORT= devel/subversion (default) +# or devel/subversion-freebsd +# +# - WITH_FREEBSD_SUBVERSION= yes +# +# Hint: +# If the port specifies on of the parameters below and WITH_SVN_FBSD +# then WITH_FREEBSD_SUBVERSION is implied. +# ============================================================== +# This script will be included if one of the following parameters +# is defined in the Makefile of the port. +# +# USE_SVN - BUILD and RUN depends (FETCH depends) +# USE_SVN_LIB - LIB_DEPENDS +# USE_SVN_BUILD - BUILD_DEPENDS +# USE_SVN_RUN - RUN_DEPENDS +# +# +# The following values can be used with the parameters above. +# +# USE_SVN= yes perl python ruby fetch +# USE_SVN_LIB= yes perl python ruby java +# USE_SVN_BUILD= yes perl python ruby +# USE_SVN_RUN= yes perl python ruby +# +# - yes depend on devel/subversion(-freebsd) +# - perl depend on devel/p5-subversion +# - python depend on devel/py-subversion +# - ruby depend on devel/ruby-subversion +# - java depend on java/subversion-java +# +# - fetch depend on svn to fetch sources. Only valid if +# BOOTSTRAP is defined. This shouldn't be used by +# endusers to fetch sourecs. +# +# Hint: +# - perl, python, ruby and java do not imply an explicit dependency on subversion, +# the dependency is triggered by the (p5|py|ruby|java)-subversion port. +# - do not specified a value more than once: +# +# Note: +# Subversion installs the following binaries: +# - svn, svnadmin, svndumpfilter, svnlook, svnserve, svnsync, svnversion +# => Because of this, it is sufficient to check only for svn +# +# + +.if !defined(SVN_Include) +SVN_Include= bsd.svn.mk + +_USE_SVN_BUILD= yes perl python ruby +_USE_SVN= ${_USE_SVN_BUILD} fetch +_USE_SVN_LIB= ${_USE_SVN_BUILD} java +_USE_SVN_RUN= ${_USE_SVN_BUILD} +_USE_SVN_FETCH= yes + +# Print warnings +_ERROR_MSG= : Error from bsd.svn.mk. + +# ========================================================================= +# check for port OPTION SVN_FBSD +.if defined(WITH_SVN_FBSD) +WITH_FREEBSD_SUBVERSION= yes +.endif + +# User controlled port decision +.if defined(SVN_PORT) && !empty(SVN_PORT) +. if ${SVN_PORT} == "devel/subversion" +. if defined(WITH_FREEBSD_SUBVERSION) +IGNORE= ${_ERROR_MSG} SVN_PORT ( ${SVN_PORT} ) conflicts WITH_FREEBSD_SUBVERSION or OPTION SVN_FBSD +. endif +. elif ${SVN_PORT} == "devel/subversion-freebsd" +WITH_FREEBSD_SUBVERSION= yes +. else +IGNORE= ${_ERROR_MSG} unknown value for SVN_PORT ( ${SVN_PORT} ) +. endif +.endif + +.if defined(WITH_FREEBSD_SUBVERSION) || defined(WITH_SVN_FBSD) +SVN_PORT?= devel/subversion-freebsd +.else +SVN_PORT?= devel/subversion +.endif + +# ========================================================================= +# If the port depends on (python|ruby)-subversion and USE_(PYTHON|RUBY) +# is not defined we have to include the bsd.XXX.mk file else PYTHON|RUBY +# specific paths are undefined. + +_TMP_SVN_VAR:= ${USE_SVN} ${USE_SVN_BUILD} ${USE_SVN_RUN} + +.if ${_TMP_SVN_VAR:Mpython} && !defined(Python_Pre_Include) +.include "${PORTSDIR}/Mk/bsd.python.mk" +.endif + +.if ${_TMP_SVN_VAR:Mruby} && !defined(Ruby_Include) +.include "${PORTSDIR}/Mk/bsd.ruby.mk" +.endif + +# ========================================================================= +# BUILD_DEPENDS / RUN_DEPENDS +_SVN:= svn:${PORTSDIR}/${SVN_PORT} +_SVN_PL:= ${SITE_PERL}/${PERL_ARCH}/SVN/Core.pm:${PORTSDIR}/devel/p5-subversion +_SVN_PY:= ${PYTHON_SITELIBDIR}/svn/__init__.py:${PORTSDIR}/devel/py-subversion +_SVN_RB:= ${RUBY_SITEARCHLIBDIR}/svn/ext/core.so:${PORTSDIR}/devel/ruby-subversion + +# LIB_DEPENDS +_SVN_LIB:= svn_client-1:${PORTSDIR}/${SVN_PORT} +_SVN_LIB_PL:= svn_swig_perl-1:${PORTSDIR}/devel/p5-subversion +_SVN_LIB_PY:= svn_swig_py-1:${PORTSDIR}/devel/py-subversion +_SVN_LIB_RB:= svn_swig_ruby-1:${PORTSDIR}/devel/ruby-subversion +_SVN_LIB_JA:= svnjavahl-1:${PORTSDIR}/java/subversion-java + +# ========================================================================= +.if defined(USE_SVN_LIB) +. for _opt in ${USE_SVN_LIB} +. if ${_USE_SVN_LIB:M${_opt}} == "yes" +LIB_DEPENDS+= ${_SVN_LIB} +. elif ${_USE_SVN_LIB:M${_opt}} == "perl" +LIB_DEPENDS+= ${_SVN_LIB_PL} +. elif ${_USE_SVN_LIB:M${_opt}} == "python" +LIB_DEPENDS+= ${_SVN_LIB_PY} +. elif ${_USE_SVN_LIB:M${_opt}} == "ruby" +LIB_DEPENDS+= ${_SVN_LIB_RB} +. elif ${_USE_SVN_LIB:M${_opt}} == "java" +LIB_DEPENDS+= ${_SVN_LIB_JA} +. else +IGNORE= ${_ERROR_MSG} Illegal use of USE_SVN_LIB ( value: ${_opt} ) +. endif +. endfor +.endif + +# ========================================================================= +.if defined(USE_SVN) +. for _opt in ${USE_SVN} +. if ${_USE_SVN:M${_opt}} == "yes" +USE_SVN_BUILD+= yes +USE_SVN_RUN+= yes +. elif ${_USE_SVN:M${_opt}} == "perl" +USE_SVN_BUILD+= perl +USE_SVN_RUN+= perl +. elif ${_USE_SVN:M${_opt}} == "python" +USE_SVN_BUILD+= python +USE_SVN_RUN+= python +. elif ${_USE_SVN:M${_opt}} == "ruby" +USE_SVN_BUILD+= ruby +USE_SVN_RUN+= ruby +. elif ${_USE_SVN:M${_opt}} == "fetch" +. if !defined(BOOTSTRAP) +IGNORE= ${_ERROR_MSG} USE_SVN=fetch should be used only if BOOTSTRAP is defined +. endif +FETCH_DEPENDS+= ${_SVN} +. else +IGNORE= ${_ERROR_MSG} Illegal use of USE_SVN ( value: ${_opt} ) +. endif +. endfor +.endif + +# ========================================================================= +.if defined(USE_SVN_BUILD) +. for _opt in ${USE_SVN_BUILD} +. if ${_USE_SVN_BUILD:M${_opt}} == "yes" +BUILD_DEPENDS+= ${_SVN} +. elif ${_USE_SVN_BUILD:M${_opt}} == "perl" +BUILD_DEPENDS+= ${_SVN_PL} +. elif ${_USE_SVN_BUILD:M${_opt}} == "python" +BUILD_DEPENDS+= ${_SVN_PY} +. elif ${_USE_SVN_BUILD:M${_opt}} == "ruby" +BUILD_DEPENDS+= ${_SVN_RB} +. else +IGNORE= ${_ERROR_MSG} Illegal use of USE_SVN_BUILD ( value: ${_opt} ) +. endif +. endfor +.endif + +# ========================================================================= +.if defined(USE_SVN_RUN) +. for _opt in ${USE_SVN_RUN} +. if ${_USE_SVN_RUN:M${_opt}} == "yes" +RUN_DEPENDS+= ${_SVN} +. elif ${_USE_SVN_RUN:M${_opt}} == "perl" +RUN_DEPENDS+= ${_SVN_PL} +. elif ${_USE_SVN_RUN:M${_opt}} == "python" +RUN_DEPENDS+= ${_SVN_PY} +. elif ${_USE_SVN_RUN:M${_opt}} == "ruby" +RUN_DEPENDS+= ${_SVN_RB} +. else +IGNORE= ${_ERROR_MSG} Illegal use of USE_SVN_RUN ( value: ${_opt} ) +. endif +. endfor +.endif + +# ========================================================================= +.endif # SVN_Include