iopsys-feed/urlfilter/Makefile
Rahul Thakur 29979d3559 urlfilter: update regex
* update regex handling
* simplify iptables rules to setup nfq into single rule
* update makefile to not compile urlfilter as a kernel module
2024-08-13 06:10:08 +00:00

57 lines
1.5 KiB
Makefile

#
# Copyright (C) 2021 IOPSYS
#
include $(TOPDIR)/rules.mk
PKG_NAME:=urlfilter
PKG_VERSION:=2.0.0
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/urlfilter.git
PKG_SOURCE_VERSION:=08044747036259db23d6581fcbaa51750516749e
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
PKG_LICENSE:=GPL-2.0-only
PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/feeds/iopsys/bbfdm/bbfdm.mk
define Package/urlfilter
SECTION:=utils
CATEGORY:=Utilities
TITLE:=URL filter
DEPENDS:=+libuci +libnetfilter-queue +libnfnetlink +iptables-mod-nfqueue +libpthread +libubox +ubus +conntrack
endef
define Package/urlfilter/description
Enables filtering of packets on the basis of URL and source MAC address.
endef
TARGET_CFLAGS += \
-D_GNU_SOURCE
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
$(CP) -rf ./urlfilter/* $(PKG_BUILD_DIR)/
endef
endif
define Package/urlfilter/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_DIR) $(1)/etc/urlfilter
$(INSTALL_BIN) $(PKG_BUILD_DIR)/urlfilter $(1)/usr/sbin
$(INSTALL_BIN) ./files/etc/init.d/urlfilter $(1)/etc/init.d/
$(INSTALL_DATA) ./files/etc/config/urlfilter $(1)/etc/config/
$(BBFDM_INSTALL_MS_DM) ./files/etc/urlfilter/urlfilter.json $(1) $(PKG_NAME)
endef
$(eval $(call BuildPackage,urlfilter))