forked from Zxilly/UA2F
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
46 lines (34 loc) · 1.06 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
include $(TOPDIR)/rules.mk
PKG_NAME:=UA2F
PKG_VERSION:=3.7
PKG_RELEASE:=10
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
TARGET_LDFLAGS+=-lmnl -lnetfilter_queue -lipset
include $(INCLUDE_DIR)/package.mk
define Package/ua2f
SECTION:=net
CATEGORY:=Network
SUBMENU:=Routing and Redirection
TITLE:=Change User-Agent to Fwords
URL:=https://github.com/Zxilly/UA2F
DEPENDS:=+libmnl +libnetfilter-queue +iptables-mod-nfqueue +libipset
endef
define Package/ua2f/description
Change User-agent to Fwords to prevent being checked by Dr.Com.
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
cp ./src/* $(PKG_BUILD_DIR)
$(Build/Patch)
endef
define Build/Compile
$(TARGET_CC) $(TARGET_CFLAGS) -o $(PKG_BUILD_DIR)/ua2f.o -c $(PKG_BUILD_DIR)/ua2f.c
$(TARGET_CC) $(TARGET_LDFLAGS) -o $(PKG_BUILD_DIR)/$1 $(PKG_BUILD_DIR)/ua2f.o
endef
define Package/ua2f/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ua2f $(1)/usr/bin
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./init/ua2f $(1)/etc/init.d/ua2f
endef
$(eval $(call BuildPackage,ua2f))