Mon, 28 Jan 2013 17:37:18 +0100
Correct socket error reporting improvement with IPv6 portable code,
after helpful recommendation by Saúl Ibarra Corretgé on OSips devlist.
michael@166 | 1 | ## |
michael@166 | 2 | ## rrdtool.spec -- OpenPKG RPM Package Specification |
michael@491 | 3 | ## Copyright (c) 2000-2012 OpenPKG Foundation e.V. <http://openpkg.net/> |
michael@166 | 4 | ## |
michael@166 | 5 | ## Permission to use, copy, modify, and distribute this software for |
michael@166 | 6 | ## any purpose with or without fee is hereby granted, provided that |
michael@166 | 7 | ## the above copyright notice and this permission notice appear in all |
michael@166 | 8 | ## copies. |
michael@166 | 9 | ## |
michael@166 | 10 | ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED |
michael@166 | 11 | ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
michael@166 | 12 | ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
michael@166 | 13 | ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR |
michael@166 | 14 | ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
michael@166 | 15 | ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
michael@166 | 16 | ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF |
michael@166 | 17 | ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
michael@166 | 18 | ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
michael@166 | 19 | ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
michael@166 | 20 | ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
michael@166 | 21 | ## SUCH DAMAGE. |
michael@166 | 22 | ## |
michael@166 | 23 | |
michael@166 | 24 | # package version |
michael@490 | 25 | %define V_rrdtool 1.4.7 |
michael@491 | 26 | %define V_rrdtool_oo 0.32 |
michael@368 | 27 | %define V_rrdtool_creator 1.0 |
michael@166 | 28 | %define V_rrd_simple 1.44 |
michael@166 | 29 | |
michael@166 | 30 | # package information |
michael@166 | 31 | Name: rrdtool |
michael@166 | 32 | Summary: Round Robin Database |
michael@166 | 33 | URL: http://www.rrdtool.org/ |
michael@166 | 34 | Vendor: Tobias Oetiker |
michael@166 | 35 | Packager: OpenPKG Foundation e.V. |
michael@166 | 36 | Distribution: OpenPKG Community |
michael@166 | 37 | Class: BASE |
michael@166 | 38 | Group: Database |
michael@166 | 39 | License: LGPL |
michael@166 | 40 | Version: %{V_rrdtool} |
michael@492 | 41 | Release: 20120800 |
michael@166 | 42 | |
michael@166 | 43 | # package options |
michael@166 | 44 | %option with_perl no |
michael@166 | 45 | %option with_python no |
michael@166 | 46 | |
michael@166 | 47 | # list of sources |
michael@166 | 48 | Source0: http://oss.oetiker.ch/rrdtool/pub/rrdtool-%{V_rrdtool}.tar.gz |
michael@166 | 49 | Source1: http://www.cpan.org/authors/id/M/MS/MSCHILLI/RRDTool-OO-%{V_rrdtool_oo}.tar.gz |
michael@166 | 50 | Source2: http://www.cpan.org/authors/id/J/JA/JACQUELIN/RRDTool-Creator-%{V_rrdtool_creator}.tar.gz |
michael@166 | 51 | Source3: http://www.cpan.org/authors/id/N/NI/NICOLAW/RRD-Simple-%{V_rrd_simple}.tar.gz |
michael@166 | 52 | Patch0: rrdtool.patch |
michael@166 | 53 | |
michael@166 | 54 | # build information |
michael@491 | 55 | BuildPreReq: OpenPKG, openpkg >= 20100101, gcc, make, pkgconfig, perl-openpkg >= 5.8.3-20040126, perl-module, intltool |
michael@491 | 56 | PreReq: OpenPKG, openpkg >= 20100101 |
michael@710 | 57 | BuildPreReq: png, zlib, freetype, pango, cairo, libpixman, libxml, libffi |
michael@710 | 58 | PreReq: png, zlib, freetype, pango, cairo, libpixman, libxml, libffi |
michael@166 | 59 | %if "%{with_perl}" == "yes" |
michael@710 | 60 | BuildPreReq: perl, libpixman::with_pic = yes |
michael@710 | 61 | PreReq: perl, libpixman::with_pic = yes |
michael@166 | 62 | %endif |
michael@166 | 63 | %if "%{with_python}" == "yes" |
michael@166 | 64 | BuildPreReq: python |
michael@166 | 65 | PreReq: python |
michael@166 | 66 | %endif |
michael@166 | 67 | |
michael@166 | 68 | %description |
michael@166 | 69 | RRD is the Acronym for Round Robin Database. RRD is a system |
michael@166 | 70 | to store and display time-series data (i.e. network bandwidth, |
michael@166 | 71 | machine-room temperature, server load average). It stores the |
michael@166 | 72 | data in a very compact way that will not expand over time, and it |
michael@166 | 73 | presents useful graphs by processing the data to enforce a certain |
michael@166 | 74 | data density. It can be used either via simple wrapper scripts (from |
michael@166 | 75 | shell or Perl) or via frontends that poll network devices and put a |
michael@166 | 76 | friendly user interface on it. |
michael@166 | 77 | |
michael@166 | 78 | %track |
michael@166 | 79 | prog rrdtool = { |
michael@166 | 80 | version = %{V_rrdtool} |
michael@166 | 81 | url = http://oss.oetiker.ch/rrdtool/pub/ |
michael@166 | 82 | regex = rrdtool-(__VER__)\.tar\.gz |
michael@166 | 83 | } |
michael@166 | 84 | prog rrdtool:RRDTool-OO = { |
michael@166 | 85 | version = %{V_rrdtool_oo} |
michael@166 | 86 | url = http://www.cpan.org/authors/id/M/MS/MSCHILLI/ |
michael@166 | 87 | regex = RRDTool-OO-(__VER__)\.tar\.gz |
michael@166 | 88 | } |
michael@166 | 89 | prog rrdtool:RRDTool-Creator = { |
michael@166 | 90 | version = %{V_rrdtool_creator} |
michael@166 | 91 | url = http://www.cpan.org/authors/id/J/JA/JACQUELIN/ |
michael@166 | 92 | regex = RRDTool-Creator-(__VER__)\.tar\.gz |
michael@166 | 93 | } |
michael@166 | 94 | prog rrdtool:RRD-Simple = { |
michael@166 | 95 | version = %{V_rrd_simple} |
michael@166 | 96 | url = http://www.cpan.org/authors/id/N/NI/NICOLAW/ |
michael@166 | 97 | regex = RRD-Simple-(__VER__)\.tar\.gz |
michael@166 | 98 | } |
michael@166 | 99 | |
michael@166 | 100 | %prep |
michael@166 | 101 | %setup -q |
michael@166 | 102 | %setup -q -D -T -a 1 |
michael@166 | 103 | %setup -q -D -T -a 2 |
michael@166 | 104 | %setup -q -D -T -a 3 |
michael@166 | 105 | %patch -p0 |
michael@166 | 106 | rm -f bindings/perl-shared/ntmake.pl |
michael@166 | 107 | rm -rf RRDTool-Creator-*/_build |
michael@492 | 108 | %{l_shtool} subst \ |
michael@492 | 109 | -e 's;-lglib2;-lglib;g' \ |
michael@492 | 110 | configure |
michael@492 | 111 | %{l_shtool} subst \ |
michael@492 | 112 | -e 's;glib2/glib\.h;glib/glib.h;' \ |
michael@492 | 113 | src/rrd_daemon.c |
michael@166 | 114 | |
michael@166 | 115 | %build |
michael@166 | 116 | # configure package |
michael@491 | 117 | echo "ac_cv_path_PERL=no" >config.cache |
michael@166 | 118 | CC="%{l_cc}" \ |
michael@166 | 119 | CPPFLAGS="%{l_cppflags}" \ |
michael@710 | 120 | %if "%{with_perl}" == "yes" |
michael@710 | 121 | CFLAGS="%{l_cflags -O} -fPIC" \ |
michael@710 | 122 | LDLAGS="%{l_ldflags} -fPIC" \ |
michael@710 | 123 | %else |
michael@166 | 124 | CFLAGS="%{l_cflags -O}" \ |
michael@166 | 125 | LDLAGS="%{l_ldflags}" \ |
michael@710 | 126 | %endif |
michael@491 | 127 | LIBS="`pkg-config pangocairo --libs`" \ |
michael@166 | 128 | ./configure \ |
michael@166 | 129 | --cache-file=./config.cache \ |
michael@166 | 130 | --prefix=%{l_prefix} \ |
michael@166 | 131 | --mandir=%{l_prefix}/man \ |
michael@166 | 132 | %if "%{with_python}" == "yes" |
michael@166 | 133 | --enable-python \ |
michael@166 | 134 | %else |
michael@166 | 135 | --disable-python \ |
michael@166 | 136 | %endif |
michael@166 | 137 | --disable-tcl \ |
michael@166 | 138 | --disable-ruby \ |
michael@166 | 139 | --disable-shared \ |
michael@491 | 140 | --disable-nls \ |
michael@166 | 141 | --enable-rrdcgi |
michael@166 | 142 | |
michael@166 | 143 | # build package |
michael@630 | 144 | %{l_make} %{l_mflags -O} |
michael@166 | 145 | |
michael@166 | 146 | # build Perl part |
michael@166 | 147 | %if "%{with_perl}" == "yes" |
michael@166 | 148 | %{l_prefix}/bin/perl-openpkg prepare |
michael@166 | 149 | %{l_prefix}/bin/perl-openpkg -d bindings/perl-piped configure build |
michael@166 | 150 | %{l_prefix}/bin/perl-openpkg -d bindings/perl-shared configure build |
michael@166 | 151 | %{l_prefix}/bin/perl-openpkg -d RRDTool-OO-%{V_rrdtool_oo} configure build |
michael@166 | 152 | %{l_prefix}/bin/perl-openpkg -d RRDTool-Creator-%{V_rrdtool_creator} configure build |
michael@166 | 153 | %{l_prefix}/bin/perl-openpkg -d RRD-Simple-%{V_rrd_simple} configure build |
michael@166 | 154 | %endif |
michael@166 | 155 | |
michael@166 | 156 | %install |
michael@166 | 157 | |
michael@166 | 158 | # install package |
michael@166 | 159 | %{l_shtool} subst \ |
michael@166 | 160 | -e 's/^\(install-data-am:\).*/\1/' \ |
michael@166 | 161 | Makefile |
michael@166 | 162 | %{l_make} %{l_mflags} install \ |
michael@710 | 163 | DESTDIR=$RPM_BUILD_ROOT DESTDIR="$RPM_BUILD_ROOT" |
michael@166 | 164 | |
michael@166 | 165 | # install Perl part |
michael@166 | 166 | %if "%{with_perl}" == "yes" |
michael@166 | 167 | %{l_prefix}/bin/perl-openpkg -d bindings/perl-piped install |
michael@166 | 168 | %{l_prefix}/bin/perl-openpkg -d bindings/perl-shared install |
michael@166 | 169 | %{l_prefix}/bin/perl-openpkg -d RRDTool-OO-%{V_rrdtool_oo} install |
michael@166 | 170 | %{l_prefix}/bin/perl-openpkg -d RRDTool-Creator-%{V_rrdtool_creator} install |
michael@166 | 171 | %{l_prefix}/bin/perl-openpkg -d RRD-Simple-%{V_rrd_simple} install |
michael@166 | 172 | %endif |
michael@166 | 173 | |
michael@166 | 174 | # strip down installation hierarchy |
michael@166 | 175 | rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/doc |
michael@166 | 176 | %if "%{with_python}" == "no" |
michael@166 | 177 | rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib/python |
michael@166 | 178 | %endif |
michael@166 | 179 | rm -rf $RPM_BUILD_ROOT%{l_prefix}/rrdtool-* |
michael@166 | 180 | rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/rrdtutorial.es.1 |
michael@166 | 181 | rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/locale |
michael@166 | 182 | strip $RPM_BUILD_ROOT%{l_prefix}/bin/* 2>/dev/null || true |
michael@166 | 183 | |
michael@166 | 184 | # post-process Perl part |
michael@166 | 185 | %if "%{with_perl}" == "yes" |
michael@166 | 186 | %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup |
michael@166 | 187 | %else |
michael@166 | 188 | >perl-openpkg-files |
michael@166 | 189 | %endif |
michael@166 | 190 | |
michael@166 | 191 | # determine installation files |
michael@166 | 192 | %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ |
michael@166 | 193 | %{l_files_std} `cat perl-openpkg-files` |
michael@166 | 194 | |
michael@166 | 195 | %files -f files |
michael@166 | 196 | |
michael@166 | 197 | %clean |
michael@166 | 198 |