Сompile failed

No guarantee that this works, but it does build!

openwrt/package/openwrt-redsocks2$ git diff HEAD^
diff --git a/Makefile b/Makefile
index da48d92..baca193 100644
--- a/Makefile
+++ b/Makefile
@@ -8,12 +8,17 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=redsocks2
-PKG_VERSION:=0.60
-PKG_RELEASE=2
+PKG_VERSION:=2018-09-27
+PKG_RELEASE=1
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://github.com/aa65535/openwrt-redsocks2/releases/download/v$(PKG_VERSION)
-PKG_MD5SUM:=b88bf23bf75fa7642f8d230db21f73b9
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/semigodking/redsocks
+PKG_SOURCE_VERSION:=4133bcf5f9ee7dd7687ab55bd36c051d149eb3ea
+PKG_SOURCE_DATE:=2018-09-27
+# make package/openwrt-redsocks2/check
+# WARNING: PKG_MIRROR_HASH is missing, set to f100249533ff792df5ed20e4f148d244e91ae2eb8a3edbc181e9481ee3f16ee3
+PKG_MIRROR_HASH:=f100249533ff792df5ed20e4f148d244e91ae2eb8a3edbc181e9481ee3f16ee3
 
 PKG_LICENSE:=GPLv2
 PKG_LICENSE_FILES:=LICENSE
@@ -28,7 +33,7 @@ define Package/redsocks2
        CATEGORY:=Network
        TITLE:=Redirect any TCP connection to a SOCKS or HTTPS proxy server
        URL:=https://github.com/semigodking/redsocks
-       DEPENDS:=+libevent2
+       DEPENDS:=+libevent2 +libopenssl
 endef
 
 define Package/redsocks2/description

It's apparently possible to build it with the "polar" libraries (now known as mbedTLS), but this should get you going with the newer code.

1 Like

https://openwrt.org/docs/guide-developer/feeds is indeed outdated. svn is long no more.

Any volunteers for updating that page?

all OK! Thanks for the support!

compiled, but it doesn't work for me. can it not work due to installed package mbedTLS ?

receives packets, but does not send

netstat -tulpn

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      1169/uhttpd
tcp        0      0 192.168.2.60:53         0.0.0.0:*               LISTEN      2731/dnsmasq
tcp        0      0 127.0.0.1:53            0.0.0.0:*               LISTEN      2731/dnsmasq
tcp        0      0 192.168.2.1:53          0.0.0.0:*               LISTEN      2731/dnsmasq
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1308/dropbear
tcp       18      0 0.0.0.0:12345           0.0.0.0:*               LISTEN      7088/redsocks2
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      1169/uhttpd
tcp        0      0 :::80                   :::*                    LISTEN      1169/uhttpd
tcp        0      0 fe80::e495:6eff:fe44:a9e7:53 :::*                    LISTEN      2731/dnsmasq
tcp        0      0 fe80::e695:6eff:fe44:a9e7:53 :::*                    LISTEN      2731/dnsmasq
tcp        0      0 ::1:53                  :::*                    LISTEN      2731/dnsmasq
tcp        0      0 fd95:5bcb:c745::1:53    :::*                    LISTEN      2731/dnsmasq
tcp        0      0 fe80::e695:6eff:fe44:a9e7:53 :::*                    LISTEN      2731/dnsmasq
tcp        0      0 :::22                   :::*                    LISTEN      1308/dropbear
tcp        0      0 :::443                  :::*                    LISTEN      1169/uhttpd
udp        0      0 192.168.2.60:53         0.0.0.0:*                           2731/dnsmasq
udp        0      0 127.0.0.1:53            0.0.0.0:*                           2731/dnsmasq
udp        0      0 192.168.2.1:53          0.0.0.0:*                           2731/dnsmasq
udp        0      0 0.0.0.0:67              0.0.0.0:*                           2731/dnsmasq
udp        0      0 :::547                  :::*                                947/odhcpd
udp        0      0 fe80::e495:6eff:fe44:a9e7:53 :::*                                2731/dnsmasq
udp        0      0 fe80::e695:6eff:fe44:a9e7:53 :::*                                2731/dnsmasq
udp        0      0 ::1:53                  :::*                                2731/dnsmasq
udp        0      0 fd95:5bcb:c745::1:53    :::*                                2731/dnsmasq
udp        0      0 fe80::e695:6eff:fe44:a9e7:53 :::*                                2731/dnsmasq

