Skip to content

Commit

Permalink
knock: init at 0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
theobori committed Nov 17, 2024
1 parent 7d0c987 commit 15755a5
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
23 changes: 23 additions & 0 deletions pkgs/by-name/kn/knock/makefile_destination_files.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
diff --git a/Makefile.am b/Makefile.am
index c5b15ab..f202b3d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -5,16 +5,12 @@ bin_PROGRAMS = knock
man_MANS = doc/knock.1

if BUILD_KNOCKD
-sbin_PROGRAMS = knockd
-dist_sbin_SCRIPTS = src/knock_helper_ipt.sh
+bin_PROGRAMS += knockd
man_MANS += doc/knockd.1
-sysconf_DATA = knockd.conf
endif

-dist_doc_DATA = README.md TODO ChangeLog COPYING
-
knock_SOURCES = src/knock.c
-knockd_SOURCES = src/knockd.c src/list.c src/list.h src/knock_helper_ipt.sh
+knockd_SOURCES = src/knockd.c src/list.c src/list.h

%.1: %.1.in
sed -e "s/#VERSION#/$(VERSION)/" $< > $@
40 changes: 40 additions & 0 deletions pkgs/by-name/kn/knock/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
lib,
stdenv,
fetchFromGitHub,
pkg-config,
libpcap,
autoreconfHook,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "knock";
version = "0.8";

src = fetchFromGitHub {
owner = "jvinet";
repo = "knock";
rev = "v${finalAttrs.version}";
hash = "sha256-GOg6wovyr6J5qHm5EsOxrposFtwwx/FyJs7g0dagFmk=";
};

nativeBuildInputs = [
autoreconfHook
pkg-config
];

buildInputs = [
libpcap
];

patches = [ ./makefile_destination_files.patch ];

meta = {
description = "A port-knocking implementation";
homepage = "https://github.com/jvinet/knock";
changelog = "https://github.com/jvinet/knock/releases";
license = lib.licenses.gpl2Plus;
maintainers = with lib.maintainers; [ theobori ];
mainProgram = "knock";
platforms = lib.platforms.unix;
};
})

0 comments on commit 15755a5

Please sign in to comment.