mrtg.spec 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. ##
  2. ## mrtg.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2004 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2004 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2004 Cable & Wireless <http://www.cw.com/>
  6. ##
  7. ## Permission to use, copy, modify, and distribute this software for
  8. ## any purpose with or without fee is hereby granted, provided that
  9. ## the above copyright notice and this permission notice appear in all
  10. ## copies.
  11. ##
  12. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  13. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  14. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  15. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  16. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  17. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  18. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  19. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  20. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  21. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  22. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  23. ## SUCH DAMAGE.
  24. ##
  25. # package information
  26. Name: mrtg
  27. Summary: Multi Router Traffic Grapher
  28. URL: http://people.ee.ethz.ch/~oetiker/webtools/mrtg/
  29. Vendor: Tobias Oetiker
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG
  32. Class: EVAL
  33. Group: Web
  34. License: GPL
  35. Version: 2.10.15
  36. Release: 20040808
  37. # list of sources
  38. Source0: http://people.ee.ethz.ch/~oetiker/webtools/mrtg/pub/mrtg-%{version}.tar.gz
  39. Source1: mrtg.cfg
  40. Source2: rc.mrtg
  41. # build information
  42. Prefix: %{l_prefix}
  43. BuildRoot: %{l_buildroot}
  44. BuildPreReq: OpenPKG, openpkg >= 20040130, perl, zlib, gd, png
  45. PreReq: OpenPKG, openpkg >= 20040130, perl, zlib, gd, png, snmp
  46. AutoReq: no
  47. AutoReqProv: no
  48. %description
  49. The Multi Router Traffic Grapher (MRTG) is a tool to monitor the traffic
  50. load on network-links. MRTG generates HTML pages containing graphical
  51. images which provide a LIVE visual representation of this traffic.
  52. %track
  53. prog mrtg = {
  54. version = %{version}
  55. url = http://people.ee.ethz.ch/~oetiker/webtools/mrtg/pub/
  56. regex = mrtg-(__VER__)\.tar\.gz
  57. }
  58. %prep
  59. %setup -q
  60. %{l_shtool} subst \
  61. -e 's;mrtg2";mrtg";g' \
  62. bin/*
  63. %build
  64. CC="%{l_cc}" \
  65. CFLAGS="%{l_cflags -O}" \
  66. CPPFLAGS="%{l_cppflags}" \
  67. LDFLAGS="%{l_ldflags}" \
  68. ./configure \
  69. --prefix=%{l_prefix} \
  70. --with-gd=%{l_prefix} \
  71. --with-z=%{l_prefix} \
  72. --with-png=%{l_prefix}
  73. %{l_make} %{l_mflags -O}
  74. %install
  75. rm -rf $RPM_BUILD_ROOT
  76. %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
  77. %{l_shtool} mkdir -f -p -m 755 \
  78. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
  79. $RPM_BUILD_ROOT%{l_prefix}/etc/mrtg \
  80. $RPM_BUILD_ROOT%{l_prefix}/var/mrtg \
  81. $RPM_BUILD_ROOT%{l_prefix}/web/mrtg
  82. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  83. %{SOURCE rc.mrtg} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  84. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  85. %{SOURCE mrtg.cfg} $RPM_BUILD_ROOT%{l_prefix}/etc/mrtg/
  86. mv $RPM_BUILD_ROOT%{l_prefix}/lib/mrtg2 \
  87. $RPM_BUILD_ROOT%{l_prefix}/lib/mrtg
  88. mv $RPM_BUILD_ROOT%{l_prefix}/share/mrtg2 \
  89. $RPM_BUILD_ROOT%{l_prefix}/share/mrtg
  90. mv -f $RPM_BUILD_ROOT%{l_prefix}/share/doc/mrtg2 \
  91. $RPM_BUILD_ROOT%{l_prefix}/share/mrtg/doc
  92. rmdir $RPM_BUILD_ROOT%{l_prefix}/share/doc
  93. strip $RPM_BUILD_ROOT%{l_prefix}/bin/rateup >/dev/null 2>&1 || true
  94. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  95. %{l_files_std} \
  96. '%config %{l_prefix}/etc/mrtg/mrtg.cfg'
  97. %files -f files
  98. %clean
  99. rm -rf $RPM_BUILD_ROOT