snmp.spec 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. ##
  2. ## snmp.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2003 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
  5. ## Copyright (c) 2000-2003 Ralf S. Engelschall <rse@engelschall.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: snmp
  27. Summary: Simple Network Management Protocol (SNMP) Toolkit
  28. URL: http://www.net-snmp.org/
  29. Vendor: University of California Davis
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG [PLUS]
  32. Group: Network
  33. License: BSD
  34. Version: 5.0.8
  35. Release: 20030429
  36. # package options
  37. %option with_host_mib no
  38. # list of sources
  39. Source0: http://osdn.dl.sourceforge.net/net-snmp/net-snmp-%{version}.tar.gz
  40. Source1: rc.snmp
  41. Source2: snmpd.conf
  42. # build information
  43. Prefix: %{l_prefix}
  44. BuildRoot: %{l_buildroot}
  45. BuildPreReq: OpenPKG, openpkg >= 20030428, openssl
  46. PreReq: OpenPKG, openpkg >= 20030428
  47. AutoReq: no
  48. AutoReqProv: no
  49. %description
  50. This is a toolkit relating to the Simple Network Management Protocol
  51. (SNMP), including: an extensible agent; an SNMP library; tools to
  52. request or set information from SNMP agents; tools to generate and
  53. handle SNMP traps; a version of the unix 'netstat' command using
  54. SNMP; etc.
  55. %prep
  56. %setup -q -n net-snmp-%{version}
  57. %{l_shtool} subst \
  58. -e 's;/usr/include/rpm;%{l_prefix}/include/rpm;g' \
  59. -e 's;-lpopt\([^a-z]\);-lrpmpopt\1;g' \
  60. -e 's;-ldb\([^a-z]\);-lrpmdb\1;g' \
  61. -e 's;-lz\([^a-z]\);-lrpz\1;g' \
  62. -e 's;-lrpm\([^a-z]\);-lrpm -lrpmio\1;g' \
  63. -e 's;-lrpmio\([^a-z]\);-lrpmio -lrpmpopt -lrpmbz2 -lrpmz\1;g' \
  64. configure
  65. %build
  66. ./configure \
  67. --with-cc="%{l_cc}" \
  68. --with-cflags="%{l_cflags -O}" \
  69. --with-ldflags="%{l_ldflags}" \
  70. --prefix=%{l_prefix} \
  71. --with-persistent-directory=%{l_prefix}/var/snmp \
  72. --with-openssl=%{l_prefix} \
  73. --enable-silent-libtool \
  74. --disable-shared \
  75. %if "%{with_host_mib}" == "yes"
  76. --with-mib-modules="host" \
  77. %endif
  78. --with-defaults
  79. %{l_make} %{l_mflags} touchit
  80. %{l_make} %{l_mflags}
  81. %install
  82. rm -rf $RPM_BUILD_ROOT
  83. %{l_shtool} subst -v \
  84. -e "s;^\\(prefix.*=\\).*;\\1 $RPM_BUILD_ROOT%{l_prefix};g" \
  85. -e "s;^\\(exec_prefix.*=\\).*;\\1 $RPM_BUILD_ROOT%{l_prefix};g" \
  86. -e "s;^\\(persistentdir.*=\\).*;\\1 $RPM_BUILD_ROOT%{l_prefix}/var/snmp;g" \
  87. `find . -type f -name Makefile -print`
  88. %{l_make} %{l_mflags} install
  89. %{l_shtool} mkdir -f -p -m 755 \
  90. $RPM_BUILD_ROOT%{l_prefix}/var/snmp \
  91. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
  92. $RPM_BUILD_ROOT%{l_prefix}/etc/snmp
  93. %{l_shtool} install -c -m 644 \
  94. %{SOURCE snmpd.conf} \
  95. $RPM_BUILD_ROOT%{l_prefix}/etc/snmp/
  96. %{l_shtool} install -c -m 755 \
  97. -e 's;@l_prefix@;%{l_prefix};g' \
  98. -e 's;@l_susr@;%{l_susr};g' \
  99. %{SOURCE rc.snmp} \
  100. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  101. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/snmpinform
  102. ln $RPM_BUILD_ROOT%{l_prefix}/bin/snmptrap \
  103. $RPM_BUILD_ROOT%{l_prefix}/bin/snmpinform
  104. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  105. strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true
  106. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \
  107. '%config %{l_prefix}/etc/snmp/*.conf'
  108. %files -f files
  109. %clean
  110. rm -rf $RPM_BUILD_ROOT