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