blob: c655da1199e730bc04b30ffc30c05c3040e55a4c [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"
Patrick Williamsc124f4f2015-09-15 14:41:29 -05009
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080010DEPENDS += "libnsl2"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050011
12PACKAGES = "${PN}-dbg libwrap libwrap-doc libwrap-dev libwrap-staticdev ${PN} ${PN}-doc"
Patrick Williams213cb262021-08-07 19:21:33 -050013FILES:libwrap = "${base_libdir}/lib*${SOLIBS}"
14FILES:libwrap-doc = "${mandir}/man3 ${mandir}/man5"
15FILES:libwrap-dev = "${libdir}/lib*${SOLIBSDEV} ${includedir}"
16FILES:libwrap-staticdev = "${libdir}/lib*.a"
17FILES:${PN} = "${sbindir}"
18FILES:${PN}-doc = "${mandir}/man8"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050019
Brad Bishop08902b02019-08-20 09:16:51 -040020SRC_URI = "http://ftp.porcupine.org/pub/security/tcp_wrappers_${PV}.tar.gz \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050021 file://00_man_quoting.diff \
22 file://01_man_portability.patch \
23 file://05_wildcard_matching.patch \
24 file://06_fix_gethostbyname.patch \
25 file://10_usagi-ipv6.patch \
26 file://11_tcpd_blacklist.patch \
27 file://11_usagi_fix.patch \
28 file://12_makefile_config.patch \
29 file://13_shlib_weaksym.patch \
30 file://14_cidr_support.patch \
31 file://15_match_clarify.patch \
32 file://expand_remote_port.patch \
33 file://have_strerror.patch \
34 file://man_fromhost.patch \
35 file://restore_sigalarm.patch \
36 file://rfc931.diff \
37 file://safe_finger.patch \
38 file://sig_fix.patch \
39 file://siglongjmp.patch \
40 file://socklen_t.patch \
41 file://tcpdchk_libwrapped.patch \
42 file://ldflags.patch \
43 file://rename_strings_variable.patch \
44 file://try-from.8 \
45 file://safe_finger.8 \
46 file://makefile-fix-parallel.patch \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050047 file://musl-decls.patch \
Brad Bishop316dfdd2018-06-25 12:45:53 -040048 file://0001-Fix-build-with-clang.patch \
Brad Bishop15ae2502019-06-18 21:44:24 -040049 file://fix_warnings.patch \
50 file://fix_warnings2.patch \
Andrew Geissler82c905d2020-04-13 13:39:40 -050051 file://0001-Remove-fgets-extern-declaration.patch \
Patrick Williams92b42cb2022-09-03 06:53:57 -050052 file://0001-Fix-implicit-function-declaration-warnings.patch \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050053 "
54
55SRC_URI[md5sum] = "e6fa25f71226d090f34de3f6b122fb5a"
56SRC_URI[sha256sum] = "9543d7adedf78a6de0b221ccbbd1952e08b5138717f4ade814039bb489a4315d"
57
58S = "${WORKDIR}/tcp_wrappers_${PV}"
59
60EXTRA_OEMAKE = "'CC=${CC}' \
61 'AR=${AR}' \
62 'RANLIB=${RANLIB}' \
63 'REAL_DAEMON_DIR=${sbindir}' \
64 'STYLE=-DPROCESS_OPTIONS' \
65 'FACILITY=LOG_DAEMON' \
66 'SEVERITY=LOG_INFO' \
67 'BUGS=' \
68 'VSYSLOG=' \
69 'RFC931_TIMEOUT=10' \
70 'ACCESS=-DHOSTS_ACCESS' \
71 'KILL_OPT=-DKILL_IP_OPTIONS' \
72 'UMASK=-DDAEMON_UMASK=022' \
73 'NETGROUP=${EXTRA_OEMAKE_NETGROUP}' \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050074 'ARFLAGS=rv' \
75 'AUX_OBJ=weak_symbols.o' \
76 'TLI=' \
77 'COPTS=' \
78 'EXTRA_CFLAGS=${CFLAGS} -DSYS_ERRLIST_DEFINED -DHAVE_STRERROR -DHAVE_WEAKSYMS -D_REENTRANT -DINET6=1 -Dss_family=__ss_family -Dss_len=__ss_len'"
79
80EXTRA_OEMAKE_NETGROUP = "-DNETGROUP -DUSE_GETDOMAIN"
Patrick Williams213cb262021-08-07 19:21:33 -050081EXTRA_OEMAKE_NETGROUP:libc-musl = "-DUSE_GETDOMAIN"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050082
Patrick Williams213cb262021-08-07 19:21:33 -050083EXTRA_OEMAKE:append:libc-musl = " 'LIBS='"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050084
85do_compile () {
86 oe_runmake 'TABLES=-DHOSTS_DENY=\"${sysconfdir}/hosts.deny\" -DHOSTS_ALLOW=\"${sysconfdir}/hosts.allow\"' \
87 all
88}
89
90BINS = "safe_finger tcpd tcpdchk try-from tcpdmatch"
91MANS3 = "hosts_access"
92MANS5 = "hosts_options"
93MANS8 = "tcpd tcpdchk tcpdmatch"
94do_install () {
95 oe_libinstall -a libwrap ${D}${libdir}
96 oe_libinstall -C shared -so libwrap ${D}${base_libdir}
97
98 if [ "${libdir}" != "${base_libdir}" ] ; then
99 rel_lib_prefix=`echo ${libdir} | sed 's,\(^/\|\)[^/][^/]*,..,g'`
100 libname=`readlink ${D}${base_libdir}/libwrap.so | xargs basename`
101 ln -s ${rel_lib_prefix}${base_libdir}/${libname} ${D}${libdir}/libwrap.so
102 rm -f ${D}${base_libdir}/libwrap.so
103 fi
104
105 install -d ${D}${sbindir}
106 for b in ${BINS}; do
107 install -m 0755 $b ${D}${sbindir}/ || exit 1
108 done
109
110 install -d ${D}${mandir}/man3
111 for m in ${MANS3}; do
112 install -m 0644 $m.3 ${D}${mandir}/man3/ || exit 1
113 done
114
115 install -d ${D}${mandir}/man5
116 for m in ${MANS5}; do
117 install -m 0644 $m.5 ${D}${mandir}/man5/ || exit 1
118 done
119
120 install -d ${D}${mandir}/man8
121 for m in ${MANS8}; do
122 install -m 0644 $m.8 ${D}${mandir}/man8/ || exit 1
123 done
124
125 install -m 0644 ${WORKDIR}/try-from.8 ${D}${mandir}/man8/
126 install -m 0644 ${WORKDIR}/safe_finger.8 ${D}${mandir}/man8/
127
128 install -d ${D}${includedir}
129 install -m 0644 tcpd.h ${D}${includedir}/
130
131 install -d ${D}${sysconfdir}
132 touch ${D}${sysconfdir}/hosts.allow
133 touch ${D}${sysconfdir}/hosts.deny
134}
135
Patrick Williams213cb262021-08-07 19:21:33 -0500136FILES:${PN} += "${sysconfdir}/hosts.allow ${sysconfdir}/hosts.deny"