Merge pull request #8584 from jefferyto/python-compileall-recursion-level
authorRosen Penev <rosenp@gmail.com>
Thu, 4 Apr 2019 07:19:55 +0000 (00:19 -0700)
committerGitHub <noreply@github.com>
Thu, 4 Apr 2019 07:19:55 +0000 (00:19 -0700)
python,python3: Increase max recursion level when generating bytecode

26 files changed:
CONTRIBUTING.md
lang/luasec/Makefile
lang/python/python/Makefile
lang/python/python/files/python-config.in [new file with mode: 0644]
lang/python/python3/Makefile
libs/jose/Makefile [new file with mode: 0644]
libs/jose/patches/Fix_minor_leak_upstream_198f720.patch [new file with mode: 0644]
libs/libdouble-conversion/Makefile
libs/libglog/Makefile
libs/libglog/patches/100-fix-musl-compilation.patch [new file with mode: 0644]
net/kea/Makefile [new file with mode: 0644]
net/kea/patches/001-fix-cross-compile.patch [new file with mode: 0644]
net/kea/patches/002-fix-host-compile.patch [new file with mode: 0644]
net/kea/patches/003-no-test-compile.patch [new file with mode: 0644]
net/pptpd/Makefile
net/pptpd/files/pptpd.init
net/rosy-file-server/Makefile [new file with mode: 0644]
net/rosy-file-server/files/rosyfs.config [new file with mode: 0644]
net/rosy-file-server/files/rosyfs.init [new file with mode: 0755]
utils/btrfs-progs/Config.in
utils/tang/Makefile [new file with mode: 0644]
utils/tang/files/tangdw [new file with mode: 0755]
utils/tang/files/tangdx [new file with mode: 0644]
utils/tang/patches/Makefile_am.patch [new file with mode: 0644]
utils/tang/patches/rm-systemd-from-configure.patch [new file with mode: 0644]
utils/tang/patches/use-readlink-in-tangd-update.patch [new file with mode: 0644]

index 75d8bc2dc2781aabada91437dc4eacb52343d0b0..ef47a6391f562dadbdf9d30c7e969e8fe48ced6a 100644 (file)
@@ -42,7 +42,7 @@ All packages you commit or submit by pull-request should follow these simple gui
 * Have a useful description prefixed with the package name
     (E.g.: "foopkg: Add libzot dependency")
 * Include Signed-off-by tag in the commit comments.
-    See: [Sign your work](https://openwrt.org/docs/guide-developer/submittingpatches-tomerge?s[]=sign#sign_your_work)
+    See: [Sign your work](https://openwrt.org/submitting-patches#sign_your_work)
 
 ### Advice on pull requests:
 
index 29c120e1ae90a85eff27d4f995832b98d2aa9dfa..621cb7af69a3684e56cf4ef600f12ea141ef9e98 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=luasec
 PKG_VERSION:=0.7
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/brunoos/luasec/tar.gz/luasec-$(PKG_VERSION)?
@@ -45,8 +45,9 @@ TARGET_CFLAGS += $(FPIC)
 TARGET_LDFLAGS += $(FPIC)
 
 MAKE_FLAGS += \
-       INCDIR="$(TARGET_CPPFLAGS) -I." \
-       LIBDIR="$(TARGET_LDFLAGS) -L./luasocket" \
+       LD="$(TARGET_CC)" \
+       INC_PATH="" \
+       LIB_PATH="" \
        LUACPATH="$(PKG_INSTALL_DIR)/usr/lib/lua" \
        LUAPATH="$(PKG_INSTALL_DIR)/usr/lib/lua"
 
index af584bcddd90754bc07688be2beaf6360fa9e9b2..6eec6bd362ae850dc7ad640198682766d4da9397 100644 (file)
@@ -195,6 +195,8 @@ endef
 
 define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib $(1)/usr/lib/pkgconfig
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_DIR) $(1)/usr/lib/python$(PYTHON_VERSION)-openwrt
        $(CP) \
                $(PKG_INSTALL_DIR)/usr/include/python$(PYTHON_VERSION) \
                $(1)/usr/include/
@@ -205,6 +207,15 @@ define Build/InstallDev
        $(CP) \
                $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/python*.pc \
                $(1)/usr/lib/pkgconfig
+       $(INSTALL_BIN) \
+               ./files/python-config.in \
+               $(1)/usr/bin/python$(PYTHON_VERSION)-config
+       $(SED) \
+               's|@EXENAME@|$(HOST_PYTHON_DIR)/bin/python$(PYTHON_VERSION)|' \
+               $(1)/usr/bin/python$(PYTHON_VERSION)-config
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON_VERSION)/_sysconfigdata.py \
+               $(1)/usr/lib/python$(PYTHON_VERSION)-openwrt/_sysconfigdatatarget.py
 endef
 
 PYTHON_BASE_LIB_FILES:= \
