1SUMMARY = "Lightweight http(s) proxy daemon"
2HOMEPAGE = "https://tinyproxy.github.io/"
3LICENSE = "GPL-2.0-only"
4LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
5
6SRC_URI = "https://github.com/${BPN}/${BPN}/releases/download/${PV}/${BP}.tar.gz \
7           file://disable-documentation.patch \
8           file://tinyproxy.service \
9           file://tinyproxy.conf \
10           "
11
12SRC_URI[md5sum] = "658db5558ffb849414341b756a546a99"
13SRC_URI[sha256sum] = "20f74769e40144e4d251d2977cc4c40d2d428a2bec8c1b8709cd07315454baef"
14
15UPSTREAM_CHECK_URI = "https://github.com/tinyproxy/tinyproxy/releases"
16
17EXTRA_OECONF += " \
18	--enable-filter \
19	--enable-transparent \
20	--enable-reverse \
21	--enable-upstream \
22	--enable-xtinyproxy \
23	"
24
25inherit autotools systemd useradd
26
27#User specific
28USERADD_PACKAGES = "${PN}"
29USERADD_PARAM:${PN} = "--system --home /dev/null \
30                       --no-user-group --gid nogroup tinyproxy"
31
32SYSTEMD_PACKAGES += "${BPN}"
33SYSTEMD_SERVICE:${PN} = "tinyproxy.service"
34SYSTEMD_AUTO_ENABLE:${PN} = "enable"
35
36do_install:append() {
37	if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
38		install -d ${D}${systemd_system_unitdir}
39		install -m 0644 ${WORKDIR}/tinyproxy.service ${D}${systemd_system_unitdir}
40	fi
41	install -m 0644 ${WORKDIR}/tinyproxy.conf ${D}${sysconfdir}/tinyproxy.conf
42}
43