recipe 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. # Build recipe for tcp_wrappers.
  2. #
  3. # Copyright (c) 2018 Matias Fonzo, <selk@dragora.org>.
  4. #
  5. # Licensed under the Apache License, Version 2.0 (the "License");
  6. # you may not use this file except in compliance with the License.
  7. # You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. program=tcp_wrappers
  17. version=7.6-ipv6.4
  18. pkgversion=7.6
  19. release=1
  20. tarname=${program}_${version}.tar.gz
  21. # Remote source(s)
  22. fetch=ftp://ftp.porcupine.org/pub/security/$tarname
  23. description="
  24. Monitor of incoming TCP connections.
  25. TCP Wrapper is a host-based Networking ACL system, used to
  26. filter network access to Internet Protocol servers on
  27. (Unix-like) operating systems such as Linux or BSD.
  28. It allows host or subnetwork IP addresses, names and/or
  29. ident query replies, to be used as tokens on which to
  30. filter for access control purposes.
  31. "
  32. homepage=ftp://ftp.porcupine.org/pub/security/index.html
  33. license=BSD
  34. # Source documentation
  35. docs="BLURB CHANGES DISCLAIMER README README.NIS"
  36. docsdir="${docdir}/${program}-${pkgversion}"
  37. # Source directory
  38. srcdir=${program}_${version}
  39. # Limit parallel jobs for the compiler to 1
  40. jobs=1
  41. build()
  42. {
  43. set -e
  44. unpack "${tardir}/$tarname"
  45. cd "$srcdir"
  46. make -j${jobs} STYLE="-DPROCESS_OPTIONS" REAL_DAEMON_DIR=/usr/sbin linux
  47. # Install manually
  48. mkdir -p "${destdir}/usr/include" \
  49. "${destdir}/usr/sbin" "${destdir}/usr/lib${libSuffix}"
  50. for file in safe_finger tcpd tcpdchk tcpdmatch try-from
  51. do
  52. cp -p $file "${destdir}/usr/sbin/"
  53. chmod 755 "${destdir}/usr/sbin/${file}"
  54. done
  55. cp -p libwrap.a "${destdir}/usr/lib${libSuffix}/"
  56. chmod 644 "${destdir}/usr/lib${libSuffix}/libwrap.a"
  57. cp -p tcpd.h "${destdir}/usr/include/"
  58. chmod 644 "${destdir}/usr/include/tcpd.h"
  59. mkdir -p "${destdir}${mandir}/man3" \
  60. "${destdir}${mandir}/man5" "${destdir}${mandir}/man8"
  61. lzip -9c < hosts_access.3 > "${destdir}${mandir}/man3/hosts_access.3.lz"
  62. lzip -9c < hosts_access.5 > "${destdir}${mandir}/man5/hosts_access.5.lz"
  63. lzip -9c < hosts_options.5 > "${destdir}${mandir}/man5/hosts_options.5.lz"
  64. lzip -9c < tcpd.8 > "${destdir}${mandir}/man8/tcpd.8.lz"
  65. lzip -9c < tcpdchk.8 > "${destdir}${mandir}/man8/tcpdchk.8.lz"
  66. lzip -9c < tcpdmatch.8 > "${destdir}${mandir}/man8/tcpdmatch.8.lz"
  67. # Strip remaining binaries and libraries
  68. find "$destdir" -type f | xargs file | \
  69. awk '/ELF/ && /executable/ || /shared object/' | \
  70. cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  71. strip --strip-debug "${destdir}/usr/lib${libSuffix}/libwrap.a"
  72. # Copy local config files
  73. mkdir -p "${destdir}/etc"
  74. cp -p "${worktree}/archive/tcp_wrappers/etc/hosts.allow" "${destdir}/etc/"
  75. cp -p "${worktree}/archive/tcp_wrappers/etc/hosts.deny" "${destdir}/etc/"
  76. chmod 644 "${destdir}/etc/hosts.allow" "${destdir}/etc/hosts.deny"
  77. touch "${destdir}/etc/.graft-config"
  78. # Copy documentation
  79. mkdir -p "${destdir}${docsdir}"
  80. cp -p $docs "${destdir}${docsdir}/"
  81. }