From: Cédric Krier Date: Tue, 9 Jan 2007 23:01:44 +0000 (+0000) Subject: Fix memory usage X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8deb89997d306829aef09a002fb7fa6ec59db3b5;p=gentoo.git Fix memory usage Package-Manager: portage-2.1.1-r2 --- diff --git a/net-analyzer/rrdtool/ChangeLog b/net-analyzer/rrdtool/ChangeLog index b4af908df06c..94f1da47e1a6 100644 --- a/net-analyzer/rrdtool/ChangeLog +++ b/net-analyzer/rrdtool/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for net-analyzer/rrdtool # Copyright 2002-2007 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-analyzer/rrdtool/ChangeLog,v 1.107 2007/01/09 08:10:08 corsair Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/rrdtool/ChangeLog,v 1.108 2007/01/09 23:01:44 cedk Exp $ + +*rrdtool-1.2.15-r3 (09 Jan 2007) + + 09 Jan 2007; Cedric Krier + +files/rrdtool-1.2.15-mem-usage.patch, +rrdtool-1.2.15-r3.ebuild: + Add patch for memory usage see: http://oss.oetiker.ch/rrdtool-trac/ticket/54 09 Jan 2007; Markus Rothe rrdtool-1.2.15-r2.ebuild: Stable on ppc64; bug #160321 diff --git a/net-analyzer/rrdtool/Manifest b/net-analyzer/rrdtool/Manifest index d0105111fc58..bd6fc0591d7b 100644 --- a/net-analyzer/rrdtool/Manifest +++ b/net-analyzer/rrdtool/Manifest @@ -1,3 +1,7 @@ +AUX rrdtool-1.2.15-mem-usage.patch 4039 RMD160 674ac6fd1ec441776d3b364c919411a991baf162 SHA1 8b8f330627021b6de61dd77ee62e4a9e291b2b19 SHA256 a3363e8ac158eaa4179489735f2cfb2b1a7d2f0614bbeefb21a89141ba1f775e +MD5 78384e6b77d8f0d4816a7137db475315 files/rrdtool-1.2.15-mem-usage.patch 4039 +RMD160 674ac6fd1ec441776d3b364c919411a991baf162 files/rrdtool-1.2.15-mem-usage.patch 4039 +SHA256 a3363e8ac158eaa4179489735f2cfb2b1a7d2f0614bbeefb21a89141ba1f775e files/rrdtool-1.2.15-mem-usage.patch 4039 AUX rrdtool-1.2.15-newstyle-resize.patch 5231 RMD160 acdd68b7a7f422c615cfac824516beaeb782eb5e SHA1 973b40a3954942dd3306d5781f31faf4f88c257d SHA256 e55f1e7f0c4d3649b6790cb56247eaf5518a359ef662a959848805e416239fd1 MD5 7fcb8fda7c3d799249423d8e69e0febe files/rrdtool-1.2.15-newstyle-resize.patch 5231 RMD160 acdd68b7a7f422c615cfac824516beaeb782eb5e files/rrdtool-1.2.15-newstyle-resize.patch 5231 @@ -27,14 +31,18 @@ EBUILD rrdtool-1.2.15-r2.ebuild 2874 RMD160 3138905b4fb8da33745945dbfd84c0e4d280 MD5 fd879021ca0ddc7a13461cb32cd20c44 rrdtool-1.2.15-r2.ebuild 2874 RMD160 3138905b4fb8da33745945dbfd84c0e4d28006d8 rrdtool-1.2.15-r2.ebuild 2874 SHA256 3673d4443fb3040ae243e7938d3710012632f4ce919b5bcfa7f3bc4d51a779a5 rrdtool-1.2.15-r2.ebuild 2874 +EBUILD rrdtool-1.2.15-r3.ebuild 2919 RMD160 57942a45abb077df26c47150b1d7847f44bbe5ee SHA1 fc1391e76b909235c5862b05ce7e6fa33563c5ef SHA256 ddba78823257c496af69458ac559a235144a6407ca2b96bfa4c18661e5eca4f6 +MD5 a6707703d5b401ec281e6a1d4c0e3d02 rrdtool-1.2.15-r3.ebuild 2919 +RMD160 57942a45abb077df26c47150b1d7847f44bbe5ee rrdtool-1.2.15-r3.ebuild 2919 +SHA256 ddba78823257c496af69458ac559a235144a6407ca2b96bfa4c18661e5eca4f6 rrdtool-1.2.15-r3.ebuild 2919 EBUILD rrdtool-1.2.6-r1.ebuild 2788 RMD160 c4055a9138eb6e94af32062ba79280482813ae45 SHA1 a666087d78e3106377866ce27a04a411ebec979d SHA256 b6a7a497d9bdda2bda0e6186fbe944a1f776be937804474f7ba91fa9b13682fd MD5 e722b378905afb3354e4c82d5d12b731 rrdtool-1.2.6-r1.ebuild 2788 RMD160 c4055a9138eb6e94af32062ba79280482813ae45 rrdtool-1.2.6-r1.ebuild 2788 SHA256 b6a7a497d9bdda2bda0e6186fbe944a1f776be937804474f7ba91fa9b13682fd rrdtool-1.2.6-r1.ebuild 2788 -MISC ChangeLog 16413 RMD160 4edc285053b2367f2bd1fe35b99e107c9a69ed77 SHA1 e6f07516e98e6d85e7b88ef21d37fe3c1f4a65d2 SHA256 d4fba9d61d9a784e618ddff3c215049e5e5c80943e1052a788806c46d4af91ba -MD5 e2c87c80dd9ac0b4cd662b915e4a5a90 ChangeLog 16413 -RMD160 4edc285053b2367f2bd1fe35b99e107c9a69ed77 ChangeLog 16413 -SHA256 d4fba9d61d9a784e618ddff3c215049e5e5c80943e1052a788806c46d4af91ba ChangeLog 16413 +MISC ChangeLog 16638 RMD160 9d905ed7d5daf7f4a6ae3f86aba0ce009aa33e66 SHA1 2f06868e39f093035b61598ae392252f49154491 SHA256 a334c3fa3e52479f20d44df23ea61a36e83d37512c5f733f85d096903ae9f1c4 +MD5 0f2333ab4ba24c38231cc175e1d10e38 ChangeLog 16638 +RMD160 9d905ed7d5daf7f4a6ae3f86aba0ce009aa33e66 ChangeLog 16638 +SHA256 a334c3fa3e52479f20d44df23ea61a36e83d37512c5f733f85d096903ae9f1c4 ChangeLog 16638 MISC metadata.xml 241 RMD160 b010229ed860b6dadc3faa19006512f195e3ee55 SHA1 01721f8bf6f699f3647589a173ef1941fbd6dd1c SHA256 de63c7fc765937d32e93bda47d365a2e044ad3c6a70caff4ff5916dde97e6a3c MD5 1a739170238a1fae241a8a0df21462e9 metadata.xml 241 RMD160 b010229ed860b6dadc3faa19006512f195e3ee55 metadata.xml 241 @@ -51,6 +59,9 @@ SHA256 8c4da2c7ffee42dd2da4823e3fe3ccaee43b6a64c89565037239e3b47f30ed6f files/di MD5 d04040e7f409bdc7d2ab4fce17702cdf files/digest-rrdtool-1.2.15-r2 247 RMD160 772add36b866e1107c42ba47f6b9f6e938a758c4 files/digest-rrdtool-1.2.15-r2 247 SHA256 62ab296ac4fc6e30708d669ec3df2e44b159d3b5075b047d2f551d4e1dea6f5b files/digest-rrdtool-1.2.15-r2 247 +MD5 d04040e7f409bdc7d2ab4fce17702cdf files/digest-rrdtool-1.2.15-r3 247 +RMD160 772add36b866e1107c42ba47f6b9f6e938a758c4 files/digest-rrdtool-1.2.15-r3 247 +SHA256 62ab296ac4fc6e30708d669ec3df2e44b159d3b5075b047d2f551d4e1dea6f5b files/digest-rrdtool-1.2.15-r3 247 MD5 105ab00f490ce2f0372afde45ccd2549 files/digest-rrdtool-1.2.6-r1 241 RMD160 3425de5ce68bc51b0c1c301cc75956def35af3f2 files/digest-rrdtool-1.2.6-r1 241 SHA256 b1a53151e3b90098c6124eac6da2dcd5ebff47f1f378709f3c5af62174565743 files/digest-rrdtool-1.2.6-r1 241 diff --git a/net-analyzer/rrdtool/files/digest-rrdtool-1.2.15-r3 b/net-analyzer/rrdtool/files/digest-rrdtool-1.2.15-r3 new file mode 100644 index 000000000000..4a38035815c3 --- /dev/null +++ b/net-analyzer/rrdtool/files/digest-rrdtool-1.2.15-r3 @@ -0,0 +1,3 @@ +MD5 bde8b12c202bc4e27fb9a9588a0aaddf rrdtool-1.2.15.tar.gz 1043064 +RMD160 493e5b108ac363484eb4015c0962945c5fb9fb9e rrdtool-1.2.15.tar.gz 1043064 +SHA256 b33d68da8a39bb0fc745c0202f3a58e73bfc6a9fd35d71fbd8979d40a5ef7397 rrdtool-1.2.15.tar.gz 1043064 diff --git a/net-analyzer/rrdtool/files/rrdtool-1.2.15-mem-usage.patch b/net-analyzer/rrdtool/files/rrdtool-1.2.15-mem-usage.patch new file mode 100644 index 000000000000..e6f2f7d3761f --- /dev/null +++ b/net-analyzer/rrdtool/files/rrdtool-1.2.15-mem-usage.patch @@ -0,0 +1,133 @@ +diff -ru rrdtool-1.2.15~/src/rrd_graph.c rrdtool-1.2.15/src/rrd_graph.c +--- rrdtool-1.2.15~/src/rrd_graph.c 2007-01-09 23:40:14.000000000 +0100 ++++ rrdtool-1.2.15/src/rrd_graph.c 2007-01-09 23:48:03.000000000 +0100 +@@ -1060,8 +1060,9 @@ + ** relevant for min and max + */ + if (finite(paintval) && im->gdes[ii].gf != GF_TICK ) { +- if (isnan(minval) || paintval < minval) +- minval = paintval; ++ if ((isnan(minval) || paintval < minval ) && ++ ! (im->logarithmic && paintval <= 0.0)) ++ minval = paintval; + if (isnan(maxval) || paintval > maxval) + maxval = paintval; + } +@@ -1710,6 +1711,35 @@ + return mnt; + } + ++static int AlmostEqual2sComplement (float A, float B, int maxUlps) ++{ ++ ++ int aInt = *(int*)&A; ++ int bInt = *(int*)&B; ++ int intDiff; ++ /* Make sure maxUlps is non-negative and small enough that the ++ default NAN won't compare as equal to anything. */ ++ ++ /* assert(maxUlps > 0 && maxUlps < 4 * 1024 * 1024); */ ++ ++ /* Make aInt lexicographically ordered as a twos-complement int */ ++ ++ if (aInt < 0) ++ aInt = 0x80000000l - aInt; ++ ++ /* Make bInt lexicographically ordered as a twos-complement int */ ++ ++ if (bInt < 0) ++ bInt = 0x80000000l - bInt; ++ ++ intDiff = abs(aInt - bInt); ++ ++ if (intDiff <= maxUlps) ++ return 1; ++ ++ return 0; ++} ++ + /* logaritmic horizontal grid */ + int + horizontal_log_grid(image_desc_t *im) +@@ -1719,7 +1749,9 @@ + {1.0, 5.0, 10., 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + {1.0, 2.0, 5.0, 7.0, 10., 0.0, 0.0, 0.0, 0.0, 0.0}, + {1.0, 2.0, 4.0, 6.0, 8.0, 10., 0.0, 0.0, 0.0, 0.0}, +- {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.}}; ++ {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.}, ++ {0,0,0,0,0, 0,0,0,0,0} /* last line */ }; ++ + + int i, j, val_exp, min_exp; + double nex; /* number of decades in data */ +@@ -1728,7 +1760,7 @@ + int mid = -1; /* row in yloglab for major grid */ + double mspac; /* smallest major grid spacing (pixels) */ + int flab; /* first value in yloglab to use */ +- double value, tmp; ++ double value, tmp, pre_value; + double X0,X1,Y0; + char graph_label[100]; + +@@ -1747,11 +1779,11 @@ + mid++; + for(i = 0; yloglab[mid][i + 1] < 10.0; i++); + mspac = logscale * log10(10.0 / yloglab[mid][i]); +- } while(mspac > 2 * im->text_prop[TEXT_PROP_LEGEND].size && mid < 5); ++ } while(mspac > 2 * im->text_prop[TEXT_PROP_LEGEND].size && yloglab[mid][0] > 0); + if(mid) mid--; + + /* find first value in yloglab */ +- for(flab = 0; frexp10(im->minval, &tmp) > yloglab[mid][flab]; flab++); ++ for(flab = 0; yloglab[mid][flab] < 10 && frexp10(im->minval, &tmp) > yloglab[mid][flab] ; flab++); + if(yloglab[mid][flab] == 10.0) { + tmp += 1.0; + flab = 0; +@@ -1763,8 +1795,12 @@ + X1=im->xorigin+im->xsize; + + /* draw grid */ ++ pre_value = DNAN; + while(1) { + value = yloglab[mid][flab] * pow(10.0, val_exp); ++ if ( AlmostEqual2sComplement(value,pre_value,4) ) break; /* it seems we are not converging */ ++ ++ pre_value = value; + + Y0 = ytr(im, value); + if(Y0 <= im->yorigin - im->ysize) break; +@@ -2484,34 +2520,6 @@ + /* yes we are loosing precision by doing tos with floats instead of doubles + but it seems more stable this way. */ + +-static int AlmostEqual2sComplement (float A, float B, int maxUlps) +-{ +- +- int aInt = *(int*)&A; +- int bInt = *(int*)&B; +- int intDiff; +- /* Make sure maxUlps is non-negative and small enough that the +- default NAN won't compare as equal to anything. */ +- +- /* assert(maxUlps > 0 && maxUlps < 4 * 1024 * 1024); */ +- +- /* Make aInt lexicographically ordered as a twos-complement int */ +- +- if (aInt < 0) +- aInt = 0x80000000l - aInt; +- +- /* Make bInt lexicographically ordered as a twos-complement int */ +- +- if (bInt < 0) +- bInt = 0x80000000l - bInt; +- +- intDiff = abs(aInt - bInt); +- +- if (intDiff <= maxUlps) +- return 1; +- +- return 0; +-} + + /* draw that picture thing ... */ + int diff --git a/net-analyzer/rrdtool/rrdtool-1.2.15-r3.ebuild b/net-analyzer/rrdtool/rrdtool-1.2.15-r3.ebuild new file mode 100644 index 000000000000..d514801ae4bd --- /dev/null +++ b/net-analyzer/rrdtool/rrdtool-1.2.15-r3.ebuild @@ -0,0 +1,125 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/rrdtool/rrdtool-1.2.15-r3.ebuild,v 1.1 2007/01/09 23:01:44 cedk Exp $ + +WANT_AUTOCONF="latest" +WANT_AUTOMAKE="latest" + +inherit perl-module flag-o-matic eutils multilib autotools + +DESCRIPTION="A system to store and display time-series data" +HOMEPAGE="http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/" +SRC_URI="http://people.ee.ethz.ch/~oetiker/webtools/${PN}/pub/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86" +IUSE="doc perl python rrdcgi tcl uclibc" + +RDEPEND="tcl? ( dev-lang/tcl ) + >=sys-libs/zlib-1.2.1 + >=media-libs/freetype-2.1.5 + >=media-libs/libart_lgpl-2.3.16 + >=media-libs/libpng-1.2.5 + rrdcgi? ( >=dev-libs/cgilib-0.5 )" + +DEPEND="${RDEPEND} + perl? ( dev-lang/perl ) + python? ( dev-lang/python ) + sys-apps/gawk" + +TCLVER="" + +src_unpack() { + unpack ${A} + cd "${S}" + sed -i -e 's::"../../src/rrd_\1":g' \ + bindings/tcl/tclrrd.c || die "sed failed" + sed -i -e 's:-lrrd_private:-ltcl -lrrd:' \ + bindings/tcl/Makefile.* || die "sed failed" + sed -i -e 's:python_PROGRAMS:pyexec_PROGRAMS:' \ + bindings/python/Makefile.* || die "sed failed" + sed -i -e 's:\$TCL_PACKAGE_PATH:${TCL_PACKAGE_PATH%% *}:' \ + configure.ac + epatch "${FILESDIR}"/${P}-newstyle-resize.patch + use uclibc && epatch "${FILESDIR}"/${P}-no-man.patch + epatch "${FILESDIR}"/${P}-mem-usage.patch + eautoreconf +} + +pkg_setup() { + use perl && perl-module_pkg_setup +} + +src_compile() { + filter-mfpmath sse + filter-flags -ffast-math + + local myconf + myconf="--datadir=/usr/share --enable-shared" + + if use tcl ; then + myconf="${myconf} --with-tcllib=/usr/$(get_libdir)" + else + myconf="${myconf} --disable-tcl" + fi + + use python || myconf="${myconf} --disable-python" + + if use perl ; then + econf ${myconf} \ + $(use_enable rrdcgi) \ + --with-perl-options='PREFIX=/usr INSTALLDIRS=vendor DESTDIR=${D}' || \ + die "econf failed" + else + econf ${myconf} \ + $(use_enable rrdcgi) \ + --disable-perl || die "econf failed" + fi + + make || die "make failed" +} + +src_install() { + make DESTDIR="${D}" install || die "make install failed" + + rm -fr "${D}"/usr/examples + rm -fr "${D}"/usr/shared + + if use doc ; then + dohtml doc/*.html + dodoc doc/*.pod + dodoc doc/*.txt + insinto /usr/share/doc/${PF}/examples + doins examples/* + insinto /usr/share/doc/${PF}/contrib + doins contrib/* + fi + + if use perl ; then + perlinfo + mytargets="site-perl-install" + perl-module_src_install || die + + # remove duplicate installation into /usr/lib/perl + rm -Rf "${D}"/usr/lib/perl + fi + + dodoc CONTRIBUTORS README TODO +} + +pkg_preinst() { + use perl && perl-module_pkg_preinst +} + +pkg_postinst() { + use perl && perl-module_pkg_postinst +} + +pkg_prerm() { + use perl && perl-module_pkg_prerm +} + +pkg_postrm() { + use perl && perl-module_pkg_postrm +}