Skip to content

Commit

Permalink
zapret: 0-unstable-2024-08-01 -> 0-unstable-2024-10-12
Browse files Browse the repository at this point in the history
  • Loading branch information
Nishimara committed Oct 12, 2024
1 parent 69151ff commit 7219820
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions pkgs/by-name/za/zapret/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,38 +15,44 @@

stdenv.mkDerivation {
pname = "zapret";
version = "0-unstable-2024-08-01";
version = "0-unstable-2024-10-12";

src = fetchFromGitHub {
owner = "bol-van";
repo = "zapret";
rev = "9cf72b7c68f6a7c80dfddc6c1cf6d6db32718376";
hash = "sha256-8cqKCNYLLkZXlwrybKUPG6fLd7gmf8zV9tjWoTxAwIY=";
rev = "d760093f52c02c05177dc0ba66aa833179a489e5";
hash = "sha256-cIZsTK1SuI/YfN8oDb/nBmPA5d3QhWzKSEzn5wEcadc=";
};

buildInputs = [ libcap zlib libnetfilter_queue libnfnetlink ];
nativeBuildInputs = [ iptables nftables gawk ];

buildPhase = ''
runHook preBuild
mkdir -p $out/bin
make TGT=$out/bin
runHook postBuild
'';

installPhase = ''
runHook preInstall
mkdir -p $out/usr/share/zapret/init.d/sysv
mkdir -p $out/usr/share/docs
cp $src/blockcheck.sh $out/bin/blockcheck
substituteInPlace $out/bin/blockcheck \
--replace "ZAPRET_BASE=\"\$EXEDIR\"" "ZAPRET_BASE=$out/usr/share/zapret"
--replace-fail '$(cd "$EXEDIR"; pwd)' "$out/usr/share/zapret"
cp $src/init.d/sysv/functions $out/usr/share/zapret/init.d/sysv/functions
cp $src/init.d/sysv/zapret $out/usr/share/zapret/init.d/sysv/init.d
substituteInPlace $out/usr/share/zapret/init.d/sysv/functions \
--replace "ZAPRET_BASE=\$(readlink -f \"\$EXEDIR/../..\")" "ZAPRET_BASE=$out/usr/share/zapret"
--replace-fail "/opt/zapret" "\"$out/usr/share/zapret\""
touch $out/usr/share/zapret/config
Expand All @@ -57,6 +63,8 @@ stdenv.mkDerivation {
cp $src/common/* $out/usr/share/zapret/common
cp $src/ipset/* $out/usr/share/zapret/ipset
rm -f $out/usr/share/zapret/ipset/zapret-hosts-user-exclude.txt.default
mkdir -p $out/usr/share/zapret/nfq
ln -s ../../../../bin/nfqws $out/usr/share/zapret/nfq/nfqws
Expand All @@ -67,6 +75,8 @@ stdenv.mkDerivation {
done
ln -s ../usr/share/zapret/init.d/sysv/init.d $out/bin/zapret
runHook postInstall
'';

meta = with lib; {
Expand Down

0 comments on commit 7219820

Please sign in to comment.