portsentry.spec 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. ##
  2. ## portsentry.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: 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 [BASE]
  32. Group: Security
  33. License: Open Source
  34. Version: 1.1
  35. Release: 20030708
  36. # package options
  37. %option with_fsl yes
  38. # list of sources
  39. Source0: http://www.psionic.com/downloads/portsentry-%{version}.tar.gz
  40. Source1: rc.portsentry
  41. Source2: fsl.portsentry
  42. # build information
  43. Prefix: %{l_prefix}
  44. BuildRoot: %{l_buildroot}
  45. BuildPreReq: OpenPKG, openpkg >= 20030415
  46. PreReq: OpenPKG, openpkg >= 20030415
  47. %if "%{with_fsl}" == "yes"
  48. BuildPreReq: fsl
  49. PreReq: fsl
  50. %endif
  51. AutoReq: no
  52. AutoReqProv: no
  53. %description
  54. Portsentry is a program designed to detect and respond to port scans
  55. against a target host in real-time. It runs as a daemon and listens
  56. to a wide range of spare sockets in order to detect port scans.
  57. %prep
  58. %setup -q
  59. %{l_shtool} subst \
  60. -e 's;portsentry_util.c$;portsentry_util.c $(LIBS);' \
  61. Makefile
  62. %build
  63. %{l_shtool} subst \
  64. -e 's;^\(.*CONFIG_FILE.*"\)[^"]*\("\);\1%{l_prefix}/etc/portsentry/portsentry.conf\2;' \
  65. -e 's;^\(.*WRAPPER_HOSTS_DENY.*"\)[^"]*\("\);\1%{l_prefix}/etc/portsentry/portsentry.deny\2;' \
  66. portsentry_config.h
  67. %{l_shtool} subst \
  68. -e 's;/usr/local/psionic/portsentry/;%{l_prefix}/etc/portsentry/;g' \
  69. portsentry.conf
  70. case "%{l_target}" in
  71. *-freebsd* ) os="freebsd" ;;
  72. *-solaris* ) os="solaris" ;;
  73. *-linux* ) os="linux" ;;
  74. esac
  75. %{l_make} %{l_mflags -O} \
  76. CC="%{l_cc}" \
  77. CFLAGS="%{l_cflags -O}" \
  78. LDFLAGS="%{l_fsl_ldflags}" \
  79. LIBS="%{l_fsl_libs}" \
  80. $os
  81. %install
  82. rm -rf $RPM_BUILD_ROOT
  83. %{l_shtool} mkdir -f -p -m 755 \
  84. $RPM_BUILD_ROOT%{l_prefix}/var/portsentry \
  85. $RPM_BUILD_ROOT%{l_prefix}/sbin \
  86. $RPM_BUILD_ROOT%{l_prefix}/etc/portsentry \
  87. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  88. %{l_shtool} install -c -s -m 755 \
  89. portsentry $RPM_BUILD_ROOT%{l_prefix}/sbin/
  90. %{l_shtool} install -c -m 644 \
  91. portsentry.conf $RPM_BUILD_ROOT%{l_prefix}/etc/portsentry/
  92. %{l_shtool} install -c -m 644 \
  93. portsentry.ignore $RPM_BUILD_ROOT%{l_prefix}/etc/portsentry/
  94. %{l_shtool} install -c -m 644 \
  95. /dev/null $RPM_BUILD_ROOT%{l_prefix}/etc/portsentry/portsentry.history
  96. %{l_shtool} install -c -m 644 \
  97. /dev/null $RPM_BUILD_ROOT%{l_prefix}/etc/portsentry/portsentry.blocked
  98. # install run-command script
  99. %{l_shtool} mkdir -f -p -m 755 \
  100. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  101. %{l_shtool} install -c -m 755 \
  102. -e 's;@l_prefix@;%{l_prefix};g' \
  103. -e 's;@l_susr@;%{l_susr};g' \
  104. -e 's;@l_rusr@;%{l_rusr};g' \
  105. -e 's;@l_rgrp@;%{l_rgrp};g' \
  106. %{SOURCE rc.portsentry} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  107. # install OSSP fsl configuration
  108. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
  109. %{l_shtool} install -c -m 644 \
  110. -e 's;@l_prefix@;%{l_prefix};g' \
  111. %{SOURCE fsl.portsentry} \
  112. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
  113. # determine installation files
  114. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  115. %{l_files_std} \
  116. '%not %dir %{l_prefix}/etc/fsl' \
  117. '%config %{l_prefix}/etc/fsl/fsl.portsentry' \
  118. '%config %{l_prefix}/etc/portsentry/portsentry.conf' \
  119. '%config %{l_prefix}/etc/portsentry/portsentry.ignore'
  120. %files -f files
  121. %clean
  122. rm -rf $RPM_BUILD_ROOT