cjdns: luci-app-cjdns: update maintainer (#524)
[feed/routing.git] / cjdns / Makefile
index 9744d7b5486d1a326988a50962835e08e2beef1a..2674c457c8f63c9c587f82a1b1491239aa0d8e6d 100644 (file)
@@ -1,12 +1,28 @@
+#
+# Copyright (C) 2014,2015 Hyperboria.net
+#
+# You may redistribute this program and/or modify it under the terms of
+# the GNU General Public License as published by the Free Software Foundation,
+# either version 3 of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=cjdns
-PKG_VERSION:=0.16
-PKG_RELEASE:=9
+PKG_VERSION:=20.4
+PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=https://github.com/cjdelisle/cjdns.git
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_VERSION:=2138a1f6a94fc009958cde7b002c077a1eee929a
+PKG_SOURCE_VERSION:=45cdd8b3eebb18b6239feeef3b787e40d773edfb
 PKG_LICENSE:=GPL-3.0
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.bz2
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
@@ -20,9 +36,9 @@ define Package/cjdns
        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:=+kmod-tun +kmod-ipv6 +libnl-tiny +libpthread +librt \
+       URL:=https://github.com/cjdelisle/cjdns
+       MAINTAINER:=William Fleurant <meshnet@protonmail.com>
+       DEPENDS:=@!arc @IPV6 +kmod-tun +libnl-tiny +libpthread +librt \
                +libuci-lua +lua-bencode +dkjson +luasocket +lua-sha2
 endef
 
@@ -33,10 +49,24 @@ define Package/cjdns/description
        of the security and scalability issues that plague existing networks.
 endef
 
+define Package/cjdns-tests
+       SECTION:=net
+       CATEGORY:=Network
+       SUBMENU:=Routing and Redirection
+       TITLE:=cjdns test cases
+       URL:=https://github.com/cjdelisle/cjdns
+       MAINTAINER:=Lars Gierth <larsg@systemli.org>
+       DEPENDS:=+libpthread +librt @!arc
+endef
+
+define Package/cjdns-test/description
+       cjdns test cases
+endef
+
 define Build/Configure
 endef
 
-PKG_DO_VARS:=
+PKG_DO_VARS:=CJDNS_RELEASE_VERSION=$(PKG_SOURCE_VERSION)
 
 ifneq ($(CONFIG_KERNEL_SECCOMP_FILTER),y)
 PKG_DO_VARS+= Seccomp_NO=1
@@ -47,15 +77,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)" \
-       CFLAGS="$(TARGET_CFLAGS)" \
+       AR="$(TARGET_AR)" \
+       RANLIB="$(TARGET_RANLIB)" \
+       CFLAGS="$(TARGET_CFLAGS) -U_FORTIFY_SOURCE" \
        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
@@ -102,4 +138,12 @@ if [ -z $${IPKG_INSTROOT} ] ; then
 fi
 endef
 
+define Package/cjdns-tests/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) \
+               $(PKG_BUILD_DIR)/build_linux/test_testcjdroute_c \
+               $(1)/usr/bin
+endef
+
 $(eval $(call BuildPackage,cjdns))
+$(eval $(call BuildPackage,cjdns-tests))