Skip to content

Commit

Permalink
Merge pull request #50 from hackerschoice/fixie
Browse files Browse the repository at this point in the history
openwrt
  • Loading branch information
rootTHC authored Jul 11, 2021
2 parents 873c363 + 53bc2ee commit 09d9144
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 9 deletions.
21 changes: 12 additions & 9 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dnl Process this File with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT([gsocket],[1.4.32])
AC_INIT([gsocket],[1.4.33])
AC_CONFIG_AUX_DIR(config)
AC_CANONICAL_TARGET

Expand Down Expand Up @@ -29,16 +29,19 @@ if test $ac_cv_c_compiler_gnu = yes; then
fi
test "x$prefix" != "xNONE" || prefix="/usr/local"
test "x$exec_prefix" != "xNONE" || exec_prefix="${prefix}"
trydir_i="${prefix}/include /usr/include"
trydir_l="${prefix}/lib /usr/lib"
dnl trydir_i="${prefix}/include /usr/include"
dnl trydir_l="${prefix}/lib /usr/lib"

if test "${prefix}" != "/usr/local" ; then
trydir_i="${trydir_i} /usr/local/include"
trydir_l="${trydir_l} /usr/local/lib"
fi
dnl trydir_i="${includedir}"
dnl trydir_l="${libdir}"

dnl if test "${prefix}" != "/usr/local" ; then
dnl trydir_i="${trydir_i} /usr/local/include"
dnl trydir_l="${trydir_l} /usr/local/lib"
dnl fi

dnl Try include paths (especially on OSX)
trydir_i="${trydir_i} /usr/local/opt/openssl/include /opt/homebrew/opt/openssl/include"
trydir_i="${includedir} /usr/local/include /usr/local/opt/openssl/include /opt/homebrew/opt/openssl/include"
for xincdir in $trydir_i ; do
if test ! -d "$xincdir" ; then
continue;
Expand All @@ -52,7 +55,7 @@ done
CPPFLAGS="-I${srcdir}/../include ${INCLUDES} $CPPFLAGS"

dnl Try library paths...
trydir_l="${trydir_l} /usr/local/opt/openssl/lib /opt/homebrew/opt/openssl/lib"
trydir_l="${libdir} /usr/local/lib /usr/local/opt/openssl/lib /opt/homebrew/opt/openssl/lib"
for xlibdir in $trydir_l ; do
if test ! -d "$xlibdir" ; then
continue;
Expand Down
71 changes: 71 additions & 0 deletions packaging/openwrt/gsocket/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# https://gsocket.io

include $(TOPDIR)/rules.mk

PKG_NAME:=gsocket
PKG_VERSION:=1.4.33
PKG_RELEASE:=1

#PKG_LICENSE:=BSD-2-Clause
#PKG_LICENSE_FILES:=LICENSE

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

# PKG_SOURCE_PROTO:=git
# PKG_SOURCE_URL:=https://github.com/hackerschoice/gsocket.git
# PKG_SOURCE_VERSION:=98a85e270c8ee5757134f00636a5358432cd3d83

# Direct file download
PKG_SOURCE_URL:=https://github.com/hackerschoice/gsocket/releases/download/v$(PKG_VERSION)/
PKG_HASH:=5bbc850a274b933a4e8b0ac7d5bc8b0527c3eddbaee7f8a9389c284f27a6fe14

# For testing copy to openwrt/dl
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz

# dont need 'make install'
#PKG_INSTALL:=1

PKG_MAINTAINER:=skyper <[email protected]>

include $(INCLUDE_DIR)/package.mk

define Package/gsocket
SECTION:=net
CATEGORY:=Network
DEPENDS:=+libopenssl
TITLE:=Connect like there is no firewall
URL:=https://gsocket.io
endef

define Package/gsocket/description
Connect like there is no firewall
endef

define Build/Configure
$(call Build/Configure/Default,--with-linux-headers=$(LINUX_DIR) --libdir=$(STAGING_DIR)/usr/lib --includedir=$(STAGING_DIR)/usr/include)
endef
# $(call Build/Configure/Default,--with-linux-headers=$(LINUX_DIR))

define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR) \
LD="$(TARGET_CXX)" \
all
endef

define Package/gsocket/install
$(INSTALL_DIR) $(1)/bin
$(INSTALL_DIR) $(1)/share/gsocket
$(INSTALL_DIR) $(1)/lib
$(INSTALL_DIR) $(1)/etc
$(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/gs-sftp $(1)/bin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/gs-mount $(1)/bin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/blitz $(1)/bin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/gsocket $(1)/bin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/gs-netcat $(1)/bin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/gs_funcs $(1)/share/gsocket/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/gsocket_uchroot_dso.so.0 $(1)/lib/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/gsocket_dso.so.0 $(1)/lib/
$(INSTALL_CONF) $(PKG_BUILD_DIR)/tools/gsocket.conf $(1)/etc/
endef

$(eval $(call BuildPackage,gsocket))

0 comments on commit 09d9144

Please sign in to comment.