yes, this is a newer package
how do i compile this package?

Post #21, above shows the patches (changes) that I made to the Makefile that refer to the newer sources. The lines that start with - are removed, the ones with + are added (but not the - or +). That version builds with the OpenSSL libraries, which it should build if needed when you build redsocks2.

now if I choose in make menuconfig OpenSSL instead mbedTLS. I got an error
make -j1 V=s

Collected errors:
 * check_data_file_clashes: Package libustream-openssl wants to install file /home/user/openwrt/build_dir/target-mips_24kc_musl/root-ar71xx/lib/libustream-ssl.so
	But that file is already provided by package  * libustream-mbedtls
 * opkg_install_cmd: Cannot install package libustream-openssl.
 * check_data_file_clashes: Package libustream-openssl wants to install file /home/user/openwrt/build_dir/target-mips_24kc_musl/root-ar71xx/lib/libustream-ssl.so
	But that file is already provided by package  * libustream-mbedtls
 * opkg_install_cmd: Cannot install package luci-ssl-openssl.
make[2]: *** [package/install] Error 255
make[2]: Leaving directory `/home/user/openwrt'
make[1]: *** [/home/user/openwrt/staging_dir/target-mips_24kc_musl/stamp/.package_install] Error 2
make[1]: Leaving directory `/home/user/openwrt'
make: *** [world] error 2

it's because I first installed with mbedTLS ?

Likely, yes -- Personally, I add openssl "first" when creating build configs. You'll probably need the luci-ssl-openssl collection, or at least the OpenSSL-based version of uhttpd (and probably things like curl/wget if you add those). I have found it easier to "start over" if I've got the "wrong" TLS package in my config, rather than try to figure out all the things to remove to get the dependencies right. For example, you probably can't remove mbedTLS until you remove a bunch of other things.

started all over again

.....
 make[3] -C package/openwrt-redsocks2 compile
make -r world: build failed. Please re-run make with -j1 V=s or V=sc for a higher verbosity level to see what's going on
make: *** [world] Error 1

/openwrt$ make -j1 V=s