diff --git a/lang/python/python/files/python-config.in b/lang/python/python/files/python-config.in
new file mode 100644 (file)
index 0000000..46f6c9c
--- /dev/null
@@ -0,0 +1,81 @@
+#!@EXENAME@
+
+import sys
+import os
+import getopt
+from distutils import sysconfig
+
+# start changes
+host_prefix = sysconfig.PREFIX
+
+target_bin_dir = os.path.dirname(os.path.abspath(__file__))
+target_prefix = os.path.normpath(os.path.join(target_bin_dir, '..'))
+
+target_data_dir = os.path.join(target_prefix, 'lib', 'python' + sysconfig.get_config_var('VERSION') + '-openwrt')
+sys.path.append(target_data_dir)
+
+try:
+    from _sysconfigdatatarget import build_time_vars
+    sysconfig._config_vars = {}
+    sysconfig._config_vars.update(build_time_vars)
+except ImportError:
+    print >>sys.stderr, "Could not import target data from %s" % (target_data_dir)
+    sys.exit(1)
+# end changes
+# plus .replace(host_prefix, target_prefix) below
+
+valid_opts = ['prefix', 'exec-prefix', 'includes', 'libs', 'cflags',
+              'ldflags', 'help']
+
+def exit_with_usage(code=1):
+    print >>sys.stderr, "Usage: %s [%s]" % (sys.argv[0],
+                                            '|'.join('--'+opt for opt in valid_opts))
+    sys.exit(code)
+
+try:
+    opts, args = getopt.getopt(sys.argv[1:], '', valid_opts)
+except getopt.error:
+    exit_with_usage()
+
+if not opts:
+    exit_with_usage()
+
+pyver = sysconfig.get_config_var('VERSION')
+getvar = sysconfig.get_config_var
+
+opt_flags = [flag for (flag, val) in opts]
+
+if '--help' in opt_flags:
+    exit_with_usage(code=0)
+
+for opt in opt_flags:
+    if opt == '--prefix':
+        #print sysconfig.PREFIX
+        print target_prefix
+
+    elif opt == '--exec-prefix':
+        #print sysconfig.EXEC_PREFIX
+        print target_prefix
+
+    elif opt in ('--includes', '--cflags'):
+        flags = ['-I' + sysconfig.get_python_inc(),
+                 '-I' + sysconfig.get_python_inc(plat_specific=True)]
+        if opt == '--cflags':
+            flags.extend(getvar('CFLAGS').split())
+        #print ' '.join(flags)
+        print ' '.join(flags).replace(host_prefix, target_prefix)
+
+    elif opt in ('--libs', '--ldflags'):
+        libs = ['-lpython' + pyver]
+        libs += getvar('LIBS').split()
+        libs += getvar('SYSLIBS').split()
+        # add the prefix/lib/pythonX.Y/config dir, but only if there is no
+        # shared library in prefix/lib/.
+        if opt == '--ldflags':
+            if not getvar('Py_ENABLE_SHARED'):
+                libs.insert(0, '-L' + getvar('LIBPL'))
+            if not getvar('PYTHONFRAMEWORK'):
+                libs.extend(getvar('LINKFORSHARED').split())
+        #print ' '.join(libs)
+        print ' '.join(libs).replace(host_prefix, target_prefix)
+
index bbb90e13ce7e625b1670164935ebf888e8d812f7..60fe7c69f737aae6a98731cfcb57d8d25b97281d 100644 (file)
@@ -14,7 +14,7 @@ PYTHON_VERSION:=$(PYTHON3_VERSION)
 PYTHON_VERSION_MICRO:=$(PYTHON3_VERSION_MICRO)
 
 PKG_NAME:=python3
-PKG_RELEASE:=9
+PKG_RELEASE:=10
 PKG_VERSION:=$(PYTHON_VERSION).$(PYTHON_VERSION_MICRO)
 
 PKG_SOURCE:=Python-$(PKG_VERSION).tar.xz
@@ -199,6 +199,7 @@ endef
 
 define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib $(1)/usr/lib/pkgconfig
+       $(INSTALL_DIR) $(1)/usr/bin
        $(CP) \
                $(PKG_INSTALL_DIR)/usr/include/python$(PYTHON_VERSION) \
                $(1)/usr/include/
@@ -209,6 +210,9 @@ define Build/InstallDev
        $(CP) \
                $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/python*.pc \
                $(1)/usr/lib/pkgconfig
+       $(INSTALL_BIN) \
+               $(PKG_INSTALL_DIR)/usr/bin/python$(PYTHON_VERSION)-config \
+               $(1)/usr/bin/
 endef
 
 PYTHON3_BASE_LIB_FILES:= \
