diff --git a/net/userfw/Makefile b/net/userfw/Makefile index 6c4dd48c8f74..64930e42b400 100644 --- a/net/userfw/Makefile +++ b/net/userfw/Makefile @@ -8,26 +8,17 @@ MASTER_SITES= http://userfw.net/files/release/ \ http://imax.in.ua/files/ \ http://projects.ukrweb.net/files/ -MAINTAINER= ports@FreeBSD.org +MAINTAINER= gelraen.ua@gmail.com COMMENT= Modular packet filter -LICENSE= BSD +LICENSE= BSD2CLAUSE SSP_UNSAFE= kernel module does not support ssp -USE_XZ= yes -USES= cmake:outsource +USES= cmake:outsource kmod tar:xz USE_LDCONFIG= yes -KMODDIR?= /boot/modules -PLIST_SUB+= KMODDIR=${KMODDIR} - -NO_STAGE= yes .include -.if ${OSVERSION} < 800000 -BROKEN= does not compile on FreeBSD 7.x -.endif - .if !exists(${SRC_BASE}/sys/sys/module.h) IGNORE= requires kernel source files .endif @@ -38,5 +29,6 @@ BROKEN= Does not compile on powerpc CMAKE_ARGS+= -DDOMAIN_STUB:BOOL=OFF CMAKE_ARGS+= -DOPCODE_VERIFICATION:BOOL=OFF +CMAKE_ARGS+= -DKMODDIR="${KMODDIR}" .include diff --git a/net/userfw/files/patch-cmake__userfw_module.cmake b/net/userfw/files/patch-cmake__userfw_module.cmake new file mode 100644 index 000000000000..bdaf295c0f09 --- /dev/null +++ b/net/userfw/files/patch-cmake__userfw_module.cmake @@ -0,0 +1,19 @@ +--- ./cmake/userfw_module.cmake.orig 2013-03-29 14:22:50.000000000 +0000 ++++ ./cmake/userfw_module.cmake 2014-07-29 09:30:53.000000000 +0100 +@@ -11,7 +11,7 @@ + add_custom_target(userfw_${modname} ALL + DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/userfw_${modname}.ko") + +- install(CODE "execute_process(COMMAND make install \"KMODDIR=${KMODDIR}\" \"PREFIX=${CMAKE_INSTALL_PREFIX}\" ++ install(CODE "execute_process(COMMAND make install \"KMODDIR=${KMODDIR}\" \"PREFIX=\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}\" + WORKING_DIRECTORY \"${CMAKE_CURRENT_SOURCE_DIR}\")") + endfunction(declare_userfw_module) + +@@ -28,6 +28,6 @@ + add_custom_target(userfw_${modname} ALL + DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${filename}.ko") + +- install(CODE "execute_process(COMMAND make install \"KMODDIR=${KMODDIR}\" \"PREFIX=${CMAKE_INSTALL_PREFIX}\" ++ install(CODE "execute_process(COMMAND make install \"KMODDIR=${KMODDIR}\" \"PREFIX=\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}\" + WORKING_DIRECTORY \"${CMAKE_CURRENT_SOURCE_DIR}\")") + endfunction(declare_userfw_module_with_name) diff --git a/net/userfw/files/patch-core__CMakeLists.txt b/net/userfw/files/patch-core__CMakeLists.txt new file mode 100644 index 000000000000..fdf2951999a0 --- /dev/null +++ b/net/userfw/files/patch-core__CMakeLists.txt @@ -0,0 +1,14 @@ +--- ./core/CMakeLists.txt.orig 2013-03-29 14:22:50.000000000 +0000 ++++ ./core/CMakeLists.txt 2014-07-29 09:31:46.000000000 +0100 +@@ -27,9 +27,9 @@ + add_custom_target(userfw_core_kmod ALL + DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/userfw.ko") + +-install(CODE "execute_process(COMMAND make install \"KMODDIR=${KMODDIR}\" \"PREFIX=${CMAKE_INSTALL_PREFIX}\" ++install(CODE "execute_process(COMMAND make install \"KMODDIR=${KMODDIR}\" \"PREFIX=\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}\" + WORKING_DIRECTORY \"${CMAKE_CURRENT_SOURCE_DIR}\")") + if (DOMAIN_STUB) +- install(CODE "execute_process(COMMAND make install \"KMODDIR=${KMODDIR}\" \"PREFIX=${CMAKE_INSTALL_PREFIX}\" ++ install(CODE "execute_process(COMMAND make install \"KMODDIR=${KMODDIR}\" \"PREFIX=\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}\" + WORKING_DIRECTORY \"${CMAKE_CURRENT_SOURCE_DIR}/domain_stub\")") + endif (DOMAIN_STUB) diff --git a/net/userfw/files/patch-modules__dummynet__dummynet.c b/net/userfw/files/patch-modules__dummynet__dummynet.c new file mode 100644 index 000000000000..dbadf9bc79cf --- /dev/null +++ b/net/userfw/files/patch-modules__dummynet__dummynet.c @@ -0,0 +1,22 @@ +--- ./modules/dummynet/dummynet.c.orig 2013-03-29 14:22:50.000000000 +0000 ++++ ./modules/dummynet/dummynet.c 2014-07-29 09:30:53.000000000 +0100 +@@ -57,15 +57,19 @@ + + if (ip_dn_io_ptr != NULL) + { ++#if __FreeBSD__ < 10 + SET_NET_IPLEN(mtod(*mb, struct ip *)); ++#endif + if (mtod(*mb, struct ip *)->ip_v == 4) + ret = ip_dn_io_ptr(mb, dir, &ipfw_args); + else if (mtod(*mb, struct ip *)->ip_v == 6) + ret = ip_dn_io_ptr(mb, dir | PROTO_IPV6, &ipfw_args); ++#if __FreeBSD__ < 10 + if ((*mb) != NULL) + { + SET_HOST_IPLEN(mtod(*mb, struct ip *)); + } ++#endif + } + return ret; + } diff --git a/net/userfw/files/patch-modules__ng_userfw_connector__ng_userfw_connector.c b/net/userfw/files/patch-modules__ng_userfw_connector__ng_userfw_connector.c new file mode 100644 index 000000000000..0ab5b96bd854 --- /dev/null +++ b/net/userfw/files/patch-modules__ng_userfw_connector__ng_userfw_connector.c @@ -0,0 +1,12 @@ +--- ./modules/ng_userfw_connector/ng_userfw_connector.c.orig 2013-03-29 14:22:50.000000000 +0000 ++++ ./modules/ng_userfw_connector/ng_userfw_connector.c 2014-07-29 09:30:53.000000000 +0100 +@@ -196,7 +196,9 @@ + if (hookp == NULL) + return ESRCH; + ++#if __FreeBSD__ < 10 + SET_NET_IPLEN(mtod(mb, struct ip *)); ++#endif + NG_SEND_DATA_ONLY(err, hookp, mb); + + return err; diff --git a/net/userfw/pkg-plist b/net/userfw/pkg-plist index ad8ccf6e07ea..4d49d4999437 100644 --- a/net/userfw/pkg-plist +++ b/net/userfw/pkg-plist @@ -29,5 +29,3 @@ include/userfw/modules/ng_userfw_connector.h %%KMODDIR%%/userfw_ipfw.ko %%KMODDIR%%/userfw_log.ko %%KMODDIR%%/userfw_multiruleset.ko -@exec /usr/sbin/kldxref /%%KMODDIR%% -@unexec /usr/sbin/kldxref /%%KMODDIR%%