include $(TOPDIR)/rules.mk
PKG_NAME:=php
-PKG_VERSION:=7.2.15
+PKG_VERSION:=7.2.16
PKG_RELEASE:=1
PKG_MAINTAINER:=Michael Heimpold <mhei@heimpold.de>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=http://www.php.net/distributions/
-PKG_HASH:=75e90012faef700dffb29311f3d24fa25f1a5e0f70254a9b8d5c794e25e938ce
+PKG_HASH:=7d91ed3c1447c6358a3d53f84599ef854aca4c3622de7435e2df115bf196e482
PKG_FIXUP:=libtool autoreconf
PKG_BUILD_PARALLEL:=1
+From: Debian PHP Maintainers <team+pkg-php@tracker.debian.org>
+Date: Thu, 7 Mar 2019 19:36:30 +0000
+Subject: Add-support-for-use-of-the-system-timezone-database
+
+# License: MIT
+# http://opensource.org/licenses/MIT
+
# License: MIT
# http://opensource.org/licenses/MIT
than embedding a copy. Discussed upstream but was not desired.
History:
+r17: adapt for autotool change in 7.2.16RC1
+r16: adapt for timelib 2017.06 (in 7.2.3RC1)
r15: adapt for timelib 2017.05beta7 (in 7.2.0RC1)
r14: improve check for valid tz file
r13: adapt for upstream changes to use PHP allocator
r3: fix a crash if /usr/share/zoneinfo doesn't exist (Raphael Geissert)
r2: add filesystem trawl to set up name alias index
r1: initial revision
+---
+ ext/date/config0.m4 | 13 ++
+ ext/date/lib/parse_tz.c | 536 +++++++++++++++++++++++++++++++++++++++++++++++-
+ 2 files changed, 546 insertions(+), 3 deletions(-)
-diff -up ./ext/date/lib/parse_tz.c.systzdata ./ext/date/lib/parse_tz.c
---- ./ext/date/lib/parse_tz.c.systzdata 2017-08-22 09:40:38.000000000 +0200
-+++ ./ext/date/lib/parse_tz.c 2017-08-22 12:16:00.370298079 +0200
+diff --git a/ext/date/config0.m4 b/ext/date/config0.m4
+index e464156..00dae8b 100644
+--- a/ext/date/config0.m4
++++ b/ext/date/config0.m4
+@@ -10,6 +10,19 @@ io.h
+ dnl Check for strtoll, atoll
+ AC_CHECK_FUNCS(strtoll atoll)
+
++PHP_ARG_WITH(system-tzdata, for use of system timezone data,
++[ --with-system-tzdata[=DIR] to specify use of system timezone data],
++no, no)
++
++if test "$PHP_SYSTEM_TZDATA" != "no"; then
++ AC_DEFINE(HAVE_SYSTEM_TZDATA, 1, [Define if system timezone data is used])
++
++ if test "$PHP_SYSTEM_TZDATA" != "yes"; then
++ AC_DEFINE_UNQUOTED(HAVE_SYSTEM_TZDATA_PREFIX, "$PHP_SYSTEM_TZDATA",
++ [Define for location of system timezone data])
++ fi
++fi
++
+ PHP_DATE_CFLAGS="-I@ext_builddir@/lib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -DHAVE_TIMELIB_CONFIG_H=1"
+ timelib_sources="lib/astro.c lib/dow.c lib/parse_date.c lib/parse_tz.c
+ lib/timelib.c lib/tm2unixtime.c lib/unixtime2tm.c lib/parse_iso_intervals.c lib/interval.c"
+diff --git a/ext/date/lib/parse_tz.c b/ext/date/lib/parse_tz.c
+index 960e528..501b09e 100644
+--- a/ext/date/lib/parse_tz.c
++++ b/ext/date/lib/parse_tz.c
@@ -25,8 +25,21 @@
#include "timelib.h"
#include "timelib_private.h"
#if (defined(__APPLE__) || defined(__APPLE_CC__)) && (defined(__BIG_ENDIAN__) || defined(__LITTLE_ENDIAN__))
# if defined(__LITTLE_ENDIAN__)
-@@ -67,6 +80,11 @@ static int read_php_preamble(const unsig
+@@ -67,6 +80,11 @@ static int read_php_preamble(const unsigned char **tzf, timelib_tzinfo *tz)
{
uint32_t version;
/* read ID */
version = (*tzf)[3] - '0';
*tzf += 4;
-@@ -374,7 +392,429 @@ void timelib_dump_tzinfo(timelib_tzinfo
+@@ -374,7 +392,429 @@ void timelib_dump_tzinfo(timelib_tzinfo *tz)
}
}
+ }
+
+ for (l = li[hash]; l; l = l->next) {
-+ if (strcasecmp(l->name, name) == 0)
++ if (timelib_strcasecmp(l->name, name) == 0)
+ return l;
+ }
+
+{
+ const timelib_tzdb_index_entry *alpha = first, *beta = second;
+
-+ return strcasecmp(alpha->id, beta->id);
++ return timelib_strcasecmp(alpha->id, beta->id);
+}
+
+
+static int inmem_seek_to_tz_position(const unsigned char **tzf, char *timezone, const timelib_tzdb *tzdb)
{
int left = 0, right = tzdb->index_size - 1;
- #ifdef HAVE_SETLOCALE
-@@ -419,9 +859,48 @@ static int seek_to_tz_position(const uns
+
+@@ -400,9 +840,48 @@ static int seek_to_tz_position(const unsigned char **tzf, char *timezone, const
return 0;
}
+#endif
}
- const timelib_tzdb_index_entry *timelib_timezone_identifiers_list(timelib_tzdb *tzdb, int *count)
-@@ -433,7 +912,30 @@ const timelib_tzdb_index_entry *timelib_
+ const timelib_tzdb_index_entry *timelib_timezone_identifiers_list(const timelib_tzdb *tzdb, int *count)
+@@ -414,7 +893,30 @@ const timelib_tzdb_index_entry *timelib_timezone_identifiers_list(const timelib_
int timelib_timezone_id_is_valid(char *timezone, const timelib_tzdb *tzdb)
{
const unsigned char *tzf;
}
static int skip_64bit_preamble(const unsigned char **tzf, timelib_tzinfo *tz)
-@@ -475,12 +977,14 @@ static timelib_tzinfo* timelib_tzinfo_ct
+@@ -456,12 +958,14 @@ static timelib_tzinfo* timelib_tzinfo_ctor(char *name)
timelib_tzinfo *timelib_parse_tzfile(char *timezone, const timelib_tzdb *tzdb, int *error_code)
{
const unsigned char *tzf;
tmp = timelib_tzinfo_ctor(timezone);
version = read_preamble(&tzf, tmp, &type);
-@@ -503,6 +1007,29 @@ timelib_tzinfo *timelib_parse_tzfile(cha
+@@ -484,6 +988,29 @@ timelib_tzinfo *timelib_parse_tzfile(char *timezone, const timelib_tzdb *tzdb, i
timelib_tzinfo_dtor(tmp);
return NULL;
}
if (version == 2 || version == 3) {
if (!skip_64bit_preamble(&tzf, tmp)) {
/* 64 bit preamble is not in place */
-@@ -520,6 +1047,9 @@ timelib_tzinfo *timelib_parse_tzfile(cha
+@@ -501,6 +1028,9 @@ timelib_tzinfo *timelib_parse_tzfile(char *timezone, const timelib_tzdb *tzdb, i
} else {
set_default_location_and_comments(&tzf, tmp);
}
} else {
*error_code = TIMELIB_ERROR_NO_SUCH_TIMEZONE;
tmp = NULL;
-diff -up ./ext/date/lib/timelib.m4.systzdata ./ext/date/lib/timelib.m4
---- ./ext/date/lib/timelib.m4.systzdata 2017-08-22 09:40:38.000000000 +0200
-+++ ./ext/date/lib/timelib.m4 2017-08-22 11:32:29.357799927 +0200
-@@ -81,3 +81,16 @@ io.h
-
- dnl Check for strtoll, atoll
- AC_CHECK_FUNCS(strtoll atoll strftime gettimeofday)
-+
-+PHP_ARG_WITH(system-tzdata, for use of system timezone data,
-+[ --with-system-tzdata[=DIR] to specify use of system timezone data],
-+no, no)
-+
-+if test "$PHP_SYSTEM_TZDATA" != "no"; then
-+ AC_DEFINE(HAVE_SYSTEM_TZDATA, 1, [Define if system timezone data is used])
-+
-+ if test "$PHP_SYSTEM_TZDATA" != "yes"; then
-+ AC_DEFINE_UNQUOTED(HAVE_SYSTEM_TZDATA_PREFIX, "$PHP_SYSTEM_TZDATA",
-+ [Define for location of system timezone data])
-+ fi
-+fi
])
PHP_NEW_EXTENSION(fileinfo, fileinfo.c $libmagic_sources, $ext_shared,,-I@ext_srcdir@/libmagic)
---- a/ext/opcache/config.m4
-+++ b/ext/opcache/config.m4
-@@ -232,6 +232,10 @@ int main() {
- flock_type=unknown
- AC_MSG_CHECKING(for struct flock layout)
-
-+dnl cross-compiling for Linux
-+flock_type=linux
-+AC_DEFINE([HAVE_FLOCK_LINUX], [], [Struct flock is Linux-type])
-+
- if test "$flock_type" = "unknown"; then
- AC_TRY_RUN([
- #include <fcntl.h>
SUBMENU:=Python
URL:=http://github.com/mitsuhiko/click
TITLE:=python3-click-log
- DEPENDS:=+PACKAGE_python3-click-log:python3-click
+ DEPENDS:=+python3-click
VARIANT:=python3
endef
PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
-define Package/python-chardet/Defaults
+define Package/python-chardet/Default
SUBMENU:=Python
SECTION:=lang
CATEGORY:=Languages
define Package/python3-ply
$(call Package/python-ply/Default)
- DEPENDS:=+PACKAGE_python3-ply:python3-light
+ DEPENDS:=+python3-light
VARIANT:=python3
endef
PKG_NAME:=python-requests
PKG_VERSION:=2.21.0
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_LICENSE:=Apache-2.0
PKG_SOURCE:=requests-$(PKG_VERSION).tar.gz
PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
-define Package/python-requests/Defaults
+define Package/python-requests/Default
SUBMENU:=Python
SECTION:=lang
CATEGORY:=Languages
- PKG_MAINTAINER:=Josef Schlehofer <josef.schlehofer@nic.cz>, Alexandru Ardelean <ardeleanalex@gmail.com>
+ MAINTAINER:=Josef Schlehofer <josef.schlehofer@nic.cz>, Alexandru Ardelean <ardeleanalex@gmail.com>
URL:=http://python-requests.org/
endef
TITLE:=HTTP library for Python
DEPENDS:= \
+PACKAGE_python-requests:python \
- +PACKAGE_python-requests:chardet \
+ +PACKAGE_python-requests:python-chardet \
+PACKAGE_python-requests:python-idna \
+PACKAGE_python-requests:python-urllib3 \
+PACKAGE_python-requests:python-certifi
$(call Package/python-requests/Default)
TITLE:=HTTP library for Python3
DEPENDS:= \
- +PACKAGE_python3-requests:python3-light \
- +PACKAGE_python3-requests:python3-chardet \
- +PACKAGE_python3-requests:python3-idna \
- +PACKAGE_python3-requests:python3-urllib3 \
- +PACKAGE_python3-requests:python3-certifi
+ +python3-light \
+ +python3-chardet \
+ +python3-idna \
+ +python3-urllib3 \
+ +python3-certifi
VARIANT:=python3
endef
define Package/python-simplejson
$(call Package/python-simplejson/Default)
TITLE:=Simple, fast, extensible JSON encoder/decoder for Python 2
- DEPENDS:=+PACKAGE_python-simplejson:python-light
+ DEPENDS:=+python-light
VARIANT:=python
endef
PKG_LICENSE:=PSF
PKG_LICENSE_FILES:=LICENSE Modules/_ctypes/libffi_msvc/LICENSE Modules/_ctypes/darwin/LICENSE Modules/_ctypes/libffi/LICENSE Modules/_ctypes/libffi_osx/LICENSE Tools/pybench/LICENSE
+PKG_CPE_ID:=cpe:/a:python:python
PKG_MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>, Jeffery To <jeffery.to@gmail.com>
+zlib zlibmodule.c -lz
# Interface to the Expat XML parser
- #
+ # More information on Expat can be found at www.libexpat.org.
--- a/configure
+++ b/configure
-@@ -7077,7 +7077,7 @@ sys/param.h sys/poll.h sys/random.h sys/
+@@ -7084,7 +7084,7 @@ sys/param.h sys/poll.h sys/random.h sys/
sys/termio.h sys/time.h \
sys/times.h sys/types.h sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \
sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-@@ -7299,6 +7299,24 @@ fi
+@@ -7306,6 +7306,24 @@ fi
fi
do :
--- a/configure.ac
+++ b/configure.ac
-@@ -1732,10 +1732,17 @@ sys/param.h sys/poll.h sys/random.h sys/
+@@ -1739,10 +1739,17 @@ sys/param.h sys/poll.h sys/random.h sys/
sys/termio.h sys/time.h \
sys/times.h sys/types.h sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \
sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \
-diff --git a/Modules/_ssl.c b/Modules/_ssl.c
-index a96c419260..c80437eef7 100644
--- a/Modules/_ssl.c
+++ b/Modules/_ssl.c
-@@ -1586,7 +1586,7 @@ static PyObject *PySSL_version(PySSLSocket *self)
+@@ -1590,7 +1590,7 @@ static PyObject *PySSL_version(PySSLSocket *self)
return PyUnicode_FromString(version);
}
static PyObject *PySSL_selected_npn_protocol(PySSLSocket *self) {
const unsigned char *out;
unsigned int outlen;
-@@ -2114,7 +2114,7 @@ static PyMethodDef PySSLMethods[] = {
+@@ -2118,7 +2118,7 @@ static PyMethodDef PySSLMethods[] = {
PySSL_peercert_doc},
{"cipher", (PyCFunction)PySSL_cipher, METH_NOARGS},
{"version", (PyCFunction)PySSL_version, METH_NOARGS},
-diff --git a/Lib/lib2to3/refactor.py b/Lib/lib2to3/refactor.py
-index 7841b99..1e0d3b3 100644
--- a/Lib/lib2to3/refactor.py
+++ b/Lib/lib2to3/refactor.py
-@@ -37,6 +37,12 @@ def get_all_fix_names(fixer_pkg, remove_prefix=True):
+@@ -40,6 +40,12 @@ def get_all_fix_names(fixer_pkg, remove_prefix=True):
if remove_prefix:
name = name[4:]
fix_names.append(name[:-3])
include $(TOPDIR)/rules.mk
PKG_NAME:=python3-bottle
-PKG_VERSION:=0.12.13
+PKG_VERSION:=0.12.16
PKG_RELEASE:=1
PKG_LICENSE:=MIT
-PKG_MAINTAINER:=Luka Perkov <luka@openwrt.org>
+PKG_LICENSE_FILES:=LICENSE
+PKG_CPE_ID:=cpe:/a:bottlepy:bottle
+
+PKG_MAINTAINER:=Josef Schlehofer <josef.schlehofer@nic.cz>
PKG_SOURCE:=bottle-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://files.pythonhosted.org/packages/source/b/bottle
-PKG_HASH:=39b751aee0b167be8dffb63ca81b735bbf1dd0905b3bc42761efedee8f123355
-PKG_BUILD_DIR:=$(BUILD_DIR)/bottle-$(PKG_VERSION)
-PKG_UNPACK=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+PKG_HASH:=9c310da61e7df2b6ac257d8a90811899ccb3a9743e77e947101072a2e3186726
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-bottle-$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
include ../python3-package.mk
+PKG_UNPACK=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+
define Package/python3-bottle
SECTION:=lang
CATEGORY:=Languages
TITLE:=Bottle is a fast, simple and lightweight WSGI micro web-framework for Python
URL:=https://bottlepy.org
DEPENDS:=+python3
+ VARIANT:=python3
endef
define Package/python3-bottle/description
Python Standard Library.
endef
-define Build/Configure
-endef
-
-define Build/Compile
-endef
-
-define Package/python3-bottle/install
- $(INSTALL_DIR) $(1)$(PYTHON3_PKG_DIR)
- $(CP) $(PKG_BUILD_DIR)/bottle.py $(1)$(PYTHON3_PKG_DIR)
-endef
-
+$(eval $(call Py3Package,python3-bottle))
$(eval $(call BuildPackage,python3-bottle))
+$(eval $(call BuildPackage,python3-bottle-src))
PYTHON_VERSION_MICRO:=$(PYTHON3_VERSION_MICRO)
PKG_NAME:=python3
-PKG_RELEASE:=5
+PKG_RELEASE:=6
PKG_VERSION:=$(PYTHON_VERSION).$(PYTHON_VERSION_MICRO)
PKG_SOURCE:=Python-$(PKG_VERSION).tar.xz
PKG_LICENSE:=PSF
PKG_LICENSE_FILES:=LICENSE Modules/_ctypes/libffi_msvc/LICENSE Modules/_ctypes/darwin/LICENSE Modules/_ctypes/libffi/LICENSE Modules/_ctypes/libffi_osx/LICENSE Tools/pybench/LICENSE
+PKG_CPE_ID:=cpe:/a:python:python
PKG_MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>, Jeffery To <jeffery.to@gmail.com>
+zlib zlibmodule.c -lz
# Interface to the Expat XML parser
- #
+ # More information on Expat can be found at www.libexpat.org.
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
-@@ -1381,6 +1381,7 @@ libinstall: build_all $(srcdir)/Modules/
+@@ -1389,6 +1389,7 @@ libinstall: build_all $(srcdir)/Modules/
$(INSTALL_DATA) `cat pybuilddir.txt`/_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH).py \
$(DESTDIR)$(LIBDEST); \
$(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
if test -d $(DESTDIR)$(LIBDEST)/distutils/tests; then \
$(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
$(DESTDIR)$(LIBDEST)/distutils/tests ; \
-@@ -1416,6 +1417,7 @@ libinstall: build_all $(srcdir)/Modules/
+@@ -1424,6 +1425,7 @@ libinstall: build_all $(srcdir)/Modules/
$(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
$(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt
--- a/setup.py
+++ b/setup.py
-@@ -537,16 +537,9 @@ class PyBuildExt(build_ext):
+@@ -542,16 +542,9 @@ class PyBuildExt(build_ext):
os.unlink(tmpfile)
def detect_modules(self):
--- a/setup.py
+++ b/setup.py
-@@ -547,8 +547,9 @@ class PyBuildExt(build_ext):
+@@ -552,8 +552,9 @@ class PyBuildExt(build_ext):
# directly since an inconsistently reproducible issue comes up where
# the environment variable is not set even though the value were passed
# into configure and stored in the Makefile (issue found on OS X 10.3).
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
-@@ -743,6 +743,16 @@ regen-all: regen-opcode regen-opcode-tar
+@@ -751,6 +751,16 @@ regen-all: regen-opcode regen-opcode-tar
############################################################################
# Special rules for object files
Modules/getbuildinfo.o: $(PARSER_OBJS) \
$(OBJECT_OBJS) \
$(PYTHON_OBJS) \
-@@ -750,6 +760,8 @@ Modules/getbuildinfo.o: $(PARSER_OBJS) \
+@@ -758,6 +768,8 @@ Modules/getbuildinfo.o: $(PARSER_OBJS) \
$(MODOBJS) \
$(srcdir)/Modules/getbuildinfo.c
$(CC) -c $(PY_CORE_CFLAGS) \
--- a/configure
+++ b/configure
-@@ -14962,7 +14962,7 @@ $as_echo_n "checking ABIFLAGS... " >&6;
+@@ -15129,7 +15129,7 @@ $as_echo_n "checking ABIFLAGS... " >&6;
$as_echo "$ABIFLAGS" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking SOABI" >&5
$as_echo_n "checking SOABI... " >&6; }
--- a/configure.ac
+++ b/configure.ac
-@@ -4665,7 +4665,7 @@ AC_SUBST(SOABI)
+@@ -4719,7 +4719,7 @@ AC_SUBST(SOABI)
AC_MSG_CHECKING(ABIFLAGS)
AC_MSG_RESULT($ABIFLAGS)
AC_MSG_CHECKING(SOABI)
--- a/setup.py
+++ b/setup.py
-@@ -354,6 +354,7 @@ class PyBuildExt(build_ext):
+@@ -359,6 +359,7 @@ class PyBuildExt(build_ext):
print("Failed to build these modules:")
print_three_column(failed)
print()
abi=sys.abiflags,
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
-@@ -1390,7 +1390,7 @@ libinstall: build_all $(srcdir)/Modules/
+@@ -1398,7 +1398,7 @@ libinstall: build_all $(srcdir)/Modules/
esac; \
done; \
done
$(DESTDIR)$(LIBDEST); \
$(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
ifeq (@COMPILE_ALL_TESTS@,yes)
-@@ -1525,7 +1525,7 @@ sharedinstall: sharedmods
+@@ -1543,7 +1543,7 @@ sharedinstall: sharedmods
--install-scripts=$(BINDIR) \
--install-platlib=$(DESTSHARED) \
--root=$(DESTDIR)/
# Here are a couple of targets for MacOSX again, to install a full
--- a/configure
+++ b/configure
-@@ -14981,7 +14981,7 @@ LDVERSION='$(VERSION)$(ABIFLAGS)'
+@@ -15148,7 +15148,7 @@ LDVERSION='$(VERSION)$(ABIFLAGS)'
$as_echo "$LDVERSION" >&6; }
LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
--- a/configure.ac
+++ b/configure.ac
-@@ -4682,7 +4682,7 @@ AC_MSG_RESULT($LDVERSION)
+@@ -4736,7 +4736,7 @@ AC_MSG_RESULT($LDVERSION)
dnl define LIBPL after ABIFLAGS and LDVERSION is defined.
AC_SUBST(PY_ENABLE_SHARED)
--- /dev/null
+From 991f0176e188227647bf4c993d8da81cf794b3ae Mon Sep 17 00:00:00 2001
+From: Christian Heimes <christian@python.org>
+Date: Sun, 25 Feb 2018 20:03:07 +0100
+Subject: [PATCH] bpo-30008: SSL module: emulate tls methods
+
+OpenSSL 1.1 compatility: emulate version specific TLS methods with
+SSL_CTX_set_min/max_proto_version().
+---
+ .../2018-02-25-20-05-51.bpo-30008.6Bmyhr.rst | 4 +
+ Modules/_ssl.c | 134 ++++++++++++++++-----
+ 2 files changed, 108 insertions(+), 30 deletions(-)
+ create mode 100644 Misc/NEWS.d/next/Library/2018-02-25-20-05-51.bpo-30008.6Bmyhr.rst
+
+--- /dev/null
++++ b/Misc/NEWS.d/next/Library/2018-02-25-20-05-51.bpo-30008.6Bmyhr.rst
+@@ -0,0 +1,4 @@
++The ssl module no longer uses function that are deprecated since OpenSSL
++1.1.0. The version specific TLS methods are emulated with TLS_method() plus
++SSL_CTX_set_min/max_proto_version(). Pseudo random numbers are generated
++with RAND_bytes().
+--- a/Modules/_ssl.c
++++ b/Modules/_ssl.c
+@@ -45,14 +45,6 @@ static PySocketModule_APIObject PySocketModule;
+ #include <sys/poll.h>
+ #endif
+
+-/* Don't warn about deprecated functions */
+-#ifdef __GNUC__
+-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+-#endif
+-#ifdef __clang__
+-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+-#endif
+-
+ /* Include OpenSSL header files */
+ #include "openssl/rsa.h"
+ #include "openssl/crypto.h"
+@@ -201,6 +193,7 @@ static void _PySSLFixErrno(void) {
+ #ifndef PY_OPENSSL_1_1_API
+ /* OpenSSL 1.1 API shims for OpenSSL < 1.1.0 and LibreSSL < 2.7.0 */
+
++#define ASN1_STRING_get0_data ASN1_STRING_data
+ #define TLS_method SSLv23_method
+ #define TLS_client_method SSLv23_client_method
+ #define TLS_server_method SSLv23_server_method
+@@ -1319,8 +1312,9 @@ _get_peer_alt_names (X509 *certificate) {
+ goto fail;
+ }
+ PyTuple_SET_ITEM(t, 0, v);
+- v = PyUnicode_FromStringAndSize((char *)ASN1_STRING_data(as),
+- ASN1_STRING_length(as));
++ v = PyUnicode_FromStringAndSize(
++ (char *)ASN1_STRING_get0_data(as),
++ ASN1_STRING_length(as));
+ if (v == NULL) {
+ Py_DECREF(t);
+ goto fail;
+@@ -2959,38 +2953,118 @@ _ssl__SSLContext_impl(PyTypeObject *type, int proto_version)
+ #endif
+
+ PySSL_BEGIN_ALLOW_THREADS
+- if (proto_version == PY_SSL_VERSION_TLS1)
++ switch (proto_version) {
++#if OPENSSL_VERSION_NUMBER <= 0x10100000L
++ /* OpenSSL < 1.1.0 or not LibreSSL
++ * Use old-style methods for OpenSSL 1.0.2
++ */
++#if defined(SSL2_VERSION) && !defined(OPENSSL_NO_SSL2)
++ case PY_SSL_VERSION_SSL2:
++ ctx = SSL_CTX_new(SSLv2_method());
++ break;
++#endif
++#if defined(SSL3_VERSION) && !defined(OPENSSL_NO_SSL3)
++ case PY_SSL_VERSION_SSL3:
++ ctx = SSL_CTX_new(SSLv3_method());
++ break;
++#endif
++#if defined(TLS1_VERSION) && !defined(OPENSSL_NO_TLS1)
++ case PY_SSL_VERSION_TLS1:
+ ctx = SSL_CTX_new(TLSv1_method());
+-#if HAVE_TLSv1_2
+- else if (proto_version == PY_SSL_VERSION_TLS1_1)
++ break;
++#endif
++#if defined(TLS1_1_VERSION) && !defined(OPENSSL_NO_TLS1_1)
++ case PY_SSL_VERSION_TLS1_1:
+ ctx = SSL_CTX_new(TLSv1_1_method());
+- else if (proto_version == PY_SSL_VERSION_TLS1_2)
++ break;
++#endif
++#if defined(TLS1_2_VERSION) && !defined(OPENSSL_NO_TLS1_2)
++ case PY_SSL_VERSION_TLS1_2:
+ ctx = SSL_CTX_new(TLSv1_2_method());
++ break;
+ #endif
+-#ifndef OPENSSL_NO_SSL3
+- else if (proto_version == PY_SSL_VERSION_SSL3)
+- ctx = SSL_CTX_new(SSLv3_method());
++#else
++ /* OpenSSL >= 1.1 or LibreSSL
++ * create context with TLS_method for all protocols
++ * no SSLv2_method in OpenSSL 1.1.
++ */
++#if defined(SSL3_VERSION) && !defined(OPENSSL_NO_SSL3)
++ case PY_SSL_VERSION_SSL3:
++ ctx = SSL_CTX_new(TLS_method());
++ if (ctx != NULL) {
++ /* OpenSSL 1.1.0 sets SSL_OP_NO_SSLv3 for TLS_method by default */
++ SSL_CTX_clear_options(ctx, SSL_OP_NO_SSLv3);
++ if (!SSL_CTX_set_min_proto_version(ctx, SSL3_VERSION))
++ result = -2;
++ if (!SSL_CTX_set_max_proto_version(ctx, SSL3_VERSION))
++ result = -2;
++ }
++ break;
+ #endif
+-#ifndef OPENSSL_NO_SSL2
+- else if (proto_version == PY_SSL_VERSION_SSL2)
+- ctx = SSL_CTX_new(SSLv2_method());
++#if defined(TLS1_VERSION) && !defined(OPENSSL_NO_TLS1)
++ case PY_SSL_VERSION_TLS1:
++ ctx = SSL_CTX_new(TLS_method());
++ if (ctx != NULL) {
++ SSL_CTX_clear_options(ctx, SSL_OP_NO_TLSv1);
++ if (!SSL_CTX_set_min_proto_version(ctx, TLS1_VERSION))
++ result = -2;
++ if (!SSL_CTX_set_max_proto_version(ctx, TLS1_VERSION))
++ result = -2;
++ }
++ break;
++#endif
++#if defined(TLS1_1_VERSION) && !defined(OPENSSL_NO_TLS1_1)
++ case PY_SSL_VERSION_TLS1_1:
++ ctx = SSL_CTX_new(TLS_method());
++ if (ctx != NULL) {
++ SSL_CTX_clear_options(ctx, SSL_OP_NO_TLSv1_1);
++ if (!SSL_CTX_set_min_proto_version(ctx, TLS1_1_VERSION))
++ result = -2;
++ if (!SSL_CTX_set_max_proto_version(ctx, TLS1_1_VERSION))
++ result = -2;
++ }
++ break;
++#endif
++#if defined(TLS1_2_VERSION) && !defined(OPENSSL_NO_TLS1_2)
++ case PY_SSL_VERSION_TLS1_2:
++ ctx = SSL_CTX_new(TLS_method());
++ if (ctx != NULL) {
++ SSL_CTX_clear_options(ctx, SSL_OP_NO_TLSv1_2);
++ if (!SSL_CTX_set_min_proto_version(ctx, TLS1_2_VERSION))
++ result = -2;
++ if (!SSL_CTX_set_max_proto_version(ctx, TLS1_2_VERSION))
++ result = -2;
++ }
++ break;
+ #endif
+- else if (proto_version == PY_SSL_VERSION_TLS) /* SSLv23 */
++#endif /* OpenSSL >= 1.1 */
++ case PY_SSL_VERSION_TLS:
++ /* SSLv23 */
+ ctx = SSL_CTX_new(TLS_method());
+- else if (proto_version == PY_SSL_VERSION_TLS_CLIENT)
++ break;
++ case PY_SSL_VERSION_TLS_CLIENT:
+ ctx = SSL_CTX_new(TLS_client_method());
+- else if (proto_version == PY_SSL_VERSION_TLS_SERVER)
++ break;
++ case PY_SSL_VERSION_TLS_SERVER:
+ ctx = SSL_CTX_new(TLS_server_method());
+- else
+- proto_version = -1;
++ break;
++ default:
++ result = -1;
++ break;
++ }
+ PySSL_END_ALLOW_THREADS
+
+- if (proto_version == -1) {
++ if (result == -1) {
+ PyErr_SetString(PyExc_ValueError,
+ "invalid protocol version");
+ return NULL;
+ }
+- if (ctx == NULL) {
++ else if (result == -2) {
++ PyErr_SetString(PyExc_ValueError,
++ "protocol configuration error");
++ return NULL;
++ }
++ else if (ctx == NULL) {
+ _setSSLError(NULL, 0, __FILE__, __LINE__);
+ return NULL;
+ }
--- /dev/null
+--- a/Modules/_hashopenssl.c
++++ b/Modules/_hashopenssl.c
+@@ -1071,7 +1071,7 @@ PyInit__hashlib(void)
+ {
+ PyObject *m, *openssl_md_meth_names;
+
+-#ifndef OPENSSL_VERSION_1_1
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ /* Load all digest algorithms and initialize cpuid */
+ OPENSSL_add_all_algorithms_noconf();
+ ERR_load_crypto_strings();
+--- a/Modules/_ssl.c
++++ b/Modules/_ssl.c
+@@ -47,6 +47,7 @@ static PySocketModule_APIObject PySocketModule;
+
+ /* Include OpenSSL header files */
+ #include "openssl/rsa.h"
++#include "openssl/dh.h"
+ #include "openssl/crypto.h"
+ #include "openssl/x509.h"
+ #include "openssl/x509v3.h"
+@@ -128,13 +129,13 @@ static void _PySSLFixErrno(void) {
+ #include "_ssl_data.h"
+
+ #if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER)
+-# define OPENSSL_VERSION_1_1 1
+-# define PY_OPENSSL_1_1_API 1
++# define OPENSSL_VERSION_1_1 1
++# define PY_OPENSSL_1_1_API 1
+ #endif
+
+ /* LibreSSL 2.7.0 provides necessary OpenSSL 1.1.0 APIs */
+ #if defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER >= 0x2070000fL
+-# define PY_OPENSSL_1_1_API 1
++# define PY_OPENSSL_1_1_API 1
+ #endif
+
+ /* Openssl comes with TLSv1.1 and TLSv1.2 between 1.0.0h and 1.0.1
+@@ -197,6 +198,11 @@ static void _PySSLFixErrno(void) {
+ #define TLS_method SSLv23_method
+ #define TLS_client_method SSLv23_client_method
+ #define TLS_server_method SSLv23_server_method
++#define X509_getm_notBefore X509_get_notBefore
++#define X509_getm_notAfter X509_get_notAfter
++#define OpenSSL_version_num SSLeay
++#define OpenSSL_version SSLeay_version
++#define OPENSSL_VERSION SSLEAY_VERSION
+
+ static int X509_NAME_ENTRY_set(const X509_NAME_ENTRY *ne)
+ {
+@@ -859,7 +865,7 @@ _ssl_configure_hostname(PySSLSocket *self, const char* server_hostname)
+ goto error;
+ }
+ } else {
+- if (!X509_VERIFY_PARAM_set1_ip(param, ASN1_STRING_data(ip),
++ if (!X509_VERIFY_PARAM_set1_ip(param, ASN1_STRING_get0_data(ip),
+ ASN1_STRING_length(ip))) {
+ _setSSLError(NULL, 0, __FILE__, __LINE__);
+ goto error;
+@@ -1624,7 +1630,7 @@ _decode_certificate(X509 *certificate) {
+ Py_DECREF(sn_obj);
+
+ (void) BIO_reset(biobuf);
+- notBefore = X509_get_notBefore(certificate);
++ notBefore = X509_getm_notBefore(certificate);
+ ASN1_TIME_print(biobuf, notBefore);
+ len = BIO_gets(biobuf, buf, sizeof(buf)-1);
+ if (len < 0) {
+@@ -1641,7 +1647,7 @@ _decode_certificate(X509 *certificate) {
+ Py_DECREF(pnotBefore);
+
+ (void) BIO_reset(biobuf);
+- notAfter = X509_get_notAfter(certificate);
++ notAfter = X509_getm_notAfter(certificate);
+ ASN1_TIME_print(biobuf, notAfter);
+ len = BIO_gets(biobuf, buf, sizeof(buf)-1);
+ if (len < 0) {
+@@ -3152,7 +3158,7 @@ _ssl__SSLContext_impl(PyTypeObject *type, int proto_version)
+ conservative and assume it wasn't fixed until release. We do this check
+ at runtime to avoid problems from the dynamic linker.
+ See #25672 for more on this. */
+- libver = SSLeay();
++ libver = OpenSSL_version_num();
+ if (!(libver >= 0x10001000UL && libver < 0x1000108fUL) &&
+ !(libver >= 0x10000000UL && libver < 0x100000dfUL)) {
+ SSL_CTX_set_mode(self->ctx, SSL_MODE_RELEASE_BUFFERS);
+@@ -5159,7 +5175,7 @@ PySSL_RAND(int len, int pseudo)
+ if (bytes == NULL)
+ return NULL;
+ if (pseudo) {
+- ok = RAND_pseudo_bytes((unsigned char*)PyBytes_AS_STRING(bytes), len);
++ ok = RAND_bytes((unsigned char*)PyBytes_AS_STRING(bytes), len);
+ if (ok == 0 || ok == 1)
+ return Py_BuildValue("NO", bytes, ok == 1 ? Py_True : Py_False);
+ }
+@@ -6176,10 +6192,10 @@ PyInit__ssl(void)
+ return NULL;
+
+ /* OpenSSL version */
+- /* SSLeay() gives us the version of the library linked against,
++ /* OpenSSL_version_num() gives us the version of the library linked against,
+ which could be different from the headers version.
+ */
+- libver = SSLeay();
++ libver = OpenSSL_version_num();
+ r = PyLong_FromUnsignedLong(libver);
+ if (r == NULL)
+ return NULL;
+@@ -6199,7 +6205,7 @@ PyInit__ssl(void)
+ r = Py_BuildValue("IIIII", major, minor, fix, patch, status);
+ if (r == NULL || PyModule_AddObject(m, "OPENSSL_VERSION_INFO", r))
+ return NULL;
+- r = PyUnicode_FromString(SSLeay_version(SSLEAY_VERSION));
++ r = PyUnicode_FromString(OpenSSL_version(OPENSSL_VERSION));
+ if (r == NULL || PyModule_AddObject(m, "OPENSSL_VERSION", r))
+ return NULL;
+
include $(TOPDIR)/rules.mk
PKG_NAME:=czmq
-PKG_VERSION:=4.1.1
+PKG_VERSION:=4.2.0
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/zeromq/czmq/releases/download/v$(PKG_VERSION)/
-PKG_HASH:=f00ff419881dc2a05d0686c8467cd89b4882677fc56f31c0e2cc81c134cbb0c0
+PKG_HASH:=cfab29c2b3cc8a845749758a51e1dd5f5160c1ef57e2a41ea96e4c2dcc8feceb
PKG_INSTALL:=1
PKG_FIXUP:=autoreconf
SECTION:=libs
CATEGORY:=Libraries
TITLE:=CZMQ
- DEPENDS:=+libzmq +libuuid +libpcre +liblz4
+ DEPENDS:=+libzmq +libuuid +libpcre +libmicrohttpd +liblz4 +libcurl
endef
define Package/czmq/description
include $(TOPDIR)/rules.mk
PKG_NAME:=dtc
-PKG_VERSION:=1.4.7
+PKG_VERSION:=1.5.0
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_HASH:=6643e8f00ff86350f465bb54b2185058b5b1b7bac01a0842c81a52b86589cde7
+PKG_HASH:=c672e443c9f7e39f5a7c8e602da6777f9ad55ad70de87de300a43828c8050172
PKG_SOURCE_URL:=@KERNEL/software/utils/dtc
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=GPL
$(CP) $(PKG_INSTALL_DIR)/lib/libfdt*.so* $(1)/usr/lib
endef
-TARGET_CFLAGS += \
- $(FPIC)
-
# NO_PYTHON is for disabling pylibfdt
MAKE_FLAGS += \
PREFIX= \
NO_PYTHON=1 \
- CFLAGS="$(TARGET_CFLAGS)"
+ NO_VALGRIND=1 \
+ NO_YAML=1 \
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/lib
--- /dev/null
+--- a/Makefile.orig 2019-03-15 03:55:48.407966162 +0000
++++ b/Makefile 2019-03-15 03:56:01.320976021 +0000
+@@ -15,10 +15,10 @@ EXTRAVERSION =
+ LOCAL_VERSION =
+ CONFIG_LOCALVERSION =
+
+-CPPFLAGS = -I libfdt -I .
++CPPFLAGS += -I libfdt -I .
+ WARNINGS = -Wall -Wpointer-arith -Wcast-qual -Wnested-externs \
+ -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wshadow
+-CFLAGS = -g -Os $(SHAREDLIB_CFLAGS) -Werror $(WARNINGS)
++CFLAGS += $(SHAREDLIB_CFLAGS) -Werror $(WARNINGS)
+
+ BISON = bison
+ LEX = flex
include $(TOPDIR)/rules.mk
PKG_NAME:=measurement-kit
-PKG_VERSION:=0.9.2
+PKG_VERSION:=0.9.4
PKG_RELEASE=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/measurement-kit/measurement-kit/tar.gz/v$(PKG_VERSION)?
-PKG_HASH:=b8e2624ba496c47164f3c15d35bb5e0a6c0f5e03b603e60ed9769156b1c7d82d
+PKG_HASH:=d095c28fa7283c546dcf513b9c60156f5ab7690f33f2de346372cd5328072d36
PKG_INSTALL:=1
PKG_FIXUP:=autoreconf
--- /dev/null
+--- a/autogen.sh
++++ b/autogen.sh
+@@ -3,7 +3,7 @@
+ set -e
+ export LC_ALL=C # Stable sorting regardless of the locale
+
+-. script/autogen.d/ca-bundle
++#. script/autogen.d/ca-bundle
+ . script/autogen.d/geoip
+
+ no_geoip=0
+@@ -82,7 +82,7 @@ gen_executables noinst_PROGRAMS example
+ gen_executables ALL_TESTS test libtest_main.la >> include.am
+
+ if [ $no_geoip -ne 1 ]; then
+- autogen_get_ca_bundle
++ #autogen_get_ca_bundle
+ autogen_get_geoip
+ fi
+
--- /dev/null
+--- a/script/autogen.d/geoip
++++ b/script/autogen.d/geoip
+@@ -5,13 +5,13 @@ autogen_get_geoip() {
+ echo "* Fetching geoip databases"
+ base=https://geolite.maxmind.com/download/geoip/database
+ if [ ! -f "country.mmdb" ]; then
+- curl -fsSLO $base/GeoLite2-Country.tar.gz
++ command -v curl && curl -fsSLO $base/GeoLite2-Country.tar.gz || wget $base/GeoLite2-Country.tar.gz
+ tar -xf GeoLite2-Country.tar.gz
+ mv GeoLite2-Country_20??????/GeoLite2-Country.mmdb country.mmdb
+ rm -rf GeoLite2-Country_20??????
+ fi
+ if [ ! -f "asn.mmdb" ]; then
+- curl -fsSLO $base/GeoLite2-ASN.tar.gz
++ command -v curl && curl -fsSLO $base/GeoLite2-ASN.tar.gz || wget $base/GeoLite2-ASN.tar.gz
+ tar -xf GeoLite2-ASN.tar.gz
+ mv GeoLite2-ASN_20??????/GeoLite2-ASN.mmdb asn.mmdb
+ rm -rf GeoLite2-ASN_20??????
include $(TOPDIR)/rules.mk
PKG_NAME:=dovecot
-PKG_VERSION:=2.3.4.1
-PKG_RELEASE:=2
+PKG_VERSION:=2.3.5
+PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://www.dovecot.org/releases/2.3
-PKG_HASH:=b8873e2ce5c33e58963bb7a8d2ff8427c09dbfdd63e13a0b0f4502864043aa07
+PKG_HASH:=bfe112ec6d11f7d6c6f7f0440e3b6e2c840c15cec1e99466b5495765d54aaaff
PKG_LICENSE:=LGPL-2.1 MIT BSD-3-Clause Unique
PKG_LICENSE_FILES:=COPYING COPYING.LGPL COPYING.MIT
PKG_MAINTAINER:=Lucian Cristian <lucian.cristian@gmail.com>
include $(TOPDIR)/rules.mk
PKG_NAME:=minidlna
-PKG_VERSION:=1.2.1
-PKG_RELEASE:=4
+PKG_RELEASE:=1
-PKG_SOURCE_URL:=@SF/minidlna
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_HASH:=67388ba23ab0c7033557a32084804f796aa2a796db7bb2b770fb76ac2a742eec
+PKG_SOURCE_URL=git://minidlna.git.sourceforge.net/gitroot/minidlna/minidlna
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_DATE:=2018-04-10
+PKG_SOURCE_VERSION:=799e6cf505ec470b2bf0ae4118143380aa16b837
+PKG_MIRROR_HASH:=67cc817e671de99e5a3f5ed237f89e22470f1de94819bcaba86c0ba821104af5
PKG_LICENSE:=GPL-2.0 BSD-3-Clause
PKG_LICENSE_FILES:=COPYING LICENCE.miniupnpd
--- /dev/null
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -17,7 +17,7 @@
+
+ AM_CFLAGS = -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 @STATIC_CFLAGS@
+
+-SUBDIRS=po
++SUBDIRS=
+
+ sbin_PROGRAMS = minidlnad
+ check_PROGRAMS = testupnpdescgen
+--- a/configure.ac
++++ b/configure.ac
+@@ -647,6 +647,8 @@ case "$target_os" in
+ esac
+
+
+-AC_OUTPUT([ po/Makefile.in
+-Makefile
+-])
++# AC_OUTPUT([ po/Makefile.in
++# Makefile
++# ])
++AC_CONFIG_FILES([Makefile])
++AC_OUTPUT
+++ /dev/null
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -17,7 +17,7 @@
-
- AM_CFLAGS = -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 @STATIC_CFLAGS@
-
--SUBDIRS=po
-+SUBDIRS=
-
- sbin_PROGRAMS = minidlnad
- check_PROGRAMS = testupnpdescgen
---- a/configure.ac
-+++ b/configure.ac
-@@ -644,6 +644,8 @@ case "$target_os" in
- esac
-
-
--AC_OUTPUT([ po/Makefile.in
--Makefile
--])
-+# AC_OUTPUT([ po/Makefile.in
-+# Makefile
-+# ])
-+AC_CONFIG_FILES([Makefile])
-+AC_OUTPUT
--- /dev/null
+From d297624e533d6d4274c750e3769749c3d7f121c8 Mon Sep 17 00:00:00 2001
+From: Daniel Kamil Kozar <dkk089@gmail.com>
+Date: Sat, 15 Dec 2018 16:34:30 +0100
+Subject: [PATCH] Mark all instances of magic_container_s as const
+
+---
+ containers.c | 38 +++++++++++++++++++-------------------
+ containers.h | 6 +++---
+ scanner.c | 2 +-
+ upnpsoap.c | 6 +++---
+ 4 files changed, 26 insertions(+), 26 deletions(-)
+
+--- a/containers.c
++++ b/containers.c
+@@ -25,23 +25,23 @@
+
+ #define NINETY_DAYS "7776000"
+
+-const char *music_id = MUSIC_ID;
+-const char *music_all_id = MUSIC_ALL_ID;
+-const char *music_genre_id = MUSIC_GENRE_ID;
+-const char *music_artist_id = MUSIC_ARTIST_ID;
+-const char *music_album_id = MUSIC_ALBUM_ID;
+-const char *music_plist_id = MUSIC_PLIST_ID;
+-const char *music_dir_id = MUSIC_DIR_ID;
+-const char *video_id = VIDEO_ID;
+-const char *video_all_id = VIDEO_ALL_ID;
+-const char *video_dir_id = VIDEO_DIR_ID;
+-const char *image_id = IMAGE_ID;
+-const char *image_all_id = IMAGE_ALL_ID;
+-const char *image_date_id = IMAGE_DATE_ID;
+-const char *image_camera_id = IMAGE_CAMERA_ID;
+-const char *image_dir_id = IMAGE_DIR_ID;
++static const char *music_id = MUSIC_ID;
++static const char *music_all_id = MUSIC_ALL_ID;
++static const char *music_genre_id = MUSIC_GENRE_ID;
++static const char *music_artist_id = MUSIC_ARTIST_ID;
++static const char *music_album_id = MUSIC_ALBUM_ID;
++static const char *music_plist_id = MUSIC_PLIST_ID;
++static const char *music_dir_id = MUSIC_DIR_ID;
++static const char *video_id = VIDEO_ID;
++static const char *video_all_id = VIDEO_ALL_ID;
++static const char *video_dir_id = VIDEO_DIR_ID;
++static const char *image_id = IMAGE_ID;
++static const char *image_all_id = IMAGE_ALL_ID;
++static const char *image_date_id = IMAGE_DATE_ID;
++static const char *image_camera_id = IMAGE_CAMERA_ID;
++static const char *image_dir_id = IMAGE_DIR_ID;
+
+-struct magic_container_s magic_containers[] =
++const struct magic_container_s magic_containers[] =
+ {
+ /* Alternate root container */
+ { NULL,
+@@ -124,7 +124,7 @@ struct magic_container_s magic_container
+ { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0 }
+ };
+
+-struct magic_container_s *
++const struct magic_container_s *
+ in_magic_container(const char *id, int flags, const char **real_id)
+ {
+ size_t len;
+@@ -154,7 +154,7 @@ in_magic_container(const char *id, int f
+ return NULL;
+ }
+
+-struct magic_container_s *
++const struct magic_container_s *
+ check_magic_container(const char *id, int flags)
+ {
+ int i;
+--- a/containers.h
++++ b/containers.h
+@@ -30,7 +30,7 @@ struct magic_container_s {
+ int required_flags;
+ };
+
+-extern struct magic_container_s magic_containers[];
++extern const struct magic_container_s magic_containers[];
+
+-struct magic_container_s *in_magic_container(const char *id, int flags, const char **real_id);
+-struct magic_container_s *check_magic_container(const char *id, int flags);
++const struct magic_container_s *in_magic_container(const char *id, int flags, const char **real_id);
++const struct magic_container_s *check_magic_container(const char *id, int flags);
+--- a/scanner.c
++++ b/scanner.c
+@@ -587,7 +587,7 @@ CreateDatabase(void)
+ }
+ for( i=0; magic_containers[i].objectid_match; i++ )
+ {
+- struct magic_container_s *magic = &magic_containers[i];
++ const struct magic_container_s *magic = &magic_containers[i];
+ if (!magic->name)
+ continue;
+ if( sql_get_int_field(db, "SELECT 1 from OBJECTS where OBJECT_ID = '%s'", magic->objectid_match) == 0 )
+--- a/upnpsoap.c
++++ b/upnpsoap.c
+@@ -800,7 +800,7 @@ add_res(char *size, char *duration, char
+ }
+
+ static int
+-get_child_count(const char *object, struct magic_container_s *magic)
++get_child_count(const char *object, const struct magic_container_s *magic)
+ {
+ int ret;
+
+@@ -1292,7 +1292,7 @@ BrowseContentDirectory(struct upnphttp *
+ "<Result>"
+ "<DIDL-Lite"
+ CONTENT_DIRECTORY_SCHEMAS;
+- struct magic_container_s *magic;
++ const struct magic_container_s *magic;
+ char *zErrMsg = NULL;
+ char *sql, *ptr;
+ struct Response args;
+@@ -1807,7 +1807,7 @@ SearchContentDirectory(struct upnphttp *
+ "<Result>"
+ "<DIDL-Lite"
+ CONTENT_DIRECTORY_SCHEMAS;
+- struct magic_container_s *magic;
++ const struct magic_container_s *magic;
+ char *zErrMsg = NULL;
+ char *sql, *ptr;
+ struct Response args;
--- /dev/null
+From e0065b8343bc963a89556449e00f1d20086cc1f1 Mon Sep 17 00:00:00 2001
+From: Daniel Kamil Kozar <dkk089@gmail.com>
+Date: Sat, 15 Dec 2018 16:26:37 +0100
+Subject: [PATCH] Wrap container definitions into a structure
+
+---
+ containers.c | 25 +++++++++++++++++++++++++
+ containers.h | 8 ++++++++
+ scanner.c | 33 ++++++---------------------------
+ 3 files changed, 39 insertions(+), 27 deletions(-)
+
+--- a/containers.c
++++ b/containers.c
+@@ -23,6 +23,31 @@
+ #include "containers.h"
+ #include "log.h"
+
++const struct container_s containers[] = {
++ { "0","-1", "root" },
++ { MUSIC_ID, "0", "Music" },
++ { MUSIC_ALL_ID, MUSIC_ID, "All Music" },
++ { MUSIC_GENRE_ID, MUSIC_ID, "Genre" },
++ { MUSIC_ARTIST_ID, MUSIC_ID, "Artist" },
++ { MUSIC_ALBUM_ID, MUSIC_ID, "Album" },
++ { MUSIC_DIR_ID, MUSIC_ID, "Folders" },
++ { MUSIC_PLIST_ID, MUSIC_ID, "Playlists" },
++
++ { VIDEO_ID, "0", "Video" },
++ { VIDEO_ALL_ID, VIDEO_ID, "All Video" },
++ { VIDEO_DIR_ID, VIDEO_ID, "Folders" },
++
++ { IMAGE_ID, "0", "Pictures" },
++ { IMAGE_ALL_ID, IMAGE_ID, "All Pictures" },
++ { IMAGE_DATE_ID, IMAGE_ID, "Date Taken" },
++ { IMAGE_CAMERA_ID, IMAGE_ID, "Camera" },
++ { IMAGE_DIR_ID, IMAGE_ID, "Folders" },
++
++ { BROWSEDIR_ID, "0", "Browse Folders" },
++
++ { 0, 0, 0 }
++};
++
+ #define NINETY_DAYS "7776000"
+
+ static const char *music_id = MUSIC_ID;
+--- a/containers.h
++++ b/containers.h
+@@ -16,6 +16,14 @@
+ * along with MiniDLNA. If not, see <http://www.gnu.org/licenses/>.
+ */
+
++struct container_s {
++ const char *object_id;
++ const char *parent_id;
++ const char *name;
++};
++
++extern const struct container_s containers[];
++
+ struct magic_container_s {
+ const char *name;
+ const char *objectid_match;
+--- a/scanner.c
++++ b/scanner.c
+@@ -529,30 +529,7 @@ insert_file(const char *name, const char
+ int
+ CreateDatabase(void)
+ {
+- int ret, i;
+- const char *containers[] = { "0","-1", "root",
+- MUSIC_ID, "0", _("Music"),
+- MUSIC_ALL_ID, MUSIC_ID, _("All Music"),
+- MUSIC_GENRE_ID, MUSIC_ID, _("Genre"),
+- MUSIC_ARTIST_ID, MUSIC_ID, _("Artist"),
+- MUSIC_ALBUM_ID, MUSIC_ID, _("Album"),
+- MUSIC_DIR_ID, MUSIC_ID, _("Folders"),
+- MUSIC_PLIST_ID, MUSIC_ID, _("Playlists"),
+-
+- VIDEO_ID, "0", _("Video"),
+- VIDEO_ALL_ID, VIDEO_ID, _("All Video"),
+- VIDEO_DIR_ID, VIDEO_ID, _("Folders"),
+-
+- IMAGE_ID, "0", _("Pictures"),
+- IMAGE_ALL_ID, IMAGE_ID, _("All Pictures"),
+- IMAGE_DATE_ID, IMAGE_ID, _("Date Taken"),
+- IMAGE_CAMERA_ID, IMAGE_ID, _("Camera"),
+- IMAGE_DIR_ID, IMAGE_ID, _("Folders"),
+-
+- BROWSEDIR_ID, "0", _("Browse Folders"),
+- 0 };
+-
+- ret = sql_exec(db, create_objectTable_sqlite);
++ int ret = sql_exec(db, create_objectTable_sqlite);
+ if( ret != SQLITE_OK )
+ goto sql_failed;
+ ret = sql_exec(db, create_detailTable_sqlite);
+@@ -576,16 +553,18 @@ CreateDatabase(void)
+ ret = sql_exec(db, "INSERT into SETTINGS values ('UPDATE_ID', '0')");
+ if( ret != SQLITE_OK )
+ goto sql_failed;
+- for( i=0; containers[i]; i=i+3 )
++ for( int i=0; containers[i].name; ++i )
+ {
++ const struct container_s *c = &containers[i];
++ const char *name = _(c->name);
+ ret = sql_exec(db, "INSERT into OBJECTS (OBJECT_ID, PARENT_ID, DETAIL_ID, CLASS, NAME)"
+ " values "
+ "('%s', '%s', %lld, 'container.storageFolder', '%q')",
+- containers[i], containers[i+1], GetFolderMetadata(containers[i+2], NULL, NULL, NULL, 0), containers[i+2]);
++ c->object_id, c->parent_id, GetFolderMetadata(name, NULL, NULL, NULL, 0), name);
+ if( ret != SQLITE_OK )
+ goto sql_failed;
+ }
+- for( i=0; magic_containers[i].objectid_match; i++ )
++ for( int i=0; magic_containers[i].objectid_match; i++ )
+ {
+ const struct magic_container_s *magic = &magic_containers[i];
+ if (!magic->name)
--- /dev/null
+From be9de8b2e0864b46498496af9ffdc31c0e7b764a Mon Sep 17 00:00:00 2001
+From: Daniel Kamil Kozar <dkk089@gmail.com>
+Date: Sun, 16 Dec 2018 14:21:58 +0100
+Subject: [PATCH] Reduce duplication in sql.c
+
+---
+ sql.c | 166 ++++++++++++++++++++--------------------------------------
+ 1 file changed, 58 insertions(+), 108 deletions(-)
+
+--- a/sql.c
++++ b/sql.c
+@@ -65,122 +65,72 @@ sql_get_table(sqlite3 *db, const char *s
+ return ret;
+ }
+
++#define sql_get_field(type, column_get_fn) \
++ va_list ap;\
++ int counter, result;\
++ char *sql;\
++ type ret;\
++ sqlite3_stmt *stmt;\
++ \
++ va_start(ap, fmt);\
++ sql = sqlite3_vmprintf(fmt, ap);\
++ va_end(ap);\
++\
++ /*DPRINTF(E_DEBUG, L_DB_SQL, "sql: %s\n", sql); */ \
++\
++ switch (sqlite3_prepare_v2(db, sql, -1, &stmt, NULL))\
++ {\
++ case SQLITE_OK:\
++ break;\
++ default:\
++ DPRINTF(E_ERROR, L_DB_SQL, "prepare failed: %s\n%s\n", sqlite3_errmsg(db), sql);\
++ sqlite3_free(sql);\
++ return -1;\
++ }\
++\
++ for (counter = 0;\
++ ((result = sqlite3_step(stmt)) == SQLITE_BUSY || result == SQLITE_LOCKED) && counter < 2;\
++ counter++) {\
++ /* While SQLITE_BUSY has a built in timeout,\
++ * SQLITE_LOCKED does not, so sleep */\
++ if (result == SQLITE_LOCKED)\
++ sleep(1);\
++ }\
++\
++ switch (result)\
++ {\
++ case SQLITE_DONE:\
++ /* no rows returned */\
++ ret = 0;\
++ break;\
++ case SQLITE_ROW:\
++ if (sqlite3_column_type(stmt, 0) == SQLITE_NULL)\
++ {\
++ ret = 0;\
++ break;\
++ }\
++ ret = column_get_fn(stmt, 0);\
++ break;\
++ default:\
++ DPRINTF(E_WARN, L_DB_SQL, "%s: step failed: %s\n%s\n", __func__, sqlite3_errmsg(db), sql);\
++ ret = -1;\
++ break;\
++ }\
++ sqlite3_free(sql);\
++ sqlite3_finalize(stmt);\
++\
++ return ret;
++
+ int
+ sql_get_int_field(sqlite3 *db, const char *fmt, ...)
+ {
+- va_list ap;
+- int counter, result;
+- char *sql;
+- int ret;
+- sqlite3_stmt *stmt;
+-
+- va_start(ap, fmt);
+- sql = sqlite3_vmprintf(fmt, ap);
+- va_end(ap);
+-
+- //DPRINTF(E_DEBUG, L_DB_SQL, "sql: %s\n", sql);
+-
+- switch (sqlite3_prepare_v2(db, sql, -1, &stmt, NULL))
+- {
+- case SQLITE_OK:
+- break;
+- default:
+- DPRINTF(E_ERROR, L_DB_SQL, "prepare failed: %s\n%s\n", sqlite3_errmsg(db), sql);
+- sqlite3_free(sql);
+- return -1;
+- }
+-
+- for (counter = 0;
+- ((result = sqlite3_step(stmt)) == SQLITE_BUSY || result == SQLITE_LOCKED) && counter < 2;
+- counter++) {
+- /* While SQLITE_BUSY has a built in timeout,
+- * SQLITE_LOCKED does not, so sleep */
+- if (result == SQLITE_LOCKED)
+- sleep(1);
+- }
+-
+- switch (result)
+- {
+- case SQLITE_DONE:
+- /* no rows returned */
+- ret = 0;
+- break;
+- case SQLITE_ROW:
+- if (sqlite3_column_type(stmt, 0) == SQLITE_NULL)
+- {
+- ret = 0;
+- break;
+- }
+- ret = sqlite3_column_int(stmt, 0);
+- break;
+- default:
+- DPRINTF(E_WARN, L_DB_SQL, "%s: step failed: %s\n%s\n", __func__, sqlite3_errmsg(db), sql);
+- ret = -1;
+- break;
+- }
+- sqlite3_free(sql);
+- sqlite3_finalize(stmt);
+-
+- return ret;
++ sql_get_field(int, sqlite3_column_int)
+ }
+
+ int64_t
+ sql_get_int64_field(sqlite3 *db, const char *fmt, ...)
+ {
+- va_list ap;
+- int counter, result;
+- char *sql;
+- int64_t ret;
+- sqlite3_stmt *stmt;
+-
+- va_start(ap, fmt);
+- sql = sqlite3_vmprintf(fmt, ap);
+- va_end(ap);
+-
+- //DPRINTF(E_DEBUG, L_DB_SQL, "sql: %s\n", sql);
+-
+- switch (sqlite3_prepare_v2(db, sql, -1, &stmt, NULL))
+- {
+- case SQLITE_OK:
+- break;
+- default:
+- DPRINTF(E_ERROR, L_DB_SQL, "prepare failed: %s\n%s\n", sqlite3_errmsg(db), sql);
+- sqlite3_free(sql);
+- return -1;
+- }
+-
+- for (counter = 0;
+- ((result = sqlite3_step(stmt)) == SQLITE_BUSY || result == SQLITE_LOCKED) && counter < 2;
+- counter++) {
+- /* While SQLITE_BUSY has a built in timeout,
+- * SQLITE_LOCKED does not, so sleep */
+- if (result == SQLITE_LOCKED)
+- sleep(1);
+- }
+-
+- switch (result)
+- {
+- case SQLITE_DONE:
+- /* no rows returned */
+- ret = 0;
+- break;
+- case SQLITE_ROW:
+- if (sqlite3_column_type(stmt, 0) == SQLITE_NULL)
+- {
+- ret = 0;
+- break;
+- }
+- ret = sqlite3_column_int64(stmt, 0);
+- break;
+- default:
+- DPRINTF(E_WARN, L_DB_SQL, "%s: step failed: %s\n%s\n", __func__, sqlite3_errmsg(db), sql);
+- ret = -1;
+- break;
+- }
+- sqlite3_free(sql);
+- sqlite3_finalize(stmt);
+-
+- return ret;
++ sql_get_field(int64_t, sqlite3_column_int64)
+ }
+
+ char *
PKG_NAME:=seafile-seahub
PKG_VERSION:=6.3.4
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_LICENSE:=Apache-2.0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_HASH:=53a9efdb6791fd3a2a191e89cb0f133632056046ec08adbb2ad72088e6161430
PKG_BUILD_DIR:=$(BUILD_DIR)/seahub-$(PKG_VERSION)-server
-PKG_BUILD_DEPENDS:=pytz/host
+PKG_BUILD_DEPENDS:=python-pytz/host
include $(INCLUDE_DIR)/package.mk
include ../../lang/python/python-package.mk
TITLE:=Seafile server - seahub component
MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
URL:=https://seafile.com/
- DEPENDS:=+simplejson +python +pillow +chardet +django +django-appconf \
+ DEPENDS:=+python-simplejson +python +pillow +python-chardet +django +django-appconf \
+django-compressor +django-constance +django-formtools +django-jsonfield \
+django-picklefield +django-postoffice +django-restframework \
+django-simple-captcha +django-statici18n +django-webpack-loader +et_xmlfile \
+flup +gunicorn +jdcal +openpyxl +python-dateutil +python-mysql \
- +python-qrcode +python-requests +python-requests-oauthlib +pytz +rcssmin
+ +python-qrcode +python-requests +python-requests-oauthlib +python-pytz +rcssmin
endef
define Build/Configure
# - check if default mode has changed from being tcp_only
#
PKG_NAME:=shadowsocks-libev
-PKG_VERSION:=3.2.4
+PKG_VERSION:=3.2.5
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/shadowsocks/shadowsocks-libev/releases/download/v$(PKG_VERSION)
-PKG_HASH:=65a67c355df1794dc0ef94d80d2d596fd590b13fdcd0a21bda28859c88924ce5
+PKG_HASH:=02273d571b8bea067eefb203a43c142d052042179904f9050a1f20cb8dc5d242
PKG_MAINTAINER:=Yousong Zhou <yszhou4tech@gmail.com>
-#
-# Copyright (C) 2012-2016 OpenWrt.org
-#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=tgt
-PKG_VERSION:=1.0.74
-PKG_RELEASE:=2
+PKG_VERSION:=1.0.75
+PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/fujita/tgt/tar.gz/v$(PKG_VERSION)?
-PKG_HASH:=bfc202790d5326d7a18bd3928b4bb204ffb0acf443a5ec5c16a1a0fbc53be99f
+PKG_HASH:=1c719fdccc6ddc8e5de57a6e546aa64f41056a2fb1d710b8b2a22f65e08f5b90
PKG_MAINTAINER:=Maxim Storchak <m.storchak@gmail.com>
PKG_LICENSE:=GPL-2.0
endef
define Package/tgt/description
-Linux SCSI target framework (tgt) aims to simplify various SCSI target driver (iSCSI, Fibre Channel, SRP, etc) creation and maintenance.
-Key goals of the project are the clean integration into the scsi-mid layer and implementing a great portion of tgt in user space.
-Tgt consists of kernel-space and user-space code. The kernel-space component is included in upstream as of 2.6.20.
-Note that if you are interested in only iSCSI (probably you are), you need only the user-space code (any kernel version is fine).
+The Linux target framework (tgt) is a user space SCSI target framework
+that supports the iSCSI and iSER transport protocols and that also
+supports multiple methods for accessing block storage. Tgt consists of
+a user-space daemon and user-space tools.
endef
define Build/Compile
endef
define Package/tgt/install
- $(INSTALL_DIR) $(1)/
- $(INSTALL_DIR) $(1)/usr/sbin
- $(CP) ./files/* $(1)/
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/tgtd $(1)/usr/sbin/
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/tgtadm $(1)/usr/sbin/
+ $(INSTALL_DIR) $(1)/etc/config $(1)/etc/init.d $(1)/usr/sbin
+ $(INSTALL_DATA) ./files/tgt.config $(1)/etc/config/
+ $(INSTALL_BIN) ./files/tgt.init $(1)/etc/init.d/
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/tgtd $(PKG_INSTALL_DIR)/usr/sbin/tgtadm $(1)/usr/sbin/
endef
$(eval $(call BuildPackage,tgt))
+++ /dev/null
-config options 'tgt'
-# iothreads limits number of worker threads per rdwr target, default is 16
-# which seems to be too much for an avarage router
- option iothreads '2'
-# option nop_count '3'
-# option nop_interval '1'
-# list portal '[::1]'
-# list portal '127.0.0.1:3261'
-# list portal '0.0.0.0:3262'
-# list portal '[::]:3263'
-
-config target 1
- option name 'iqn.2012-06.org.openwrt:target1'
-# list allow_name 'iqn.1994-05.org.example:fedcba987654'
-# list allow_address '192.168.2.128/27'
-
-#config target 2
-# option name 'iqn.2012-06.org.openwrt:t2'
-
-# all options are set to default, except for the device
-# lun "name" is constructed as TGTID_LUN
-#config lun 1_1
-# option 'device' '/dev/sda'
-# type of scsi device. available options: disk, cd, pt (sg passthrough)
-# option 'type' 'disk'
-# backing store access method: rdwr (read-write), aio (async IO), sg (for pt type only, device must be /dev/sgN)
-# option 'bstype' 'aio'
-# set sync and/or direct flags when opening device, affect only rdwr
-# option 'sync' '0'
-# option 'direct' '0'
-# block size for lun, default is 512
-# option 'blocksize' 4096
-# override SCSI mode page, see tgtadm man page for details
-# option 'mode_page' 'string'
-# vendor, product, revision, SCSI ID and SCSI Serial number
-# option 'vendor_id' 'string'
-# option 'product_id' 'string'
-# option 'product_rev' 'string'
-# option 'scsi_id' 'string'
-# option 'scsi_sn' 'string'
-# refuse write attempts. applies only to disk type
-# option 'readonly' '0'
-# Disk devices default to non-removable, cd - to removable
-# option 'removable' '0'
-# 0 = Classic sense format, 1 = Support descriptor format.
-# option 'sense_format' '0'
-
-#config lun 2_1
-# option device /mnt/iscsi.img
-
-#config lun 2_2
-# option device /dev/sdc
-
-#config account
-# list target 1
-# list target 2
-# option user "username1"
-# option password "pass1"
-
-#config account
-# option target 2
-# option user "user2"
-# option password "pwd2"
-# option outgoing 1
+++ /dev/null
-#!/bin/sh /etc/rc.common
-START=91
-STOP=10
-
-EXTRA_COMMANDS="show"
-EXTRA_HELP=" show Show current configuration of tgtd"
-
-NAME=tgt
-PROG=/usr/sbin/tgtd
-USE_PROCD=1
-
-tgtadm="/usr/sbin/tgtadm --lld iscsi"
-logger="logger -p daemon.err -s -t $NAME"
-
-validate_lun_section() {
- uci_load_validate tgt lun "$1" "$2" \
- 'device:or(file, device)' \
- 'type:or("disk", "cd", "pt"):disk' \
- 'bstype:or("rdwr", "aio", "sg"):rdwr' \
- 'sync:bool:0' \
- 'direct:bool:0' \
- 'blocksize:uinteger' \
- 'mode_page:string' \
- 'product_id:string' \
- 'product_rev:string' \
- 'readonly:bool:0' \
- 'removable:bool' \
- 'scsi_id:string' \
- 'scsi_sn:string' \
- 'sense_format:range(0, 1)' \
- 'vendor_id:string'
-}
-
-handle_lun() {
- local tgt_lun=$1
- local my_tgtid=${tgt_lun%_*}
- local lun=${tgt_lun#*_}
-
- [ $my_tgtid -eq $tgtid ] || return 0
-
- [ "$2" = 0 ] || {
- $logger "Validation failed for LUN $tgt_lun"
- return 1
- }
- [ "$device" ] || {
- $logger "Device is required for target $tgt_lun"
- return 1
- }
-
- if [ $sync -ne 0 -o $direct -ne 0 ]; then
- local bsoflags
- [ $sync -ne 0 ] && bsoflags="sync"
- [ $direct -ne 0 ] && bsoflags="direct"
- [ $sync -ne 0 -a $direct -ne 0 ] && bsoflags="sync:direct"
- bsoflags="--bsoflags $bsoflags"
- fi
-
- blocksize=${blocksize+--blocksize=$blocksize}
- local params='' i
- for i in mode_page product_id product_rev readonly removable scsi_id scsi_sn sense_format vendor_id; do
- eval params=\${$i+$i=\$$i,}\$params
- done
-
- local _tgtadm="$tgtadm --mode logicalunit --tid $tgtid --lun $lun"
- $_tgtadm --op new --backing-store $device --device-type $type --bstype $bstype $bsoflags $blocksize || {
- $logger "Failed to create lun $tgt_lun"
- return 1
- }
- $_tgtadm --op update --param $params || {
- $logger "Failed to update lun $tgt_lun"
- return 1
- }
-}
-
-validate_account_section () {
- uci_load_validate tgt account "$1" "$2" \
- 'target:list(uinteger)' \
- 'user:string' \
- 'password:string' \
- 'outgoing:bool:0'
-}
-
-handle_account() {
- local _tgtadm="$tgtadm --mode account"
-
- [ "$2" = 0 ] || {
- $logger "Validation failed for account ${user:-$1}"
- return 1
- }
- [ "$user" ] || {
- $logger "User is required for account $1. Run 'uci show tgt.$1' and check options"
- return 1
- }
- [ "$target" ] || {
- $logger "Target is required for account $user"
- return 1
- }
- [ "$password" ] || {
- $logger "Password is required for account $user"
- return 1
- }
- $_tgtadm --op new --user "$user" --password "$password" || {
- $logger "Failed to create user $username"
- return 1
- }
-}
-
-bind_account_to_target() {
- local _tgtadm="$tgtadm --mode account"
-
- [ "$2" = 0 ] || {
- $logger "Validation failed for account ${user:-$1}"
- return 1
- }
-
- [ "$outgoing" -ne 0 ] && outgoing=--outgoing || outgoing=""
- local t
- for t in $target; do
- [ "$t" -eq "$tgtid" ] && {
- $_tgtadm --op bind --tid $tgtid --user "$user" $outgoing || {
- $logger "Failed to bind user $username to target $tgtid"
- return 1
- }
- }
- done
- return 0
-}
-
-validate_target_section() {
- uci_load_validate tgt target "$1" "$2" \
- 'name:string:iqn.2012-06.org.openwrt' \
- 'allow_address:list(string):ALL' \
- 'allow_name:list(string)'
-}
-
-handle_target() {
- local tgtid=$1
- local _tgtadm="$tgtadm --mode target"
-
- [ $tgtid -ge 0 ] || return 1
- [ "$2" = 0 ] || {
- $logger "Validation failed for target $tgtid"
- return 1
- }
- $_tgtadm --op new --tid $tgtid --targetname $name || {
- $logger "Failed to create target $tgtid"
- return 1
- }
- local i
- for i in $allow_address; do
- $_tgtadm --op bind --tid $tgtid --initiator-address $i || {
- $logger "Failed to set allow $i to connect to target $tgtid"
- return 1
- }
- done
- for i in $allow_name; do
- $_tgtadm --op bind --tid $tgtid --initiator-name $i || {
- $logger "Failed to set allow $i to connect to target $tgtid"
- return 1
- }
- done
- config_foreach validate_lun_section lun handle_lun || return 1
- config_foreach validate_account_section account bind_account_to_target || return 1
-}
-
-configure() {
- config_load $NAME
- $tgtadm --mode sys --op update --name State -v offline || {
- $logger "Failed to set system state to Offline"
- return 1
- }
- config_foreach validate_account_section account handle_account || return 1
- config_foreach validate_target_section target handle_target || return 1
- $tgtadm --mode sys --op update --name State -v ready || {
- $logger "Failed to set system state to Ready"
- return 1
- }
- return 0
-}
-
-validate_tgt_section() {
- uci_load_validate tgt options "$1" "$2" \
- 'iothreads:uinteger' \
- 'portal:list(string)' \
- 'nop_interval:uinteger' \
- 'nop_count:uinteger'
-}
-
-start_tgt_instance() {
- [ "$2" = 0 ] || {
- $logger "Validation failed for tgt options"
- return 1
- }
- procd_open_instance
- procd_set_param command $PROG -f
- [ "$iothreads" ] && procd_append_param command -t $iothreads
- [ "$portal$nop_interval$nop_count" ] && {
- local iscsi="" i
- for i in nop_interval nop_count; do
- eval iscsi=\${$i+$i=\$$i,}\$iscsi
- done
- for i in $portal; do
- iscsi="portal=$i,$iscsi"
- done
- procd_append_param command --iscsi $iscsi
- }
- procd_set_param respawn
- procd_close_instance
- logger -p daemon.info -t $NAME -s "Configuration will be loaded in seconds"
- ( sleep 5; configure || { stop_service; exit 1; } ) &
-}
-
-start_service() {
- validate_tgt_section tgt start_tgt_instance
-}
-
-stop_service() {
- $tgtadm --mode sys --op update --name State -v offline || {
- $logger "Failed to set system state to Offline"
- return 1
- }
- $tgtadm --mode target --op show \
- | awk '$1 == "Target" {sub(/:/,"",$2); print $2}' \
- | xargs -r -n1 $tgtadm --mode target --op delete --force --tid
- $tgtadm --mode sys --op delete
-}
-
-reload_service() {
- stop_service
- start_service
-}
-
-service_triggers() {
- procd_add_reload_trigger "tgt"
-
- procd_open_validate
- validate_tgt_section
- validate_account_section
- validate_target_section
- validate_lun_section
- procd_close_validate
-}
-
-show() {
- $tgtadm --mode target --op show
-}
--- /dev/null
+config options 'tgt'
+# iothreads limits number of worker threads per rdwr target, default is 16
+# which seems to be too much for an avarage router
+ option iothreads '2'
+# option nop_count '3'
+# option nop_interval '1'
+# list portal '[::1]'
+# list portal '127.0.0.1:3261'
+# list portal '0.0.0.0:3262'
+# list portal '[::]:3263'
+
+config target 1
+ option name 'iqn.2012-06.org.openwrt:target1'
+# list allow_name 'iqn.1994-05.org.example:fedcba987654'
+# list allow_address '192.168.2.128/27'
+
+#config target 2
+# option name 'iqn.2012-06.org.openwrt:t2'
+
+# all options are set to default, except for the device
+# lun "name" is constructed as TGTID_LUN
+#config lun 1_1
+# option 'device' '/dev/sda'
+# type of scsi device. available options: disk, cd, pt (sg passthrough)
+# option 'type' 'disk'
+# backing store access method: rdwr (read-write), aio (async IO), sg (for pt type only, device must be /dev/sgN)
+# option 'bstype' 'aio'
+# set sync and/or direct flags when opening device, affect only rdwr
+# option 'sync' '0'
+# option 'direct' '0'
+# block size for lun, default is 512
+# option 'blocksize' 4096
+# override SCSI mode page, see tgtadm man page for details
+# option 'mode_page' 'string'
+# vendor, product, revision, SCSI ID and SCSI Serial number
+# option 'vendor_id' 'string'
+# option 'product_id' 'string'
+# option 'product_rev' 'string'
+# option 'scsi_id' 'string'
+# option 'scsi_sn' 'string'
+# refuse write attempts. applies only to disk type
+# option 'readonly' '0'
+# Disk devices default to non-removable, cd - to removable
+# option 'removable' '0'
+# 0 = Classic sense format, 1 = Support descriptor format.
+# option 'sense_format' '0'
+
+#config lun 2_1
+# option device /mnt/iscsi.img
+
+#config lun 2_2
+# option device /dev/sdc
+
+#config account
+# list target 1
+# list target 2
+# option user "username1"
+# option password "pass1"
+
+#config account
+# option target 2
+# option user "user2"
+# option password "pwd2"
+# option outgoing 1
--- /dev/null
+#!/bin/sh /etc/rc.common
+START=91
+STOP=10
+
+EXTRA_COMMANDS="show"
+EXTRA_HELP=" show Show current configuration of tgtd"
+
+NAME=tgt
+PROG=/usr/sbin/tgtd
+USE_PROCD=1
+
+tgtadm="/usr/sbin/tgtadm --lld iscsi"
+logger="logger -p daemon.err -s -t $NAME"
+
+validate_lun_section() {
+ uci_load_validate tgt lun "$1" "$2" \
+ 'device:or(file, device)' \
+ 'type:or("disk", "cd", "pt"):disk' \
+ 'bstype:or("rdwr", "aio", "sg"):rdwr' \
+ 'sync:bool:0' \
+ 'direct:bool:0' \
+ 'blocksize:uinteger' \
+ 'mode_page:string' \
+ 'product_id:string' \
+ 'product_rev:string' \
+ 'readonly:bool:0' \
+ 'removable:bool' \
+ 'scsi_id:string' \
+ 'scsi_sn:string' \
+ 'sense_format:range(0, 1)' \
+ 'vendor_id:string'
+}
+
+handle_lun() {
+ local tgt_lun=$1
+ local my_tgtid=${tgt_lun%_*}
+ local lun=${tgt_lun#*_}
+
+ [ $my_tgtid -eq $tgtid ] || return 0
+
+ [ "$2" = 0 ] || {
+ $logger "Validation failed for LUN $tgt_lun"
+ return 1
+ }
+ [ "$device" ] || {
+ $logger "Device is required for target $tgt_lun"
+ return 1
+ }
+
+ if [ $sync -ne 0 -o $direct -ne 0 ]; then
+ local bsoflags
+ [ $sync -ne 0 ] && bsoflags="sync"
+ [ $direct -ne 0 ] && bsoflags="direct"
+ [ $sync -ne 0 -a $direct -ne 0 ] && bsoflags="sync:direct"
+ bsoflags="--bsoflags $bsoflags"
+ fi
+
+ blocksize=${blocksize+--blocksize=$blocksize}
+ local params='' i
+ for i in mode_page product_id product_rev readonly removable scsi_id scsi_sn sense_format vendor_id; do
+ eval params=\${$i+$i=\$$i,}\$params
+ done
+
+ local _tgtadm="$tgtadm --mode logicalunit --tid $tgtid --lun $lun"
+ $_tgtadm --op new --backing-store $device --device-type $type --bstype $bstype $bsoflags $blocksize || {
+ $logger "Failed to create lun $tgt_lun"
+ return 1
+ }
+ $_tgtadm --op update --param $params || {
+ $logger "Failed to update lun $tgt_lun"
+ return 1
+ }
+}
+
+validate_account_section () {
+ uci_load_validate tgt account "$1" "$2" \
+ 'target:list(uinteger)' \
+ 'user:string' \
+ 'password:string' \
+ 'outgoing:bool:0'
+}
+
+handle_account() {
+ local _tgtadm="$tgtadm --mode account"
+
+ [ "$2" = 0 ] || {
+ $logger "Validation failed for account ${user:-$1}"
+ return 1
+ }
+ [ "$user" ] || {
+ $logger "User is required for account $1. Run 'uci show tgt.$1' and check options"
+ return 1
+ }
+ [ "$target" ] || {
+ $logger "Target is required for account $user"
+ return 1
+ }
+ [ "$password" ] || {
+ $logger "Password is required for account $user"
+ return 1
+ }
+ $_tgtadm --op new --user "$user" --password "$password" || {
+ $logger "Failed to create user $username"
+ return 1
+ }
+}
+
+bind_account_to_target() {
+ local _tgtadm="$tgtadm --mode account"
+
+ [ "$2" = 0 ] || {
+ $logger "Validation failed for account ${user:-$1}"
+ return 1
+ }
+
+ [ "$outgoing" -ne 0 ] && outgoing=--outgoing || outgoing=""
+ local t
+ for t in $target; do
+ [ "$t" -eq "$tgtid" ] && {
+ $_tgtadm --op bind --tid $tgtid --user "$user" $outgoing || {
+ $logger "Failed to bind user $username to target $tgtid"
+ return 1
+ }
+ }
+ done
+ return 0
+}
+
+validate_target_section() {
+ uci_load_validate tgt target "$1" "$2" \
+ 'name:string:iqn.2012-06.org.openwrt' \
+ 'allow_address:list(string):ALL' \
+ 'allow_name:list(string)'
+}
+
+handle_target() {
+ local tgtid=$1
+ local _tgtadm="$tgtadm --mode target"
+
+ [ $tgtid -ge 0 ] || return 1
+ [ "$2" = 0 ] || {
+ $logger "Validation failed for target $tgtid"
+ return 1
+ }
+ $_tgtadm --op new --tid $tgtid --targetname $name || {
+ $logger "Failed to create target $tgtid"
+ return 1
+ }
+ local i
+ for i in $allow_address; do
+ $_tgtadm --op bind --tid $tgtid --initiator-address $i || {
+ $logger "Failed to set allow $i to connect to target $tgtid"
+ return 1
+ }
+ done
+ for i in $allow_name; do
+ $_tgtadm --op bind --tid $tgtid --initiator-name $i || {
+ $logger "Failed to set allow $i to connect to target $tgtid"
+ return 1
+ }
+ done
+ config_foreach validate_lun_section lun handle_lun || return 1
+ config_foreach validate_account_section account bind_account_to_target || return 1
+}
+
+configure() {
+ config_load $NAME
+ $tgtadm --mode sys --op update --name State -v offline || {
+ $logger "Failed to set system state to Offline"
+ return 1
+ }
+ config_foreach validate_account_section account handle_account || return 1
+ config_foreach validate_target_section target handle_target || return 1
+ $tgtadm --mode sys --op update --name State -v ready || {
+ $logger "Failed to set system state to Ready"
+ return 1
+ }
+ return 0
+}
+
+validate_tgt_section() {
+ uci_load_validate tgt options "$1" "$2" \
+ 'iothreads:uinteger' \
+ 'portal:list(string)' \
+ 'nop_interval:uinteger' \
+ 'nop_count:uinteger'
+}
+
+start_tgt_instance() {
+ [ "$2" = 0 ] || {
+ $logger "Validation failed for tgt options"
+ return 1
+ }
+ procd_open_instance
+ procd_set_param command $PROG -f
+ [ "$iothreads" ] && procd_append_param command -t $iothreads
+ [ "$portal$nop_interval$nop_count" ] && {
+ local iscsi="" i
+ for i in nop_interval nop_count; do
+ eval iscsi=\${$i+$i=\$$i,}\$iscsi
+ done
+ for i in $portal; do
+ iscsi="portal=$i,$iscsi"
+ done
+ procd_append_param command --iscsi $iscsi
+ }
+ procd_set_param respawn
+ procd_close_instance
+ logger -p daemon.info -t $NAME -s "Configuration will be loaded in seconds"
+ ( sleep 5; configure || { stop_service; exit 1; } ) &
+}
+
+start_service() {
+ validate_tgt_section tgt start_tgt_instance
+}
+
+stop_service() {
+ $tgtadm --mode sys --op update --name State -v offline || {
+ $logger "Failed to set system state to Offline"
+ return 1
+ }
+ $tgtadm --mode target --op show \
+ | awk '$1 == "Target" {sub(/:/,"",$2); print $2}' \
+ | xargs -r -n1 $tgtadm --mode target --op delete --force --tid
+ $tgtadm --mode sys --op delete
+ procd_kill tgt
+}
+
+reload_service() {
+ stop_service
+ start_service
+}
+
+service_triggers() {
+ procd_add_reload_trigger "tgt"
+
+ procd_open_validate
+ validate_tgt_section
+ validate_account_section
+ validate_target_section
+ validate_lun_section
+ procd_close_validate
+}
+
+show() {
+ $tgtadm --mode target --op show
+}
PKG_NAME:=tor
PKG_VERSION:=0.3.5.8
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://dist.torproject.org/ \
USE_PROCD=1
start_service() {
- [ -f /var/run/tor.pid ] || {
- touch /var/run/tor.pid
- chown tor:tor /var/run/tor.pid
- }
- [ -d /var/lib/tor ] || {
- mkdir -m 0755 -p /var/lib/tor
- chmod 0700 /var/lib/tor
- chown tor:tor /var/lib/tor
- }
- [ -d /var/log/tor ] || {
- mkdir -m 0755 -p /var/log/tor
- chown tor:tor /var/log/tor
- }
+ touch /var/run/tor.pid
+ chown tor:tor /var/run/tor.pid
+
+ mkdir -m 0700 -p /var/lib/tor
+ chown -R tor:tor /var/lib/tor
+
+ mkdir -m 0755 -p /var/log/tor
+ chown -R tor:tor /var/log/tor
+
procd_open_instance
procd_set_param command /usr/sbin/tor --runasdaemon 0
procd_close_instance
include $(TOPDIR)/rules.mk
PKG_NAME:=unbound
-PKG_VERSION:=1.9.0
+PKG_VERSION:=1.9.1
PKG_RELEASE:=1
PKG_LICENSE:=BSD-3-Clause
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.unbound.net/downloads
-PKG_HASH:=415af94b8392bc6b2c52e44ac8f17935cc6ddf2cc81edfb47c5be4ad205ab917
+PKG_HASH:=c3c0bf9b86ccba4ca64f93dd4fe7351308ab54293f297a67de5a8914c1dc59c5
PKG_BUILD_PARALLEL:=1
PKG_FIXUP:=autoreconf
+++ /dev/null
---- a/util/net_help.c
-+++ b/util/net_help.c
-@@ -1049,10 +1049,10 @@ void* outgoing_ssl_fd(void* sslctx, int
- static lock_basic_type *ub_openssl_locks = NULL;
-
- /** callback that gets thread id for openssl */
--static unsigned long
--ub_crypto_id_cb(void)
-+static void
-+ub_crypto_id_cb(CRYPTO_THREADID *id)
- {
-- return (unsigned long)log_thread_get();
-+ CRYPTO_THREADID_set_numeric(id, (unsigned long)log_thread_get());
- }
-
- static void
-@@ -1078,7 +1078,7 @@ int ub_openssl_lock_init(void)
- for(i=0; i<CRYPTO_num_locks(); i++) {
- lock_basic_init(&ub_openssl_locks[i]);
- }
-- CRYPTO_set_id_callback(&ub_crypto_id_cb);
-+ CRYPTO_THREADID_set_callback(&ub_crypto_id_cb);
- CRYPTO_set_locking_callback(&ub_crypto_lock_cb);
- #endif /* OPENSSL_THREADS */
- return 1;
-@@ -1090,7 +1090,7 @@ void ub_openssl_lock_delete(void)
- int i;
- if(!ub_openssl_locks)
- return;
-- CRYPTO_set_id_callback(NULL);
-+ CRYPTO_THREADID_set_callback(NULL);
- CRYPTO_set_locking_callback(NULL);
- for(i=0; i<CRYPTO_num_locks(); i++) {
- lock_basic_destroy(&ub_openssl_locks[i]);
+++ /dev/null
-Index: daemon/remote.c
-===================================================================
---- a/daemon/remote.c (revision 5105)
-+++ b/daemon/remote.c (working copy)
-@@ -1987,7 +1987,7 @@
- return NULL;
- }
- } else {
--#ifndef HAVE_SSL_SET1_HOST
-+#if ! defined(HAVE_SSL_SET1_HOST) && ! defined(HAVE_X509_VERIFY_PARAM_SET1_HOST)
- if(auth_name)
- log_err("no name verification functionality in "
- "ssl library, ignored name for %s", todo);
-Index: iterator/iter_fwd.c
-===================================================================
---- a/iterator/iter_fwd.c (revision 5105)
-+++ b/iterator/iter_fwd.c (working copy)
-@@ -239,7 +239,7 @@
- s->name, p->str);
- return 0;
- }
--#ifndef HAVE_SSL_SET1_HOST
-+#if ! defined(HAVE_SSL_SET1_HOST) && ! defined(HAVE_X509_VERIFY_PARAM_SET1_HOST)
- if(tls_auth_name)
- log_err("no name verification functionality in "
- "ssl library, ignored name for %s", p->str);
-Index: iterator/iter_hints.c
-===================================================================
---- a/iterator/iter_hints.c (revision 5105)
-+++ b/iterator/iter_hints.c (working copy)
-@@ -252,7 +252,7 @@
- s->name, p->str);
- return 0;
- }
--#ifndef HAVE_SSL_SET1_HOST
-+#if ! defined(HAVE_SSL_SET1_HOST) && ! defined(HAVE_X509_VERIFY_PARAM_SET1_HOST)
- if(auth_name)
- log_err("no name verification functionality in "
- "ssl library, ignored name for %s", p->str);
--- /dev/null
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=bigclown-control-tool
+PKG_VERSION:=0.2.0
+PKG_RELEASE:=1
+
+PKG_SOURCE_URL:=https://codeload.github.com/bigclownlabs/bch-control-tool/tar.gz/v$(PKG_VERSION)?
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_HASH:=c79a76e0940958e4ddcf51e57fadfb127f568b6c1ceb02033c3630bab2dee612
+PKG_LICENSE:=MIT
+PKG_MAINTAINER:=Karel Kočí <cynerd@email.cz>
+PKG_BUILD_DIR:=$(BUILD_DIR)/bch-control-tool-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../../../lang/python/python3-package.mk
+
+define Package/$(PKG_NAME)
+ SECTION:=utils
+ CATEGORY:=Utilities
+ SUBMENU:=BigClown
+ URL:=https://github.com/bigclownlabs/bch-control-tool
+ TITLE:=BigCLown control tool
+ DEPENDS:=+python3-click-log +python3-paho-mqtt +python3-pyserial +python3-yaml +python3-simplejson
+endef
+
+define Build/Compile
+ sed -i 's/@@VERSION@@/$(PKG_VERSION)/' "$(PKG_BUILD_DIR)/setup.py"
+ $(call Py3Build/Compile/Default)
+endef
+
+$(eval $(call Py3Package,$(PKG_NAME)))
+$(eval $(call BuildPackage,$(PKG_NAME)))
--- /dev/null
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=bigclown-gateway
+PKG_VERSION:=1.16.2
+PKG_RELEASE:=1
+
+PKG_SOURCE_URL:=https://codeload.github.com/bigclownlabs/bch-gateway/tar.gz/v$(PKG_VERSION)?
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_HASH:=9d3208bf4cffec507d992485104fcbba2b9bc02cf7b290dfe13f98e5916ee1ca
+PKG_LICENSE:=MIT
+PKG_MAINTAINER:=Karel Kočí <cynerd@email.cz>
+PKG_BUILD_DIR:=$(BUILD_DIR)/bch-gateway-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../../../lang/python/python3-package.mk
+
+define Package/$(PKG_NAME)
+ SECTION:=utils
+ CATEGORY:=Utilities
+ SUBMENU:=BigClown
+ URL:=https://github.com/bigclownlabs/bch-gateway
+ TITLE:=BigCLown gateway
+ DEPENDS:= \
+ +kmod-usb-serial-ftdi \
+ +kmod-usb-acm \
+ +python3-click-log \
+ +python3-paho-mqtt \
+ +python3-pyserial \
+ +python3-yaml \
+ +python3-simplejson \
+ +python3-schema \
+ +python3-appdirs
+endef
+
+define Py3Package/$(PKG_NAME)/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
+
+ $(INSTALL_DIR) $(1)/etc/config
+ $(INSTALL_CONF) ./files/config $(1)/etc/config/bigclown-gateway
+ $(INSTALL_DIR) $(1)/etc/init.d
+ $(INSTALL_BIN) ./files/init $(1)/etc/init.d/bigclown-gateway
+endef
+
+define Package/$(PKG_NAME)/conffiles
+/etc/config/bigclown-gateway
+endef
+
+define Build/Compile
+ sed -i 's/@@VERSION@@/$(PKG_VERSION)/' "$(PKG_BUILD_DIR)/setup.py"
+ $(call Py3Build/Compile/Default)
+endef
+
+$(eval $(call Py3Package,$(PKG_NAME)))
+$(eval $(call BuildPackage,$(PKG_NAME)))
--- /dev/null
+
+config gateway 'gateway'
+ option enabled '0'
+ option name 'usb-dongle'
+ option device '/dev/ttyUSB0'
+ option automatic_rename_kit_nodes '1'
+
+config mqtt 'mqtt'
+ option host 'localhost'
+ option port '1883'
--- /dev/null
+#!/bin/sh /etc/rc.common
+
+START=98
+STOP=1
+
+USE_PROCD=1
+
+PROG=/usr/bin/bcg
+CONF=/tmp/etc/bigclown-gateway.conf
+
+append() {
+ local cfg="$1"
+ local uci_name="$2"
+ local out_name="$3"
+ local default="$4"
+ config_get val $cfg $uci_name $default
+ if [ -n "$val" ]; then
+ echo "$out_name $val" >> $CONF
+ fi
+}
+
+start_service() {
+ config_load bigclown-gateway
+
+ local enabled
+ config_get_bool enabled gateway enabled "0"
+ [ "$enabled" = "1" ] || {
+ echo "Bigclown gateway service disabled"
+ exit 1
+ }
+
+ rm -rf $CONF
+ echo "Generating bigclown-gateway config file in $CONF"
+
+ append gateway name 'name:' usb-dongle
+ # TODO add hotplug script and use different default here
+ append gateway device 'device:' /dev/ttyUSB0
+ append gateway automatic_rename_kit_nodes 'automatic_rename_kit_nodes:' 1
+ append gateway base_topic_prefix 'base_topic_prefix:'
+
+ echo "mqtt:" >> $CONF
+ append mqtt host ' host:' localhost
+ append mqtt port ' port:' 1883
+ append mqtt cafile ' cafile:'
+ append mqtt certfile ' certfile:'
+ append mqtt keyfile ' keyfile:'
+
+ procd_open_instance
+ procd_set_param respawn ${respawn_threshold:-3600} ${respawn_timeout:-5} ${respawn_retry:-5}
+ procd_set_param command "$PROG" -c "$CONF"
+ procd_set_param stdout 1
+ procd_set_param stderr 1
+ procd_close_instance
+}
+
+service_triggers() {
+ procd_add_reload_trigger 'bigclown-gateway'
+}
--- /dev/null
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=bigclown-mqtt2influxdb
+PKG_VERSION:=1.1.0
+PKG_RELEASE:=1
+
+PKG_SOURCE_URL:=https://codeload.github.com/bigclownlabs/bch-mqtt2influxdb/tar.gz/v$(PKG_VERSION)?
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_HASH:=5be14132311e85215abbfd732fe6cd652522ea0a343ee8ba7abab3ec7578eb99
+PKG_LICENSE:=MIT
+PKG_MAINTAINER:=Karel Kočí <cynerd@email.cz>
+PKG_BUILD_DIR:=$(BUILD_DIR)/bch-mqtt2influxdb-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../../../lang/python/python3-package.mk
+
+define Package/$(PKG_NAME)
+ SECTION:=utils
+ CATEGORY:=Utilities
+ SUBMENU:=BigClown
+ URL:=https://github.com/bigclownlabs/bch-mqtt2influxdb
+ TITLE:=BigCLown MQTT to Influxdb bridge
+ DEPENDS:=+python3-paho-mqtt +python3-yaml +python3-influxdb +python3-jsonpath-ng +python3-schema
+endef
+
+define Py3Package/$(PKG_NAME)/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
+
+ $(INSTALL_DIR) $(1)/etc/init.d
+ $(INSTALL_BIN) ./files/init $(1)/etc/init.d/bigclown-mqtt2influxdb
+ $(INSTALL_DATA) ./files/config.yml $(1)/etc/bigclown-mqtt2influxdb.yml
+endef
+
+define Package/$(PKG_NAME)/conffiles
+/etc/bigclown-mqtt2influxdb.yml
+endef
+
+define Build/Compile
+ sed -i 's/@@VERSION@@/$(PKG_VERSION)/' "$(PKG_BUILD_DIR)/setup.py"
+ $(call Py3Build/Compile/Default)
+endef
+
+$(eval $(call Py3Package,$(PKG_NAME)))
+$(eval $(call BuildPackage,$(PKG_NAME)))
--- /dev/null
+## Example bigclown-mqtt2influxdb configuration
+
+# MQTT configuration
+mqtt:
+ #host: 127.0.0.1
+ #port: 1883
+
+# InfluxDB configuration
+influxdb:
+ #host: 127.0.0.1
+ #port: 8086
+ #database: node
+
+# This is default configuration used to mirror all values produced by default
+# BigClown modules firmware. You might want to add your topics or drop those for
+# modules you don't own.
+points:
+ - measurement: temperature
+ topic: node/+/thermometer/+/temperature
+ fields:
+ value: $.payload
+ tags:
+ id: $.topic[1]
+ channel: $.topic[3]
+
+ - measurement: relative-humidity
+ topic: node/+/hygrometer/0:4/relative-humidity
+ fields:
+ value: $.payload
+ tags:
+ id: $.topic[1]
+
+ - measurement: illuminance
+ topic: node/+/lux-meter/0:0/illuminance
+ fields:
+ value: $.payload
+ tags:
+ id: $.topic[1]
+
+ - measurement: pressure
+ topic: node/+/barometer/0:0/pressure
+ fields:
+ value: $.payload
+ tags:
+ id: $.topic[1]
+
+ - measurement: co2
+ topic: node/+/co2-meter/-/concentration
+ fields:
+ value: $.payload
+ tags:
+ id: $.topic[1]
+
+ - measurement: voltage
+ topic: node/+/battery/+/voltage
+ fields:
+ value: $.payload
+ tags:
+ id: $.topic[1]
+
+ - measurement: button
+ topic: node/+/push-button/+/event-count
+ fields:
+ value: $.payload
+ tags:
+ id: $.topic[1]
+ channel: $.topic[3]
--- /dev/null
+#!/bin/sh /etc/rc.common
+
+START=99
+STOP=1
+
+USE_PROCD=1
+
+PROG=/usr/bin/mqtt2influxdb
+CONF=/etc/bigclown-mqtt2influxdb.yml
+
+start_service() {
+ procd_open_instance
+ procd_set_param respawn 3600 5 5
+ procd_set_param command "$PROG" -c "$CONF"
+ procd_set_param stdout 1
+ procd_set_param stderr 1
+ procd_close_instance
+}
+
+stop_service() {
+ service_stop "$PROG"
+}
include $(TOPDIR)/rules.mk
PKG_NAME:=btrfs-progs
-PKG_VERSION:=4.20.1
-PKG_RELEASE:=2
+PKG_VERSION:=4.20.2
+PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-v$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@KERNEL/linux/kernel/people/kdave/btrfs-progs
-PKG_HASH:=562f5d1ff1d17867c4c2be2768c653b62f1f257c42f9bb3e1a36380c02ec4fcd
+PKG_HASH:=890f8b7e162f2bbfaa5c7b23e8b6f791fd3f325239a0510871fa4b45e4a80e7c
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-v$(PKG_VERSION)
-PKG_MAINTAINER:=Rosen Penev <rosenp@gmail.com>
+PKG_MAINTAINER:=Karel Kočí <karel.koci@nic.cz>
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING
include $(TOPDIR)/rules.mk
PKG_NAME:=fish
-PKG_VERSION:=3.0.0
-PKG_RELEASE:=3
+PKG_VERSION:=3.0.2
+PKG_RELEASE:=4
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://codeload.github.com/fish-shell/fish-shell/tar.gz/$(PKG_VERSION)?
-PKG_HASH:=a16b0ff31111167ef4f3831ef428bb236bef592b7f49a2867bf42405ee95ff33
-PKG_MAINTAINER:=Curtis Jiang <jqqqqqqqqqq@gmail.com>
+PKG_SOURCE_URL:=https://github.com/fish-shell/fish-shell/releases/download/$(PKG_VERSION)
+PKG_HASH:=14728ccc6b8e053d01526ebbd0822ca4eb0235e6487e832ec1d0d22f1395430e
+PKG_MAINTAINER:=Curtis Jiang <jqqqqqqqqqq@gmail.com>, Hao Dong <halbertdong@gmail.com>
PKG_LICENSE:=GPL-2.0
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
-PKG_BUILD_DIR:=$(BUILD_DIR)/fish-shell-$(PKG_VERSION)
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk