hBlock: bump (#5535)

This commit is contained in:
Héctor Molinero Fernández
2020-12-30 10:30:09 +01:00
committed by GitHub
parent bfdb604507
commit eb72858b5b
2 changed files with 47 additions and 34 deletions

View File

@@ -1,34 +0,0 @@
SUMMARY="Host file based adblocker with automatic update functionality"
DESCRIPTION="This POSIX-compliant shell script, designed for Unix-like \
systems, gets a list of domains that serve ads, trhblocking scripts and malware \
from multiple sources and creates a hosts file (alternative formats are also \
supported) that prevents your system from connecting to them."
HOMEPAGE="https://github.com/hectorm/hblock"
COPYRIGHT="2020 Héctor Molinero Fernández"
LICENSE="MIT"
REVISION="1"
SOURCE_URI="https://github.com/hectorm/hblock/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="47fb10ac91b54ec41d1880184eb683c7bfc62f74b19c45ec2044745f8c58f139"
ARCHITECTURES="any"
PROVIDES="
hblock = $portVersion
cmd:hblock
"
REQUIRES="
haiku
"
PATCH()
{
# Replacing hardcoded path for the hosts file
hostsfile="`finddir B_SYSTEM_SETTINGS_DIRECTORY`/network/hosts"
sed -i 's,/etc/hosts',$hostsfile, hblock
}
INSTALL()
{
mkdir -p $binDir
cp hblock $binDir
}

View File

@@ -0,0 +1,47 @@
SUMMARY="An adblocker that creates a hosts file from automatically downloaded 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="2020 Héctor Molinero Fernández"
LICENSE="MIT"
REVISION="1"
SOURCE_URI="https://github.com/hectorm/hblock/archive/v${portVersion:?}.tar.gz"
CHECKSUM_SHA256="7d87002c8ba13b72b4614fd2e528dfee816ea632ddee7f49be7cc463b43b6c3c"
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:?}"
}