portsentry.spec 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. ##
  2. ## portsentry.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2002 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2002 The OpenPKG Project <http://www.openpkg.org/>
  5. ## Copyright (c) 2000-2002 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: portsentry
  27. Summary: Port Scanning Detection Daemon
  28. URL: http://www.psionic.com/products/portsentry.html
  29. Vendor: Psionic Software, Inc
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG [REL]
  32. Group: Security
  33. License: Open Source
  34. Version: 1.1
  35. Release: 20020206
  36. # list of sources
  37. Source0: http://www.psionic.com/tools/portsentry-%{version}.tar.gz
  38. Source1: rc.portsentry
  39. # build information
  40. Prefix: %{l_prefix}
  41. BuildRoot: %{l_buildroot}
  42. BuildPreReq: OpenPKG, openpkg >= 20020206
  43. PreReq: OpenPKG, openpkg >= 20020206
  44. AutoReq: no
  45. AutoReqProv: no
  46. %description
  47. Portsentry is a program designed to detect and respond to port scans
  48. against a target host in real-time. It runs as a daemon and listens
  49. to a wide range of spare sockets in order to detect port scans.
  50. %prep
  51. %setup -q
  52. %build
  53. %{l_shtool} subst \
  54. -e 's;^\(.*CONFIG_FILE.*"\)[^"]*\("\);%{l_prefix}/etc/portsentry/portsentry.conf;' \
  55. -e 's;^\(.*WRAPPER_HOSTS_DENY.*"\)[^"]*\("\);%{l_prefix}/etc/portsentry/portsentry.deny;' \
  56. portsentry_conf.h
  57. %{l_shtool} subst \
  58. -e 's;/usr/local/psionic/portsentry/;%{l_prefix}/etc/portsentry/;g' \
  59. portsentry.conf
  60. case "%{l_target}" in
  61. *-freebsd* ) os="freebsd" ;;
  62. *-solaris* ) os="solaris" ;;
  63. *-linux* ) os="linux" ;;
  64. esac
  65. %{l_make} %{l_mflags -O} \
  66. CC="%{l_cc}" \
  67. CFLAGS="%{l_cflags -O}" \
  68. $os
  69. %install
  70. rm -rf $RPM_BUILD_ROOT
  71. %{l_shtool} mkdir -f -p -m 755 \
  72. $RPM_BUILD_ROOT%{l_prefix}/sbin \
  73. $RPM_BUILD_ROOT%{l_prefix}/etc/portsentry \
  74. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  75. %{l_shtool} install -c -s -m 755 \
  76. portsentry $RPM_BUILD_ROOT%{l_prefix}/sbin/
  77. %{l_shtool} install -c -m 644 \
  78. portsentry.conf $RPM_BUILD_ROOT%{l_prefix}/etc/portsentry/
  79. %{l_shtool} install -c -m 644 \
  80. portsentry.ignore $RPM_BUILD_ROOT%{l_prefix}/etc/portsentry/
  81. %{l_shtool} install -c -m 644 \
  82. /dev/null $RPM_BUILD_ROOT%{l_prefix}/etc/portsentry/portsentry.history
  83. %{l_shtool} install -c -m 644 \
  84. /dev/null $RPM_BUILD_ROOT%{l_prefix}/etc/portsentry/portsentry.blocked
  85. %{l_shtool} install -c -m 755 \
  86. -e 's;@l_prefix@;%{l_prefix};g' \
  87. %{SOURCE rc.portsentry} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  88. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  89. %files -f files
  90. %clean
  91. rm -rf $RPM_BUILD_ROOT