diff --git a/libs/jose/Makefile b/libs/jose/Makefile
new file mode 100644 (file)
index 0000000..f515cf8
--- /dev/null
@@ -0,0 +1,74 @@
+#
+# Author: Tibor Dudlák
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=jose
+PKG_VERSION:=10
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=https://github.com/latchset/$(PKG_NAME)/releases/download/v$(PKG_VERSION)/
+PKG_HASH:=5c9cdcfb535c4d9f781393d7530521c72b1dd81caa9934cab6dd752cc7efcd72
+
+PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
+
+PKG_FIXUP:=autoreconf
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libjose
+  SECTION:=libs
+  TITLE:=Provides a full crypto stack including key generation, signing and encryption.
+  DEPENDS:=+zlib +jansson +libopenssl +libpthread
+  URL:=https://github.com/latchset/jose
+  MAINTAINER:=Tibor Dudlák <tibor.dudlak@gmail.com>
+endef
+
+define Package/jose
+  SECTION:=utils
+  TITLE:=Provides a full crypto stack including key generation, signing and encryption.
+  DEPENDS:=+libjose
+  URL:=https://github.com/latchset/jose
+  MAINTAINER:=Tibor Dudlák <tibor.dudlak@gmail.com>
+endef
+
+define Package/jose/description
+       jose is a command line utility for performing various tasks on JSON
+       Object Signing and Encryption (JOSE) objects. José provides a full
+       crypto stack including key generation, signing and encryption.
+endef
+
+define Package/libjose/description
+       libjose is a library for performing various tasks on JSON
+       Object Signing and Encryption (JOSE) objects. José provides a full
+       crypto stack including key generation, signing and encryption.
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR)  $(1)/usr/lib
+       $(INSTALL_DIR)  $(1)/usr/include
+       $(INSTALL_DIR)  $(1)/usr/include/$(PKG_NAME)
+       $(INSTALL_DIR)  $(1)/usr/lib/pkgconfig
+       $(CP)   $(PKG_INSTALL_DIR)/usr/lib/lib$(PKG_NAME).so*   $(1)/usr/lib
+       $(CP)   $(PKG_INSTALL_DIR)/usr/include/$(PKG_NAME)/*.h  $(1)/usr/include/$(PKG_NAME)
+       $(CP)   $(PKG_BUILD_DIR)/*.pc                           $(1)/usr/lib/pkgconfig
+endef
+
+define Package/libjose/install
+       $(INSTALL_DIR)  $(1)/usr/lib
+       $(CP)           $(PKG_INSTALL_DIR)/usr/lib/lib$(PKG_NAME).so*   $(1)/usr/lib/
+endef
+
+define Package/jose/install
+       $(INSTALL_DIR)  $(1)/usr/bin
+       $(INSTALL_BIN)  $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME)          $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,libjose))
+$(eval $(call BuildPackage,jose))
diff --git a/libs/jose/patches/Fix_minor_leak_upstream_198f720.patch b/libs/jose/patches/Fix_minor_leak_upstream_198f720.patch
new file mode 100644 (file)
index 0000000..5075760
--- /dev/null
@@ -0,0 +1,33 @@
+From 198f7207427ad7f569aa3592ea16e2bb400db040 Mon Sep 17 00:00:00 2001
+From: Nathaniel McCallum <npmccallum@redhat.com>
+Date: Fri, 29 Sep 2017 14:49:57 -0400
+Subject: [PATCH] Fix minor FILE* leak
+
+---
+ cmd/jwe/pwd.h | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/cmd/jwe/pwd.h b/cmd/jwe/pwd.h
+index 0b5be54..2f021eb 100644
+--- a/cmd/jwe/pwd.h
++++ b/cmd/jwe/pwd.h
+@@ -57,8 +57,10 @@ jwe_getpass(const char *prompt)
+     nf.c_lflag &= ~ECHO;
+     nf.c_lflag |= ECHONL;
+-    if (tcsetattr(fileno(tty), TCSANOW, &nf) != 0)
++    if (tcsetattr(fileno(tty), TCSANOW, &nf) != 0) {
++        fclose(tty);
+         return NULL;
++    }
+     fprintf(tty, "%s", prompt);
+@@ -72,6 +74,7 @@ jwe_getpass(const char *prompt)
+     }
+     tcsetattr(fileno(tty), TCSANOW, &of);
++    fclose(tty);
+     return pwd;
+ }
+ #endif
index 5bb3faf90b692c4dff3c7c36b3f95759aaff4a17..ac7e4f93407e4b590587c59a0688318df8d44437 100644 (file)
@@ -9,11 +9,13 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libdouble-conversion
 PKG_VERSION:=3.1.4
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=double-conversion-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/google/double-conversion/tar.gz/v$(PKG_VERSION)?
 PKG_HASH:=95004b65e43fefc6100f337a25da27bb99b9ef8d4071a36a33b5e83eb1f82021
+
+HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/double-conversion-$(PKG_VERSION)
 PKG_BUILD_DIR:=$(BUILD_DIR)/double-conversion-$(PKG_VERSION)
 
 PKG_MAINTAINER:=
@@ -21,6 +23,7 @@ PKG_LICENSE:=BSD-3c
 PKG_LICENSE_FILES:=COPYING LICENSE
 
 include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/host-build.mk
 include $(INCLUDE_DIR)/cmake.mk
 
 define Package/libdouble-conversion
@@ -67,3 +70,4 @@ define Package/libdouble-conversion/install
 endef
 
 $(eval $(call BuildPackage,libdouble-conversion))
+$(eval $(call HostBuild))
index 98b1970f05a98d94fb0c4213b1e8f26b1fb339f5..dcaab6afb6193e4f8b3646d6f897351c85fe31ba 100644 (file)
@@ -1,12 +1,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=glog
-PKG_VERSION:=0.3.5
-PKG_RELEASE:=3
+PKG_VERSION:=0.4.0
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/google/glog/tar.gz/v$(PKG_VERSION)?
-PKG_HASH:=7580e408a2c0b5a89ca214739978ce6ff480b5e7d8d7698a2aa92fadc484d1e0
+PKG_HASH:=f28359aeba12f30d73d9e4711ef356dc842886968112162bc73002645139c39c
 
 PKG_LICENSE:=BSD-3-Clause
 PKG_LICENSE_FILE:=COPYING
diff --git a/libs/libglog/patches/100-fix-musl-compilation.patch b/libs/libglog/patches/100-fix-musl-compilation.patch
new file mode 100644 (file)
index 0000000..dab64be
--- /dev/null
@@ -0,0 +1,13 @@
+Index: glog-0.4.0/src/symbolize_unittest.cc
+===================================================================
+--- glog-0.4.0.orig/src/symbolize_unittest.cc
++++ glog-0.4.0/src/symbolize_unittest.cc
+@@ -401,7 +401,7 @@ int main(int argc, char **argv) {
+   FLAGS_logtostderr = true;
+   InitGoogleLogging(argv[0]);
+   InitGoogleTest(&argc, argv);
+-#if defined(HAVE_SYMBOLIZE)
++#if defined(HAVE_SYMBOLIZE) && defined(HAVE_STACKTRACE)
+ # if defined(__ELF__)
+   // We don't want to get affected by the callback interface, that may be
+   // used to install some callback function at InitGoogle() time.
diff --git a/net/kea/Makefile b/net/kea/Makefile
new file mode 100644 (file)
index 0000000..e66aedd
--- /dev/null
@@ -0,0 +1,201 @@
+#
+# Copyright (C) 2019 Banglang Huang <banglang.huang@foxmail.com>
+# Copyright (C) 2019 Rosy Song <rosysong@rosinson.com>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=kea
+PKG_VERSION:=1.5.0
+PKG_RELEASE:=1
+PKG_MAINTAINER:=BangLang Huang<banglang.huang@foxmail.com>, Rosy Song<rosysong@rosinson.com>
+PKG_BUILD_DEPENDS:=boost log4cplus kea/host
+HOST_BUILD_DEPENDS:=boost boost/host log4cplus/host
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://ftp.isc.org/isc/kea/$(PKG_VERSION)/
+
+PKG_HASH:=edce4fab68ca7af607cf7f5bc86596e04fe0ef4b8e88906e339cdefcf21daaec
+
+PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
+PKG_LICENSE:=MPL-2.0
+PKG_FIXUP:=autoreconf
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/host-build.mk
+
+HOST_BUILD_PREFIX:=$(STAGING_DIR_HOST)
+
+define Package/kea/Default
+  SECTION:=net
+  CATEGORY:=Network
+  SUBMENU:=IP Addresses and Names
+  TITLE:=ISC Kea
+  URL:=https://www.isc.org/kea
+endef
+
+define Package/kea/description
+  Kea is an open source DHCPv4/DHCPv6 server being developed by Internet
+  Systems Consortium. Kea is a high-performance, extensible DHCP server
+  engine that is designed to be easily modified and extended with hooks
+  libraries. It provides DHCPv4 and DHCPv6 servers, a dynamic DNS update
+  module, a portable DHCP library, libdhcp++, control agent that provides
+  management REST interface, and a DHCP benchmarking tool, perfdhcp.
+endef
+
+define Package/kea-libs
+       $(call Package/kea/Default)
+       TITLE+= Libraries
+       DEPENDS:=+libopenssl +log4cplus \
+               +boost +boost-python3 +boost-system
+endef
+
+define Package/kea-dhcp4
+       $(call Package/kea/Default)
+       TITLE+= DHCP Server v4
+       DEPENDS:=+kea-libs
+endef
+
+define Package/kea-dhcp6
+       $(call Package/kea/Default)
+       TITLE+= DHCP Server v6
+       DEPENDS:=@IPV6 +kea-libs
+endef
+
+define Package/kea-dhcp-ddns
+       $(call Package/kea/Default)
+       TITLE+= DHCP - DDNS
+       DEPENDS:=+kea-libs
+endef
+
+define Package/kea-admin
+       $(call Package/kea/Default)
+       TITLE+= Admin
+       DEPENDS:= +kea-libs +python3
+endef
+
+define Package/kea-ctrl
+       $(call Package/kea/Default)
+       TITLE+= Control
+       DEPENDS:= +kea-dhcp4 +IPV6:kea-dhcp6 \
+               +kea-dhcp-ddns
+endef
+
+define Package/kea-lfc
+       $(call Package/kea/Default)
+       TITLE+= lfc
+       DEPENDS:=+kea-libs
+endef
+
+define Package/kea-perfdhcp
+       $(call Package/kea/Default)
+       TITLE+= perfdhcp
+       DEPENDS:=+kea-libs
+endef
+
+CONFIGURE_ARGS += \
+       --with-log4cplus="$(STAGING_DIR)/usr" \
+       $(if $(CONFIG_PACKAGE_kea-perfdhcp),--enable-perfdhcp,)
+
+CONFIGURE_VARS += \
+       cross_compiling="yes"
+
+HOST_CONFIGURE_ARGS += \
+       --enable-static-link \
+       --enable-boost-headers-only \
+       --with-log4cplus="$(STAGING_DIR_HOSTPKG)" \
+       --with-boost-include="$(STAGING_DIR)/usr/include"
+
+HOST_LDFLAGS += \
+               -Wl,--gc-sections,--as-needed
+
+TARGET_CXXFLAGS += \
+               -fdata-sections \
+               -ffunction-sections
+
+TARGET_LDFLAGS += \
+               -Wl,--gc-sections,--as-needed
+
+# Only compile the kea-msg-compiler which we need for
+# package compilation
+define Host/Compile
+       +$(HOST_MAKE_VARS) \
+       $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR)/src/lib/exceptions $(HOST_MAKE_FLAGS)
+       +$(HOST_MAKE_VARS) \
+       $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR)/src/lib/util $(HOST_MAKE_FLAGS)
+       +$(HOST_MAKE_VARS) \
+       $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR)/src/lib/log $(HOST_MAKE_FLAGS)
+endef
+
+define Host/Install
+       $(INSTALL_BIN) $(HOST_BUILD_DIR)/src/lib/log/compiler/kea-msg-compiler \
+               $(STAGING_DIR_HOSTPKG)/bin/
+endef
+
+define Build/Compile
+       $(INSTALL_DIR) $(PKG_BUILD_DIR)/src/lib/log/compiler
+       $(INSTALL_BIN) $(STAGING_DIR_HOSTPKG)/bin/kea-msg-compiler \
+               $(PKG_BUILD_DIR)/src/lib/log/compiler/
+       $(call Build/Compile/Default)
+endef
+
+define Package/kea-libs/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
+endef
+
+define Package/kea-dhcp4/install
+       $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/kea
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-dhcp4 $(1)/usr/sbin/kea-dhcp4
+       $(CP) $(PKG_INSTALL_DIR)/etc/kea/kea-dhcp4.conf $(1)/etc/kea/
+endef
+
+define Package/kea-dhcp6/install
+       $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/kea
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-dhcp6 $(1)/usr/sbin/kea-dhcp6
+       $(CP) $(PKG_INSTALL_DIR)/etc/kea/kea-dhcp6.conf $(1)/etc/kea/
+endef
+
+define Package/kea-dhcp-ddns/install
+       $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/kea
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-dhcp-ddns $(1)/usr/sbin/kea-dhcp-ddns
+       $(CP) $(PKG_INSTALL_DIR)/etc/kea/kea-dhcp-ddns.conf $(1)/etc/kea/
+endef
+
+define Package/kea-admin/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-admin $(1)/usr/sbin/kea-admin
+endef
+
+define Package/kea-ctrl/install
+       $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/kea
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/keactrl $(1)/usr/sbin/keactrl
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-ctrl-agent $(1)/usr/sbin/kea-ctrl-agent
+       $(CP) $(PKG_INSTALL_DIR)/etc/kea/keactrl.conf $(1)/etc/kea/
+       $(CP) $(PKG_INSTALL_DIR)/etc/kea/kea-ctrl-agent.conf $(1)/etc/kea/
+       $(CP) $(PKG_INSTALL_DIR)/etc/kea/kea-netconf.conf $(1)/etc/kea/
+endef
+
+define Package/kea-lfc/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-lfc $(1)/usr/sbin/kea-lfc
+endef
+
+define Package/kea-perfdhcp/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/perfdhcp $(1)/usr/sbin/perfdhcp
+endef
+
+$(eval $(call HostBuild))
+$(eval $(call BuildPackage,kea-libs))
+$(eval $(call BuildPackage,kea-dhcp4))
+$(eval $(call BuildPackage,kea-dhcp6))
+$(eval $(call BuildPackage,kea-dhcp-ddns))
+$(eval $(call BuildPackage,kea-admin))
+$(eval $(call BuildPackage,kea-ctrl))
+$(eval $(call BuildPackage,kea-lfc))
+$(eval $(call BuildPackage,kea-perfdhcp))
diff --git a/net/kea/patches/001-fix-cross-compile.patch b/net/kea/patches/001-fix-cross-compile.patch
new file mode 100644 (file)
index 0000000..40a4750
--- /dev/null
@@ -0,0 +1,16 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -594,10 +594,10 @@ AC_TRY_COMPILE([
+         AC_MSG_RESULT(no))
+ AC_MSG_CHECKING(for usuable C++11 regex)
+-AC_TRY_RUN([
++AC_TRY_COMPILE([
+ #include <regex>
+-#include <iostream>
+-int main() {
++#include <iostream>],
++[int main() {
+   const std::regex regex(".*");
+   const std::string string = "This should match!";
+   const auto result = std::regex_search(string, regex);
diff --git a/net/kea/patches/002-fix-host-compile.patch b/net/kea/patches/002-fix-host-compile.patch
new file mode 100644 (file)
index 0000000..01f20d1
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/m4macros/ax_crypto.m4
++++ b/m4macros/ax_crypto.m4
+@@ -454,7 +454,7 @@ EOF
+     dnl Check availability of SHA-2
+     AC_MSG_CHECKING([support of SHA-2])
+     LIBS_SAVED=${LIBS}
+-    LIBS="$LIBS $CRYPTO_LIBS"
++    LIBS="$LIBS $CRYPTO_LIBS -lpthread"
+     CPPFLAGS_SAVED=${CPPFLAGS}
+     CPPFLAGS="$CRYPTO_INCLUDES $CPPFLAGS"
+     AC_LINK_IFELSE(
diff --git a/net/kea/patches/003-no-test-compile.patch b/net/kea/patches/003-no-test-compile.patch
new file mode 100644 (file)
index 0000000..9b484d5
--- /dev/null
@@ -0,0 +1,328 @@
+--- a/src/bin/admin/Makefile.am
++++ b/src/bin/admin/Makefile.am
+@@ -1,4 +1,4 @@
+-SUBDIRS = . tests
++SUBDIRS = .
+ # Install kea-admin in sbin.
+ sbin_SCRIPTS  = kea-admin
+--- a/src/bin/agent/Makefile.am
++++ b/src/bin/agent/Makefile.am
+@@ -1,4 +1,4 @@
+-SUBDIRS = . tests
++SUBDIRS = .
+ AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
+ AM_CPPFLAGS += -I$(top_srcdir)/src/bin -I$(top_builddir)/src/bin
+--- a/src/bin/d2/Makefile.am
++++ b/src/bin/d2/Makefile.am
+@@ -1,4 +1,4 @@
+-SUBDIRS = . tests
++SUBDIRS = .
+ AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
+ AM_CPPFLAGS += -I$(top_srcdir)/src/bin -I$(top_builddir)/src/bin
+--- a/src/bin/dhcp4/Makefile.am
++++ b/src/bin/dhcp4/Makefile.am
+@@ -1,4 +1,4 @@
+-SUBDIRS = . tests
++SUBDIRS = .
+ AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
+ AM_CPPFLAGS += -I$(top_srcdir)/src/bin -I$(top_builddir)/src/bin
+--- a/src/bin/dhcp6/Makefile.am
++++ b/src/bin/dhcp6/Makefile.am
+@@ -1,4 +1,4 @@
+-SUBDIRS = . tests
++SUBDIRS = .
+ AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
+ AM_CPPFLAGS += -I$(top_srcdir)/src/bin -I$(top_builddir)/src/bin
+--- a/src/bin/keactrl/Makefile.am
++++ b/src/bin/keactrl/Makefile.am
+@@ -1,4 +1,4 @@
+-SUBDIRS = . tests
++SUBDIRS = .
+ # Install keactrl in sbin and the keactrl.conf required by the keactrl
+ # in etc. keactrl will look for its configuration file in the etc folder.
+--- a/src/bin/lfc/Makefile.am
++++ b/src/bin/lfc/Makefile.am
+@@ -1,4 +1,4 @@
+-SUBDIRS = . tests
++SUBDIRS = .
+ AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
+ AM_CPPFLAGS += -I$(top_srcdir)/src/bin -I$(top_builddir)/src/bin
+--- a/src/bin/netconf/Makefile.am
++++ b/src/bin/netconf/Makefile.am
+@@ -1,4 +1,4 @@
+-SUBDIRS = . tests
++SUBDIRS = .
+ AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
+ AM_CPPFLAGS += -I$(top_srcdir)/src/bin -I$(top_builddir)/src/bin
+--- a/src/bin/perfdhcp/Makefile.am
++++ b/src/bin/perfdhcp/Makefile.am
+@@ -1,4 +1,4 @@
+-SUBDIRS = . tests
++SUBDIRS = .
+ AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
+ AM_CPPFLAGS += -I$(top_srcdir)/src/bin -I$(top_builddir)/src/bin
+--- a/src/bin/shell/Makefile.am
++++ b/src/bin/shell/Makefile.am
+@@ -1,4 +1,4 @@
+-SUBDIRS = . tests
++SUBDIRS = .
+ pkgpython_PYTHON = kea_conn.py kea_connector2.py kea_connector3.py
+--- a/src/hooks/dhcp/high_availability/Makefile.am
++++ b/src/hooks/dhcp/high_availability/Makefile.am
+@@ -1,4 +1,4 @@
+-SUBDIRS = . tests
++SUBDIRS = .
+ AM_CPPFLAGS  = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
+ AM_CPPFLAGS += $(BOOST_INCLUDES)
+--- a/src/hooks/dhcp/lease_cmds/Makefile.am
++++ b/src/hooks/dhcp/lease_cmds/Makefile.am
+@@ -1,4 +1,4 @@
+-SUBDIRS = . tests
++SUBDIRS = .
+ AM_CPPFLAGS  = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
+ AM_CPPFLAGS += $(BOOST_INCLUDES)
+--- a/src/hooks/dhcp/stat_cmds/Makefile.am
++++ b/src/hooks/dhcp/stat_cmds/Makefile.am
+@@ -1,4 +1,4 @@
+-SUBDIRS = . tests
++SUBDIRS = .
+ AM_CPPFLAGS  = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
+ AM_CPPFLAGS += $(BOOST_INCLUDES)
+--- a/src/hooks/dhcp/user_chk/Makefile.am
++++ b/src/hooks/dhcp/user_chk/Makefile.am
+@@ -1,4 +1,4 @@
+-SUBDIRS = . tests
++SUBDIRS = .
+ AM_CPPFLAGS  = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
+ AM_CPPFLAGS += $(BOOST_INCLUDES)
+--- a/src/lib/asiodns/Makefile.am
++++ b/src/lib/asiodns/Makefile.am
+@@ -1,4 +1,4 @@
+-SUBDIRS = . tests
++SUBDIRS = .
+ AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
+ AM_CPPFLAGS += $(BOOST_INCLUDES)
+--- a/src/lib/asiolink/Makefile.am
++++ b/src/lib/asiolink/Makefile.am
+@@ -1,4 +1,4 @@
+-SUBDIRS = . testutils tests
++SUBDIRS = .
+ AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
+ AM_CPPFLAGS += $(BOOST_INCLUDES)
+--- a/src/lib/cc/Makefile.am
++++ b/src/lib/cc/Makefile.am
+@@ -1,4 +1,4 @@
+-SUBDIRS = . tests
++SUBDIRS = .
+ AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
+ AM_CPPFLAGS += $(BOOST_INCLUDES)
+--- a/src/lib/cfgrpt/Makefile.am
++++ b/src/lib/cfgrpt/Makefile.am
+@@ -1,4 +1,4 @@
+-SUBDIRS = . tests
++SUBDIRS = .
+ AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
+ AM_CXXFLAGS  = $(KEA_CXXFLAGS)
+--- a/src/lib/config/Makefile.am
++++ b/src/lib/config/Makefile.am
+@@ -1,4 +1,4 @@
+-SUBDIRS = . tests
++SUBDIRS = .
+ AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
+ AM_CPPFLAGS += $(BOOST_INCLUDES)
+--- a/src/lib/config_backend/Makefile.am
++++ b/src/lib/config_backend/Makefile.am
+@@ -1,4 +1,4 @@
+-SUBDIRS = . tests
++SUBDIRS = .
+ AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
+ AM_CPPFLAGS += $(BOOST_INCLUDES)
+--- a/src/lib/cql/Makefile.am
++++ b/src/lib/cql/Makefile.am
+@@ -1,4 +1,4 @@
+-SUBDIRS = . testutils tests
++SUBDIRS = .
+ AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
+ AM_CPPFLAGS += $(BOOST_INCLUDES) $(CQL_CPPFLAGS)
+--- a/src/lib/cryptolink/Makefile.am
++++ b/src/lib/cryptolink/Makefile.am
+@@ -1,4 +1,4 @@
+-SUBDIRS = . tests
++SUBDIRS = .
+ AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
+ AM_CPPFLAGS += $(BOOST_INCLUDES) $(CRYPTO_CFLAGS) $(CRYPTO_INCLUDES)
+--- a/src/lib/database/Makefile.am
++++ b/src/lib/database/Makefile.am
+@@ -1,4 +1,4 @@
+-SUBDIRS = . testutils tests
++SUBDIRS = .
+ AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
+ AM_CPPFLAGS += $(BOOST_INCLUDES)
+--- a/src/lib/dhcp/Makefile.am
++++ b/src/lib/dhcp/Makefile.am
+@@ -1,4 +1,4 @@
+-SUBDIRS = . tests
++SUBDIRS = .
+ AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
+ AM_CPPFLAGS += $(BOOST_INCLUDES)
+--- a/src/lib/dhcp_ddns/Makefile.am
++++ b/src/lib/dhcp_ddns/Makefile.am
+@@ -1,4 +1,4 @@
+-SUBDIRS = . tests
++SUBDIRS = .
+ AM_CPPFLAGS  = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
+ AM_CPPFLAGS += $(BOOST_INCLUDES)
+--- a/src/lib/dhcpsrv/Makefile.am
++++ b/src/lib/dhcpsrv/Makefile.am
+@@ -1,6 +1,6 @@
+ AUTOMAKE_OPTIONS = subdir-objects
+-SUBDIRS = . testutils tests benchmarks
++SUBDIRS = . benchmarks
+ dhcp_data_dir = @localstatedir@/@PACKAGE@
+ kea_lfc_location = @prefix@/sbin/kea-lfc
+--- a/src/lib/dns/Makefile.am
++++ b/src/lib/dns/Makefile.am
+@@ -1,6 +1,6 @@
+ AUTOMAKE_OPTIONS = subdir-objects
+-SUBDIRS = . tests
++SUBDIRS = .
+ AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
+ AM_CPPFLAGS += $(BOOST_INCLUDES)
+--- a/src/lib/eval/Makefile.am
++++ b/src/lib/eval/Makefile.am
+@@ -1,4 +1,4 @@
+-SUBDIRS = . tests
++SUBDIRS = .
+ AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
+ AM_CPPFLAGS += $(BOOST_INCLUDES)
+--- a/src/lib/exceptions/Makefile.am
++++ b/src/lib/exceptions/Makefile.am
+@@ -1,4 +1,4 @@
+-SUBDIRS = . tests
++SUBDIRS = .
+ AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
+ AM_CXXFLAGS=$(KEA_CXXFLAGS)
+--- a/src/lib/hooks/Makefile.am
++++ b/src/lib/hooks/Makefile.am
+@@ -1,4 +1,4 @@
+-SUBDIRS = . tests
++SUBDIRS = .
+ AM_CPPFLAGS  = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
+ AM_CPPFLAGS += $(BOOST_INCLUDES)
+--- a/src/lib/http/Makefile.am
++++ b/src/lib/http/Makefile.am
+@@ -1,4 +1,4 @@
+-SUBDIRS = . tests
++SUBDIRS = .
+ AM_CPPFLAGS  = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
+ AM_CPPFLAGS += $(BOOST_INCLUDES)
+--- a/src/lib/log/Makefile.am
++++ b/src/lib/log/Makefile.am
+@@ -2,7 +2,6 @@ SUBDIRS = interprocess .
+ if !CROSS_COMPILING
+ SUBDIRS += compiler
+ endif
+-SUBDIRS += tests
+ AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
+ AM_CPPFLAGS += $(BOOST_INCLUDES)
+--- a/src/lib/log/interprocess/Makefile.am
++++ b/src/lib/log/interprocess/Makefile.am
+@@ -1,4 +1,4 @@
+-SUBDIRS = . tests
++SUBDIRS = .
+ AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
+ AM_CPPFLAGS += -DLOCKFILE_DIR=\"$(localstatedir)/run/$(PACKAGE_NAME)\"
+--- a/src/lib/mysql/Makefile.am
++++ b/src/lib/mysql/Makefile.am
+@@ -1,4 +1,4 @@
+-SUBDIRS = . testutils tests
++SUBDIRS = .
+ AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
+ AM_CPPFLAGS += $(BOOST_INCLUDES) $(MYSQL_CPPFLAGS)
+--- a/src/lib/pgsql/Makefile.am
++++ b/src/lib/pgsql/Makefile.am
+@@ -1,4 +1,4 @@
+-SUBDIRS = . testutils tests
++SUBDIRS = .
+ AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
+ AM_CPPFLAGS += $(BOOST_INCLUDES) $(PGSQL_CPPFLAGS)
+--- a/src/lib/process/Makefile.am
++++ b/src/lib/process/Makefile.am
+@@ -1,4 +1,4 @@
+-SUBDIRS = . testutils tests
++SUBDIRS = .
+ dhcp_data_dir = @localstatedir@/@PACKAGE@
+ AM_CPPFLAGS  = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
+ AM_CPPFLAGS += -DDATA_DIR="\"$(dhcp_data_dir)\""
+--- a/src/lib/stats/Makefile.am
++++ b/src/lib/stats/Makefile.am
+@@ -1,4 +1,4 @@
+-SUBDIRS = . tests
++SUBDIRS = .
+ AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
+ AM_CPPFLAGS += $(BOOST_INCLUDES)
+--- a/src/lib/util/Makefile.am
++++ b/src/lib/util/Makefile.am
+@@ -1,6 +1,6 @@
+ AUTOMAKE_OPTIONS = subdir-objects
+-SUBDIRS = . io unittests tests python threads
++SUBDIRS = . io python threads
+ AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
+ AM_CPPFLAGS += $(BOOST_INCLUDES)
+--- a/src/lib/util/threads/Makefile.am
++++ b/src/lib/util/threads/Makefile.am
+@@ -1,4 +1,4 @@
+-SUBDIRS = . tests
++SUBDIRS = .
+ AM_CXXFLAGS = $(KEA_CXXFLAGS)
+ AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
+--- a/src/lib/yang/Makefile.am
++++ b/src/lib/yang/Makefile.am
+@@ -1,4 +1,4 @@
+-SUBDIRS = . testutils pretests tests
++SUBDIRS = .
+ AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
+ AM_CPPFLAGS += $(BOOST_INCLUDES) $(SYSREPO_CPPFLAGS)
index e9f0d62c807dd2945951c1618da1938c2190e714..083254b834bcf0553650009b1c9b12954fcd8abf 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=pptpd
 PKG_VERSION:=1.4.0
-PKG_RELEASE:=4
+PKG_RELEASE:=5
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/poptop
@@ -18,8 +18,6 @@ PKG_HASH:=8fcd8b8a42de2af59e9fe8cbaa9f894045c977f4d038bbd6346a8522bb7f06c0
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
 
-PKG_MAINTAINER:=Luka Perkov <luka@openwrt.org>
-
 include $(INCLUDE_DIR)/package.mk
 
 define Package/pptpd
index dc945c4e8ce848ee057cee92426e414c71d96e54..322eaaf1b5ef3f0db786a1caab4cc1ce41653429 100644 (file)
@@ -12,7 +12,8 @@ OPTIONS_PPTP=/var/etc/options.pptpd
 validate_login_section() {
        uci_load_validate pptpd login "$1" "$2" \
                'username:string' \
-               'password:string'
+               'password:string' \
+               'remoteip:string'
 }
 
 validate_pptpd_section() {
@@ -32,8 +33,9 @@ setup_login() {
 
        [ -n "$username" ] || return 0
        [ -n "$password" ] || return 0
+       [ -n "$remoteip" ] || remoteip=*
 
-       echo "$username pptp-server $password *" >> $CHAP_SECRETS
+       echo "$username pptp-server $password $remoteip" >> $CHAP_SECRETS
 }
 
 setup_config() {
diff --git a/net/rosy-file-server/Makefile b/net/rosy-file-server/Makefile
new file mode 100644 (file)
index 0000000..c1a097d
--- /dev/null
@@ -0,0 +1,52 @@
+#
+# Copyright (C) 2019 rosysong@rosinson.com
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=rosy-file-server
+PKG_VERSION:=1.0.0
+PKG_RELEASE:=1
+PKG_LICENSE:=GPL-2.0
+
+PKG_MAINTAINER:=Rosy Song <rosysong@rosinson.com>
+
+PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/rosy-file-server
+  SUBMENU:=File Transfer
+  SECTION:=net
+  CATEGORY:=Network
+  TITLE:=Rosy File Server over HTTP
+  PKGARCH:=all
+endef
+
+define Package/rosy-file-server/description
+ This package is a configuration management for luci-app-rosy-file-server.
+endef
+
+define Package/rosy-file-server/conffiles
+/etc/config/rosy-file-server
+endef
+
+define Build/Prepare
+endef
+
+define Build/Configure
+endef
+
+define Build/Compile
+endef
+
+define Package/rosy-file-server/install
+       $(INSTALL_DIR) $(1)/etc/init.d $(1)/etc/config
+       $(INSTALL_BIN) ./files/rosyfs.init $(1)/etc/init.d/rosyfs
+       $(INSTALL_CONF) ./files/rosyfs.config $(1)/etc/config/rosyfs
+endef
+
+$(eval $(call BuildPackage,rosy-file-server))
diff --git a/net/rosy-file-server/files/rosyfs.config b/net/rosy-file-server/files/rosyfs.config
new file mode 100644 (file)
index 0000000..53ad71a
--- /dev/null
@@ -0,0 +1,13 @@
+#
+# Copyright (C) 2019 rosysong@rosinson.com
+#
+
+config rosyfs default
+
+       # Web title
+       option title    'Rosy File Server'
+
+       # Path to share
+       option target   '/www'
+
+       option disabled '0'
diff --git a/net/rosy-file-server/files/rosyfs.init b/net/rosy-file-server/files/rosyfs.init
new file mode 100755 (executable)
index 0000000..ebcd19d
--- /dev/null
@@ -0,0 +1,29 @@
+#!/bin/sh /etc/rc.common
+#
+# Copyright (C) 2019 rosysong@rosinson.com
+#
+
+START=99
+USE_PROCD=1
+SHARE_PATH=/www/rosyfs-share
+
+service_triggers() {
+       procd_add_reload_trigger rosyfs
+}
+
+start_service() {
+       config_load rosyfs
+       config_get disabled default disabled '0'
+       config_get target default target ''
+
+       [ $disabled -eq 1 ] && return
+
+       [ -n "$target" -a ! "$(readlink $SHARE_PATH)" = "$target" ] && {
+               rm -f $SHARE_PATH
+               ln -s $target $SHARE_PATH
+       }
+}
+
+stop_service() {
+       rm -f $SHARE_PATH
+}
index 013bc8cced8d16ffffd1c6a54df1a740ca98da02..88cd86954affffd1756fae3d2509cc25718154d2 100644 (file)
@@ -2,7 +2,6 @@ if PACKAGE_btrfs-progs
 
 config BTRFS_PROGS_ZSTD
        bool "Build with zstd support"
-       depends on PACKAGE_libzstd
        default n
        help
                This allows you to manage BTRFS with zstd compression
diff --git a/utils/tang/Makefile b/utils/tang/Makefile
new file mode 100644 (file)
index 0000000..0bc686d
--- /dev/null
@@ -0,0 +1,68 @@
+#
+# Author: Tibor Dudlák
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=tang
+PKG_VERSION:=6
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=https://github.com/latchset/$(PKG_NAME)/releases/download/v$(PKG_VERSION)/
+PKG_HASH:=1df78b48a52d2ca05656555cfe52bd4427c884f5a54a2c5e37a7b39da9e155e3
+
+PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
+
+PKG_FIXUP:=autoreconf
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/tang
+  SECTION:=utils
+  TITLE:=tang v$(PKG_VERSION) - daemon for binding data to the presence of a third party
+  DEPENDS:=+libhttp-parser +xinetd +jose +bash
+  URL:=https://github.com/latchset/tang
+  MAINTAINER:=Tibor Dudlák <tibor.dudlak@gmail.com>
+endef
+
+define Package/tang/description
+       Tang is a small daemon for binding data to the presence of a third party.
+endef
+
+define Package/tang/conffiles
+/etc/xinetd.d/tangdx
+/usr/share/tang/db/
+endef
+
+define Package/tang/install
+       $(INSTALL_DIR)  $(1)/usr/libexec
+       $(INSTALL_DIR)  $(1)/etc/xinetd.d/
+       $(INSTALL_BIN)  $(PKG_INSTALL_DIR)/usr/lib/tangd*       $(1)/usr/libexec/
+       $(INSTALL_BIN)  ./files/tangdw                          $(1)/usr/libexec/
+       $(CP)           ./files/tangdx                          $(1)/etc/xinetd.d/
+endef
+
+define Package/tang/postinst
+#!/bin/sh
+if [ -z "$${IPKG_INSTROOT}" ]; then
+       mkdir -p /usr/share/tang/db && mkdir -p /usr/share/tang/cache
+       KEYS=$(find /usr/share/tang/db/ -name "*.jw*" -maxdepth 1 | wc -l)
+       if [ "${KEYS}" = "0" ]; then # if db is empty generate new key pair
+               /usr/libexec/tangd-keygen /usr/share/tang/db/
+       elif [ "${KEYS}" = "1" ]; then # having 1 key should not happen
+               (>&2 echo "Please check the Tang's keys in /usr/share/tang/db \
+and regenate cache using /usr/libexec/tangd-update script.")
+       else
+               /usr/libexec/tangd-update /usr/share/tang/db/ /usr/share/tang/cache/
+       fi
+       (cat /etc/services | grep -E "tangd.*8888\/tcp") > /dev/null \
+               || echo -e "tangd\t\t8888/tcp" >> /etc/services
+fi
+endef
+
+$(eval $(call BuildPackage,tang))
diff --git a/utils/tang/files/tangdw b/utils/tang/files/tangdw
new file mode 100755 (executable)
index 0000000..91c8a89
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/sh
+echo "==================================" >> /var/log/tangd.log
+echo `date`: >> /var/log/tangd.log
+/usr/libexec/tangd $1 2>> /var/log/tangd.log
diff --git a/utils/tang/files/tangdx b/utils/tang/files/tangdx
new file mode 100644 (file)
index 0000000..2b15eb0
--- /dev/null
@@ -0,0 +1,12 @@
+service tangd
+{
+    port            = 8888
+    socket_type     = stream
+    wait            = no
+    user            = root
+    server          = /usr/libexec/tangdw
+    server_args     = /usr/share/tang/cache
+    log_on_success  += USERID
+    log_on_failure  += USERID
+    disable         = no
+}
diff --git a/utils/tang/patches/Makefile_am.patch b/utils/tang/patches/Makefile_am.patch
new file mode 100644 (file)
index 0000000..647aca5
--- /dev/null
@@ -0,0 +1,45 @@
+diff --git a/Makefile.am b/Makefile.am
+index 14bf91d..dfa6d07 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -1,5 +1,3 @@
+-DISTCHECK_CONFIGURE_FLAGS = --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
+-
+ AM_CFLAGS = @TANG_CFLAGS@ @jose_CFLAGS@
+ LDADD = @jose_LIBS@ @http_parser_LIBS@
+@@ -7,21 +5,11 @@ nagiosdir = $(libdir)/nagios/plugins
+ cachedir = $(localstatedir)/cache/$(PACKAGE_NAME)
+ jwkdir = $(localstatedir)/db/$(PACKAGE_NAME)
+-nodist_systemdsystemunit_DATA = \
+-    units/tangd@.service \
+-    units/tangd.socket \
+-    units/tangd-update.path \
+-    units/tangd-update.service \
+-    units/tangd-keygen.service
+-
+ dist_libexec_SCRIPTS = src/tangd-update src/tangd-keygen
+ libexec_PROGRAMS = src/tangd
+-nagios_PROGRAMS = src/tang
+-man1_MANS = doc/tang-nagios.1
+ man8_MANS = doc/tang.8
+ src_tangd_SOURCES = src/http.c src/http.h src/tangd.c
+-src_tang_SOURCES = src/nagios.c
+ %: %.in
+       $(AM_V_GEN)mkdir -p "`dirname "$@"`"
+@@ -32,11 +20,9 @@ src_tang_SOURCES = src/nagios.c
+               $(srcdir)/$@.in > $@
+ AM_TESTS_ENVIRONMENT = SD_ACTIVATE="@SD_ACTIVATE@" PATH=$(srcdir)/src:$(builddir)/src:$(PATH)
+-TESTS = tests/adv tests/rec tests/nagios
++TESTS = tests/adv tests/rec 
+-CLEANFILES = $(nodist_systemdsystemunit_DATA)
+ EXTRA_DIST = \
+-    $(foreach unit,$(nodist_systemdsystemunit_DATA),$(unit).in) \
+     COPYING \
+     $(TESTS) \
+     $(man1_MANS) \
diff --git a/utils/tang/patches/rm-systemd-from-configure.patch b/utils/tang/patches/rm-systemd-from-configure.patch
new file mode 100644 (file)
index 0000000..50dc68c
--- /dev/null
@@ -0,0 +1,37 @@
+diff --git a/configure.ac b/configure.ac
+index b51bb31..4b37d30 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -27,32 +27,6 @@ AC_CHECK_LIB([http_parser], [http_parser_execute],
+              [AC_MSG_ERROR([http-parser required!])])
+ PKG_CHECK_MODULES([jose], [jose >= 8])
+-PKG_CHECK_MODULES([systemd], [systemd])
+-
+-AC_ARG_WITH([systemdsystemunitdir],
+-            [AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files])],
+-            [],
+-            [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
+-
+-AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
+-
+-for ac_prog in systemd-socket-activate systemd-activate; do
+-    AC_CHECK_PROG([SD_ACTIVATE], [$ac_prog], [$as_dir/$ac_prog], [],
+-                [$PATH$PATH_SEPARATOR$($PKG_CONFIG --variable=systemdutildir systemd)])
+-    test -n "$SD_ACTIVATE" && break
+-done
+-
+-test -n "$SD_ACTIVATE" || AC_MSG_ERROR([systemd-socket-activate required!])
+-
+-AC_MSG_CHECKING([systemd-socket-activate inetd flag])
+-if $SD_ACTIVATE --help | grep -q inetd; then
+-    SD_ACTIVATE="$SD_ACTIVATE --inetd"
+-    AC_MSG_RESULT([--inetd])
+-else
+-    AC_MSG_RESULT([(default)])
+-fi
+-
+-AC_SUBST(SD_ACTIVATE)
+ TANG_CFLAGS="\
+ -Wall \
diff --git a/utils/tang/patches/use-readlink-in-tangd-update.patch b/utils/tang/patches/use-readlink-in-tangd-update.patch
new file mode 100644 (file)
index 0000000..7c07b1d
--- /dev/null
@@ -0,0 +1,15 @@
+diff --git a/src/tangd-update b/src/tangd-update
+index 652dbef..01aa842 100755
+--- a/src/tangd-update
++++ b/src/tangd-update
+@@ -33,8 +33,8 @@ fi
+ [ ! -d "$2" ] && mkdir -p -m 0700 "$2"
+-src=`realpath "$1"`
+-dst=`realpath "$2"`
++src=`readlink -f "$1"`
++dst=`readlink -f "$2"`
+ payl=()
+ sign=()