Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 1 | SUMMARY = "A fully-featured http proxy and web-cache daemon for Linux" |
| 2 | DESCRIPTION = "A fully-featured http proxy and web-cache daemon for Linux. \ |
| 3 | Squid offers a rich access control, authorization and logging environment to \ |
| 4 | develop web proxy and content serving applications. \ |
| 5 | Squid offers a rich set of traffic optimization options, most of which are \ |
| 6 | enabled by default for simpler installation and high performance. \ |
| 7 | " |
| 8 | HOMEPAGE = "http://www.squid-cache.org" |
| 9 | SECTION = "web" |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 10 | LICENSE = "GPL-2.0-or-later" |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 11 | |
| 12 | MAJ_VER = "${@oe.utils.trim_version("${PV}", 1)}" |
| 13 | MIN_VER = "${@oe.utils.trim_version("${PV}", 2)}" |
| 14 | |
| 15 | SRC_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 \ |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 18 | file://squid-use-serial-tests-config-needed-by-ptest.patch \ |
| 19 | file://run-ptest \ |
| 20 | file://volatiles.03_squid \ |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 21 | file://0001-configure-Check-for-Wno-error-format-truncation-comp.patch \ |
Patrick Williams | da29531 | 2023-12-05 16:48:56 -0600 | [diff] [blame] | 22 | file://0002-squid-make-squid-conf-tests-run-on-target-device.patch \ |
| 23 | file://squid.nm \ |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 24 | " |
| 25 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 26 | SRC_URI:remove:toolchain-clang = "file://0001-configure-Check-for-Wno-error-format-truncation-comp.patch" |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 27 | |
Patrick Williams | da29531 | 2023-12-05 16:48:56 -0600 | [diff] [blame] | 28 | SRC_URI[sha256sum] = "99acd54ec9d68b2a9080d19fcc43eca1a245146cf162dbba689510d01e6d0f25" |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 29 | |
| 30 | LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ |
Patrick Williams | da29531 | 2023-12-05 16:48:56 -0600 | [diff] [blame] | 31 | file://errors/COPYRIGHT;md5=d324bc1f9447d1d1588d75b22a678dc4 \ |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 32 | " |
Patrick Williams | da29531 | 2023-12-05 16:48:56 -0600 | [diff] [blame] | 33 | DEPENDS = "libtool" |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 34 | |
Patrick Williams | da29531 | 2023-12-05 16:48:56 -0600 | [diff] [blame] | 35 | inherit autotools pkgconfig useradd ptest perlnative systemd |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 36 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 37 | LDFLAGS:append:mipsarch = " -latomic" |
| 38 | LDFLAGS:append:powerpc = " -latomic" |
| 39 | LDFLAGS:append:riscv64 = " -latomic" |
| 40 | LDFLAGS:append:riscv32 = " -latomic" |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 41 | |
| 42 | USERADD_PACKAGES = "${PN}" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 43 | USERADD_PARAM:${PN} = "--system --no-create-home --home-dir /var/run/squid --shell /bin/false --user-group squid" |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 44 | |
Patrick Williams | da29531 | 2023-12-05 16:48:56 -0600 | [diff] [blame] | 45 | PACKAGECONFIG ??= "auth url-rewrite-helpers \ |
| 46 | ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \ |
| 47 | ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \ |
| 48 | " |
| 49 | |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 50 | PACKAGECONFIG[libnetfilter-conntrack] = "--with-netfilter-conntrack=${includedir}, --without-netfilter-conntrack, libnetfilter-conntrack" |
| 51 | PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6," |
| 52 | PACKAGECONFIG[werror] = "--enable-strict-error-checking,--disable-strict-error-checking," |
| 53 | PACKAGECONFIG[esi] = "--enable-esi,--disable-esi,expat libxml2" |
| 54 | PACKAGECONFIG[ssl] = "--with-openssl=yes,--with-openssl=no,openssl" |
Patrick Williams | da29531 | 2023-12-05 16:48:56 -0600 | [diff] [blame] | 55 | PACKAGECONFIG[auth] = "--enable-auth-basic='${BASIC_AUTH}',--disable-auth --disable-auth-basic,krb5 openldap db cyrus-sasl" |
| 56 | PACKAGECONFIG[url-rewrite-helpers] = "--enable-url-rewrite-helpers,--disable-url-rewrite-helpers," |
| 57 | PACKAGECONFIG[systemd] = "--with-systemd,--without-systemd,systemd" |
| 58 | |
| 59 | PACKAGES =+ " \ |
| 60 | ${PN}-conf \ |
| 61 | ${PN}-networkmanager \ |
| 62 | " |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 63 | |
| 64 | BASIC_AUTH = "DB SASL LDAP" |
| 65 | |
| 66 | DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}" |
| 67 | BASIC_AUTH += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'PAM', '', d)}" |
| 68 | |
Patrick Williams | da29531 | 2023-12-05 16:48:56 -0600 | [diff] [blame] | 69 | EXTRA_OECONF += "--with-default-user=squid \ |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 70 | --sysconfdir=${sysconfdir}/${BPN} \ |
| 71 | --with-logdir=${localstatedir}/log/${BPN} \ |
| 72 | 'PERL=${USRBINPATH}/env perl'" |
| 73 | |
| 74 | export BUILDCXXFLAGS="${BUILD_CXXFLAGS}" |
| 75 | |
| 76 | TESTDIR = "test-suite" |
| 77 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 78 | do_configure:prepend() { |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 79 | export SYSROOT=$PKG_CONFIG_SYSROOT_DIR |
| 80 | } |
| 81 | |
Andrew Geissler | 3eeda90 | 2023-05-19 10:14:02 -0500 | [diff] [blame] | 82 | do_configure:append() { |
| 83 | sed -i -e 's|${WORKDIR}||g' ${B}/include/autoconf.h |
| 84 | } |
| 85 | |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 86 | do_compile_ptest() { |
| 87 | oe_runmake -C ${TESTDIR} buildtest-TESTS |
| 88 | } |
| 89 | |
| 90 | do_install_ptest() { |
| 91 | cp -rf ${B}/${TESTDIR} ${D}${PTEST_PATH} |
| 92 | cp -rf ${S}/${TESTDIR} ${D}${PTEST_PATH} |
| 93 | |
Patrick Williams | da29531 | 2023-12-05 16:48:56 -0600 | [diff] [blame] | 94 | # Install default config |
| 95 | install -d ${D}${PTEST_PATH}/src |
| 96 | install -m 0644 ${B}/src/squid.conf.default ${D}${PTEST_PATH}/src |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 97 | |
Patrick Williams | da29531 | 2023-12-05 16:48:56 -0600 | [diff] [blame] | 98 | # autoconf.h is needed during squid-conf-tests |
| 99 | install -d ${D}${PTEST_PATH}/include |
| 100 | install -m 0644 ${B}/include/autoconf.h ${D}${PTEST_PATH}/include |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 101 | |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 102 | # do NOT need to rebuild Makefile itself |
| 103 | sed -i 's/^Makefile:.*$/Makefile:/' ${D}${PTEST_PATH}/${TESTDIR}/Makefile |
| 104 | |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 105 | # Ensure the path for command true is correct |
| 106 | sed -i 's:^TRUE = .*$:TRUE = /bin/true:' ${D}${PTEST_PATH}/${TESTDIR}/Makefile |
| 107 | } |
| 108 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 109 | do_install:append() { |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 110 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then |
Patrick Williams | da29531 | 2023-12-05 16:48:56 -0600 | [diff] [blame] | 111 | # Install service unit file |
| 112 | install -d ${D}/${systemd_unitdir}/system |
| 113 | install ${S}/tools/systemd/squid.service ${D}/${systemd_unitdir}/system |
| 114 | sed -i 's:/var/run/:/run/:g' ${D}/${systemd_unitdir}/system/squid.service |
| 115 | |
| 116 | # Configure tmpfiles.d |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 117 | install -d ${D}${sysconfdir}/tmpfiles.d |
| 118 | echo "d ${localstatedir}/run/${BPN} 0755 squid squid -" >> ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf |
| 119 | echo "d ${localstatedir}/log/${BPN} 0750 squid squid -" >> ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf |
| 120 | fi |
| 121 | |
| 122 | install -d ${D}${sysconfdir}/default/volatiles |
| 123 | install -m 0644 ${WORKDIR}/volatiles.03_squid ${D}${sysconfdir}/default/volatiles/03_squid |
| 124 | |
| 125 | rmdir "${D}${localstatedir}/run/${BPN}" |
| 126 | rmdir --ignore-fail-on-non-empty "${D}${localstatedir}/run" |
| 127 | |
| 128 | rmdir "${D}${localstatedir}/log/${BPN}" |
| 129 | rmdir --ignore-fail-on-non-empty "${D}${localstatedir}/log" |
Patrick Williams | da29531 | 2023-12-05 16:48:56 -0600 | [diff] [blame] | 130 | |
| 131 | # Install NetworkManager dispatcher reload hooks |
| 132 | install -d ${D}${libdir}/NetworkManager/dispatcher.d |
| 133 | install -m 0755 ${WORKDIR}/squid.nm ${D}${libdir}/NetworkManager/dispatcher.d/20-squid |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 134 | } |
| 135 | |
Patrick Williams | da29531 | 2023-12-05 16:48:56 -0600 | [diff] [blame] | 136 | SYSTEMD_AUTO_ENABLE = "disable" |
| 137 | SYSTEMD_SERVICE:${PN} = "squid.service" |
| 138 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 139 | FILES:${PN} += "${libdir} ${datadir}/errors ${datadir}/icons" |
| 140 | FILES:${PN}-dbg += "/usr/src/debug" |
| 141 | FILES:${PN}-doc += "${datadir}/*.txt" |
Patrick Williams | da29531 | 2023-12-05 16:48:56 -0600 | [diff] [blame] | 142 | FILES:${PN}-conf += "${sysconfdir}/squid" |
| 143 | FILES:${PN}-networkmanager = "${libdir}/NetworkManager/dispatcher.d" |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 144 | |
Patrick Williams | da29531 | 2023-12-05 16:48:56 -0600 | [diff] [blame] | 145 | RDEPENDS:${PN} += "perl ${PN}-conf" |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 146 | RDEPENDS:${PN}-ptest += "perl make" |