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 \ |
| 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 \ |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 25 | " |
| 26 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 27 | 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] | 28 | |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 29 | SRC_URI[sha256sum] = "4c17e1eb324c4b7aa3c6889eba66eeca7ed98625d44076f7db7b027b2b093bd5" |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 30 | |
| 31 | LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 32 | file://errors/COPYRIGHT;md5=0a7deb73d8fb7a9849af7145987829a4 \ |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 33 | " |
| 34 | DEPENDS = "libtool krb5 openldap db cyrus-sasl" |
| 35 | |
| 36 | inherit autotools pkgconfig useradd ptest perlnative |
| 37 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 38 | LDFLAGS:append:mipsarch = " -latomic" |
| 39 | LDFLAGS:append:powerpc = " -latomic" |
| 40 | LDFLAGS:append:riscv64 = " -latomic" |
| 41 | LDFLAGS:append:riscv32 = " -latomic" |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 42 | |
| 43 | USERADD_PACKAGES = "${PN}" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 44 | 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] | 45 | |
| 46 | PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \ |
| 47 | " |
| 48 | PACKAGECONFIG[libnetfilter-conntrack] = "--with-netfilter-conntrack=${includedir}, --without-netfilter-conntrack, libnetfilter-conntrack" |
| 49 | PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6," |
| 50 | PACKAGECONFIG[werror] = "--enable-strict-error-checking,--disable-strict-error-checking," |
| 51 | PACKAGECONFIG[esi] = "--enable-esi,--disable-esi,expat libxml2" |
| 52 | PACKAGECONFIG[ssl] = "--with-openssl=yes,--with-openssl=no,openssl" |
| 53 | |
| 54 | BASIC_AUTH = "DB SASL LDAP" |
| 55 | |
| 56 | DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}" |
| 57 | BASIC_AUTH += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'PAM', '', d)}" |
| 58 | |
| 59 | EXTRA_OECONF += "--with-default-user=squid --enable-auth-basic='${BASIC_AUTH}' \ |
| 60 | --sysconfdir=${sysconfdir}/${BPN} \ |
| 61 | --with-logdir=${localstatedir}/log/${BPN} \ |
| 62 | 'PERL=${USRBINPATH}/env perl'" |
| 63 | |
| 64 | export BUILDCXXFLAGS="${BUILD_CXXFLAGS}" |
| 65 | |
| 66 | TESTDIR = "test-suite" |
| 67 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 68 | do_configure:prepend() { |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 69 | export SYSROOT=$PKG_CONFIG_SYSROOT_DIR |
| 70 | } |
| 71 | |
Andrew Geissler | 3eeda90 | 2023-05-19 10:14:02 -0500 | [diff] [blame] | 72 | do_configure:append() { |
| 73 | sed -i -e 's|${WORKDIR}||g' ${B}/include/autoconf.h |
| 74 | } |
| 75 | |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 76 | do_compile_ptest() { |
| 77 | oe_runmake -C ${TESTDIR} buildtest-TESTS |
| 78 | } |
| 79 | |
| 80 | do_install_ptest() { |
| 81 | cp -rf ${B}/${TESTDIR} ${D}${PTEST_PATH} |
| 82 | cp -rf ${S}/${TESTDIR} ${D}${PTEST_PATH} |
| 83 | |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 84 | # Needed to generate file squid.conf.default |
| 85 | oe_runmake DESTDIR=${D}${PTEST_PATH} -C src install-data-local |
| 86 | install -d ${D}${sysconfdir}/squid |
| 87 | install -m 0644 ${D}${PTEST_PATH}/${sysconfdir}/squid/squid.conf.default ${D}${sysconfdir}/squid |
| 88 | |
| 89 | # Don't need these directories |
| 90 | rm -rf ${D}${PTEST_PATH}/${sysconfdir} |
| 91 | rm -rf ${D}${PTEST_PATH}/usr |
| 92 | rm -rf ${D}${PTEST_PATH}/var |
| 93 | |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 94 | # do NOT need to rebuild Makefile itself |
| 95 | sed -i 's/^Makefile:.*$/Makefile:/' ${D}${PTEST_PATH}/${TESTDIR}/Makefile |
| 96 | |
| 97 | # Add squid-conf-tests for runtime tests |
| 98 | sed -e 's/^\(runtest-TESTS:\)/\1 squid-conf-tests/' \ |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 99 | -i ${D}${PTEST_PATH}/${TESTDIR}/Makefile |
| 100 | |
| 101 | # Ensure the path for command true is correct |
| 102 | sed -i 's:^TRUE = .*$:TRUE = /bin/true:' ${D}${PTEST_PATH}/${TESTDIR}/Makefile |
| 103 | } |
| 104 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 105 | do_install:append() { |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 106 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then |
| 107 | install -d ${D}${sysconfdir}/tmpfiles.d |
| 108 | echo "d ${localstatedir}/run/${BPN} 0755 squid squid -" >> ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf |
| 109 | echo "d ${localstatedir}/log/${BPN} 0750 squid squid -" >> ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf |
| 110 | fi |
| 111 | |
| 112 | install -d ${D}${sysconfdir}/default/volatiles |
| 113 | install -m 0644 ${WORKDIR}/volatiles.03_squid ${D}${sysconfdir}/default/volatiles/03_squid |
| 114 | |
| 115 | rmdir "${D}${localstatedir}/run/${BPN}" |
| 116 | rmdir --ignore-fail-on-non-empty "${D}${localstatedir}/run" |
| 117 | |
| 118 | rmdir "${D}${localstatedir}/log/${BPN}" |
| 119 | rmdir --ignore-fail-on-non-empty "${D}${localstatedir}/log" |
| 120 | } |
| 121 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 122 | FILES:${PN} += "${libdir} ${datadir}/errors ${datadir}/icons" |
| 123 | FILES:${PN}-dbg += "/usr/src/debug" |
| 124 | FILES:${PN}-doc += "${datadir}/*.txt" |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 125 | FILES:${PN}-ptest += "${sysconfdir}/squid/squid.conf.default" |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 126 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 127 | RDEPENDS:${PN} += "perl" |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 128 | RDEPENDS:${PN}-ptest += "perl make" |