recipe 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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. # Set 'outdir' for a nice and well-organized output directory
  21. outdir="${outdir}/${arch}/networking"
  22. tarname=${program}_${version}.tar.gz
  23. # Remote source(s)
  24. fetch=ftp://ftp.porcupine.org/pub/security/$tarname
  25. description="
  26. Monitor of incoming TCP connections.
  27. TCP Wrapper is a host-based Networking ACL system, used to
  28. filter network access to Internet Protocol servers on
  29. (Unix-like) operating systems such as Linux or BSD.
  30. It allows host or subnetwork IP addresses, names and/or
  31. ident query replies, to be used as tokens on which to
  32. filter for access control purposes.
  33. "
  34. homepage=ftp://ftp.porcupine.org/pub/security/index.html
  35. license=BSD
  36. # Source documentation
  37. docs="BLURB CHANGES DISCLAIMER README README.NIS"
  38. docsdir="${docdir}/${program}-${pkgversion}"
  39. # Source directory
  40. srcdir=${program}_${version}
  41. # Limit parallel jobs for the compiler to 1
  42. jobs=1
  43. build()
  44. {
  45. set -e
  46. unpack "${tardir}/$tarname"
  47. cd "$srcdir"
  48. # Set sane permissions
  49. chmod -R u+w,go-w,a+rX-s .
  50. make -j${jobs} STYLE="-DPROCESS_OPTIONS" REAL_DAEMON_DIR=/usr/sbin linux
  51. # Install manually
  52. mkdir -p "${destdir}/usr/include" \
  53. "${destdir}/usr/sbin" "${destdir}/usr/lib${libSuffix}"
  54. for file in safe_finger tcpd tcpdchk tcpdmatch try-from
  55. do
  56. cp -p $file "${destdir}/usr/sbin/"
  57. chmod 755 "${destdir}/usr/sbin/${file}"
  58. done
  59. cp -p libwrap.a "${destdir}/usr/lib${libSuffix}/"
  60. chmod 644 "${destdir}/usr/lib${libSuffix}/libwrap.a"
  61. cp -p tcpd.h "${destdir}/usr/include/"
  62. chmod 644 "${destdir}/usr/include/tcpd.h"
  63. mkdir -p "${destdir}${mandir}/man3" \
  64. "${destdir}${mandir}/man5" "${destdir}${mandir}/man8"
  65. lzip -9c < hosts_access.3 > "${destdir}${mandir}/man3/hosts_access.3.lz"
  66. lzip -9c < hosts_access.5 > "${destdir}${mandir}/man5/hosts_access.5.lz"
  67. lzip -9c < hosts_options.5 > "${destdir}${mandir}/man5/hosts_options.5.lz"
  68. lzip -9c < tcpd.8 > "${destdir}${mandir}/man8/tcpd.8.lz"
  69. lzip -9c < tcpdchk.8 > "${destdir}${mandir}/man8/tcpdchk.8.lz"
  70. lzip -9c < tcpdmatch.8 > "${destdir}${mandir}/man8/tcpdmatch.8.lz"
  71. # Strip remaining binaries and libraries
  72. find "$destdir" -type f | xargs file | \
  73. awk '/ELF/ && /executable/ || /shared object/' | \
  74. cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  75. strip --strip-debug "${destdir}/usr/lib${libSuffix}/libwrap.a"
  76. # Copy local config files
  77. mkdir -p "${destdir}/etc"
  78. cp -p "${worktree}/archive/tcp_wrappers/etc/hosts.allow" "${destdir}/etc/"
  79. cp -p "${worktree}/archive/tcp_wrappers/etc/hosts.deny" "${destdir}/etc/"
  80. chmod 644 "${destdir}/etc/hosts.allow" "${destdir}/etc/hosts.deny"
  81. touch "${destdir}/etc/.graft-config"
  82. # Copy documentation
  83. mkdir -p "${destdir}${docsdir}"
  84. cp -p $docs "${destdir}${docsdir}/"
  85. }