blob: 8137d257c8243b3c0c299b414ee9c0aefa7135c4 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "Security tool that is a wrapper for TCP daemons"
Brad Bishopd7bf8c12018-02-25 22:55:05 -05002HOMEPAGE = "http://www.softpanorama.org/Net/Network_security/TCP_wrappers/"
Patrick Williamsc124f4f2015-09-15 14:41:29 -05003DESCRIPTION = "Tools for monitoring and filtering incoming requests for tcp \
4 services."
5SECTION = "console/network"
6
Brad Bishopf3f93bb2019-10-16 14:33:32 -04007LICENSE = "BSD-1-Clause"
Patrick Williamsc124f4f2015-09-15 14:41:29 -05008LIC_FILES_CHKSUM = "file://DISCLAIMER;md5=071bd69cb78b18888ea5e3da5c3127fa"
9PR ="r10"
10
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080011DEPENDS += "libnsl2"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050012
13PACKAGES = "${PN}-dbg libwrap libwrap-doc libwrap-dev libwrap-staticdev ${PN} ${PN}-doc"
Patrick Williams213cb262021-08-07 19:21:33 -050014FILES:libwrap = "${base_libdir}/lib*${SOLIBS}"
15FILES:libwrap-doc = "${mandir}/man3 ${mandir}/man5"
16FILES:libwrap-dev = "${libdir}/lib*${SOLIBSDEV} ${includedir}"
17FILES:libwrap-staticdev = "${libdir}/lib*.a"
18FILES:${PN} = "${sbindir}"
19FILES:${PN}-doc = "${mandir}/man8"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050020
Brad Bishop08902b02019-08-20 09:16:51 -040021SRC_URI = "http://ftp.porcupine.org/pub/security/tcp_wrappers_${PV}.tar.gz \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050022 file://00_man_quoting.diff \
23 file://01_man_portability.patch \
24 file://05_wildcard_matching.patch \
25 file://06_fix_gethostbyname.patch \
26 file://10_usagi-ipv6.patch \
27 file://11_tcpd_blacklist.patch \
28 file://11_usagi_fix.patch \
29 file://12_makefile_config.patch \
30 file://13_shlib_weaksym.patch \
31 file://14_cidr_support.patch \
32 file://15_match_clarify.patch \
33 file://expand_remote_port.patch \
34 file://have_strerror.patch \
35 file://man_fromhost.patch \
36 file://restore_sigalarm.patch \
37 file://rfc931.diff \
38 file://safe_finger.patch \
39 file://sig_fix.patch \
40 file://siglongjmp.patch \
41 file://socklen_t.patch \
42 file://tcpdchk_libwrapped.patch \
43 file://ldflags.patch \
44 file://rename_strings_variable.patch \
45 file://try-from.8 \
46 file://safe_finger.8 \
47 file://makefile-fix-parallel.patch \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050048 file://musl-decls.patch \
Brad Bishop316dfdd2018-06-25 12:45:53 -040049 file://0001-Fix-build-with-clang.patch \
Brad Bishop15ae2502019-06-18 21:44:24 -040050 file://fix_warnings.patch \
51 file://fix_warnings2.patch \
Andrew Geissler82c905d2020-04-13 13:39:40 -050052 file://0001-Remove-fgets-extern-declaration.patch \
Patrick Williams92b42cb2022-09-03 06:53:57 -050053 file://0001-Fix-implicit-function-declaration-warnings.patch \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050054 "
55
56SRC_URI[md5sum] = "e6fa25f71226d090f34de3f6b122fb5a"
57SRC_URI[sha256sum] = "9543d7adedf78a6de0b221ccbbd1952e08b5138717f4ade814039bb489a4315d"
58
59S = "${WORKDIR}/tcp_wrappers_${PV}"
60
61EXTRA_OEMAKE = "'CC=${CC}' \
62 'AR=${AR}' \
63 'RANLIB=${RANLIB}' \
64 'REAL_DAEMON_DIR=${sbindir}' \
65 'STYLE=-DPROCESS_OPTIONS' \
66 'FACILITY=LOG_DAEMON' \
67 'SEVERITY=LOG_INFO' \
68 'BUGS=' \
69 'VSYSLOG=' \
70 'RFC931_TIMEOUT=10' \
71 'ACCESS=-DHOSTS_ACCESS' \
72 'KILL_OPT=-DKILL_IP_OPTIONS' \
73 'UMASK=-DDAEMON_UMASK=022' \
74 'NETGROUP=${EXTRA_OEMAKE_NETGROUP}' \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050075 'ARFLAGS=rv' \
76 'AUX_OBJ=weak_symbols.o' \
77 'TLI=' \
78 'COPTS=' \
79 'EXTRA_CFLAGS=${CFLAGS} -DSYS_ERRLIST_DEFINED -DHAVE_STRERROR -DHAVE_WEAKSYMS -D_REENTRANT -DINET6=1 -Dss_family=__ss_family -Dss_len=__ss_len'"
80
81EXTRA_OEMAKE_NETGROUP = "-DNETGROUP -DUSE_GETDOMAIN"
Patrick Williams213cb262021-08-07 19:21:33 -050082EXTRA_OEMAKE_NETGROUP:libc-musl = "-DUSE_GETDOMAIN"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050083
Patrick Williams213cb262021-08-07 19:21:33 -050084EXTRA_OEMAKE:append:libc-musl = " 'LIBS='"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050085
86do_compile () {
87 oe_runmake 'TABLES=-DHOSTS_DENY=\"${sysconfdir}/hosts.deny\" -DHOSTS_ALLOW=\"${sysconfdir}/hosts.allow\"' \
88 all
89}
90
91BINS = "safe_finger tcpd tcpdchk try-from tcpdmatch"
92MANS3 = "hosts_access"
93MANS5 = "hosts_options"
94MANS8 = "tcpd tcpdchk tcpdmatch"
95do_install () {
96 oe_libinstall -a libwrap ${D}${libdir}
97 oe_libinstall -C shared -so libwrap ${D}${base_libdir}
98
99 if [ "${libdir}" != "${base_libdir}" ] ; then
100 rel_lib_prefix=`echo ${libdir} | sed 's,\(^/\|\)[^/][^/]*,..,g'`
101 libname=`readlink ${D}${base_libdir}/libwrap.so | xargs basename`
102 ln -s ${rel_lib_prefix}${base_libdir}/${libname} ${D}${libdir}/libwrap.so
103 rm -f ${D}${base_libdir}/libwrap.so
104 fi
105
106 install -d ${D}${sbindir}
107 for b in ${BINS}; do
108 install -m 0755 $b ${D}${sbindir}/ || exit 1
109 done
110
111 install -d ${D}${mandir}/man3
112 for m in ${MANS3}; do
113 install -m 0644 $m.3 ${D}${mandir}/man3/ || exit 1
114 done
115
116 install -d ${D}${mandir}/man5
117 for m in ${MANS5}; do
118 install -m 0644 $m.5 ${D}${mandir}/man5/ || exit 1
119 done
120
121 install -d ${D}${mandir}/man8
122 for m in ${MANS8}; do
123 install -m 0644 $m.8 ${D}${mandir}/man8/ || exit 1
124 done
125
126 install -m 0644 ${WORKDIR}/try-from.8 ${D}${mandir}/man8/
127 install -m 0644 ${WORKDIR}/safe_finger.8 ${D}${mandir}/man8/
128
129 install -d ${D}${includedir}
130 install -m 0644 tcpd.h ${D}${includedir}/
131
132 install -d ${D}${sysconfdir}
133 touch ${D}${sysconfdir}/hosts.allow
134 touch ${D}${sysconfdir}/hosts.deny
135}
136
Patrick Williams213cb262021-08-07 19:21:33 -0500137FILES:${PN} += "${sysconfdir}/hosts.allow ${sysconfdir}/hosts.deny"