blob: 5af00d6269d6ee91c925fa572db6368878863d72 [file] [log] [blame]
Brad Bishopc342db32019-05-15 21:57:59 -04001SUMMARY = "A fully-featured http proxy and web-cache daemon for Linux"
2DESCRIPTION = "A fully-featured http proxy and web-cache daemon for Linux. \
3Squid offers a rich access control, authorization and logging environment to \
4develop web proxy and content serving applications. \
5Squid offers a rich set of traffic optimization options, most of which are \
6enabled by default for simpler installation and high performance. \
7"
8HOMEPAGE = "http://www.squid-cache.org"
9SECTION = "web"
10LICENSE = "GPLv2+"
11
12MAJ_VER = "${@oe.utils.trim_version("${PV}", 1)}"
13MIN_VER = "${@oe.utils.trim_version("${PV}", 2)}"
14
15SRC_URI = "http://www.squid-cache.org/Versions/v${MAJ_VER}/${BPN}-${PV}.tar.bz2 \
16 file://Set-up-for-cross-compilation.patch \
17 file://Skip-AC_RUN_IFELSE-tests.patch \
18 file://Fix-flawed-dynamic-ldb-link-test-in-configure.patch \
19 file://squid-use-serial-tests-config-needed-by-ptest.patch \
20 file://run-ptest \
21 file://volatiles.03_squid \
22 file://set_sysroot_patch.patch \
23 file://squid-don-t-do-squid-conf-tests-at-build-time.patch \
24 file://0001-configure-Check-for-Wno-error-format-truncation-comp.patch \
25 file://0001-tools.cc-fixed-unused-result-warning.patch \
26 file://0001-splay.cc-fix-bind-is-not-a-member-of-std.patch \
Andrew Geissler97771a32021-03-05 15:23:11 -060027 file://0001-Fix-build-on-Fedora-Rawhide-772.patch \
Brad Bishopc342db32019-05-15 21:57:59 -040028 "
29
Patrick Williams213cb262021-08-07 19:21:33 -050030SRC_URI:remove:toolchain-clang = "file://0001-configure-Check-for-Wno-error-format-truncation-comp.patch"
Brad Bishopc342db32019-05-15 21:57:59 -040031
William A. Kennington IIIb95905d2021-06-02 12:40:56 -070032SRC_URI[sha256sum] = "71635811e766ce8b155225a9e3c7757cfc7ff93df26b28d82e5e6fc021b9a605"
Brad Bishopc342db32019-05-15 21:57:59 -040033
34LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
Andrew Geissler97771a32021-03-05 15:23:11 -060035 file://errors/COPYRIGHT;md5=0e03cd976052c45697ad5d96e7dff8dc \
Brad Bishopc342db32019-05-15 21:57:59 -040036 "
37DEPENDS = "libtool krb5 openldap db cyrus-sasl"
38
39inherit autotools pkgconfig useradd ptest perlnative
40
Patrick Williams213cb262021-08-07 19:21:33 -050041LDFLAGS:append:mipsarch = " -latomic"
42LDFLAGS:append:powerpc = " -latomic"
43LDFLAGS:append:riscv64 = " -latomic"
44LDFLAGS:append:riscv32 = " -latomic"
Brad Bishopc342db32019-05-15 21:57:59 -040045
46USERADD_PACKAGES = "${PN}"
Patrick Williams213cb262021-08-07 19:21:33 -050047USERADD_PARAM:${PN} = "--system --no-create-home --home-dir /var/run/squid --shell /bin/false --user-group squid"
Brad Bishopc342db32019-05-15 21:57:59 -040048
49PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \
50 "
51PACKAGECONFIG[libnetfilter-conntrack] = "--with-netfilter-conntrack=${includedir}, --without-netfilter-conntrack, libnetfilter-conntrack"
52PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
53PACKAGECONFIG[werror] = "--enable-strict-error-checking,--disable-strict-error-checking,"
54PACKAGECONFIG[esi] = "--enable-esi,--disable-esi,expat libxml2"
55PACKAGECONFIG[ssl] = "--with-openssl=yes,--with-openssl=no,openssl"
56
57BASIC_AUTH = "DB SASL LDAP"
58
59DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
60BASIC_AUTH += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'PAM', '', d)}"
61
62EXTRA_OECONF += "--with-default-user=squid --enable-auth-basic='${BASIC_AUTH}' \
63 --sysconfdir=${sysconfdir}/${BPN} \
64 --with-logdir=${localstatedir}/log/${BPN} \
65 'PERL=${USRBINPATH}/env perl'"
66
67export BUILDCXXFLAGS="${BUILD_CXXFLAGS}"
68
69TESTDIR = "test-suite"
70
Patrick Williams213cb262021-08-07 19:21:33 -050071do_configure:prepend() {
Brad Bishopc342db32019-05-15 21:57:59 -040072 export SYSROOT=$PKG_CONFIG_SYSROOT_DIR
73}
74
75do_compile_ptest() {
76 oe_runmake -C ${TESTDIR} buildtest-TESTS
77}
78
79do_install_ptest() {
80 cp -rf ${B}/${TESTDIR} ${D}${PTEST_PATH}
81 cp -rf ${S}/${TESTDIR} ${D}${PTEST_PATH}
82
83 # do NOT need to rebuild Makefile itself
84 sed -i 's/^Makefile:.*$/Makefile:/' ${D}${PTEST_PATH}/${TESTDIR}/Makefile
85
86 # Add squid-conf-tests for runtime tests
87 sed -e 's/^\(runtest-TESTS:\)/\1 squid-conf-tests/' \
88 -e "s/\(list=' \$(TESTS)\)/\1 squid-conf-tests/" \
89 -i ${D}${PTEST_PATH}/${TESTDIR}/Makefile
90
91 # Ensure the path for command true is correct
92 sed -i 's:^TRUE = .*$:TRUE = /bin/true:' ${D}${PTEST_PATH}/${TESTDIR}/Makefile
93}
94
Patrick Williams213cb262021-08-07 19:21:33 -050095do_install:append() {
Brad Bishopc342db32019-05-15 21:57:59 -040096 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
97 install -d ${D}${sysconfdir}/tmpfiles.d
98 echo "d ${localstatedir}/run/${BPN} 0755 squid squid -" >> ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf
99 echo "d ${localstatedir}/log/${BPN} 0750 squid squid -" >> ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf
100 fi
101
102 install -d ${D}${sysconfdir}/default/volatiles
103 install -m 0644 ${WORKDIR}/volatiles.03_squid ${D}${sysconfdir}/default/volatiles/03_squid
104
105 rmdir "${D}${localstatedir}/run/${BPN}"
106 rmdir --ignore-fail-on-non-empty "${D}${localstatedir}/run"
107
108 rmdir "${D}${localstatedir}/log/${BPN}"
109 rmdir --ignore-fail-on-non-empty "${D}${localstatedir}/log"
110}
111
Patrick Williams213cb262021-08-07 19:21:33 -0500112FILES:${PN} += "${libdir} ${datadir}/errors ${datadir}/icons"
113FILES:${PN}-dbg += "/usr/src/debug"
114FILES:${PN}-doc += "${datadir}/*.txt"
Brad Bishopc342db32019-05-15 21:57:59 -0400115
Patrick Williams213cb262021-08-07 19:21:33 -0500116RDEPENDS:${PN} += "perl"
117RDEPENDS:${PN}-ptest += "make"