From owner-freebsd-ports-bugs@FreeBSD.ORG Sun Nov 29 00:30:02 2009 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A1BA106568B for ; Sun, 29 Nov 2009 00:30:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 5CD578FC28 for ; Sun, 29 Nov 2009 00:30:02 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id nAT0U1NH065351 for ; Sun, 29 Nov 2009 00:30:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id nAT0U1T0065350; Sun, 29 Nov 2009 00:30:01 GMT (envelope-from gnats) Resent-Date: Sun, 29 Nov 2009 00:30:01 GMT Resent-Message-Id: <200911290030.nAT0U1T0065350@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, olli hauer Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 286EA106566C for ; Sun, 29 Nov 2009 00:21:49 +0000 (UTC) (envelope-from ohauer@gmx.de) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.freebsd.org (Postfix) with SMTP id 96B8E8FC13 for ; Sun, 29 Nov 2009 00:21:48 +0000 (UTC) Received: (qmail invoked by alias); 29 Nov 2009 00:21:46 -0000 Received: from u18-124.dsl.vianetworks.de (EHLO u18-124.dsl.vianetworks.de) [194.231.39.124] by mail.gmx.net (mp044) with SMTP; 29 Nov 2009 01:21:46 +0100 Received: by u18-124.dsl.vianetworks.de (Postfix, from userid 1100) id C5B8E2614B; Sun, 29 Nov 2009 01:21:41 +0100 (CET) Message-Id: <20091129002141.C5B8E2614B@u18-124.dsl.vianetworks.de> Date: Sun, 29 Nov 2009 01:21:41 +0100 (CET) From: olli hauer To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: ohauer@gmx.de Subject: ports/140983: [patch] port Mk/bsd.port.mk + bsd.rrd.mk X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: olli hauer List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 00:30:02 -0000 >Number: 140983 >Category: ports >Synopsis: [patch] Mk/bsd.port.mk + bsd.rrd.mk >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Sun Nov 29 00:30:01 UTC 2009 >Closed-Date: >Last-Modified: >Originator: olli hauer >Release: >Organization: >Environment: >Description: Within the last RRD update to version 1.3.x a lot of depencies (most X) have to build. Most of the ports running fine even with rrdtool10 but this can not be configured without modify everytime port database/rrdtool (replace with older version) or patching every port to include anouther version. A solution is maybe to make this configurable with a USE_RRD variable in the port self. To make this work I wrote bsd.rrd.mk and extend bsd.ports.mk, so a port which use RRD can now be written in this form (see sample modification from mail/mailgraph) It is only important to set USE_RRD after RUN_DEPENDS! (hope I can attach more than one file) -- olli hauer >How-To-Repeat: compair build on fresh between rrdtool12 and rrdtool(13) >Fix: --- sample_for_rewritten_mail_mailgraph_Makefile.txt begins here --- --- mail/mailgraph/Makefile.orig 2008-06-24 14:34:52.000000000 +0200 +++ mail/mailgraph/Makefile 2009-11-29 00:39:38.000000000 +0100 @@ -15,11 +15,11 @@ MAINTAINER= rafan@FreeBSD.org COMMENT= A RRDtool frontend for Postfix statistics -RUN_DEPENDS= ${SITE_PERL}/RRDp.pm:${PORTSDIR}/databases/rrdtool \ - ${SITE_PERL}/File/Tail.pm:${PORTSDIR}/devel/p5-File-Tail +RUN_DEPENDS= ${SITE_PERL}/File/Tail.pm:${PORTSDIR}/devel/p5-File-Tail NO_BUILD= yes USE_PERL5= yes +USE_RRD= 10+ CGIDIR?= ${PREFIX}/www/cgi-bin DATADIR?= /var/db/mailgraph --- sample_for_rewritten_mail_mailgraph_Makefile.txt ends here --- --- patch_Mk_bsd.port.mk.txt begins here --- --- Mk/bsd.port.mk +++ Mk/bsd.port.mk @@ -1583,6 +1583,10 @@ .include "${PORTSDIR}/Mk/bsd.kde4.mk" .endif +.if defined(USE_RRD) +.include "${PORTSDIR}/Mk/bsd.rrd.mk" +.endif + # You can force skipping these test by defining IGNORE_PATH_CHECKS .if !defined(IGNORE_PATH_CHECKS) .if (${PREFIX:C,(^.).*,\1,} != "/") @@ -2076,6 +2080,10 @@ .include "${PORTSDIR}/Mk/bsd.cmake.mk" .endif +.if defined(USE_RRD) +.include "${PORTSDIR}/Mk/bsd.rrd.mk" +.endif + .if exists(${PORTSDIR}/../Makefile.inc) .include "${PORTSDIR}/../Makefile.inc" USE_SUBMAKE= yes --- patch_MK_bsd.port.mk.txt ends here --- --- patch_Mk_bsd.rrd.mk.txt begins here --- --- /dev/null 2009-11-29 00:52:27.000000000 +0100 +++ Mk/bsd.rrd.mk 2009-11-29 00:52:59.000000000 +0100 @@ -0,0 +1,114 @@ +#-*- mode: makefile; tab-width: 4; -*- +# ex:ts=4 +# +# $FreeBSD$ +# +# bsd.rrd.mk - rrdtool related macros. +# Author: olli hauer +# +# Please view me with 4 column tabs! + +########################################################################## +# +# Variables definition +# USE_RRD: Call this script. Values can be: +# : 1.0/10/1.2/12/1.3/1.3/1.0+/1.2+/1.3+ +# +# Note: Setting USE_RRD to "yes" will set RRD_PORT to database/rrdtool +# + + +.if !defined(RRD_Pre_Include) +RRD_Pre_Include= bsd.rrd.mk + +#RRD_PORT= rrdtool13 + +# Print warnings +_ERROR_MSG= : Error from bsd.rrd.mk. +RRD_SUPPORTED_VERSION= 10 12 13 +RRD_DEFAULT_VERSION= 13 + +# fallback to last version +.if ${USE_RRD:L} == yes +RRD_PORT?= database/rrdtool +USE_RRD= ${RRD_DEFAULT_VERSION} +.endif + +RRD_VERSION= ${USE_RRD:C/\.//} +RRD?= ${LOCALBASE}/bin/rrdtool + +.if exists(${RRD}) +RRD_INSTALLED_VERSION!= ${RRD} | ${SED} -ne 's/^RRDtool \([0-9]\)\.\([0-9]\)\.\([0-9][0-9]\).*/\1\2/p' +.endif + +.if defined(RRD_PORT) +STR_RRD_PORT= ${RRD_PORT:C/rrdtool//} +. if ${STR_RRD_PORT} != "" +. if ${STR_RRD_PORT} == "10" +RRD_CUR_VERSION= 10 +. elif ${STR_RRD_PORT} == "12" +RRD_CUR_VERSION= 12 +. elif ${STR_RRD_PORT} == "${RRD_DEFAULT_VERSION}" +RRD_CUR_VERSION= ${RRD_DEFAULT_VERSION} +. endif +. else +# only "rrdtool" is defined (without numeric prefix) +RRD_CUR_VERSION= ${RRD_DEFAULT_VERSION} +. endif +.endif + +# check if installed version match defined version in make.conf +.if defined(RRD_INSTALLED_VERSION) && defined(RRD_CUR_VERSION) +VERSION_CHECK!= eval `${ECHO_CMD} "[ ${RRD_INSTALLED_VERSION} -eq ${RRD_CUR_VERSION} ]" | ${SED} -e 's/- -eq/ -ge/ ; s/+ -eq/ -le/' ` ; ${ECHO_CMD} $${?} +. if ${VERSION_CHECK} == 1 +IGNORE= ${_ERROR_MSG} rrdtool${RRD_INSTALLED_VERSION} is installed but RRD_PORT rrdtool${RRD_CUR_VERSION} is defined (maybe in make.conf) +. endif +.endif + +# nothing defined in make.conf, use installed version +.if defined(RRD_INSTALLED_VERSION) && !defined(RRD_CUR_VERSION) +RRD_CUR_VERSION= ${RRD_INSTALLED_VERSION} +.endif + +# check if installed version match version the port wants +.if defined(RRD_CUR_VERSION) +VERSION_CHECK!= eval `${ECHO_CMD} "[ ${RRD_VERSION} -eq ${RRD_CUR_VERSION} ]" | ${SED} -e 's/- -eq/ -ge/ ; s/+ -eq/ -le/' ` ; ${ECHO_CMD} $${?} +. if ${VERSION_CHECK} == 1 +IGNORE= ${_ERROR_MSG} rrdtool${RRD_CUR_VERSION} is installed (or RRD_PORT is defined) and port requires ${USE_RRD} +. endif +RRD_VERSION= ${RRD_CUR_VERSION} +.else +RRD_CUR_VERSION= none +. if !defined(RRD_PORT) +#Fallback to smallest version... +RRD_VERSION= ${USE_RRD:C/\+//} +. endif +.endif + +# map RRD version to ports directory +.if ${RRD_VERSION} == 10 +RRD_PORT?= database/rrdttol${RRD_VERSION} +RUN_DEPENDS+= rrdtool10:${PORTSDIR}/databases/rrdtool10 + +.elif ${RRD_VERSION} == 12 +RRD_PORT?= database/rrdttol${RRD_VERSION} +RUN_DEPENDS+= rrdtool12:${PORTSDIR}/databases/rrdtool12 + +.elif ${RRD_VERSION} == ${RRD_DEFAULT_VERSION} +RRD_PORT?= database/rrdttol +RUN_DEPENDS+= rrdtool:${PORTSDIR}/databases/rrdtool + +.elif ${RRD_VERSION} >= ${RRD_DEFAULT_VERSION} +RRD_PORT?= database/rrdttol +RUN_DEPENDS+= rrdtool:${PORTSDIR}/databases/rrdtool + +.else +RRD_PORT?= database/rrdttol +RUN_DEPENDS+= rrdtool:${PORTSDIR}/databases/rrdtool +.endif + +.endif #!defined(RRD_Pre_Include) + +.if defined(_POSTMKINCLUDED) && !defined(RRD_Post_Include) +RRD_Post_Include= bsd.rrd.mk +.endif # defined(_POSTMKINCLUDED) && !defined(RRD_Post_Include) --- patch_MK_bsd.rrd.mk.txt ends here --- >Release-Note: >Audit-Trail: >Unformatted: