|
| 1 | +include $(TOPDIR)/rules.mk |
| 2 | + |
| 3 | +PKG_NAME:=firehol |
| 4 | +PKG_VERSION:=<<VER>> |
| 5 | +PKG_RELEASE:=1 |
| 6 | + |
| 7 | +PKG_BUILD_DIR:=$(BUILD_DIR)/firehol-$(PKG_VERSION) |
| 8 | +PKG_SOURCE:=firehol-$(PKG_VERSION).tar.bz2 |
| 9 | +PKG_SOURCE_URL:=<<URL>> |
| 10 | +PKG_MD5SUM:=<<MD5>> |
| 11 | +PKG_CAT:=bzcat |
| 12 | + |
| 13 | +include $(INCLUDE_DIR)/package.mk |
| 14 | + |
| 15 | +define Package/firehol |
| 16 | + SECTION:=net |
| 17 | + CATEGORY:=Network |
| 18 | + PKGARCH=all |
| 19 | + DEPENDS:=+bash +ip-full +bash +coreutils-fold +flock \ |
| 20 | + +grep +ipset +tc \ |
| 21 | + +kmod-ifb +kmod-sched +kmod-dummy +kmod-sched-connmark \ |
| 22 | + +iptables-mod-extra +iptables-mod-conntrack-extra \ |
| 23 | + +iptables-mod-ipopt |
| 24 | + TITLE:=firehol and fireqos - firewalling and QOS for humans |
| 25 | + URL:=https://firehol.org/ |
| 26 | +endef |
| 27 | + |
| 28 | +define Package/firehol/description |
| 29 | + FireHOL - a firewall for humans |
| 30 | + FireQOS - traffic management for humans |
| 31 | + Related tools |
| 32 | +endef |
| 33 | + |
| 34 | +CONFIGURE_ARGS += \ |
| 35 | + --disable-doc \ |
| 36 | + --disable-man \ |
| 37 | + --disable-firehol-wizard \ |
| 38 | + --disable-link-balancer \ |
| 39 | + --disable-update-ipsets \ |
| 40 | + --disable-vnetbuild |
| 41 | + |
| 42 | +CONFIGURE_VARS += \ |
| 43 | + IPRANGE_VERSION=1.0.3 \ |
| 44 | + BASH_VERSION=4 \ |
| 45 | + BASH_VERSION_PATH=/bin/bash \ |
| 46 | + |
| 47 | +# This list generated by inspecting the results of running |
| 48 | +# ./configure on an actual openwrt router - there's no point |
| 49 | +# in detecting the locations on the build host. |
| 50 | +CONFIGURE_VARS += \ |
| 51 | + BASENAME=/usr/bin/basename \ |
| 52 | + BRIDGE=x \ |
| 53 | + CAT=/bin/cat \ |
| 54 | + CHMOD=/bin/chmod \ |
| 55 | + CHOWN=/bin/chown \ |
| 56 | + CP=/bin/cp \ |
| 57 | + CURL=x \ |
| 58 | + CUT=/usr/bin/cut \ |
| 59 | + DATE=/bin/date \ |
| 60 | + DIFF=x \ |
| 61 | + DIRNAME=/usr/bin/dirname \ |
| 62 | + DOT=x \ |
| 63 | + EGREP=/usr/bin/grep\ -E \ |
| 64 | + ENV=x \ |
| 65 | + EXPR=/usr/bin/expr \ |
| 66 | + FIND=/usr/bin/find \ |
| 67 | + FLOCK=/usr/bin/flock \ |
| 68 | + FOLD=/usr/bin/fold \ |
| 69 | + FUNZIP=x \ |
| 70 | + JQ=x \ |
| 71 | + GAWK=/usr/bin/awk \ |
| 72 | + GIT=x \ |
| 73 | + GREP=/usr/bin/grep \ |
| 74 | + HEAD=/usr/bin/head \ |
| 75 | + HOSTNAME=x \ |
| 76 | + IP6TABLES=/usr/sbin/ip6tables \ |
| 77 | + IP6TABLES_RESTORE=/usr/sbin/ip6tables-restore \ |
| 78 | + IP6TABLES_SAVE=/usr/sbin/ip6tables-save \ |
| 79 | + IP=/usr/sbin/ip \ |
| 80 | + IPRANGE=x \ |
| 81 | + IPSET=/usr/sbin/ipset \ |
| 82 | + IPTABLES=/usr/sbin/iptables \ |
| 83 | + IPTABLES_RESTORE=/usr/sbin/iptables-restore \ |
| 84 | + IPTABLES_SAVE=/usr/sbin/iptables-save \ |
| 85 | + JQ=x \ |
| 86 | + LN=x \ |
| 87 | + LOGGER=/usr/bin/logger \ |
| 88 | + LS=/bin/ls \ |
| 89 | + LSMOD=/usr/sbin/lsmod \ |
| 90 | + MKDIR=/bin/mkdir \ |
| 91 | + MKTEMP=/bin/mktemp \ |
| 92 | + MODPROBE=/usr/sbin/modprobe\ -q \ |
| 93 | + MORE=/usr/bin/less \ |
| 94 | + MV=/bin/mv \ |
| 95 | + NEATO=x \ |
| 96 | + NFACCT=x \ |
| 97 | + PING6=/bin/ping\ -6 \ |
| 98 | + PING=/bin/ping \ |
| 99 | + READLINK=/usr/bin/readlink \ |
| 100 | + RENICE=: \ |
| 101 | + RMMOD=/usr/sbin/rmmod \ |
| 102 | + RM=/bin/rm \ |
| 103 | + SCREEN=x \ |
| 104 | + SED=/bin/sed \ |
| 105 | + SEQ=/usr/bin/seq \ |
| 106 | + SH=x \ |
| 107 | + SLEEP=/bin/sleep \ |
| 108 | + SORT=/usr/bin/sort \ |
| 109 | + SS=x \ |
| 110 | + STTY=: \ |
| 111 | + SYSCTL=/sbin/sysctl \ |
| 112 | + TAIL=/usr/bin/tail \ |
| 113 | + TAR=x \ |
| 114 | + TCPDUMP=/usr/sbin/tcpdump \ |
| 115 | + TC=/usr/sbin/tc \ |
| 116 | + TOUCH=/bin/touch \ |
| 117 | + TPUT=x \ |
| 118 | + TRACEROUTE=x \ |
| 119 | + TR=/usr/bin/tr \ |
| 120 | + UNAME=/bin/uname \ |
| 121 | + UNIQ=/usr/bin/uniq \ |
| 122 | + UNZIP=x \ |
| 123 | + WC=/usr/bin/wc \ |
| 124 | + WGET=x \ |
| 125 | + WHOISx= \ |
| 126 | + ZCAT=/bin/zcat |
| 127 | + |
| 128 | +define Build/Configure |
| 129 | + $(call Build/Configure/Default) |
| 130 | +endef |
| 131 | + |
| 132 | +define Package/firehol/install |
| 133 | + $(INSTALL_DIR) $(1)/usr/lib/firehol/$(PKG_VERSION) |
| 134 | + $(INSTALL_BIN) $(PKG_BUILD_DIR)/sbin/firehol $(1)/usr/lib/firehol/$(PKG_VERSION) |
| 135 | + $(INSTALL_BIN) $(PKG_BUILD_DIR)/sbin/fireqos $(1)/usr/lib/firehol/$(PKG_VERSION) |
| 136 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/sbin/functions.common $(1)/usr/lib/firehol/$(PKG_VERSION) |
| 137 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/sbin/install.config $(1)/usr/lib/firehol/$(PKG_VERSION) |
| 138 | + |
| 139 | +# Remove any programs that we do not expect to find and change |
| 140 | +# the default spool directory to one that will persist, enabling |
| 141 | +# the fast startup functionality to work. |
| 142 | + $(INSTALL_DIR) $(1)/etc/firehol-spool/ |
| 143 | + sed -i -e 's/"x"/""/' -e '/FIREHOL_SPOOL_DIR=/s:=.*:=/etc/firehol-spool:' $(1)/usr/lib/firehol/$(PKG_VERSION)/install.config |
| 144 | + |
| 145 | + $(INSTALL_DIR) $(1)/etc/firehol/ |
| 146 | + $(INSTALL_DIR) $(1)/etc/firehol/services |
| 147 | + $(INSTALL_CONF) files/firehol-defaults.conf $(1)/etc/firehol/ |
| 148 | + $(INSTALL_CONF) files/firehol.conf.example $(1)/etc/firehol/ |
| 149 | + $(INSTALL_CONF) files/fireqos.conf.example $(1)/etc/firehol/ |
| 150 | + |
| 151 | + $(INSTALL_DIR) $(1)/sbin |
| 152 | + ln -s /usr/lib/firehol/$(PKG_VERSION)/firehol $(1)/sbin/firehol |
| 153 | + ln -s /usr/lib/firehol/$(PKG_VERSION)/fireqos $(1)/sbin/fireqos |
| 154 | + |
| 155 | + $(INSTALL_DIR) $(1)/etc/init.d |
| 156 | + $(INSTALL_BIN) files/firehol $(1)/etc/init.d/ |
| 157 | + $(INSTALL_BIN) files/fireqos $(1)/etc/init.d/ |
| 158 | + |
| 159 | + $(INSTALL_DIR) $(1)/etc/hotplug.d/iface/ |
| 160 | + $(INSTALL_CONF) files/50-qos $(1)/etc/hotplug.d/iface/ |
| 161 | +endef |
| 162 | + |
| 163 | +$(eval $(call BuildPackage,firehol)) |
0 commit comments