cjdns: upgrade uci-defaults for ucitrack handling to use json
[feed/routing.git] / cjdns / Makefile
index a81b49144cfe66598ccbddcd68088c09ffa49edf..cd3ccfeb4b13cc0a502ab4dc09be73893d8297d5 100644 (file)
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=cjdns
-PKG_VERSION:=0.17
-PKG_RELEASE:=2
+PKG_VERSION:=21.1
+PKG_RELEASE:=6
 
-PKG_SOURCE_URL:=https://github.com/hyperboria/cjdns.git
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_VERSION:=40e87d9419c19063e772e39c7c59a8a8771c5ee8
-PKG_LICENSE:=GPL-3.0
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.bz2
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_SOURCE_VERSION)
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://codeload.github.com/cjdelisle/cjdns/tar.gz/$(PKG_NAME)-v$(PKG_VERSION)?
+PKG_HASH:=a6158ce7847159aa44e86f74ccc7b6ded6910a230ed8f3830db53cda5838f0b0
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_NAME)-v$(PKG_VERSION)
 
-include $(INCLUDE_DIR)/package.mk
+PKG_MAINTAINER:=William Fleurant <meshnet@protonmail.com>
+PKG_LICENSE:=GPL-3.0-or-later
+PKG_LICENSE_FILES:=LICENSE
 
+include $(INCLUDE_DIR)/package.mk
 
 define Package/cjdns
        SECTION:=net
        CATEGORY:=Network
        SUBMENU:=Routing and Redirection
        TITLE:=Encrypted near-zero-conf mesh routing protocol
-       URL:=https://github.com/hyperboria/cjdns
-       MAINTAINER:=Lars Gierth <larsg@systemli.org>
-       DEPENDS:=@IPV6 +kmod-tun +libnl-tiny +libpthread +librt \
+       URL:=https://github.com/cjdelisle/cjdns
+       DEPENDS:=@!arc @IPV6 +kmod-tun +libnl-tiny +libpthread +librt \
                +libuci-lua +lua-bencode +dkjson +luasocket +lua-sha2
 endef
 
@@ -54,13 +53,12 @@ define Package/cjdns-tests
        CATEGORY:=Network
        SUBMENU:=Routing and Redirection
        TITLE:=cjdns test cases
-       URL:=https://github.com/hyperboria/cjdns
-       MAINTAINER:=Lars Gierth <larsg@systemli.org>
-       DEPENDS:=+libpthread +librt
+       URL:=https://github.com/cjdelisle/cjdns
+       DEPENDS:=+libpthread +librt @!arc
 endef
 
 define Package/cjdns-test/description
-       cjdns test cases
+       Builds cjdns test cases binary test_testcjdroute_c
 endef
 
 define Build/Configure
@@ -77,18 +75,21 @@ PKG_DO_VARS+= UCLIBC=1
 endif
 
 define Build/Compile
+       $(INSTALL_DIR) $(PKG_BUILD_DIR)/tmp
+       (cd $(PKG_BUILD_DIR) && \
        CROSS="true" \
-       CC="$(TARGET_CC)" \
+       CC="$(TARGET_CC_NOCACHE)" \
        AR="$(TARGET_AR)" \
        RANLIB="$(TARGET_RANLIB)" \
-       CFLAGS="$(TARGET_CFLAGS)" \
+       CFLAGS="$(TARGET_CFLAGS) -U_FORTIFY_SOURCE -Wno-error=array-bounds -Wno-error=stringop-overflow -Wno-error=stringop-overread" \
        LDFLAGS="$(TARGET_LDFLAGS)" \
        SYSTEM="linux" \
        TARGET_ARCH="$(CONFIG_ARCH)" \
        SSP_SUPPORT="$(CONFIG_SSP_SUPPORT)" \
        GYP_ADDITIONAL_ARGS="-f make-linux" \
+       CJDNS_BUILD_TMPDIR="$(PKG_BUILD_DIR)/tmp" \
        $(PKG_DO_VARS) \
-       $(PKG_BUILD_DIR)/do
+       exec ./do)
 endef
 
 define Package/cjdns/install
@@ -98,7 +99,8 @@ define Package/cjdns/install
                $(1)/etc/config \
                $(1)/etc/init.d \
                $(1)/etc/uci-defaults \
-               $(1)/usr/lib/lua/cjdns
+               $(1)/usr/lib/lua/cjdns \
+               $(1)/usr/share/ucitrack
 
        $(INSTALL_BIN) \
                ./files/cjdrouteconf \
@@ -120,6 +122,10 @@ define Package/cjdns/install
                ./files/cjdns.defaults \
                $(1)/etc/uci-defaults/cjdns
 
+       $(INSTALL_DATA) \
+               ./files/luci-app-cjdns.json \
+               $(1)/usr/share/ucitrack
+
        $(CP) \
                ./lua/cjdns/* \
                $(1)/usr/lib/lua/cjdns
@@ -129,7 +135,6 @@ define Package/cjdns/postinst
 #!/bin/sh
 if [ -z $${IPKG_INSTROOT} ] ; then
        ( . /etc/uci-defaults/cjdns ) && rm -f /etc/uci-defaults/cjdns
-       # TODO: we should have an 'Enable' button instead
        /etc/init.d/cjdns enabled || /etc/init.d/cjdns enable
        exit 0
 fi