.....
SHELL= flock /home/user/openwrt/tmp/.root-copy.flock -c 'cp -fpR /home/user/openwrt/build_dir/target-mips_24kc_musl/uclient-2018-11-24-3ba74ebc/.pkgdir/uclient-fetch/. /home/user/openwrt/staging_dir/target-mips_24kc_musl/root-ar71xx/'
touch /home/user/openwrt/staging_dir/target-mips_24kc_musl/root-ar71xx/stamp/.uclient-fetch_installed
echo "uclient-fetch" >> /home/user/openwrt/staging_dir/target-mips_24kc_musl/pkginfo/uclient.default.install
make[3]: Leaving directory `/home/user/openwrt/package/libs/uclient'
time: package/libs/uclient/compile#0.29#0.68#0.94
make[3]: Entering directory `/home/user/openwrt/package/network/config/swconfig'
mkdir -p /home/user/openwrt/staging_dir/target-mips_24kc_musl/root-ar71xx/stamp
SHELL= flock /home/user/openwrt/tmp/.root-copy.flock -c 'cp -fpR /home/user/openwrt/build_dir/target-mips_24kc_musl/swconfig/.pkgdir/swconfig/. /home/user/openwrt/staging_dir/target-mips_24kc_musl/root-ar71xx/'
touch /home/user/openwrt/staging_dir/target-mips_24kc_musl/root-ar71xx/stamp/.swconfig_installed
echo "swconfig" >> /home/user/openwrt/staging_dir/target-mips_24kc_musl/pkginfo/swconfig.default.install
make[3]: Leaving directory `/home/user/openwrt/package/network/config/swconfig'
time: package/network/config/swconfig/compile#0.09#0.23#0.32
make[3]: Entering directory `/home/user/openwrt/package/network/ipv6/odhcp6c'
mkdir -p /home/user/openwrt/staging_dir/target-mips_24kc_musl/root-ar71xx/stamp
SHELL= flock /home/user/openwrt/tmp/.root-copy.flock -c 'cp -fpR /home/user/openwrt/build_dir/target-mips_24kc_musl/odhcp6c-2018-07-14-67ae6a71/.pkgdir/odhcp6c/. /home/user/openwrt/staging_dir/target-mips_24kc_musl/root-ar71xx/'
touch /home/user/openwrt/staging_dir/target-mips_24kc_musl/root-ar71xx/stamp/.odhcp6c_installed
echo "odhcp6c" >> /home/user/openwrt/staging_dir/target-mips_24kc_musl/pkginfo/odhcp6c.default.install
make[3]: Leaving directory `/home/user/openwrt/package/network/ipv6/odhcp6c'
time: package/network/ipv6/odhcp6c/compile#0.26#0.57#0.81
make[3]: Entering directory `/home/user/openwrt/package/network/services/dnsmasq'
mkdir -p /home/user/openwrt/staging_dir/target-mips_24kc_musl/root-ar71xx/stamp
SHELL= flock /home/user/openwrt/tmp/.root-copy.flock -c 'cp -fpR /home/user/openwrt/build_dir/target-mips_24kc_musl/dnsmasq-nodhcpv6/dnsmasq-2.80/.pkgdir/dnsmasq/. /home/user/openwrt/staging_dir/target-mips_24kc_musl/root-ar71xx/'
touch /home/user/openwrt/staging_dir/target-mips_24kc_musl/root-ar71xx/stamp/.dnsmasq_installed
echo "dnsmasq" >> /home/user/openwrt/staging_dir/target-mips_24kc_musl/pkginfo/dnsmasq.nodhcpv6.install
make[3]: Leaving directory `/home/user/openwrt/package/network/services/dnsmasq'
time: package/network/services/dnsmasq/nodhcpv6/compile#0.12#0.21#0.33
make[3]: Entering directory `/home/user/openwrt/package/network/services/dropbear'
mkdir -p /home/user/openwrt/staging_dir/target-mips_24kc_musl/root-ar71xx/stamp
SHELL= flock /home/user/openwrt/tmp/.root-copy.flock -c 'cp -fpR /home/user/openwrt/build_dir/target-mips_24kc_musl/dropbear-2017.75/.pkgdir/dropbear/. /home/user/openwrt/staging_dir/target-mips_24kc_musl/root-ar71xx/'
touch /home/user/openwrt/staging_dir/target-mips_24kc_musl/root-ar71xx/stamp/.dropbear_installed
echo "dropbear" >> /home/user/openwrt/staging_dir/target-mips_24kc_musl/pkginfo/dropbear.default.install
make[3]: Leaving directory `/home/user/openwrt/package/network/services/dropbear'
time: package/network/services/dropbear/compile#0.14#0.16#1.05
make[3]: Entering directory `/home/user/openwrt/package/network/services/odhcpd'
mkdir -p /home/user/openwrt/staging_dir/target-mips_24kc_musl/root-ar71xx/stamp
SHELL= flock /home/user/openwrt/tmp/.root-copy.flock -c 'cp -fpR /home/user/openwrt/build_dir/target-mips_24kc_musl/odhcpd-ipv6only/odhcpd-1.12/.pkgdir/odhcpd-ipv6only/. /home/user/openwrt/staging_dir/target-mips_24kc_musl/root-ar71xx/'
touch /home/user/openwrt/staging_dir/target-mips_24kc_musl/root-ar71xx/stamp/.odhcpd-ipv6only_installed
echo "odhcpd-ipv6only" >> /home/user/openwrt/staging_dir/target-mips_24kc_musl/pkginfo/odhcpd.ipv6only.install
make[3]: Leaving directory `/home/user/openwrt/package/network/services/odhcpd'
time: package/network/services/odhcpd/ipv6only/compile#0.12#0.19#0.29
make[3]: Entering directory `/home/user/openwrt/package/libs/libpcap'
make[3]: Leaving directory `/home/user/openwrt/package/libs/libpcap'
time: package/libs/libpcap/compile#0.14#0.20#0.35
make[3]: Entering directory `/home/user/openwrt/package/network/utils/linux-atm'
make[3]: Leaving directory `/home/user/openwrt/package/network/utils/linux-atm'
time: package/network/utils/linux-atm/compile#0.17#0.20#0.41
make[3]: Entering directory `/home/user/openwrt/package/network/utils/resolveip'
make[3]: Nothing to be done for `compile'.
make[3]: Leaving directory `/home/user/openwrt/package/network/utils/resolveip'
time: package/network/utils/resolveip/compile#0.08#0.12#0.18
make[3]: Entering directory `/home/user/openwrt/package/network/services/ppp'
mkdir -p /home/user/openwrt/staging_dir/target-mips_24kc_musl/root-ar71xx/stamp
SHELL= flock /home/user/openwrt/tmp/.root-copy.flock -c 'cp -fpR /home/user/openwrt/build_dir/target-mips_24kc_musl/ppp-default/ppp-2.4.7/.pkgdir/ppp/. /home/user/openwrt/staging_dir/target-mips_24kc_musl/root-ar71xx/'
touch /home/user/openwrt/staging_dir/target-mips_24kc_musl/root-ar71xx/stamp/.ppp_installed
echo "ppp" >> /home/user/openwrt/staging_dir/target-mips_24kc_musl/pkginfo/ppp.default.install
mkdir -p /home/user/openwrt/staging_dir/target-mips_24kc_musl/root-ar71xx/stamp
SHELL= flock /home/user/openwrt/tmp/.root-copy.flock -c 'cp -fpR /home/user/openwrt/build_dir/target-mips_24kc_musl/ppp-default/ppp-2.4.7/.pkgdir/ppp-mod-pppoe/. /home/user/openwrt/staging_dir/target-mips_24kc_musl/root-ar71xx/'
touch /home/user/openwrt/staging_dir/target-mips_24kc_musl/root-ar71xx/stamp/.ppp-mod-pppoe_installed
echo "ppp-mod-pppoe" >> /home/user/openwrt/staging_dir/target-mips_24kc_musl/pkginfo/ppp.default.install
make[3]: Leaving directory `/home/user/openwrt/package/network/services/ppp'
time: package/network/services/ppp/default/compile#0.14#0.25#0.41
make[3]: Entering directory `/home/user/openwrt/package/openwrt-redsocks2'
touch /home/user/openwrt/build_dir/target-mips_24kc_musl/redsocks2//redsocks2-2018-09-27/.prepared_a9807c9407f8a49921945e50da0e7470_6664517399ebbbc92a37c5bb081b5c53_check
. /home/user/openwrt/include/shell.sh; xzcat /home/user/openwrt/dl/redsocks2-2018-09-27.tar.xz | tar -C /home/user/openwrt/build_dir/target-mips_24kc_musl/redsocks2//redsocks2-2018-09-27/.. -xf - 
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors
make[3]: *** [/home/user/openwrt/build_dir/target-mips_24kc_musl/redsocks2//redsocks2-2018-09-27/.prepared_a9807c9407f8a49921945e50da0e7470_6664517399ebbbc92a37c5bb081b5c53] Error 2
make[3]: Leaving directory `/home/user/openwrt/package/openwrt-redsocks2'
time: package/openwrt-redsocks2/compile#0.09#0.17#0.27
make[2]: *** [package/openwrt-redsocks2/compile] Error 2
make[2]: Leaving directory `/home/user/openwrt'
make[1]: *** [/home/user/openwrt/staging_dir/target-mips_24kc_musl/stamp/.package_compile] Error 2
make[1]: Leaving directory `/home/user/openwrt'
make: *** [world] Error 2

