Files
haikuports/net-firewall/hblock/hblock-3.3.1.recipe
Héctor Molinero Fernández 109c322692 hBlock: bump (#6509)
2022-01-01 19:44:25 +01:00

49 lines
1.3 KiB
Bash

SUMMARY="Adblocker that creates a hosts file from multiple sources"
DESCRIPTION="hBlock is a POSIX-compliant shell script that gets a list of domains that serve \
ads, tracking scripts and malware from multiple sources and creates a hosts \
file, among other formats, that prevents your system from connecting to them."
HOMEPAGE="https://github.com/hectorm/hblock"
COPYRIGHT="2021 Héctor Molinero Fernández"
LICENSE="MIT"
REVISION="1"
SOURCE_URI="https://github.com/hectorm/hblock/archive/v${portVersion:?}.tar.gz"
CHECKSUM_SHA256="649ef980871d4be467a43edfa99c636b95b5af38ee976985082a65c4989eac01"
PATCHES="hblock-$portVersion.patchset"
ARCHITECTURES="any"
PROVIDES="
hblock = ${portVersion:?}
cmd:hblock
"
REQUIRES="
haiku
cmd:curl
"
BUILD_PREREQUIRES="
cmd:install
cmd:make
cmd:sed
"
PATCH()
{
# Replace hardcoded paths.
bSystemEtcDirectory=$(finddir B_SYSTEM_ETC_DIRECTORY)
bSystemSettingsDirectory=$(finddir B_SYSTEM_SETTINGS_DIRECTORY)
sed -i \
-e "s|\"\${ETCDIR?}/hosts\"|\"${bSystemSettingsDirectory:?}/network/hosts\"|" \
-e "s|'/etc'|'${bSystemEtcDirectory:?}'|" \
./hblock
sed -i \
-e "s|,/etc/hosts|,${bSystemSettingsDirectory:?}/network/hosts|" \
-e "s|,/etc/|,${bSystemEtcDirectory:?}/|" \
./hblock.1
}
INSTALL()
{
make install prefix="${prefix:?}" bindir="${binDir:?}" mandir="${manDir:?}"
}