snmpdx.spec 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. ##
  2. ## snmpdx.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: snmpdx
  27. Summary: SNMP Daemon Extension
  28. URL: http://www.ossp.org/pkg/tool/snmpdx/
  29. Vendor: The OSSP Project
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG
  32. Class: EVAL
  33. Group: Network
  34. License: GPL
  35. Version: 0.2.8
  36. Release: 20040705
  37. # list of sources
  38. Source0: ftp://ftp.ossp.org/pkg/tool/snmpdx/snmpdx-%{version}.tar.gz
  39. # build information
  40. Prefix: %{l_prefix}
  41. BuildRoot: %{l_buildroot}
  42. BuildPreReq: OpenPKG, openpkg >= 20040130, perl, snmp
  43. PreReq: OpenPKG, openpkg >= 20040130, perl, snmp
  44. AutoReq: no
  45. AutoReqProv: no
  46. %description
  47. OSSP snmpdx is a framework for easily hooking into net-snmp's
  48. snmpd(8) and providing an own SNMP MIB and the OID implementing
  49. probes. It is a Perl program which either can be configured as a
  50. pass (not recommended) or pass_persist (recommended) program into
  51. snmpd.conf.
  52. %track
  53. prog snmpdx = {
  54. version = %{version}
  55. url = ftp://ftp.ossp.org/pkg/tool/snmpdx/
  56. regex = snmpdx-(__VER__)\.tar\.gz
  57. }
  58. %prep
  59. %setup -q
  60. %build
  61. ./configure \
  62. --prefix=%{l_prefix} \
  63. --with-snmp=%{l_prefix} \
  64. --with-perl=%{l_prefix}/bin/perl
  65. %{l_make} %{l_mflags -O}
  66. %install
  67. rm -rf $RPM_BUILD_ROOT
  68. %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
  69. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  70. %files -f files
  71. %clean
  72. rm -rf $RPM_BUILD_ROOT
  73. %post
  74. # add snmpd(8) hook
  75. snmpdx_mibprefix=`$RPM_INSTALL_PREFIX/bin/snmptranslate \
  76. -M $RPM_INSTALL_PREFIX/share/snmp/mibs:$RPM_INSTALL_PREFIX/share/snmpdx -m snmpdx -Ib -On snmpdx`
  77. echo "pass_persist $snmpdx_mibprefix $RPM_INSTALL_PREFIX/sbin/snmpdx" |\
  78. $RPM_INSTALL_PREFIX/lib/openpkg/rpmtool config \
  79. -a -s -i "$RPM_INSTALL_PREFIX:snmpdx" $RPM_INSTALL_PREFIX/etc/snmp/snmpd.conf
  80. %preun
  81. # remove snmpd(8) hook
  82. $RPM_INSTALL_PREFIX/lib/openpkg/rpmtool config \
  83. -r -s -i "$RPM_INSTALL_PREFIX:snmpdx" $RPM_INSTALL_PREFIX/etc/snmp/snmpd.conf