can compile with mbedTLS package? everything worked with mbedTLS OK.

makefile

#
# 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:=redsocks2
PKG_VERSION:=2018-09-27
PKG_RELEASE=1


PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/semigodking/redsocks
PKG_SOURCE_VERSION:=4133bcf5f9ee7dd7687ab55bd36c051d149eb3ea
PKG_SOURCE_DATE:=2018-09-27
# make package/openwrt-redsocks2/check
# WARNING: PKG_MIRROR_HASH is missing, set to f100249533ff792df5ed20e4f148d244e91ae2eb8a3edbc181e9481ee3f16ee3
PKG_MIRROR_HASH:=f100249533ff792df5ed20e4f148d244e91ae2eb8a3edbc181e9481ee3f16ee3

PKG_LICENSE:=GPLv2
PKG_LICENSE_FILES:=LICENSE
PKG_MAINTAINER:=Zhuofei Wang <SemigodKing@gmail.com>

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)

include $(INCLUDE_DIR)/package.mk

define Package/redsocks2
	SECTION:=net
	CATEGORY:=Network
	TITLE:=Redirect any TCP connection to a SOCKS or HTTPS proxy server
	URL:=https://github.com/semigodking/redsocks
	DEPENDS:=+libevent2 +libopenssl
endef

define Package/redsocks2/description
This is a modified version of original redsocks. \
The name is changed to be REDSOCKS2 since this release to distinguish with original redsocks. \
This variant is useful for anti-GFW (Great Fire Wall).
endef

