diff --git a/package/lean/ipt2socks/Makefile b/package/lean/ipt2socks/Makefile index 10aeef6366..11936cf5e4 100644 --- a/package/lean/ipt2socks/Makefile +++ b/package/lean/ipt2socks/Makefile @@ -1,46 +1,39 @@ +# +# Copyright (C) 2014 OpenWrt-dist +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + include $(TOPDIR)/rules.mk PKG_NAME:=ipt2socks -PKG_VERSION:=1.0.2 +PKG_VERSION:=1.1.2 PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/zfl9/ipt2socks.git -PKG_SOURCE_VERSION:=e6c9b60444bfe2f30830619aacbc67d26ee1015e +PKG_SOURCE_VERSION:=cfbc2189356aba7fcafb0bc961a95419f313d8a7 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION) -PKG_BUILD_PARALLEL:=1 -PKG_BUILD_DEPENDS:=libuv -PKG_USE_MIPS16:=0 - -PKG_LICENSE:=GPLv3 -PKG_LICENSE_FILES:=LICENSE - - include $(INCLUDE_DIR)/package.mk define Package/ipt2socks SECTION:=net CATEGORY:=Network TITLE:=Utility for converting iptables (REDIRECT/TPROXY) to SOCKS5 - URL:=https://github.com/zfl9/ipt2socks.git + URL:=https://github.com/zfl9/ipt2socks endef define Package/ipt2socks/description Utility for converting iptables (REDIRECT/TPROXY) to SOCKS5. endef -define Package/ipt2socks/conffiles -/etc/config/ipt2socks -endef - -MAKE_FLAGS += LIBS="-l:libuv_a.a" - define Package/ipt2socks/install $(INSTALL_DIR) $(1)/usr/bin $(INSTALL_BIN) $(PKG_BUILD_DIR)/ipt2socks $(1)/usr/bin endef -$(eval $(call BuildPackage,ipt2socks)) +$(eval $(call BuildPackage,ipt2socks)) \ No newline at end of file diff --git a/package/lean/ipt2socks/patches/001-fix-splice.patch b/package/lean/ipt2socks/patches/001-fix-splice.patch new file mode 100644 index 0000000000..c7af3ca479 --- /dev/null +++ b/package/lean/ipt2socks/patches/001-fix-splice.patch @@ -0,0 +1,49 @@ +--- a/ipt2socks.c ++++ b/ipt2socks.c +@@ -28,6 +28,36 @@ + + #define IPT2SOCKS_VERSION "ipt2socks v1.1.2 " + ++#ifdef __MUSL__ ++#include ++#include ++ ++ssize_t splice(int __fdin, __off64_t *__offin, int __fdout, ++ __off64_t *__offout, size_t __len, unsigned int __flags) { ++#ifdef __NR_splice ++ return syscall(__NR_splice, __fdin, __offin, __fdout, __offout, __len, __flags); ++#else ++ (void)__fdin; ++ (void)__offin; ++ (void)__fdout; ++ (void)__offout; ++ (void)__len; ++ (void)__flags; ++ errno = ENOSYS; ++ return -1; ++#endif ++} ++ ++#undef SPLICE_F_MOVE ++#undef SPLICE_F_NONBLOCK ++#undef SPLICE_F_MORE ++ ++#define SPLICE_F_MOVE 1 ++#define SPLICE_F_NONBLOCK 2 ++#define SPLICE_F_MORE 4 ++ ++#endif /* __MUSL__ */ ++ + enum { + OPT_ENABLE_TCP = 0x01 << 0, // enable tcp proxy + OPT_ENABLE_UDP = 0x01 << 1, // enable udp proxy + +--- a/Makefile ++++ b/Makefile +@@ -1,5 +1,5 @@ + CC = gcc +-CFLAGS = -std=c99 -Wall -Wextra -O2 -pthread ++CFLAGS = -std=c99 -Wall -Wextra -O2 -pthread -D __MUSL__ + LIBS = -lm + SRCS = ipt2socks.c logutils.c lrucache.c netutils.c protocol.c + OBJS = $(SRCS:.c=.o) \ No newline at end of file