diff options
Diffstat (limited to 'meta-networking/recipes-daemons/squid/squid_7.5.bb')
| -rw-r--r-- | meta-networking/recipes-daemons/squid/squid_7.5.bb | 153 |
1 files changed, 153 insertions, 0 deletions
diff --git a/meta-networking/recipes-daemons/squid/squid_7.5.bb b/meta-networking/recipes-daemons/squid/squid_7.5.bb new file mode 100644 index 0000000000..3364c1f746 --- /dev/null +++ b/meta-networking/recipes-daemons/squid/squid_7.5.bb | |||
| @@ -0,0 +1,153 @@ | |||
| 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" | ||
| 10 | LICENSE = "GPL-2.0-or-later" | ||
| 11 | |||
| 12 | PV_U = "${@d.getVar('PV').replace('.', '_')}" | ||
| 13 | |||
| 14 | SRC_URI = "https://github.com/squid-cache/${BPN}/releases/download/SQUID_${PV_U}/${BPN}-${PV}.tar.xz \ | ||
| 15 | file://Set-up-for-cross-compilation.patch \ | ||
| 16 | file://Skip-AC_RUN_IFELSE-tests.patch \ | ||
| 17 | file://squid-use-serial-tests-config-needed-by-ptest.patch \ | ||
| 18 | file://run-ptest \ | ||
| 19 | file://volatiles.03_squid \ | ||
| 20 | file://0002-squid-make-squid-conf-tests-run-on-target-device.patch \ | ||
| 21 | file://0001-libltdl-remove-reference-to-nonexisting-directory.patch \ | ||
| 22 | file://squid.nm \ | ||
| 23 | " | ||
| 24 | |||
| 25 | SRC_URI[sha256sum] = "f6058907db0150d2f5d228482b5a9e5678920cf368ae0ccbcecceb2ff4c35106" | ||
| 26 | |||
| 27 | LIC_FILES_CHKSUM = "file://COPYING;md5=570a9b3749dd0463a1778803b12a6dce \ | ||
| 28 | file://errors/COPYRIGHT;md5=41d117978dbffedc893e8eeca12537d0 \ | ||
| 29 | " | ||
| 30 | |||
| 31 | UPSTREAM_CHECK_URI = "https://github.com/squid-cache/${BPN}/releases/" | ||
| 32 | UPSTREAM_CHECK_REGEX = "SQUID_(?P<pver>\d+(_\d+)+)" | ||
| 33 | |||
| 34 | DEPENDS = "libtool" | ||
| 35 | |||
| 36 | inherit autotools pkgconfig useradd ptest perlnative systemd | ||
| 37 | |||
| 38 | LDFLAGS:append:mipsarch = " -latomic" | ||
| 39 | LDFLAGS:append:powerpc = " -latomic" | ||
| 40 | LDFLAGS:append:riscv64 = " -latomic" | ||
| 41 | LDFLAGS:append:riscv32 = " -latomic" | ||
| 42 | |||
| 43 | USERADD_PACKAGES = "${PN}" | ||
| 44 | USERADD_PARAM:${PN} = "--system --no-create-home --home-dir /var/run/squid --shell /bin/false --user-group squid" | ||
| 45 | |||
| 46 | PACKAGECONFIG ??= "auth url-rewrite-helpers \ | ||
| 47 | ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \ | ||
| 48 | ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \ | ||
| 49 | " | ||
| 50 | |||
| 51 | PACKAGECONFIG[libnetfilter-conntrack] = "--with-netfilter-conntrack=${includedir}, --without-netfilter-conntrack, libnetfilter-conntrack" | ||
| 52 | PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6," | ||
| 53 | PACKAGECONFIG[werror] = "--enable-strict-error-checking,--disable-strict-error-checking," | ||
| 54 | PACKAGECONFIG[ssl] = "--with-openssl=yes,--with-openssl=no,openssl" | ||
| 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 | " | ||
| 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 | |||
| 69 | EXTRA_OECONF += "--with-default-user=squid \ | ||
| 70 | --sysconfdir=${sysconfdir}/${BPN} \ | ||
| 71 | --with-logdir=${localstatedir}/log/${BPN} \ | ||
| 72 | 'PERL=${USRBINPATH}/env perl' \ | ||
| 73 | --disable-esi \ | ||
| 74 | " | ||
| 75 | |||
| 76 | # Workaround a build failure when using a native compiler that need -std=c++17 | ||
| 77 | # with a cross-compiler that doesn't. | ||
| 78 | # Upstream issue closed as invalid : https://bugs.squid-cache.org/show_bug.cgi?id=5376 | ||
| 79 | BUILD_CXXFLAGS += "-std=c++17" | ||
| 80 | |||
| 81 | export BUILDCXXFLAGS = "${BUILD_CXXFLAGS}" | ||
| 82 | |||
| 83 | TESTDIR = "test-suite" | ||
| 84 | |||
| 85 | do_configure:prepend() { | ||
| 86 | export SYSROOT=$PKG_CONFIG_SYSROOT_DIR | ||
| 87 | } | ||
| 88 | |||
| 89 | do_configure:append() { | ||
| 90 | sed -i -e 's|${WORKDIR}||g' ${B}/include/autoconf.h | ||
| 91 | } | ||
| 92 | |||
| 93 | do_compile_ptest() { | ||
| 94 | oe_runmake -C ${TESTDIR} buildtest-TESTS | ||
| 95 | } | ||
| 96 | |||
| 97 | do_install_ptest() { | ||
| 98 | cp -rf ${B}/${TESTDIR} ${D}${PTEST_PATH} | ||
| 99 | cp -rf ${S}/${TESTDIR} ${D}${PTEST_PATH} | ||
| 100 | |||
| 101 | # Install default config | ||
| 102 | install -d ${D}${PTEST_PATH}/src | ||
| 103 | install -m 0644 ${B}/src/squid.conf.default ${D}${PTEST_PATH}/src | ||
| 104 | |||
| 105 | # autoconf.h is needed during squid-conf-tests | ||
| 106 | install -d ${D}${PTEST_PATH}/include | ||
| 107 | install -m 0644 ${B}/include/autoconf.h ${D}${PTEST_PATH}/include | ||
| 108 | |||
| 109 | # do NOT need to rebuild Makefile itself | ||
| 110 | sed -i 's/^Makefile:.*$/Makefile:/' ${D}${PTEST_PATH}/${TESTDIR}/Makefile | ||
| 111 | |||
| 112 | # Ensure the path for command true is correct | ||
| 113 | sed -i 's:^TRUE = .*$:TRUE = /bin/true:' ${D}${PTEST_PATH}/${TESTDIR}/Makefile | ||
| 114 | } | ||
| 115 | |||
| 116 | do_install:append() { | ||
| 117 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then | ||
| 118 | # Install service unit file | ||
| 119 | install -d ${D}/${systemd_unitdir}/system | ||
| 120 | install ${S}/tools/systemd/squid.service ${D}/${systemd_unitdir}/system | ||
| 121 | sed -i 's:/var/run/:/run/:g' ${D}/${systemd_unitdir}/system/squid.service | ||
| 122 | |||
| 123 | # Configure tmpfiles.d | ||
| 124 | install -d ${D}${sysconfdir}/tmpfiles.d | ||
| 125 | echo "d ${localstatedir}/run/${BPN} 0755 squid squid -" >> ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf | ||
| 126 | echo "d ${localstatedir}/log/${BPN} 0750 squid squid -" >> ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf | ||
| 127 | fi | ||
| 128 | |||
| 129 | install -d ${D}${sysconfdir}/default/volatiles | ||
| 130 | install -m 0644 ${UNPACKDIR}/volatiles.03_squid ${D}${sysconfdir}/default/volatiles/03_squid | ||
| 131 | |||
| 132 | rmdir "${D}${localstatedir}/run/${BPN}" | ||
| 133 | rmdir --ignore-fail-on-non-empty "${D}${localstatedir}/run" | ||
| 134 | |||
| 135 | rmdir "${D}${localstatedir}/log/${BPN}" | ||
| 136 | rmdir --ignore-fail-on-non-empty "${D}${localstatedir}/log" | ||
| 137 | |||
| 138 | # Install NetworkManager dispatcher reload hooks | ||
| 139 | install -d ${D}${libdir}/NetworkManager/dispatcher.d | ||
| 140 | install -m 0755 ${UNPACKDIR}/squid.nm ${D}${libdir}/NetworkManager/dispatcher.d/20-squid | ||
| 141 | } | ||
| 142 | |||
| 143 | SYSTEMD_AUTO_ENABLE = "disable" | ||
| 144 | SYSTEMD_SERVICE:${PN} = "squid.service" | ||
| 145 | |||
| 146 | FILES:${PN} += "${libdir} ${datadir}/errors ${datadir}/icons" | ||
| 147 | FILES:${PN}-dbg += "/usr/src/debug" | ||
| 148 | FILES:${PN}-doc += "${datadir}/*.txt" | ||
| 149 | FILES:${PN}-conf += "${sysconfdir}/squid" | ||
| 150 | FILES:${PN}-networkmanager = "${libdir}/NetworkManager/dispatcher.d" | ||
| 151 | |||
| 152 | RDEPENDS:${PN} += "perl ${PN}-conf" | ||
| 153 | RDEPENDS:${PN}-ptest += "perl make bash" | ||
