mrtg.spec 3.8 KB

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