rrdtool.spec 6.4 KB

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