define Package/redsocks2/conffiles
/etc/config/redsocks2
endef

define Package/redsocks2/install
	$(INSTALL_DIR) $(1)/usr/bin
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/redsocks2 $(1)/usr/bin
	$(INSTALL_DIR) $(1)/etc/config
	$(INSTALL_DATA) ./files/redsocks2.config $(1)/etc/config/redsocks2
	$(INSTALL_DIR) $(1)/etc/init.d
	$(INSTALL_BIN) ./files/redsocks2.init $(1)/etc/init.d/redsocks2
	$(INSTALL_DIR) $(1)/etc/redsocks2
	$(INSTALL_DATA) ./files/redsocks2.template $(1)/etc/redsocks2/config.template
endef

$(eval $(call BuildPackage,redsocks2))

/openwrt/package/openwrt-redsocks2$ git diff HEAD^

diff --git a/Makefile b/Makefile
index b973745..baca193 100644
--- a/Makefile
+++ b/Makefile
@@ -8,12 +8,17 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=redsocks2
-PKG_VERSION:=0.60
-PKG_RELEASE=2
+PKG_VERSION:=2018-09-27
+PKG_RELEASE=1
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://github.com/aa65535/openwrt-redsocks2/releases/download/v$(PKG_VERSION)
-PKG_MD5SUM:=b88bf23bf75fa7642f8d230db21f73b9
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/semigodking/redsocks
+PKG_SOURCE_VERSION:=4133bcf5f9ee7dd7687ab55bd36c051d149eb3ea
+PKG_SOURCE_DATE:=2018-09-27
+# make package/openwrt-redsocks2/check
+# WARNING: PKG_MIRROR_HASH is missing, set to f100249533ff792df5ed20e4f148d244e91ae2eb8a3edbc181e9481ee3f16ee3
+PKG_MIRROR_HASH:=f100249533ff792df5ed20e4f148d244e91ae2eb8a3edbc181e9481ee3f16ee3
 
 PKG_LICENSE:=GPLv2
 PKG_LICENSE_FILES:=LICENSE
@@ -28,7 +33,7 @@ define Package/redsocks2
        CATEGORY:=Network
        TITLE:=Redirect any TCP connection to a SOCKS or HTTPS proxy server
        URL:=https://github.com/semigodking/redsocks
-       DEPENDS:=+libevent2
+       DEPENDS:=+libevent2 +libopenssl
 endef
 
 define Package/redsocks2/description
@@ -37,7 +42,7 @@ The name is changed to be REDSOCKS2 since this release to distinguish with origi
 This variant is useful for anti-GFW (Great Fire Wall).
 endef
 
-define Package/shadowsocks-libev-spec/conffiles
+define Package/redsocks2/conffiles
 /etc/config/redsocks2
 endef