Browse Source

Fresh pull from upstream (stable) package feed

RISCi_ATOM 6 years ago
parent
commit
2560ad38cb
100 changed files with 4538 additions and 3189 deletions
  1. 5 5
      admin/monit/Makefile
  2. 1 1
      admin/monit/patches/001-fix-default-piddir.patch
  3. 2 2
      admin/zabbix/Makefile
  4. 11 9
      admin/zabbix/files/mac80211
  5. 65 0
      devel/automake/Makefile
  6. 0 42
      devel/lpc21isp/Makefile
  7. 42 0
      lang/lua-mosquitto/Makefile
  8. 91 0
      lang/luajit/Makefile
  9. 13 0
      lang/luajit/patches/010-lua-path.patch
  10. 7 3
      lang/python/Makefile
  11. 1 1
      lang/python/files/python-version.mk
  12. 1 6
      lang/python/patches/001-enable-zlib.patch
  13. 1 3
      lang/python/patches/002-do-not-add-include-dirs-when-cross-compiling.patch
  14. 2 4
      lang/python/patches/003-do-not-compile-tests-at-build.patch
  15. 2 4
      lang/python/patches/004-do-not-write-bytes-codes.patch
  16. 61 0
      lang/python/patches/005-fix-bluetooth-support.patch
  17. 0 14
      lang/python/patches/006-remove-debian-multiarch-support.patch
  18. 16 0
      lang/python/patches/006-remove-multi-arch-and-local-paths.patch
  19. 2 6
      lang/python/patches/008-distutils-use-python-sysroot.patch
  20. 3 5
      lang/python/patches/009-do-not-use-dblib_dir-when-cross-compiling.patch
  21. 1 3
      lang/python/patches/010-do-not-add-rt-lib-dirs-when-cross-compiling.patch
  22. 0 2
      lang/python/patches/011-remove-setupterm-definition.patch
  23. 3 3
      lang/ruby/Makefile
  24. 2 2
      libs/alsa-lib/Makefile
  25. 32 0
      libs/alsa-lib/patches/006-properly-define-S_IRUSR.patch
  26. 3 3
      libs/gnutls/Makefile
  27. 1 1
      libs/icu/Makefile
  28. 10 0
      libs/icu/patches/CVE-2017-14952.patch
  29. 106 0
      libs/icu/patches/CVE-2017-15422.patch
  30. 51 0
      libs/libevhtp/Makefile
  31. 49 0
      libs/libevhtp/patches/010-strcmp-endianness-fix.patch
  32. 51 0
      libs/libmraa/Makefile
  33. 118 0
      libs/libmraa/patches/0001-base.patch
  34. 483 0
      libs/libmraa/patches/0002-add-mips-support.patch
  35. 26 0
      libs/libmraa/patches/0003-uart.patch
  36. 666 0
      libs/libmraa/patches/0004-fixes.patch
  37. 0 10
      libs/libradcli/Config.in
  38. 0 75
      libs/libradcli/Makefile
  39. 6 5
      libs/libssh2/Makefile
  40. 2 2
      libs/libtasn1/Makefile
  41. 53 0
      libs/libtins/Makefile
  42. 112 0
      libs/libwebsockets/Makefile
  43. 3 2
      libs/libxslt/Makefile
  44. 48 0
      libs/libxslt/patches/0005-Fix-a-couple-of-places-where-f-printf-parameters-wer.patch
  45. 56 0
      libs/libxslt/patches/0006-Initialize-pseudo-random-number-generator-with-curre.patch
  46. 38 0
      libs/libxslt/patches/0007-EXSLT-function-str-replace-is-broken-as-is.patch
  47. 43 0
      libs/libxslt/patches/0008-Fix-quoting-of-xlocale-test-program-in-configure.in.patch
  48. 29 0
      libs/libxslt/patches/0009-Fix-for-type-confusion-in-preprocessing-attributes.patch
  49. 62 0
      libs/libxslt/patches/0010-Always-initialize-EXSLT-month-and-day-to-1.patch
  50. 105 0
      libs/libxslt/patches/0011-Fix-use-after-free-in-xsltDocumentFunctionLoadDocume.patch
  51. 171 0
      libs/libxslt/patches/0012-Fix-xsltNumberFormatGetMultipleLevel.patch
  52. 26 0
      libs/libxslt/patches/0013-Round-xsl-number-values-to-nearest-integer.patch
  53. 51 0
      libs/libxslt/patches/0014-Handle-negative-xsl-number-values.patch
  54. 75 0
      libs/libxslt/patches/0015-Lower-bound-for-format-token-a.patch
  55. 64 0
      libs/libxslt/patches/0016-Lower-and-upper-bound-for-format-token-i.patch
  56. 62 0
      libs/libxslt/patches/0017-Fix-double-free-in-libexslt-hash-functions.patch
  57. 33 0
      libs/libxslt/patches/0018-Fix-buffer-overflow-in-exsltDateFormat.patch
  58. 36 0
      libs/libxslt/patches/0019-Fix-OOB-heap-read-in-xsltExtModuleRegisterDynamic.patch
  59. 31 0
      libs/libxslt/patches/0020-Fix-heap-overread-in-xsltFormatNumberConversion.patch
  60. 74 0
      libs/libxslt/patches/0021-Check-for-integer-overflow-in-xsltAddTextString.patch
  61. 73 0
      libs/loudmouth/Makefile
  62. 2 2
      libs/openldap/Makefile
  63. 3 2
      libs/p11-kit/Makefile
  64. 3 2
      libs/pcre/Makefile
  65. 0 53
      libs/pcre/patches/001-CVE-2017-7186
  66. 2 2
      libs/postgresql/Makefile
  67. 7 4
      libs/sqlite3/Makefile
  68. 0 109
      libs/tiff/Makefile
  69. 0 33
      libs/tiff/patches/001-autoconf-compat.patch
  70. 0 136
      libs/tiff/patches/002-CVE-2015-8665_and_CVE-2015-8683.patch
  71. 0 193
      libs/tiff/patches/003-fix_potential_out-of-bound_writes_in_decode_functions.patch
  72. 0 72
      libs/tiff/patches/004-fix_potential_out-of-bound_write_in_NeXTDecode.patch
  73. 0 11
      libs/tiff/patches/005-fix-ftell-macro.patch
  74. 59 0
      mail/nail/Makefile
  75. 22 0
      mail/nail/patches/100-handle-openssl-without-sslv2-sslv3.patch
  76. 0 473
      multimedia/ffmpeg/Config.in
  77. 0 645
      multimedia/ffmpeg/Makefile
  78. 0 277
      multimedia/gst1-plugins-bad/Makefile
  79. 0 26
      multimedia/gst1-plugins-bad/patches/001-no-translations.patch
  80. 0 57
      multimedia/gst1-plugins-bad/patches/002-no-tests.patch
  81. 237 0
      multimedia/gst1-plugins-good/Makefile
  82. 20 0
      multimedia/gst1-plugins-good/patches/001-no-translations.patch
  83. 34 0
      multimedia/gst1-plugins-good/patches/002-no-tests.patch
  84. 22 0
      multimedia/gst1-plugins-good/patches/003-no-docs.patch
  85. 0 177
      multimedia/gst1-plugins-ugly/Makefile
  86. 0 23
      multimedia/gst1-plugins-ugly/patches/001-no-translations.patch
  87. 0 23
      multimedia/gst1-plugins-ugly/patches/002-no-tests.patch
  88. 0 23
      multimedia/gst1-plugins-ugly/patches/003-no-docs.patch
  89. 0 85
      multimedia/minidlna/Makefile
  90. 0 17
      multimedia/minidlna/files/minidlna.config
  91. 0 97
      multimedia/minidlna/files/minidlna.init
  92. 0 19
      multimedia/minidlna/patches/010-libav-fix.patch
  93. 5 4
      net/acme/Makefile
  94. 4 0
      net/acme/files/run.sh
  95. 6 4
      net/adblock/Makefile
  96. 146 102
      net/adblock/files/README.md
  97. 77 66
      net/adblock/files/adblock.conf
  98. 42 14
      net/adblock/files/adblock.init
  99. 56 0
      net/adblock/files/adblock.notify
  100. 610 225
      net/adblock/files/adblock.sh

+ 5 - 5
admin/monit/Makefile

@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=monit
-PKG_VERSION:=5.18
+PKG_VERSION:=5.24.0
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://mmonit.com/monit/dist
-PKG_MD5SUM:=a1bfac0fbb83439435f8616200d2364d
+PKG_HASH:=754d1f0e165e5a26d4639a6a83f44ccf839e381f2622e0946d5302fa1f2d2414
+PKG_SOURCE_URL:=https://mmonit.com/monit/dist
 
 PKG_LICENSE:=AGPL-3.0
 PKG_LICENSE_FILES:=COPYING
@@ -26,9 +26,9 @@ include $(INCLUDE_DIR)/package.mk
 define Package/monit/Default
   SECTION:=admin
   CATEGORY:=Administration
-  DEPENDS:= +libpthread
+  DEPENDS:= +libpthread +zlib
   TITLE:=System services monitoring utility
-  URL:=http://mmonit.com/monit/
+  URL:=https://mmonit.com/monit/
   MAINTAINER:=Etienne CHAMPETIER <champetier.etienne@gmail.com>
 endef
 

+ 1 - 1
admin/monit/patches/001-fix-default-piddir.patch

@@ -1,6 +1,6 @@
 --- a/configure
 +++ b/configure
-@@ -13849,14 +13849,7 @@ fi
+@@ -13852,14 +13852,7 @@ fi
  # Find the right directory to put the root-mode PID file in
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking pid file location" >&5
  $as_echo_n "checking pid file location... " >&6; }

+ 2 - 2
admin/zabbix/Makefile

@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=zabbix
-PKG_VERSION:=3.0.3
+PKG_VERSION:=3.2.6
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_HASH:=98f025b39515b196552b8a23e2fe20a8180b5e99e613ce7378725a46ed8b62d6
 PKG_SOURCE_URL:=@SF/zabbix
-PKG_MD5SUM:=7c45d37000e67d75042695344c9937e0
 
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYING

+ 11 - 9
admin/zabbix/files/mac80211

@@ -15,13 +15,15 @@ UserParameter=mac80211.ACKFailureCount[*],zabbix_helper_mac80211 $1 dot11ACKFail
 UserParameter=mac80211.FCSErrorCount[*],zabbix_helper_mac80211 $1 dot11FCSErrorCount
 UserParameter=mac80211.RTSFailureCount[*],zabbix_helper_mac80211 $1 dot11RTSFailureCount
 UserParameter=mac80211.RTSSuccessCount[*],zabbix_helper_mac80211 $1 dot11RTSSuccessCount
-UserParameter=mac80211.FailedCount[*],zabbix_helper_mac80211 $1 failed_count
-UserParameter=mac80211.FrameDuplicateCount[*],zabbix_helper_mac80211 $1 frame_duplicate_count
-UserParameter=mac80211.MulticastReceivedFrameCount[*],zabbix_helper_mac80211 $1 multicast_received_frame_count
-UserParameter=mac80211.MulticastTransmittedFrameCount[*],zabbix_helper_mac80211 $1 multicast_transmitted_frame_count
-UserParameter=mac80211.MultipleRetryCount[*],zabbix_helper_mac80211 $1 multiple_retry_count
-UserParameter=mac80211.ReceivedFragmentCount[*],zabbix_helper_mac80211 $1 received_fragment_count
-UserParameter=mac80211.RetryCount[*],zabbix_helper_mac80211 $1 retry_count
-UserParameter=mac80211.TransmittedFragmentCount[*],zabbix_helper_mac80211 $1 transmitted_fragment_count
-UserParameter=mac80211.TransmittedFrameCount[*],zabbix_helper_mac80211 $1 transmitted_frame_count
+
+# hidden behind MAC80211_DEBUG_COUNTERS
+UserParameter=mac80211.FailedCount[*],zabbix_helper_mac80211 $1 dot11FailedCount
+UserParameter=mac80211.FrameDuplicateCount[*],zabbix_helper_mac80211 $1 dot11FrameDuplicateCount
+UserParameter=mac80211.MulticastReceivedFrameCount[*],zabbix_helper_mac80211 $1 dot11MulticastReceivedFrameCount
+UserParameter=mac80211.MulticastTransmittedFrameCount[*],zabbix_helper_mac80211 $1 dot11MulticastTransmittedFrameCount
+UserParameter=mac80211.MultipleRetryCount[*],zabbix_helper_mac80211 $1 dot11MultipleRetryCount
+UserParameter=mac80211.ReceivedFragmentCount[*],zabbix_helper_mac80211 $1 dot11ReceivedFragmentCount
+UserParameter=mac80211.RetryCount[*],zabbix_helper_mac80211 $1 dot11RetryCount
+UserParameter=mac80211.TransmittedFragmentCount[*],zabbix_helper_mac80211 $1 dot11TransmittedFragmentCount
+UserParameter=mac80211.TransmittedFrameCount[*],zabbix_helper_mac80211 $1 dot11TransmittedFrameCount
 

+ 65 - 0
devel/automake/Makefile

@@ -0,0 +1,65 @@
+#
+# Copyright (C) 2015-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:=automake
+PKG_VERSION:=1.15
+PKG_RELEASE:=4
+
+PKG_SOURCE_URL:=@GNU/automake
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MD5SUM:=9a1ddb0e053474d9d1105cfe39b0c48d
+PKG_MAINTAINER:=Heinrich Schuchardt <xypron.glpk@gmx.de>
+PKG_LICENSE:=GPL-3.0+
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/automake
+  SECTION:=devel
+  CATEGORY:=Development
+  TITLE:=automake
+  URL:=https://www.gnu.org/software/automake/
+  DEPENDS:=+autoconf +perlbase-thread +perlbase-attributes
+endef
+
+define Package/automake/description
+  Automake is a tool for automatically generating Makefile.in files compliant
+  with the GNU Coding Standards.
+endef
+
+FIX_PATHS = $(SED) '1c \#!/usr/bin/perl' -e 's| /[^ ]*/bin/perl| /usr/bin/perl|g'
+
+define Package/automake/install
+	$(INSTALL_DIR) $(1)/usr/bin
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/automake-$(PKG_VERSION) \
+	  $(1)/usr/bin/automake-$(PKG_VERSION)
+	$(LN) automake-$(PKG_VERSION) $(1)/usr/bin/automake
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/aclocal-$(PKG_VERSION) \
+	  $(1)/usr/bin/aclocal-$(PKG_VERSION)
+	$(LN) aclocal-$(PKG_VERSION) $(1)/usr/bin/aclocal
+	$(FIX_PATHS) $(1)/usr/bin/automake-$(PKG_VERSION)
+	$(FIX_PATHS) $(1)/usr/bin/aclocal-$(PKG_VERSION)
+	$(INSTALL_DIR) $(1)/usr/share/automake-$(PKG_VERSION)
+
+	for dir in \
+	  automake-$(PKG_VERSION) automake-$(PKG_VERSION)/Automake \
+	  automake-$(PKG_VERSION)/am aclocal \
+	  aclocal-$(PKG_VERSION) aclocal-$(PKG_VERSION)/internal \
+	; do \
+		$(INSTALL_DIR) $(1)/usr/share/$$$$dir; \
+		for file in $$$$(cd $(PKG_INSTALL_DIR) && \
+		  find usr/share/$$$$dir -maxdepth 1 -type f); do \
+			$(INSTALL_DATA) $$(PKG_INSTALL_DIR)/$$$$file \
+			$(1)/$$$$file; \
+		done; \
+	done
+endef
+
+$(eval $(call BuildPackage,automake))

+ 0 - 42
devel/lpc21isp/Makefile

@@ -1,42 +0,0 @@
-#
-# Copyright (C) 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:=lpc21isp
-PKG_VERSION:=197
-PKG_RELEASE:=1
-PKG_LICENSE:=LGPL-3.0+
-PKG_LICENSE_FILES:=README gpl.txt lgpl-3.0.txt
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/lpc21isp_$(PKG_VERSION)
-PKG_SOURCE:=lpc21isp_$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=@SF/lpc21isp
-PKG_MD5SUM:=0b286859a05a725647ecb1b3fe9ba606
-PKG_CAT:=zcat
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/lpc21isp
-  SECTION:=base
-  CATEGORY:=Development
-  TITLE:=Command line ISP for NXP LPC family and ADUC70xx
-  URL:=http://lpc21isp.sourceforge.net/
-  MAINTAINER:=Emil 'Skeen' Madsen <sovende@gmail.com>
-endef
-
-define Package/lpc21isp/description
- Portable command line ISP (In-circuit Programmer) for NXP LPC family
- and Analog Devices ADUC70xx.
-endef
-
-define Package/lpc21isp/install
-		$(INSTALL_DIR) $(1)/usr/sbin
-		$(INSTALL_BIN) $(PKG_BUILD_DIR)/lpc21isp $(1)/usr/sbin/
-endef
-
-$(eval $(call BuildPackage,lpc21isp))

+ 42 - 0
lang/lua-mosquitto/Makefile

@@ -0,0 +1,42 @@
+#
+# Copyright (C) 2013-2015 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:=lua-mosquitto
+PKG_VERSION:=0.2
+PKG_RELEASE:=1
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_URL:=https://github.com/flukso/lua-mosquitto.git
+PKG_SOURCE_VERSION:=v$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/$(PKG_NAME)
+    SUBMENU:=Lua
+    SECTION:=lang
+    CATEGORY:=Languages
+    TITLE:=Lua-mosquitto
+    DEPENDS:=+libmosquitto +lua
+    MAINTAINER:=Karl Palsson <karlp@remake.is>
+endef
+
+define Package/$(PKG_NAME)/description
+	Lua bindings to libmosquitto
+endef
+
+define Package/$(PKG_NAME)/install
+	$(INSTALL_DIR) $(1)/usr/lib/lua
+	$(INSTALL_BIN) $(PKG_BUILD_DIR)/mosquitto.so $(1)/usr/lib/lua
+endef
+
+$(eval $(call BuildPackage,$(PKG_NAME)))

+ 91 - 0
lang/luajit/Makefile

@@ -0,0 +1,91 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=luajit
+PKG_VERSION:=2016-06-05-8e5d7be
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Morteza Milani <milani@pichak.co>
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=COPYRIGHT
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/LuaJIT/LuaJIT.git
+PKG_SOURCE_VERSION:=8e5d7bec0d110aa4ccd7e8492f697ff2a88a55ed
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+
+PKG_USE_MIPS16:=0
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/host-build.mk
+
+define Package/luajit
+ SUBMENU:=Lua
+ SECTION:=lang
+ CATEGORY:=Languages
+ TITLE:=LuaJIT
+ URL:=http://www.luajit.org
+ DEPENDS:=@(i386||x86_64||arm||armeb||powerpc||mips||mipsel)
+endef
+
+define Package/luajit/description
+ LuaJIT is a Just-In-Time (JIT) compiler for the Lua programming language.
+endef
+
+TARGET_CFLAGS += $(FPIC) -std=gnu99
+HOST_CFLAGS += $(FPIC) -std=gnu99
+
+ifeq ($(HOST_ARCH),x86_64)
+  ifeq ($(CONFIG_x86_64),)
+    HOST_BITS := -m32
+  endif
+endif
+
+define Build/Compile
+	$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
+		HOST_CC="$(HOSTCC) $(HOST_CFLAGS) $(HOST_BITS)" \
+		CROSS="$(TARGET_CROSS)" \
+		DPREFIX=$(PKG_INSTALL_DIR)/usr \
+		PREFIX=/usr \
+		TARGET_CFLAGS="$(TARGET_CFLAGS)"
+	rm -rf $(PKG_INSTALL_DIR)
+	mkdir -p $(PKG_INSTALL_DIR)
+	$(MAKE) -C $(PKG_BUILD_DIR) \
+		DPREFIX=$(PKG_INSTALL_DIR)/usr \
+		PREFIX=/usr \
+		install
+endef
+
+define Build/InstallDev
+	$(INSTALL_DIR) $(1)/usr/include/luajit-2.1
+	$(CP) $(PKG_INSTALL_DIR)/usr/include/luajit-2.1/*.h $(1)/usr/include/luajit-2.1
+	$(INSTALL_DIR) $(1)/usr/lib
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/*.{a,so*} $(1)/usr/lib/
+	$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/luajit.pc $(1)/usr/lib/pkgconfig/
+	$(CP) $(PKG_INSTALL_DIR)/usr/bin/luajit-2.1.0-beta2 $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME)
+endef
+
+define Package/luajit/install
+	$(INSTALL_DIR) $(1)/usr/lib/
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so $(1)/usr/lib/
+	$(INSTALL_DIR) $(1)/usr/bin
+	$(CP) $(PKG_INSTALL_DIR)/usr/bin/luajit-2.1.0-beta2 $(1)/usr/bin/$(PKG_NAME)
+endef
+
+define Host/Compile
+	$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \
+		DPREFIX=$(STAGING_DIR_HOSTPKG) \
+		TARGET_CFLAGS="$(HOST_CFLAGS)" \
+		TARGET_LDFLAGS="$(HOST_LDFLAGS)"
+endef
+
+define Host/Install
+	$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \
+		DPREFIX=$(STAGING_DIR_HOSTPKG) \
+		install
+	$(CP) $(STAGING_DIR_HOSTPKG)/bin/luajit-2.1.0-beta2 $(STAGING_DIR_HOSTPKG)/bin/$(PKG_NAME)
+endef
+
+$(eval $(call HostBuild,luajit))
+$(eval $(call BuildPackage,luajit))

+ 13 - 0
lang/luajit/patches/010-lua-path.patch

@@ -0,0 +1,13 @@
+--- a/src/luaconf.h
++++ b/src/luaconf.h
+@@ -35,8 +35,8 @@
+ #ifndef LUA_LMULTILIB
+ #define LUA_LMULTILIB	"lib"
+ #endif
+-#define LUA_LROOT	"/usr/local"
+-#define LUA_LUADIR	"/lua/5.1/"
++#define LUA_LROOT	"/usr"
++#define LUA_LUADIR	"/lua/"
+ #define LUA_LJDIR	"/luajit-2.1.0-beta2/"
+
+ #ifdef LUA_ROOT

+ 7 - 3
lang/python/Makefile

@@ -12,12 +12,12 @@ include ./files/python-version.mk
 
 PKG_NAME:=python
 PKG_VERSION:=$(PYTHON_VERSION).$(PYTHON_VERSION_MICRO)
-PKG_RELEASE:=4
+PKG_RELEASE:=5
 
 PKG_SOURCE:=Python-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=https://www.python.org/ftp/python/$(PKG_VERSION)
-PKG_MD5SUM:=53b43534153bb2a0363f08bae8b9d990
-PKG_HASH:=35d543986882f78261f97787fd3e06274bfa6df29fac9b4a94f73930ff98f731
+PKG_MD5SUM:=1f6db41ad91d9eb0a6f0c769b8613c5b
+PKG_HASH:=71ffb26e09e78650e424929b2b457b9c912ac216576e6bd9e7d204ed03296a66
 
 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
@@ -242,6 +242,10 @@ HOST_CONFIGURE_ARGS+= \
 	--with-system-ffi=no \
 	CONFIG_SITE=
 
+define Host/Compile
+	$(call Host/Compile/Default,python Parser/pgen sharedmods)
+endef
+
 define Host/Install
 	$(MAKE) -C $(HOST_BUILD_DIR) install
 	$(INSTALL_DIR) $(HOST_PYTHON_DIR)/bin/

+ 1 - 1
lang/python/files/python-version.mk

@@ -6,5 +6,5 @@
 #
 
 PYTHON_VERSION:=2.7
-PYTHON_VERSION_MICRO:=13
+PYTHON_VERSION_MICRO:=14
 

+ 1 - 6
lang/python/patches/001-enable-zlib.patch

@@ -7,11 +7,9 @@ Subject: [PATCH] enable zlib
  Modules/Setup.dist | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
-diff --git a/Modules/Setup.dist b/Modules/Setup.dist
-index 01fb85f..01ac492 100644
 --- a/Modules/Setup.dist
 +++ b/Modules/Setup.dist
-@@ -358,7 +358,7 @@ _symtable symtablemodule.c
+@@ -464,7 +464,7 @@ GLHACK=-Dclear=__GLclear
  # Andrew Kuchling's zlib module.
  # This require zlib 1.1.3 (or later).
  # See http://www.gzip.org/zlib/
@@ -20,6 +18,3 @@ index 01fb85f..01ac492 100644
  
  # Interface to the Expat XML parser
  #
--- 
-1.8.4.5
-

+ 1 - 3
lang/python/patches/002-do-not-add-include-dirs-when-cross-compiling.patch

@@ -1,8 +1,6 @@
-diff --git a/setup.py b/setup.py
-index cbdeaf3..5154412 100644
 --- a/setup.py
 +++ b/setup.py
-@@ -480,7 +480,8 @@ class PyBuildExt(build_ext):
+@@ -497,7 +497,8 @@ class PyBuildExt(build_ext):
                          add_dir_to_list(dir_list, directory)
  
          if os.path.normpath(sys.prefix) != '/usr' \

+ 2 - 4
lang/python/patches/003-do-not-compile-tests-at-build.patch

@@ -1,8 +1,6 @@
-diff --git a/Makefile.pre.in b/Makefile.pre.in
-index 7f4ec2f..e270bf2 100644
 --- a/Makefile.pre.in
 +++ b/Makefile.pre.in
-@@ -1038,6 +1038,7 @@ libinstall:	build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
+@@ -1110,6 +1110,7 @@ libinstall:	build_all $(srcdir)/Lib/$(PL
  		done; \
  	done
  	$(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
@@ -10,7 +8,7 @@ index 7f4ec2f..e270bf2 100644
  	if test -d $(DESTDIR)$(LIBDEST)/distutils/tests; then \
  		$(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
  			$(DESTDIR)$(LIBDEST)/distutils/tests ; \
-@@ -1064,6 +1065,7 @@ libinstall:	build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
+@@ -1136,6 +1137,7 @@ libinstall:	build_all $(srcdir)/Lib/$(PL
  		$(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

+ 2 - 4
lang/python/patches/004-do-not-write-bytes-codes.patch

@@ -1,8 +1,6 @@
-diff --git a/Python/pythonrun.c b/Python/pythonrun.c
-index 748a63b..cb6e291 100644
 --- a/Python/pythonrun.c
 +++ b/Python/pythonrun.c
-@@ -79,7 +79,7 @@ int Py_InteractiveFlag; /* Needed by Py_FdIsInteractive() below */
+@@ -79,7 +79,7 @@ int Py_InteractiveFlag; /* Needed by Py_
  int Py_InspectFlag; /* Needed to determine whether to exit at SystemExit */
  int Py_NoSiteFlag; /* Suppress 'import site' */
  int Py_BytesWarningFlag; /* Warn on str(bytes) and str(buffer) */
@@ -11,7 +9,7 @@ index 748a63b..cb6e291 100644
  int Py_UseClassExceptionsFlag = 1; /* Needed by bltinmodule.c: deprecated */
  int Py_FrozenFlag; /* Needed by getpath.c */
  int Py_UnicodeFlag = 0; /* Needed by compile.c */
-@@ -174,7 +174,7 @@ Py_InitializeEx(int install_sigs)
+@@ -185,7 +185,7 @@ Py_InitializeEx(int install_sigs)
      if ((p = Py_GETENV("PYTHONOPTIMIZE")) && *p != '\0')
          Py_OptimizeFlag = add_flag(Py_OptimizeFlag, p);
      if ((p = Py_GETENV("PYTHONDONTWRITEBYTECODE")) && *p != '\0')

+ 61 - 0
lang/python/patches/005-fix-bluetooth-support.patch

@@ -0,0 +1,61 @@
+diff --git a/configure b/configure
+index 4c0435e..0068a9d 100755
+--- a/configure
++++ b/configure
+@@ -7045,7 +7045,7 @@ sys/param.h sys/poll.h sys/random.h sys/select.h sys/socket.h sys/statvfs.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 \
+-bluetooth/bluetooth.h linux/tipc.h spawn.h util.h alloca.h
++linux/tipc.h spawn.h util.h alloca.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"
+@@ -7267,6 +7267,24 @@ fi
+ fi
+ 
+ 
++# bluetooth/bluetooth.h has been known to not compile with -std=c99.
++# http://permalink.gmane.org/gmane.linux.bluez.kernel/22294
++SAVE_CFLAGS=$CFLAGS
++CFLAGS="-std=c99 $CFLAGS"
++for ac_header in bluetooth/bluetooth.h
++do :
++  ac_fn_c_check_header_mongrel "$LINENO" "bluetooth/bluetooth.h" "ac_cv_header_bluetooth_bluetooth_h" "$ac_includes_default"
++if test "x$ac_cv_header_bluetooth_bluetooth_h" = xyes; then :
++  cat >>confdefs.h <<_ACEOF
++#define HAVE_BLUETOOTH_BLUETOOTH_H 1
++_ACEOF
++
++fi
++
++done
++
++CFLAGS=$SAVE_CFLAGS
++
+ # On Linux, netlink.h requires asm/types.h
+ for ac_header in linux/netlink.h
+ do :
+diff --git a/configure.ac b/configure.ac
+index 780f275..dceca1c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1702,10 +1702,17 @@ sys/param.h sys/poll.h sys/random.h sys/select.h sys/socket.h sys/statvfs.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 \
+-bluetooth/bluetooth.h linux/tipc.h spawn.h util.h alloca.h)
++linux/tipc.h spawn.h util.h alloca.h)
+ AC_HEADER_DIRENT
+ AC_HEADER_MAJOR
+ 
++# bluetooth/bluetooth.h has been known to not compile with -std=c99.
++# http://permalink.gmane.org/gmane.linux.bluez.kernel/22294
++SAVE_CFLAGS=$CFLAGS
++CFLAGS="-std=c99 $CFLAGS"
++AC_CHECK_HEADERS(bluetooth/bluetooth.h)
++CFLAGS=$SAVE_CFLAGS
++
+ # On Linux, netlink.h requires asm/types.h
+ AC_CHECK_HEADERS(linux/netlink.h,,,[
+ #ifdef HAVE_ASM_TYPES_H

+ 0 - 14
lang/python/patches/006-remove-debian-multiarch-support.patch

@@ -1,14 +0,0 @@
-diff --git a/setup.py b/setup.py
-index 1d1ae72..511aed5 100644
---- a/setup.py
-+++ b/setup.py
-@@ -444,7 +444,8 @@ class PyBuildExt(build_ext):
-             add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
-         if cross_compiling:
-             self.add_gcc_paths()
--        self.add_multiarch_paths()
-+        else:
-+            self.add_multiarch_paths()
- 
-         # Add paths specified in the environment variables LDFLAGS and
-         # CPPFLAGS for header and library files.

+ 16 - 0
lang/python/patches/006-remove-multi-arch-and-local-paths.patch

@@ -0,0 +1,16 @@
+--- a/setup.py
++++ b/setup.py
+@@ -454,13 +454,8 @@ class PyBuildExt(build_ext):
+             os.unlink(tmpfile)
+ 
+     def detect_modules(self):
+-        # Ensure that /usr/local is always used
+-        if not cross_compiling:
+-            add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
+-            add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
+         if cross_compiling:
+             self.add_gcc_paths()
+-        self.add_multiarch_paths()
+ 
+         # Add paths specified in the environment variables LDFLAGS and
+         # CPPFLAGS for header and library files.

+ 2 - 6
lang/python/patches/008-distutils-use-python-sysroot.patch

@@ -16,11 +16,9 @@ taken from the sysconfigdata module.
 
 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
 
-Index: b/Lib/distutils/sysconfig.py
-===================================================================
 --- a/Lib/distutils/sysconfig.py
 +++ b/Lib/distutils/sysconfig.py
-@@ -19,8 +19,13 @@
+@@ -19,8 +19,13 @@ import sys
  from distutils.errors import DistutilsPlatformError
  
  # These are needed in a couple of spots, so just compute them once.
@@ -36,11 +34,9 @@ Index: b/Lib/distutils/sysconfig.py
  
  # Path to the base directory of the project. On Windows the binary may
  # live in project/PCBuild9.  If we're dealing with an x64 Windows build,
-Index: b/Lib/distutils/command/build_ext.py
-===================================================================
 --- a/Lib/distutils/command/build_ext.py
 +++ b/Lib/distutils/command/build_ext.py
-@@ -237,7 +237,10 @@
+@@ -240,7 +240,10 @@ class build_ext (Command):
          if (sysconfig.get_config_var('Py_ENABLE_SHARED')):
              if not sysconfig.python_build:
                  # building third party extensions

+ 3 - 5
lang/python/patches/009-do-not-use-dblib_dir-when-cross-compiling.patch

@@ -1,8 +1,6 @@
-diff --git a/setup.py b/setup.py
-index 7868b7b..10ec68f 100644
 --- a/setup.py
 +++ b/setup.py
-@@ -1067,6 +1067,7 @@ class PyBuildExt(build_ext):
+@@ -1083,6 +1083,7 @@ class PyBuildExt(build_ext):
                          if db_setup_debug: print "db lib: ", dblib, "not found"
  
          except db_found:
@@ -10,7 +8,7 @@ index 7868b7b..10ec68f 100644
              if db_setup_debug:
                  print "bsddb using BerkeleyDB lib:", db_ver, dblib
                  print "bsddb lib dir:", dblib_dir, " inc dir:", db_incdir
-@@ -1081,7 +1082,7 @@ class PyBuildExt(build_ext):
+@@ -1097,7 +1098,7 @@ class PyBuildExt(build_ext):
              exts.append(Extension('_bsddb', ['_bsddb.c'],
                                    depends = ['bsddb.h'],
                                    library_dirs=dblib_dir,
@@ -19,7 +17,7 @@ index 7868b7b..10ec68f 100644
                                    include_dirs=db_incs,
                                    libraries=dblibs))
          else:
-@@ -1292,10 +1293,11 @@ class PyBuildExt(build_ext):
+@@ -1308,10 +1309,11 @@ class PyBuildExt(build_ext):
                              break
                  elif cand == "bdb":
                      if db_incs is not None:

+ 1 - 3
lang/python/patches/010-do-not-add-rt-lib-dirs-when-cross-compiling.patch

@@ -1,8 +1,6 @@
-diff --git a/setup.py b/setup.py
-index 7868b7b..544fa7e 100644
 --- a/setup.py
 +++ b/setup.py
-@@ -452,8 +452,9 @@ class PyBuildExt(build_ext):
+@@ -463,8 +463,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).

+ 0 - 2
lang/python/patches/011-remove-setupterm-definition.patch

@@ -1,5 +1,3 @@
-diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c
-index e478a57..eb297b4 100644
 --- a/Modules/_cursesmodule.c
 +++ b/Modules/_cursesmodule.c
 @@ -117,7 +117,6 @@ char *PyCursesVersion = "2.2";

+ 3 - 3
lang/ruby/Makefile

@@ -11,15 +11,15 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ruby
-PKG_VERSION:=2.4.1
+PKG_VERSION:=2.4.3
 PKG_RELEASE:=1
 
 # First two numbes
 PKG_ABI_VERSION:=$(subst $(space),.,$(wordlist 1, 2, $(subst .,$(space),$(PKG_VERSION))))
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_SOURCE_URL:=http://cache.ruby-lang.org/pub/ruby/$(PKG_ABI_VERSION)/
-PKG_HASH:=4fc8a9992de3e90191de369270ea4b6c1b171b7941743614cc50822ddc1fe654
+PKG_SOURCE_URL:=https://cache.ruby-lang.org/pub/ruby/$(PKG_ABI_VERSION)/
+PKG_HASH:=23677d40bf3b7621ba64593c978df40b1e026d8653c74a0599f0ead78ed92b51
 PKG_MAINTAINER:=Luiz Angelo Daros de Luca <luizluca@gmail.com>
 PKG_LICENSE:=BSD-2-Clause
 PKG_LICENSE_FILES:=COPYING

+ 2 - 2
libs/alsa-lib/Makefile

@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2006-2016 OpenWrt.org
+# Copyright (C) 2006-2018 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=alsa-lib
 PKG_VERSION:=1.1.0
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=ftp://ftp.alsa-project.org/pub/lib/ \

+ 32 - 0
libs/alsa-lib/patches/006-properly-define-S_IRUSR.patch

@@ -0,0 +1,32 @@
+From 3f1dba9a821b53b42001605f9a126a958804884f Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Mon, 9 Nov 2015 13:37:26 +0100
+Subject: [PATCH] topology: Add missing include sys/stat.h
+
+Necessary for proper definitions of S_IRUSR & co.  Otherwise it
+results in compile errors with old glibc:
+  parser.c: In function 'snd_tplg_build_file':
+  parser.c:262: error: 'S_IRUSR' undeclared (first use in this function)
+  parser.c:262: error: (Each undeclared identifier is reported only once
+  parser.c:262: error: for each function it appears in.)
+
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+---
+ src/topology/parser.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/topology/parser.c b/src/topology/parser.c
+index 80a0ae0..18bb9c7 100644
+--- a/src/topology/parser.c
++++ b/src/topology/parser.c
+@@ -16,6 +16,7 @@
+            Liam Girdwood <liam.r.girdwood@linux.intel.com>
+ */
+ 
++#include <sys/stat.h>
+ #include "list.h"
+ #include "tplg_local.h"
+ 
+-- 
+1.7.11.7
+

+ 3 - 3
libs/gnutls/Makefile

@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=gnutls
-PKG_VERSION:=3.5.11
+PKG_VERSION:=3.5.16
 PKG_RELEASE:=1
 PKG_USE_MIPS16:=0
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_SOURCE_URL:=ftp://ftp.gnutls.org/gcrypt/gnutls/v3.5
-PKG_HASH:=51765cc5579e250da77fbd7871507c517d01b15353cc40af7b67e9ec7b6fe28f
+PKG_SOURCE_URL:=https://www.gnupg.org/ftp/gcrypt/gnutls/v3.5
+PKG_HASH:=0924dec90c37c05f49fec966eba3672dab4d336d879e5c06e06e13325cbfec25
 #PKG_FIXUP:=autoreconf gettext-version
 PKG_MAINTAINER:=Nikos Mavrogiannopoulos <nmav@gnutls.org>
 PKG_LICENSE:=LGPLv2.1+

+ 1 - 1
libs/icu/Makefile

@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=icu4c
 PKG_VERSION:=58.2
-PKG_RELEASE:=2
+PKG_RELEASE:=4
 
 PKG_SOURCE:=$(PKG_NAME)-58_2-src.tgz
 PKG_SOURCE_URL:=http://download.icu-project.org/files/$(PKG_NAME)/$(PKG_VERSION)

+ 10 - 0
libs/icu/patches/CVE-2017-14952.patch

@@ -0,0 +1,10 @@
+Index: source/i18n/zonemeta.cpp
+===================================================================
+--- source/i18n/zonemeta.cpp	(revision 40283)
++++ source/i18n/zonemeta.cpp	(revision 40324)
+@@ -684,5 +684,4 @@
+                     if (U_FAILURE(status)) {
+                         delete mzMappings;
+-                        deleteOlsonToMetaMappingEntry(entry);
+                         uprv_free(entry);
+                         break;

+ 106 - 0
libs/icu/patches/CVE-2017-15422.patch

@@ -0,0 +1,106 @@
+Index: source/i18n/gregoimp.cpp
+===================================================================
+--- source/i18n/gregoimp.cpp	(revision 40653)
++++ source/i18n/gregoimp.cpp	(revision 40654)
+@@ -24,4 +24,9 @@
+ 
+ int32_t ClockMath::floorDivide(int32_t numerator, int32_t denominator) {
++    return (numerator >= 0) ?
++        numerator / denominator : ((numerator + 1) / denominator) - 1;
++}
++
++int64_t ClockMath::floorDivide(int64_t numerator, int64_t denominator) {
+     return (numerator >= 0) ?
+         numerator / denominator : ((numerator + 1) / denominator) - 1;
+Index: source/i18n/gregoimp.h
+===================================================================
+--- source/i18n/gregoimp.h	(revision 40653)
++++ source/i18n/gregoimp.h	(revision 40654)
+@@ -40,4 +40,15 @@
+      */
+     static int32_t floorDivide(int32_t numerator, int32_t denominator);
++
++    /**
++     * Divide two integers, returning the floor of the quotient.
++     * Unlike the built-in division, this is mathematically
++     * well-behaved.  E.g., <code>-1/4</code> => 0 but
++     * <code>floorDivide(-1,4)</code> => -1.
++     * @param numerator the numerator
++     * @param denominator a divisor which must be != 0
++     * @return the floor of the quotient
++     */
++    static int64_t floorDivide(int64_t numerator, int64_t denominator);
+ 
+     /**
+Index: source/i18n/persncal.cpp
+===================================================================
+--- source/i18n/persncal.cpp	(revision 40653)
++++ source/i18n/persncal.cpp	(revision 40654)
+@@ -214,5 +214,5 @@
+ 
+     int32_t daysSinceEpoch = julianDay - PERSIAN_EPOCH;
+-    year = 1 + ClockMath::floorDivide(33 * daysSinceEpoch + 3, 12053);
++    year = 1 + (int32_t)ClockMath::floorDivide(33 * (int64_t)daysSinceEpoch + 3, (int64_t)12053);
+ 
+     int32_t farvardin1 = 365 * (year - 1) + ClockMath::floorDivide(8 * year + 21, 33);
+Index: source/test/intltest/calregts.cpp
+===================================================================
+--- source/test/intltest/calregts.cpp	(revision 40653)
++++ source/test/intltest/calregts.cpp	(revision 40654)
+@@ -13,4 +13,5 @@
+ #include "calregts.h"
+ 
++#include "unicode/calendar.h"
+ #include "unicode/gregocal.h"
+ #include "unicode/simpletz.h"
+@@ -91,4 +92,5 @@
+         CASE(49,Test9019);
+         CASE(50,TestT9452);
++        CASE(51,TestPersianCalOverflow);
+     default: name = ""; break;
+     }
+@@ -2946,4 +2948,34 @@
+     }
+ }
++
++/**
++ * @bug ticket 13454
++ */
++void CalendarRegressionTest::TestPersianCalOverflow(void) {
++    const char* localeID = "bs_Cyrl@calendar=persian";
++    UErrorCode status = U_ZERO_ERROR;
++    Calendar* cal = Calendar::createInstance(Locale(localeID), status);
++    if(U_FAILURE(status)) {
++        dataerrln("FAIL: Calendar::createInstance for localeID %s: %s", localeID, u_errorName(status));
++    } else {
++        int32_t maxMonth = cal->getMaximum(UCAL_MONTH);
++        int32_t maxDayOfMonth = cal->getMaximum(UCAL_DATE);
++        int32_t jd, month, dayOfMonth;
++        for (jd = 67023580; jd <= 67023584; jd++) { // year 178171, int32_t overflow if jd >= 67023582
++            status = U_ZERO_ERROR;
++            cal->clear();
++            cal->set(UCAL_JULIAN_DAY, jd);
++            month = cal->get(UCAL_MONTH, status);
++            dayOfMonth = cal->get(UCAL_DATE, status);
++            if ( U_FAILURE(status) ) {
++                errln("FAIL: Calendar->get MONTH/DATE for localeID %s, julianDay %d, status %s\n", localeID, jd, u_errorName(status)); 
++            } else if (month > maxMonth || dayOfMonth > maxDayOfMonth) {
++                errln("FAIL: localeID %s, julianDay %d; maxMonth %d, got month %d; maxDayOfMonth %d, got dayOfMonth %d\n",
++                        localeID, jd, maxMonth, month, maxDayOfMonth, dayOfMonth); 
++            }
++        }
++        delete cal;
++    }
++}
+ 
+ #endif /* #if !UCONFIG_NO_FORMATTING */
+Index: source/test/intltest/calregts.h
+===================================================================
+--- source/test/intltest/calregts.h	(revision 40653)
++++ source/test/intltest/calregts.h	(revision 40654)
+@@ -78,4 +78,5 @@
+     void Test9019(void);
+     void TestT9452(void);
++    void TestPersianCalOverflow(void);
+ 
+     void printdate(GregorianCalendar *cal, const char *string);

+ 51 - 0
libs/libevhtp/Makefile

@@ -0,0 +1,51 @@
+#
+# Copyright (C) 2007-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+# NOTE: please DO NOT update this package without the maintainer's consent.
+# See https://github.com/haiwen/seafile/issues/1119
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libevhtp
+PKG_VERSION:=1.1.6
+PKG_RELEASE:=1
+PKG_LICENSE:=BSD-3-Clause
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/ellzey/libevhtp.git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=91071e2f20749cd469b87ac2ef1c158dc2a6806f
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libevhtp
+    SECTION:=libs
+    CATEGORY:=Libraries
+    TITLE:=A more flexible replacement for libevent's httpd API
+    MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+    URL:=https://github.com/ellzey/libevhtp
+    DEPENDS:=+libevent2 +libevent2-openssl +libevent2-pthreads +libopenssl +libpthread
+endef
+
+define Package/libevhtp/description
+   Libevhtp was created as a replacement API for Libevent's current HTTP API.
+   The reality of libevent's http interface is that it was created as a JIT server,
+   meaning the developer never thought of it being used for creating a full-fledged HTTP service.
+endef
+
+include $(INCLUDE_DIR)/cmake.mk
+
+define Build/InstallDev
+	$(INSTALL_DIR) $(1)/usr/{include,lib}
+	$(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libevhtp))

+ 49 - 0
libs/libevhtp/patches/010-strcmp-endianness-fix.patch

@@ -0,0 +1,49 @@
+diff -rupN libevhtp-1.2.9.orig/htparse/htparse.c libevhtp-1.2.9/htparse/htparse.c
+--- libevhtp-1.2.9.orig/htparse/htparse.c	2014-03-23 12:50:50.000000000 +0100
++++ libevhtp-1.2.9/htparse/htparse.c	2014-12-09 01:12:22.242001241 +0100
+@@ -197,6 +197,7 @@ static const char * method_strmap[] = {
+ 
+ #define _MIN_READ(a, b) ((a) < (b) ? (a) : (b))
+ 
++#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ #define _str3_cmp(m, c0, c1, c2, c3) \
+     *(uint32_t *)m == ((c3 << 24) | (c2 << 16) | (c1 << 8) | c0)
+ 
+@@ -226,6 +227,37 @@ static const char * method_strmap[] = {
+     *(uint32_t *)m == ((c3 << 24) | (c2 << 16) | (c1 << 8) | c0)        \
+     && ((uint32_t *)m)[1] == ((c7 << 24) | (c6 << 16) | (c5 << 8) | c4) \
+     && m[8] == c8
++#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
++#define _str3_cmp(m, c0, c1, c2, c3) \
++    *(uint32_t *)m == ((c0 << 24) | (c1 << 16) | (c2 << 8) | c3)
++
++#define _str3Ocmp(m, c0, c1, c2, c3) \
++    *(uint32_t *)m == ((c0 << 24) | (c1 << 16) | (c2 << 8) | c3)
++
++#define _str4cmp(m, c0, c1, c2, c3) \
++    *(uint32_t *)m == ((c0 << 24) | (c1 << 16) | (c2 << 8) | c3)
++
++#define _str5cmp(m, c0, c1, c2, c3, c4)                          \
++    *(uint32_t *)m == ((c0 << 24) | (c1 << 16) | (c2 << 8) | c3) \
++    && m[4] == c4
++
++#define _str6cmp(m, c0, c1, c2, c3, c4, c5)                      \
++    *(uint32_t *)m == ((c0 << 24) | (c1 << 16) | (c2 << 8) | c3) \
++    && (((uint32_t *)m)[1] & 0xffff0000) == ((c4 << 24) | c5 << 16)
++
++#define _str7_cmp(m, c0, c1, c2, c3, c4, c5, c6, c7)             \
++    *(uint32_t *)m == ((c0 << 24) | (c1 << 16) | (c2 << 8) | c3) \
++    && ((uint32_t *)m)[1] == ((c4 << 24) | (c5 << 16) | (c6 << 8) | c7)
++
++#define _str8cmp(m, c0, c1, c2, c3, c4, c5, c6, c7)              \
++    *(uint32_t *)m == ((c0 << 24) | (c1 << 16) | (c2 << 8) | c3) \
++    && ((uint32_t *)m)[1] == ((c4 << 24) | (c5 << 16) | (c6 << 8) | c7)
++
++#define _str9cmp(m, c0, c1, c2, c3, c4, c5, c6, c7, c8)                 \
++    *(uint32_t *)m == ((c0 << 24) | (c1 << 16) | (c2 << 8) | c3)        \
++    && ((uint32_t *)m)[1] == ((c4 << 24) | (c5 << 16) | (c6 << 8) | c7) \
++    && m[8] == c8
++#endif
+ 
+ #define __HTPARSE_GENHOOK(__n)                                                    \
+     static inline int hook_ ## __n ## _run(htparser * p, htparse_hooks * hooks) { \

+ 51 - 0
libs/libmraa/Makefile

@@ -0,0 +1,51 @@
+#
+# Copyright (C) 2015 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:=libmraa
+PKG_VERSION:=0.8.0
+
+PKG_RELEASE=$(PKG_SOURCE_VERSION)
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/intel-iot-devkit/mraa.git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=70600dece4138b0c0dbaff42f57828f1559cd840
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_BUILD_DEPENDS:=node python/host swig/host node/host
+CMAKE_INSTALL:=1
+
+PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
+PKG_LICENSE:=LGPL-2.1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+CMAKE_OPTIONS=-DBUILDARCH=$(CONFIG_ARCH) \
+	-DENABLEEXAMPLES=0 \
+	-DNODE_EXECUTABLE=$(STAGING_DIR_HOSTPKG)/bin/node \
+	-DSWIG_DIR=$(STAGING_DIR_HOSTPKG)/bin
+
+TARGET_CFLAGS+=-I$(STAGING_DIR)/usr/include/node
+
+define Package/libmraa
+  SECTION:=libs
+  CATEGORY:=Libraries
+  DEPENDS:=+python +libstdcpp
+  TITLE:=Intel IoT lowlevel IO library
+endef
+
+define Package/libmraa/install
+	$(INSTALL_DIR) $(1)/usr/lib/{node/mraa,python2.7/site-packages} $(1)/usr/bin
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libmraa.so* $(1)/usr/lib/
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/node_modules/mraa/* $(1)/usr/lib/node/mraa/
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/python2.7/site-packages/* $(1)/usr/lib/python2.7/site-packages/
+#	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/mraa/examples/python/blink-io8.py $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,libmraa))

+ 118 - 0
libs/libmraa/patches/0001-base.patch

@@ -0,0 +1,118 @@
+From 6fecad819376442d057bdd35a0909cfac9df02f5 Mon Sep 17 00:00:00 2001
+From: John Crispin <blogic@openwrt.org>
+Date: Thu, 23 Jul 2015 12:18:39 +0200
+Subject: [PATCH 1/4] base
+
+---
+ CMakeLists.txt          |   10 ++++------
+ api/mraa/types.h        |    1 +
+ include/mraa_internal.h |    7 +++++++
+ src/CMakeLists.txt      |    5 +++++
+ src/i2c/i2c.c           |    2 +-
+ src/mraa.c              |    3 +++
+ src/uart/uart.c         |    1 +
+ 7 files changed, 22 insertions(+), 7 deletions(-)
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -14,12 +14,7 @@
+ set (CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})
+ 
+ # Make a version file containing the current version from git.
+-include (GetGitRevisionDescription)
+-git_describe (VERSION "--tags")
+-if ("x_${VERSION}" STREQUAL "x_GIT-NOTFOUND" OR "x_${VERSION}" STREQUAL "x_HEAD-HASH-NOTFOUND")
+-  message (WARNING " - Install git to compile a production libmraa!")
+-  set (VERSION "v0.8.0-dirty")
+-endif ()
++set (VERSION "v0.8.0")
+ 
+ message (INFO " - libmraa Version ${VERSION}")
+ 
+@@ -84,8 +79,10 @@
+   set (X86PLAT ON)
+ elseif (DETECTED_ARCH MATCHES "arm.*")
+   set (ARMPLAT ON)
++elseif (DETECTED_ARCH MATCHES "mips")
++  set (MIPSPLAT ON)
+ else ()
+-  message(FATAL_ERROR "Only x86 and arm platforms currently supported")
++  message(FATAL_ERROR "Only x86, arm and mips platforms currently supported")
+ endif()
+ 
+ if (BUILDSWIGPYTHON)
+--- a/api/mraa/types.h
++++ b/api/mraa/types.h
+@@ -46,6 +46,7 @@
+     MRAA_BEAGLEBONE = 6,            /**< The different BeagleBone Black Modes B/C */
+     MRAA_BANANA = 7,                /**< Allwinner A20 based Banana Pi and Banana Pro */
+     MRAA_INTEL_NUC5 = 8,            /**< The Intel 5th generations Broadwell NUCs */
++    MRAA_MTK_LINKIT = 9,            /**< Mediatek MT7688 based Linkit (Air) */
+ 
+     // USB platform extenders start at 256
+     MRAA_FTDI_FT4222 = 256,         /**< FTDI FT4222 USB to i2c bridge */
+--- a/include/mraa_internal.h
++++ b/include/mraa_internal.h
+@@ -66,6 +66,13 @@
+ mraa_platform_t mraa_usb_platform_extender(mraa_board_t* board);
+ 
+ /**
++ * runtime detect running arm platforms
++ *
++ * @return mraa_platform_t of the init'ed platform
++ */
++mraa_platform_t mraa_mips_platform();
++
++/**
+  * helper function to check if file exists
+  *
+  * @param filename to check
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -71,6 +71,11 @@
+   add_subdirectory(usb)
+ endif ()
+ 
++if (MIPSPLAT)
++  add_subdirectory(mips)
++  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMIPSPLAT=1")
++endif()
++
+ set (mraa_LIB_SRCS
+   ${mraa_LIB_PLAT_SRCS_NOAUTO}
+ # autogenerated version file
+--- a/src/i2c/i2c.c
++++ b/src/i2c/i2c.c
+@@ -31,9 +31,9 @@
+ #include <stdlib.h>
+ #include <unistd.h>
+ #include <fcntl.h>
++#include <errno.h>
+ #include <inttypes.h>
+ #include <sys/types.h>
+-#include <sys/errno.h>
+ #include <sys/ioctl.h>
+ #include "linux/i2c-dev.h"
+ 
+--- a/src/mraa.c
++++ b/src/mraa.c
+@@ -111,6 +111,9 @@
+ #elif defined(ARMPLAT)
+     // Use runtime ARM platform detection
+     platform_type = mraa_arm_platform();
++#elif MIPSPLAT
++    // Use runtime ARM platform detection
++    platform_type = mraa_mips_platform();
+ #else
+ #error mraa_ARCH NOTHING
+ #endif
+--- a/src/uart/uart.c
++++ b/src/uart/uart.c
+@@ -26,6 +26,7 @@
+ 
+ #include <stdlib.h>
+ #include <sys/stat.h>
++#include <sys/time.h>
+ #include <unistd.h>
+ #include <string.h>
+ #include <termios.h>

+ 483 - 0
libs/libmraa/patches/0002-add-mips-support.patch

@@ -0,0 +1,483 @@
+From 2c67c6f51ce5bab18c79f4304ccf42716f59f13c Mon Sep 17 00:00:00 2001
+From: John Crispin <blogic@openwrt.org>
+Date: Thu, 23 Jul 2015 13:21:25 +0200
+Subject: [PATCH 2/4] add mips support
+
+Signed-off-by: John Crispin <blogic@openwrt.org>
+---
+ include/mips/mediatek.h |   39 ++++++
+ src/mips/CMakeLists.txt |    6 +
+ src/mips/mediatek.c     |  349 +++++++++++++++++++++++++++++++++++++++++++++++
+ src/mips/mips.c         |   60 ++++++++
+ 4 files changed, 454 insertions(+)
+ create mode 100644 include/mips/mediatek.h
+ create mode 100644 src/mips/CMakeLists.txt
+ create mode 100644 src/mips/mediatek.c
+ create mode 100644 src/mips/mips.c
+
+--- /dev/null
++++ b/include/mips/mediatek.h
+@@ -0,0 +1,39 @@
++/*
++ * Author: Thomas Ingleby <thomas.c.ingleby@intel.com>
++ * Author: Michael Ring <mail@michael-ring.org>
++ * Copyright (c) 2014 Intel Corporation.
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining
++ * a copy of this software and associated documentation files (the
++ * "Software"), to deal in the Software without restriction, including
++ * without limitation the rights to use, copy, modify, merge, publish,
++ * distribute, sublicense, and/or sell copies of the Software, and to
++ * permit persons to whom the Software is furnished to do so, subject to
++ * the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be
++ * included in all copies or substantial portions of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
++ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
++ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++ */
++
++#pragma once
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++#include "mraa_internal.h"
++
++mraa_board_t *
++        mraa_mtk_linkit();
++
++#ifdef __cplusplus
++}
++#endif
+--- /dev/null
++++ b/src/mips/CMakeLists.txt
+@@ -0,0 +1,6 @@
++message (INFO " - Adding MIPS platforms")
++set (mraa_LIB_PLAT_SRCS_NOAUTO ${mraa_LIB_SRCS_NOAUTO}
++  ${PROJECT_SOURCE_DIR}/src/mips/mips.c
++  ${PROJECT_SOURCE_DIR}/src/mips/mediatek.c
++  PARENT_SCOPE
++)
+--- /dev/null
++++ b/src/mips/mediatek.c
+@@ -0,0 +1,349 @@
++/*
++ * Author: Thomas Ingleby <thomas.c.ingleby@intel.com>
++ * Author: Michael Ring <mail@michael-ring.org>
++ * Copyright (c) 2014 Intel Corporation.
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining
++ * a copy of this software and associated documentation files (the
++ * "Software"), to deal in the Software without restriction, including
++ * without limitation the rights to use, copy, modify, merge, publish,
++ * distribute, sublicense, and/or sell copies of the Software, and to
++ * permit persons to whom the Software is furnished to do so, subject to
++ * the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be
++ * included in all copies or substantial portions of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
++ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
++ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++ */
++
++#include <stdio.h>
++#include <stdint.h>
++#include <stdlib.h>
++#include <string.h>
++#include <sys/mman.h>
++#include <mraa/common.h>
++
++#include "mraa_internal.h"
++
++#include "common.h"
++
++#define PLATFORM_MEDIATEK_LINKIT	1
++#define PLATFORM_MEDIATEK_LINKIT_AIR	2
++#define MMAP_PATH			"/dev/mem"
++#define MT7628_GPIO_BASE		0x100
++#define MT7628_BLOCK_SIZE		(4 * 1024)
++#define MT7628_GPIO_CTRL		0x00
++#define MT7628_GPIO_DATA		0x20
++#define MT7628_GPIO_SET			0x30
++#define MT7628_GPIO_CLEAR		0x40
++
++#define MAX_SIZE 64
++
++// MMAP
++static uint8_t* mmap_reg = NULL;
++static int mmap_fd = 0;
++static int mmap_size;
++static unsigned int mmap_count = 0;
++static int platform_detected = 0;
++
++mraa_result_t
++mraa_mtk_linkit_mmap_write(mraa_gpio_context dev, int value)
++{
++    volatile uint32_t* addr;
++    if (value) {
++        *(volatile uint32_t*) (mmap_reg + MT7628_GPIO_SET + (dev->pin / 32) * 4) =
++        (uint32_t)(1 << (dev->pin % 32));
++    } else {
++        *(volatile uint32_t*) (mmap_reg + MT7628_GPIO_CLEAR + (dev->pin / 32) * 4) =
++        (uint32_t)(1 << (dev->pin % 32));
++    }
++    return MRAA_SUCCESS;
++}
++
++static mraa_result_t
++mraa_mtk_linkit_mmap_unsetup()
++{
++    if (mmap_reg == NULL) {
++        syslog(LOG_ERR, "linkit mmap: null register can't unsetup");
++        return MRAA_ERROR_INVALID_RESOURCE;
++    }
++    munmap(mmap_reg, mmap_size);
++    mmap_reg = NULL;
++    if (close(mmap_fd) != 0) {
++        return MRAA_ERROR_INVALID_RESOURCE;
++    }
++    return MRAA_SUCCESS;
++}
++
++int
++mraa_mtk_linkit_mmap_read(mraa_gpio_context dev)
++{
++    uint32_t value = *(volatile uint32_t*) (mmap_reg + MT7628_GPIO_DATA + (dev->pin / 32) * 4);
++    if (value & (uint32_t)(1 << (dev->pin % 32))) {
++        return 1;
++    }
++    return 0;
++}
++
++mraa_result_t
++mraa_mtk_linkit_mmap_setup(mraa_gpio_context dev, mraa_boolean_t en)
++{
++    if (dev == NULL) {
++        syslog(LOG_ERR, "linkit mmap: context not valid");
++        return MRAA_ERROR_INVALID_HANDLE;
++    }
++
++    if (en == 0) {
++        if (dev->mmap_write == NULL && dev->mmap_read == NULL) {
++            syslog(LOG_ERR, "linkit mmap: can't disable disabled mmap gpio");
++            return MRAA_ERROR_INVALID_PARAMETER;
++        }
++        dev->mmap_write = NULL;
++        dev->mmap_read = NULL;
++        mmap_count--;
++        if (mmap_count == 0) {
++            return mraa_mtk_linkit_mmap_unsetup();
++        }
++        return MRAA_SUCCESS;
++    }
++
++    if (dev->mmap_write != NULL && dev->mmap_read != NULL) {
++        syslog(LOG_ERR, "linkit mmap: can't enable enabled mmap gpio");
++        return MRAA_ERROR_INVALID_PARAMETER;
++    }
++
++    // Might need to make some elements of this thread safe.
++    // For example only allow one thread to enter the following block
++    // to prevent mmap'ing twice.
++    if (mmap_reg == NULL) {
++        if ((mmap_fd = open(MMAP_PATH, O_RDWR)) < 0) {
++            syslog(LOG_ERR, "linkit map: unable to open resource0 file");
++            return MRAA_ERROR_INVALID_HANDLE;
++        }
++
++        mmap_reg = (uint8_t*) mmap(NULL, MT7628_BLOCK_SIZE, PROT_READ | PROT_WRITE,
++                                       MAP_FILE | MAP_SHARED, mmap_fd, MT7628_GPIO_BASE);
++        if (mmap_reg == MAP_FAILED) {
++            syslog(LOG_ERR, "linkit mmap: failed to mmap");
++            mmap_reg = NULL;
++            close(mmap_fd);
++            return MRAA_ERROR_NO_RESOURCES;
++        }
++    }
++    dev->mmap_write = &mraa_mtk_linkit_mmap_write;
++    dev->mmap_read = &mraa_mtk_linkit_mmap_read;
++    mmap_count++;
++
++    return MRAA_SUCCESS;
++}
++
++mraa_board_t*
++mraa_mtk_linkit()
++{
++    mraa_board_t* b = (mraa_board_t*) malloc(sizeof(mraa_board_t));
++    if (b == NULL) {
++        return NULL;
++    }
++
++    b->platform_name = "LINKIT";
++    platform_detected = PLATFORM_MEDIATEK_LINKIT;
++    b->phy_pin_count = 31;
++
++    b->aio_count = 0;
++    b->adc_raw = 0;
++    b->adc_supported = 0;
++    b->pwm_default_period = 500;
++    b->pwm_max_period = 2147483;
++    b->pwm_min_period = 1;
++
++    b->pins = (mraa_pininfo_t*) malloc(sizeof(mraa_pininfo_t) * b->phy_pin_count);
++
++    advance_func->gpio_mmap_setup = &mraa_mtk_linkit_mmap_setup;
++
++    strncpy(b->pins[0].name, "P0", MRAA_PIN_NAME_SIZE);
++    b->pins[0].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
++
++    strncpy(b->pins[1].name, "P1", MRAA_PIN_NAME_SIZE);
++    b->pins[1].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
++
++    strncpy(b->pins[2].name, "P2", MRAA_PIN_NAME_SIZE);
++    b->pins[2].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
++
++    strncpy(b->pins[3].name, "P3", MRAA_PIN_NAME_SIZE);
++    b->pins[3].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
++
++    strncpy(b->pins[4].name, "P4", MRAA_PIN_NAME_SIZE);
++    b->pins[4].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
++
++    strncpy(b->pins[5].name, "P5", MRAA_PIN_NAME_SIZE);
++    b->pins[5].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
++
++    strncpy(b->pins[6].name, "P6", MRAA_PIN_NAME_SIZE);
++    b->pins[6].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
++
++    strncpy(b->pins[7].name, "P7", MRAA_PIN_NAME_SIZE);
++    b->pins[7].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
++
++    strncpy(b->pins[8].name, "P8", MRAA_PIN_NAME_SIZE);
++    b->pins[8].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 1 };
++    b->pins[8].gpio.pinmap = 21;
++    b->pins[8].uart.parent_id = 2;
++    b->pins[8].uart.mux_total = 0;
++
++    strncpy(b->pins[9].name, "P9", MRAA_PIN_NAME_SIZE);
++    b->pins[9].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 1 };
++    b->pins[9].gpio.pinmap = 20;
++    b->pins[9].uart.parent_id = 2;
++    b->pins[9].uart.mux_total = 0;
++
++    strncpy(b->pins[10].name, "P10", MRAA_PIN_NAME_SIZE);
++    b->pins[10].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
++    b->pins[10].gpio.pinmap = 2;
++
++    strncpy(b->pins[11].name, "P11", MRAA_PIN_NAME_SIZE);
++    b->pins[11].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
++    b->pins[11].gpio.pinmap = 3;
++
++    strncpy(b->pins[12].name, "P12", MRAA_PIN_NAME_SIZE);
++    b->pins[12].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
++    b->pins[12].gpio.pinmap = 0;
++
++    strncpy(b->pins[13].name, "P13", MRAA_PIN_NAME_SIZE);
++    b->pins[13].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
++    b->pins[13].gpio.pinmap = 1;
++
++    strncpy(b->pins[14].name, "P14", MRAA_PIN_NAME_SIZE);
++    b->pins[14].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
++
++    strncpy(b->pins[15].name, "P15", MRAA_PIN_NAME_SIZE);
++    b->pins[15].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
++    b->pins[15].gpio.pinmap = 44;
++
++    strncpy(b->pins[16].name, "P16", MRAA_PIN_NAME_SIZE);
++    b->pins[16].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 1 };
++    b->pins[16].gpio.pinmap = 46;
++    b->pins[16].uart.parent_id = 1;
++    b->pins[16].uart.mux_total = 0;
++
++    strncpy(b->pins[17].name, "P17", MRAA_PIN_NAME_SIZE);
++    b->pins[17].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 1 };
++    b->pins[17].gpio.pinmap = 45;
++    b->pins[17].uart.parent_id = 1;
++    b->pins[17].uart.mux_total = 0;
++
++    strncpy(b->pins[18].name, "P18", MRAA_PIN_NAME_SIZE);
++    b->pins[18].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 1 };
++    b->pins[18].gpio.pinmap = 13;
++    b->pins[18].uart.parent_id = 1;
++    b->pins[18].uart.mux_total = 0;
++
++    strncpy(b->pins[19].name, "P19", MRAA_PIN_NAME_SIZE);
++    b->pins[19].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 1 };
++    b->pins[19].gpio.pinmap = 12;
++    b->pins[19].uart.parent_id = 0;
++    b->pins[19].uart.mux_total = 0;
++
++    strncpy(b->pins[20].name, "P20", MRAA_PIN_NAME_SIZE);
++    b->pins[20].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 1, 0, 0 };
++    b->pins[20].gpio.pinmap = 5;
++    b->pins[20].i2c.pinmap = 0;
++    b->pins[20].i2c.mux_total = 0;
++
++    strncpy(b->pins[21].name, "P21", MRAA_PIN_NAME_SIZE);
++    b->pins[21].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 1, 0, 0 };
++    b->pins[21].gpio.pinmap = 4;
++    b->pins[21].i2c.pinmap = 0;
++    b->pins[21].i2c.mux_total = 0;
++
++    strncpy(b->pins[22].name, "P22", MRAA_PIN_NAME_SIZE);
++    b->pins[22].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 1, 0, 0, 0 };
++    b->pins[22].gpio.pinmap = 8;
++    b->pins[22].spi.pinmap = 0;
++    b->pins[22].spi.mux_total = 0;
++
++    strncpy(b->pins[23].name, "P23", MRAA_PIN_NAME_SIZE);
++    b->pins[23].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 1, 0, 0, 0 };
++    b->pins[23].gpio.pinmap = 9;
++    b->pins[23].spi.pinmap = 0;
++    b->pins[23].spi.mux_total = 0;
++
++    strncpy(b->pins[24].name, "P24", MRAA_PIN_NAME_SIZE);
++    b->pins[24].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 1, 0, 0, 0 };
++    b->pins[24].gpio.pinmap = 7;
++    b->pins[24].spi.pinmap = 0;
++    b->pins[24].spi.mux_total = 0;
++
++    strncpy(b->pins[25].name, "P25", MRAA_PIN_NAME_SIZE);
++    b->pins[25].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 1, 0, 0, 0 };
++    b->pins[25].gpio.pinmap = 6;
++    b->pins[25].spi.pinmap = 0;
++    b->pins[25].spi.mux_total = 0;
++
++    strncpy(b->pins[26].name, "P26", MRAA_PIN_NAME_SIZE);
++    b->pins[26].capabilites = (mraa_pincapabilities_t){ 1, 1, 1, 0, 0, 0, 0, 0 };
++    b->pins[26].gpio.pinmap = 18;
++
++    strncpy(b->pins[27].name, "P27", MRAA_PIN_NAME_SIZE);
++    b->pins[27].capabilites = (mraa_pincapabilities_t){ 1, 1, 1, 0, 0, 0, 0, 0 };
++    b->pins[27].gpio.pinmap = 19;
++
++    strncpy(b->pins[28].name, "P28", MRAA_PIN_NAME_SIZE);
++    b->pins[28].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
++    b->pins[28].gpio.pinmap = 16;
++
++    strncpy(b->pins[29].name, "P29", MRAA_PIN_NAME_SIZE);
++    b->pins[29].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
++    b->pins[29].gpio.pinmap = 17;
++
++    strncpy(b->pins[30].name, "P30", MRAA_PIN_NAME_SIZE);
++    b->pins[30].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
++    b->pins[30].gpio.pinmap = 14;
++
++    strncpy(b->pins[31].name, "P31", MRAA_PIN_NAME_SIZE);
++    b->pins[31].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
++    b->pins[31].gpio.pinmap = 15;
++
++    // BUS DEFINITIONS
++    b->i2c_bus_count = 1;
++    b->def_i2c_bus = 0;
++        b->i2c_bus[0].bus_id = 0;
++    b->i2c_bus[0].sda = 20;
++    b->i2c_bus[0].scl = 21;
++
++    b->spi_bus_count = 1;
++    b->def_spi_bus = 0;
++    b->spi_bus[0].bus_id = 0;
++    b->spi_bus[0].slave_s = 0;
++    b->spi_bus[0].cs = 25;
++    b->spi_bus[0].mosi = 22;
++    b->spi_bus[0].miso = 23;
++    b->spi_bus[0].sclk = 21;
++
++    b->uart_dev_count = 3;
++    b->def_uart_dev = 0;
++    b->uart_dev[0].rx = 18;
++    b->uart_dev[0].tx = 19;
++
++    b->uart_dev[1].rx = 16;
++    b->uart_dev[1].tx = 17;
++
++    b->uart_dev[2].rx = 9;
++    b->uart_dev[2].tx = 8;
++
++    b->gpio_count = 0;
++    int i;
++    for (i = 0; i < b->phy_pin_count; i++) {
++        if (b->pins[i].capabilites.gpio) {
++            b->gpio_count++;
++        }
++    }
++
++    return b;
++}
+--- /dev/null
++++ b/src/mips/mips.c
+@@ -0,0 +1,60 @@
++/*
++ * Author: Thomas Ingleby <thomas.c.ingleby@intel.com>
++ * Author: Michael Ring <mail@michael-ring.org>
++ * Copyright (c) 2014 Intel Corporation.
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining
++ * a copy of this software and associated documentation files (the
++ * "Software"), to deal in the Software without restriction, including
++ * without limitation the rights to use, copy, modify, merge, publish,
++ * distribute, sublicense, and/or sell copies of the Software, and to
++ * permit persons to whom the Software is furnished to do so, subject to
++ * the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be
++ * included in all copies or substantial portions of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
++ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
++ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++ */
++
++#include <stdlib.h>
++#include <string.h>
++
++#include "mraa_internal.h"
++#include "mips/mediatek.h"
++
++mraa_platform_t
++mraa_mips_platform()
++{
++    mraa_platform_t platform_type = MRAA_UNKNOWN_PLATFORM;
++    size_t len = 100;
++    char* line = malloc(len);
++    FILE* fh = fopen("/proc/cpuinfo", "r");
++    if (fh != NULL) {
++        while (getline(&line, &len, fh) != -1) {
++            if (strncmp(line, "machine", 7) == 0) {
++                if (strstr(line, "MediaTek LinkIt Smart 7688")) {
++                    platform_type = MRAA_MTK_LINKIT;
++                }
++            }
++        }
++        fclose(fh);
++    }
++    free(line);
++
++    switch (platform_type) {
++        case MRAA_MTK_LINKIT:
++            plat = mraa_mtk_linkit();
++            break;
++        default:
++            plat = NULL;
++            syslog(LOG_ERR, "Unknown Platform, currently not supported by MRAA");
++    }
++    return platform_type;
++}

+ 26 - 0
libs/libmraa/patches/0003-uart.patch

@@ -0,0 +1,26 @@
+From 9540f9b93704e8e80ab2048954ca88d8e6eddf86 Mon Sep 17 00:00:00 2001
+From: John Crispin <blogic@openwrt.org>
+Date: Thu, 23 Jul 2015 16:43:42 +0200
+Subject: [PATCH 3/4] uart
+
+---
+ src/uart/uart.c |    3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/src/uart/uart.c b/src/uart/uart.c
+index 3ef55a4..5102f81 100644
+--- a/src/uart/uart.c
++++ b/src/uart/uart.c
+@@ -34,6 +34,9 @@
+ #include "uart.h"
+ #include "mraa_internal.h"
+ 
++#ifndef CMSPAR
++#define CMSPAR	  010000000000
++#endif
+ // This function takes an unsigned int and converts it to a B* speed_t
+ // that can be used with linux/posix termios
+ static speed_t
+-- 
+1.7.10.4
+

+ 666 - 0
libs/libmraa/patches/0004-fixes.patch

@@ -0,0 +1,666 @@
+From 3c34e5f87a741ec2fc7809fc8c169a832275d32c Mon Sep 17 00:00:00 2001
+From: John Crispin <blogic@openwrt.org>
+Date: Thu, 23 Jul 2015 18:19:32 +0200
+Subject: [PATCH 4/4] fixes
+
+---
+ src/mips/mediatek.c |    6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+--- a/src/mips/mediatek.c
++++ b/src/mips/mediatek.c
+@@ -37,12 +37,12 @@
+ #define PLATFORM_MEDIATEK_LINKIT	1
+ #define PLATFORM_MEDIATEK_LINKIT_AIR	2
+ #define MMAP_PATH			"/dev/mem"
+-#define MT7628_GPIO_BASE		0x100
+-#define MT7628_BLOCK_SIZE		(4 * 1024)
+-#define MT7628_GPIO_CTRL		0x00
+-#define MT7628_GPIO_DATA		0x20
+-#define MT7628_GPIO_SET			0x30
+-#define MT7628_GPIO_CLEAR		0x40
++#define MT7628_GPIOMODE_BASE		0x10000000
++#define MT7628_BLOCK_SIZE		0x1000
++#define MT7628_GPIO_CTRL		0x600
++#define MT7628_GPIO_DATA		0x620
++#define MT7628_GPIO_SET			0x630
++#define MT7628_GPIO_CLEAR		0x640
+ 
+ #define MAX_SIZE 64
+ 
+@@ -50,6 +50,9 @@
+ static uint8_t* mmap_reg = NULL;
+ static int mmap_fd = 0;
+ static int mmap_size;
++static uint8_t* gpio_mmap_reg = NULL;
++static int gpio_mmap_fd = 0;
++static int gpio_mmap_size;
+ static unsigned int mmap_count = 0;
+ static int platform_detected = 0;
+ 
+@@ -129,9 +132,10 @@
+         }
+ 
+         mmap_reg = (uint8_t*) mmap(NULL, MT7628_BLOCK_SIZE, PROT_READ | PROT_WRITE,
+-                                       MAP_FILE | MAP_SHARED, mmap_fd, MT7628_GPIO_BASE);
++                                       MAP_FILE | MAP_SHARED, mmap_fd, 0x10000000);
+         if (mmap_reg == MAP_FAILED) {
+-            syslog(LOG_ERR, "linkit mmap: failed to mmap");
++            perror("foo");
++	    syslog(LOG_ERR, "linkit mmap: failed to mmap");
+             mmap_reg = NULL;
+             close(mmap_fd);
+             return MRAA_ERROR_NO_RESOURCES;
+@@ -144,201 +148,442 @@
+     return MRAA_SUCCESS;
+ }
+ 
++static int mmap_gpiomode(void)
++{
++    if ((gpio_mmap_fd = open(MMAP_PATH, O_RDWR)) < 0) {
++        syslog(LOG_ERR, "linkit map: unable to open resource0 file");
++        return MRAA_ERROR_INVALID_HANDLE;
++    }
++
++    gpio_mmap_reg = (uint8_t*) mmap(NULL, MT7628_BLOCK_SIZE, PROT_READ | PROT_WRITE,
++                                   MAP_FILE | MAP_SHARED, gpio_mmap_fd, MT7628_GPIOMODE_BASE);
++    if (gpio_mmap_reg == MAP_FAILED) {
++        syslog(LOG_ERR, "linkit gpio_mmap: failed to mmap");
++        gpio_mmap_reg = NULL;
++        close(gpio_mmap_fd);
++        return MRAA_ERROR_NO_RESOURCES;
++    }
++    return 0;
++}
++
++static void set_gpiomode(unsigned int mask, unsigned int shift, unsigned int val)
++{
++    unsigned int reg;
++    unsigned int offset = 0x60;
++
++    if (shift >= 32) {
++		shift -= 32;
++		offset += 4;
++    }
++
++    reg = *(volatile uint32_t*) (gpio_mmap_reg + offset);
++
++    reg &= ~(mask << shift);
++    reg |= (val << shift);
++    *(volatile uint32_t*) (gpio_mmap_reg + offset) = reg;
++}
++
++enum {
++	MUX_GPIO = 0,
++	MUX_SPI_S,
++	MUX_SPI_CS1,
++	MUX_I2S,
++	MUX_UART0,
++	MUX_I2C,
++	MUX_UART1,
++	MUX_UART2,
++	MUX_PWM0,
++	MUX_PWM1,
++	MUX_EPHY,
++	MUX_WLED,
++	__MUX_MAX,
++};
++
++static unsigned char gpio_mux_groups[64];
++static struct pinmux {
++	char *name;
++	char *func[4];
++	unsigned int shift;
++	unsigned int mask;
++} mt7688_mux[] = {
++	{
++		.name = "refclk",
++		.func = { "refclk", "gpio", NULL, NULL },
++		.shift = 18,
++		.mask = 0x1,
++	}, {
++		.name = "spi_s",
++		.func = { "spi_s", "gpio", "utif", "pwm" },
++		.shift = 2,
++		.mask = 0x3,
++	}, {
++		.name = "spi_cs1",
++		.func = { "spi_cs1", "gpio", NULL, "refclk" },
++		.shift = 4,
++		.mask = 0x3,
++	}, {
++		.name = "i2s",
++		.func = { "i2s", "gpio", "pcm", NULL },
++		.shift = 6,
++		.mask = 0x3,
++	}, {
++		.name = "uart0",
++		.func = { "uart", "gpio", NULL, NULL },
++		.shift = 8,
++		.mask = 0x3,
++	}, {
++		.name = "i2c",
++		.func = { "i2c", "gpio", NULL, NULL },
++		.shift = 20,
++		.mask = 0x3,
++	}, {
++		.name = "uart1",
++		.func = { "uart", "gpio", NULL, NULL },
++		.shift = 24,
++		.mask = 0x3,
++	}, {
++		.name = "uart2",
++		.func = { "uart", "gpio", "pwm", NULL },
++		.shift = 26,
++		.mask = 0x3,
++	}, {
++		.name = "pwm0",
++		.func = { "pwm", "gpio", NULL, NULL },
++		.shift = 28,
++		.mask = 0x3,
++	}, {
++		.name = "pwm1",
++		.func = { "pwm", "gpio", NULL, NULL },
++		.shift = 30,
++		.mask = 0x3,
++	}, {
++		.name = "ephy",
++		.func = { "ephy", "gpio", NULL, NULL },
++		.shift = 34,
++		.mask = 0x3,
++	}, {
++		.name = "wled",
++		.func = { "wled", "gpio", NULL, NULL },
++		.shift = 32,
++		.mask = 0x3,
++	},
++};
++
++mraa_result_t gpio_init_pre(int pin)
++{
++	struct pinmux *m = &mt7688_mux[gpio_mux_groups[pin]];
++
++	set_gpiomode(m->mask, m->shift, 1);
++
++	return 0;
++}
++
++static void gpiomode_set(unsigned int id, char *name)
++{
++	int i;
++
++	if (id >= __MUX_MAX)
++		return;
++
++	for (i = 0; i < 4; i++) {
++		if (!mt7688_mux[id].func[i] || strcmp(mt7688_mux[id].func[i], name))
++			continue;
++		set_gpiomode(mt7688_mux[id].mask, mt7688_mux[id].shift, i);
++		syslog(0, "mraa: set pinmux %s -> %s\n", mt7688_mux[id].name, name);
++		return;
++	}
++}
++
++mraa_result_t i2c_init_pre(unsigned int bus)
++{
++	gpiomode_set(MUX_I2C, "i2c");
++	return 0;
++}
++
++mraa_result_t
++pwm_init_post(mraa_pwm_context pwm)
++{
++	switch(pwm->pin) {
++	case 0:
++		gpiomode_set(MUX_PWM0, "pwm");
++		break;
++	case 1:
++		gpiomode_set(MUX_PWM1, "pwm");
++		break;
++	case 2:
++	case 3:
++		gpiomode_set(MUX_UART2, "pwm");
++		break;
++	}
++	return 0;
++}
++
++mraa_result_t spi_init_pre(int bus)
++{
++	gpiomode_set(MUX_SPI_CS1, "spi_cs1");
++	return 0;
++}
++
++mraa_result_t uart_init_pre(int index)
++{
++	switch(index) {
++	case 0:
++		gpiomode_set(MUX_UART0, "uart");
++		break;
++	case 1:
++		gpiomode_set(MUX_UART1, "uart");
++		break;
++	case 2:
++		gpiomode_set(MUX_UART2, "uart");
++		break;
++	}
++	return 0;
++}
++
++mraa_result_t
++i2c_freq(mraa_i2c_context dev, mraa_i2c_mode_t mode)
++{
++    switch (mode) {
++        case MRAA_I2C_STD:
++            break;
++        default:
++            syslog(LOG_ERR, "Invalid i2c frequency");
++            break;
++    }
++    return MRAA_SUCCESS;
++}
++
++
+ mraa_board_t*
+ mraa_mtk_linkit()
+ {
++    int i;
++
++    if (mmap_gpiomode())
++	    return NULL;
++
+     mraa_board_t* b = (mraa_board_t*) malloc(sizeof(mraa_board_t));
+     if (b == NULL) {
+         return NULL;
+     }
+ 
+-    b->platform_name = "LINKIT";
++    memset(b, 0, sizeof(mraa_board_t));
++
++    b->platform_name = "LinkIt Smart 7688";
+     platform_detected = PLATFORM_MEDIATEK_LINKIT;
+-    b->phy_pin_count = 31;
++    b->phy_pin_count = 64;
+ 
+     b->aio_count = 0;
+     b->adc_raw = 0;
+     b->adc_supported = 0;
+     b->pwm_default_period = 500;
+-    b->pwm_max_period = 2147483;
++    b->pwm_max_period = 1000000;
+     b->pwm_min_period = 1;
+ 
+-    b->pins = (mraa_pininfo_t*) malloc(sizeof(mraa_pininfo_t) * b->phy_pin_count);
+-
+-    advance_func->gpio_mmap_setup = &mraa_mtk_linkit_mmap_setup;
+-
+-    strncpy(b->pins[0].name, "P0", MRAA_PIN_NAME_SIZE);
+-    b->pins[0].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
+-
+-    strncpy(b->pins[1].name, "P1", MRAA_PIN_NAME_SIZE);
+-    b->pins[1].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
+-
+-    strncpy(b->pins[2].name, "P2", MRAA_PIN_NAME_SIZE);
+-    b->pins[2].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
+-
+-    strncpy(b->pins[3].name, "P3", MRAA_PIN_NAME_SIZE);
+-    b->pins[3].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
+-
+-    strncpy(b->pins[4].name, "P4", MRAA_PIN_NAME_SIZE);
+-    b->pins[4].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
+-
+-    strncpy(b->pins[5].name, "P5", MRAA_PIN_NAME_SIZE);
+-    b->pins[5].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
+-
+-    strncpy(b->pins[6].name, "P6", MRAA_PIN_NAME_SIZE);
+-    b->pins[6].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
+-
+-    strncpy(b->pins[7].name, "P7", MRAA_PIN_NAME_SIZE);
+-    b->pins[7].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
+-
+-    strncpy(b->pins[8].name, "P8", MRAA_PIN_NAME_SIZE);
+-    b->pins[8].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 1 };
+-    b->pins[8].gpio.pinmap = 21;
+-    b->pins[8].uart.parent_id = 2;
+-    b->pins[8].uart.mux_total = 0;
++    b->adv_func = (mraa_adv_func_t*) calloc(1, sizeof(mraa_adv_func_t));
++    if (b->adv_func == NULL) {
++        return NULL;
++    }
+ 
+-    strncpy(b->pins[9].name, "P9", MRAA_PIN_NAME_SIZE);
+-    b->pins[9].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 1 };
+-    b->pins[9].gpio.pinmap = 20;
+-    b->pins[9].uart.parent_id = 2;
+-    b->pins[9].uart.mux_total = 0;
++    b->adv_func->i2c_init_pre = i2c_init_pre;
++    b->adv_func->pwm_init_post = pwm_init_post;
++    b->adv_func->spi_init_pre = spi_init_pre;
++    b->adv_func->uart_init_pre = uart_init_pre;
++    b->adv_func->gpio_init_pre = gpio_init_pre;
++    b->adv_func->i2c_set_frequency_replace = &i2c_freq;
+ 
+-    strncpy(b->pins[10].name, "P10", MRAA_PIN_NAME_SIZE);
+-    b->pins[10].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
+-    b->pins[10].gpio.pinmap = 2;
++    b->pins = (mraa_pininfo_t*) malloc(sizeof(mraa_pininfo_t) * b->phy_pin_count);
+ 
+-    strncpy(b->pins[11].name, "P11", MRAA_PIN_NAME_SIZE);
+-    b->pins[11].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
+-    b->pins[11].gpio.pinmap = 3;
++    memset(b->pins, 0, sizeof(mraa_pininfo_t) * b->phy_pin_count);
++    memset(gpio_mux_groups, -1, sizeof(gpio_mux_groups));
+ 
+-    strncpy(b->pins[12].name, "P12", MRAA_PIN_NAME_SIZE);
+-    b->pins[12].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
+-    b->pins[12].gpio.pinmap = 0;
++    b->adv_func->gpio_mmap_setup = &mraa_mtk_linkit_mmap_setup;
+ 
+-    strncpy(b->pins[13].name, "P13", MRAA_PIN_NAME_SIZE);
+-    b->pins[13].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
+-    b->pins[13].gpio.pinmap = 1;
++    for (i = 0; i < b->phy_pin_count; i++) {
++        snprintf(b->pins[i].name, MRAA_PIN_NAME_SIZE, "GPIO%d", i);
++        b->pins[i].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
++    }
+ 
+-    strncpy(b->pins[14].name, "P14", MRAA_PIN_NAME_SIZE);
+-    b->pins[14].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
++    strncpy(b->pins[43].name, "GPIO43", MRAA_PIN_NAME_SIZE);
++    b->pins[43].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
++    b->pins[43].gpio.pinmap = 43;
++    gpio_mux_groups[43] = MUX_EPHY;
++
++    strncpy(b->pins[20].name, "GPIO20", MRAA_PIN_NAME_SIZE);
++    b->pins[20].capabilites = (mraa_pincapabilities_t){ 1, 1, 1, 0, 0, 0, 0, 1 };
++    b->pins[20].gpio.pinmap = 20;
++    b->pins[20].uart.parent_id = 2;
++    b->pins[20].uart.mux_total = 0;
++    b->pins[20].pwm.parent_id = 0;
++    b->pins[20].pwm.pinmap = 2;
++    gpio_mux_groups[20] = MUX_UART2;
++
++    strncpy(b->pins[21].name, "GPIO21", MRAA_PIN_NAME_SIZE);
++    b->pins[21].capabilites = (mraa_pincapabilities_t){ 1, 1, 1, 0, 0, 0, 0, 1 };
++    b->pins[21].gpio.pinmap = 21;
++    b->pins[21].uart.parent_id = 2;
++    b->pins[21].uart.mux_total = 0;
++    b->pins[21].pwm.parent_id = 0;
++    b->pins[21].pwm.pinmap = 3;
++    gpio_mux_groups[21] = MUX_UART2;
++
++    strncpy(b->pins[2].name, "GPIO2", MRAA_PIN_NAME_SIZE);
++    b->pins[2].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
++    b->pins[2].gpio.pinmap = 2;
++    gpio_mux_groups[2] = MUX_I2S;
++
++    strncpy(b->pins[3].name, "GPIO3", MRAA_PIN_NAME_SIZE);
++    b->pins[3].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
++    b->pins[3].gpio.pinmap = 3;
++    gpio_mux_groups[3] = MUX_I2S;
++
++    strncpy(b->pins[0].name, "GPIO0", MRAA_PIN_NAME_SIZE);
++    b->pins[0].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
++    b->pins[0].gpio.pinmap = 0;
++    gpio_mux_groups[0] = MUX_I2S;
++
++    strncpy(b->pins[1].name, "GPIO1", MRAA_PIN_NAME_SIZE);
++    b->pins[1].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
++    b->pins[1].gpio.pinmap = 1;
++    gpio_mux_groups[1] = MUX_I2S;
++
++    strncpy(b->pins[37].name, "GPIO37", MRAA_PIN_NAME_SIZE);
++    b->pins[37].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
++    b->pins[37].gpio.pinmap = 37;
++    gpio_mux_groups[37] = MUX_GPIO;
++
++    strncpy(b->pins[44].name, "GPIO44", MRAA_PIN_NAME_SIZE);
++    b->pins[44].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
++    b->pins[44].gpio.pinmap = 44;
++    gpio_mux_groups[44] = MUX_WLED;
++
++    strncpy(b->pins[46].name, "GPIO46", MRAA_PIN_NAME_SIZE);
++    b->pins[46].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 1 };
++    b->pins[46].gpio.pinmap = 46;
++    b->pins[46].uart.parent_id = 1;
++    b->pins[46].uart.mux_total = 0;
++    gpio_mux_groups[46] = MUX_UART1;
++
++    strncpy(b->pins[45].name, "GPIO45", MRAA_PIN_NAME_SIZE);
++    b->pins[45].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 1 };
++    b->pins[45].gpio.pinmap = 45;
++    b->pins[45].uart.parent_id = 1;
++    b->pins[45].uart.mux_total = 0;
++    gpio_mux_groups[45] = MUX_UART1;
++
++    strncpy(b->pins[13].name, "GPIO13", MRAA_PIN_NAME_SIZE);
++    b->pins[13].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 1 };
++    b->pins[13].gpio.pinmap = 13;
++    b->pins[13].uart.parent_id = 1;
++    b->pins[13].uart.mux_total = 0;
++    gpio_mux_groups[13] = MUX_UART0;
++
++    strncpy(b->pins[12].name, "GPIO12", MRAA_PIN_NAME_SIZE);
++    b->pins[12].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 1 };
++    b->pins[12].gpio.pinmap = 12;
++    b->pins[12].uart.parent_id = 0;
++    b->pins[12].uart.mux_total = 0;
++    gpio_mux_groups[12] = MUX_UART0;
++
++    strncpy(b->pins[5].name, "GPIO5", MRAA_PIN_NAME_SIZE);
++    b->pins[5].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 1, 0, 0 };
++    b->pins[5].gpio.pinmap = 5;
++    b->pins[5].i2c.pinmap = 0;
++    b->pins[5].i2c.mux_total = 0;
++    gpio_mux_groups[5] = MUX_I2C;
++
++    strncpy(b->pins[4].name, "GPIO4", MRAA_PIN_NAME_SIZE);
++    b->pins[4].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 1, 0, 0 };
++    b->pins[4].gpio.pinmap = 4;
++    b->pins[4].i2c.pinmap = 0;
++    b->pins[4].i2c.mux_total = 0;
++    gpio_mux_groups[4] = MUX_I2C;
++
++    strncpy(b->pins[6].name, "GPIO6", MRAA_PIN_NAME_SIZE);
++    b->pins[6].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 1, 0, 0, 0 };
++    b->pins[6].gpio.pinmap = 6;
++    b->pins[6].spi.pinmap = 0;
++    b->pins[6].spi.mux_total = 0;
++    gpio_mux_groups[6] = MUX_SPI_CS1;
++
++    strncpy(b->pins[7].name, "GPIO7", MRAA_PIN_NAME_SIZE);
++    b->pins[7].capabilites = (mraa_pincapabilities_t){ 1, 0, 0, 0, 1, 0, 0, 0 };
++    b->pins[7].spi.pinmap = 0;
++    b->pins[7].spi.mux_total = 0;
++
++    strncpy(b->pins[8].name, "GPIO8", MRAA_PIN_NAME_SIZE);
++    b->pins[8].capabilites = (mraa_pincapabilities_t){ 1, 0, 0, 0, 1, 0, 0, 0 };
++    b->pins[8].spi.pinmap = 0;
++    b->pins[8].spi.mux_total = 0;
++
++    strncpy(b->pins[9].name, "GPIO9", MRAA_PIN_NAME_SIZE);
++    b->pins[9].capabilites = (mraa_pincapabilities_t){ 1, 0, 0, 0, 1, 0, 0, 0 };
++    b->pins[9].spi.pinmap = 0;
++    b->pins[9].spi.mux_total = 0;
++
++    strncpy(b->pins[18].name, "GPIO18", MRAA_PIN_NAME_SIZE);
++    b->pins[18].capabilites = (mraa_pincapabilities_t){ 1, 1, 1, 0, 0, 0, 0, 0 };
++    b->pins[18].gpio.pinmap = 18;
++    b->pins[18].pwm.parent_id = 0;
++    b->pins[18].pwm.pinmap = 0;
++    gpio_mux_groups[18] = MUX_PWM0;
++
++    strncpy(b->pins[19].name, "GPIO19", MRAA_PIN_NAME_SIZE);
++    b->pins[19].capabilites = (mraa_pincapabilities_t){ 1, 1, 1, 0, 0, 0, 0, 0 };
++    b->pins[19].gpio.pinmap = 19;
++    b->pins[19].pwm.parent_id = 0;
++    b->pins[19].pwm.pinmap = 1;
++    gpio_mux_groups[19] = MUX_PWM1;
++
++    strncpy(b->pins[16].name, "GPIO16", MRAA_PIN_NAME_SIZE);
++    b->pins[16].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
++    b->pins[16].gpio.pinmap = 16;
++    gpio_mux_groups[16] = MUX_SPI_S;
++
++    strncpy(b->pins[17].name, "GPIO17", MRAA_PIN_NAME_SIZE);
++    b->pins[17].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
++    b->pins[17].gpio.pinmap = 17;
++    gpio_mux_groups[17] = MUX_SPI_S;
++
++    strncpy(b->pins[14].name, "GPIO14", MRAA_PIN_NAME_SIZE);
++    b->pins[14].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
++    b->pins[14].gpio.pinmap = 14;
++    gpio_mux_groups[14] = MUX_SPI_S;
+ 
+-    strncpy(b->pins[15].name, "P15", MRAA_PIN_NAME_SIZE);
++    strncpy(b->pins[15].name, "GPIO15", MRAA_PIN_NAME_SIZE);
+     b->pins[15].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
+-    b->pins[15].gpio.pinmap = 44;
+-
+-    strncpy(b->pins[16].name, "P16", MRAA_PIN_NAME_SIZE);
+-    b->pins[16].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 1 };
+-    b->pins[16].gpio.pinmap = 46;
+-    b->pins[16].uart.parent_id = 1;
+-    b->pins[16].uart.mux_total = 0;
+-
+-    strncpy(b->pins[17].name, "P17", MRAA_PIN_NAME_SIZE);
+-    b->pins[17].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 1 };
+-    b->pins[17].gpio.pinmap = 45;
+-    b->pins[17].uart.parent_id = 1;
+-    b->pins[17].uart.mux_total = 0;
+-
+-    strncpy(b->pins[18].name, "P18", MRAA_PIN_NAME_SIZE);
+-    b->pins[18].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 1 };
+-    b->pins[18].gpio.pinmap = 13;
+-    b->pins[18].uart.parent_id = 1;
+-    b->pins[18].uart.mux_total = 0;
+-
+-    strncpy(b->pins[19].name, "P19", MRAA_PIN_NAME_SIZE);
+-    b->pins[19].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 1 };
+-    b->pins[19].gpio.pinmap = 12;
+-    b->pins[19].uart.parent_id = 0;
+-    b->pins[19].uart.mux_total = 0;
+-
+-    strncpy(b->pins[20].name, "P20", MRAA_PIN_NAME_SIZE);
+-    b->pins[20].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 1, 0, 0 };
+-    b->pins[20].gpio.pinmap = 5;
+-    b->pins[20].i2c.pinmap = 0;
+-    b->pins[20].i2c.mux_total = 0;
+-
+-    strncpy(b->pins[21].name, "P21", MRAA_PIN_NAME_SIZE);
+-    b->pins[21].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 1, 0, 0 };
+-    b->pins[21].gpio.pinmap = 4;
+-    b->pins[21].i2c.pinmap = 0;
+-    b->pins[21].i2c.mux_total = 0;
+-
+-    strncpy(b->pins[22].name, "P22", MRAA_PIN_NAME_SIZE);
+-    b->pins[22].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 1, 0, 0, 0 };
+-    b->pins[22].gpio.pinmap = 8;
+-    b->pins[22].spi.pinmap = 0;
+-    b->pins[22].spi.mux_total = 0;
+-
+-    strncpy(b->pins[23].name, "P23", MRAA_PIN_NAME_SIZE);
+-    b->pins[23].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 1, 0, 0, 0 };
+-    b->pins[23].gpio.pinmap = 9;
+-    b->pins[23].spi.pinmap = 0;
+-    b->pins[23].spi.mux_total = 0;
+-
+-    strncpy(b->pins[24].name, "P24", MRAA_PIN_NAME_SIZE);
+-    b->pins[24].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 1, 0, 0, 0 };
+-    b->pins[24].gpio.pinmap = 7;
+-    b->pins[24].spi.pinmap = 0;
+-    b->pins[24].spi.mux_total = 0;
+-
+-    strncpy(b->pins[25].name, "P25", MRAA_PIN_NAME_SIZE);
+-    b->pins[25].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 1, 0, 0, 0 };
+-    b->pins[25].gpio.pinmap = 6;
+-    b->pins[25].spi.pinmap = 0;
+-    b->pins[25].spi.mux_total = 0;
+-
+-    strncpy(b->pins[26].name, "P26", MRAA_PIN_NAME_SIZE);
+-    b->pins[26].capabilites = (mraa_pincapabilities_t){ 1, 1, 1, 0, 0, 0, 0, 0 };
+-    b->pins[26].gpio.pinmap = 18;
+-
+-    strncpy(b->pins[27].name, "P27", MRAA_PIN_NAME_SIZE);
+-    b->pins[27].capabilites = (mraa_pincapabilities_t){ 1, 1, 1, 0, 0, 0, 0, 0 };
+-    b->pins[27].gpio.pinmap = 19;
+-
+-    strncpy(b->pins[28].name, "P28", MRAA_PIN_NAME_SIZE);
+-    b->pins[28].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
+-    b->pins[28].gpio.pinmap = 16;
+-
+-    strncpy(b->pins[29].name, "P29", MRAA_PIN_NAME_SIZE);
+-    b->pins[29].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
+-    b->pins[29].gpio.pinmap = 17;
+-
+-    strncpy(b->pins[30].name, "P30", MRAA_PIN_NAME_SIZE);
+-    b->pins[30].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
+-    b->pins[30].gpio.pinmap = 14;
+-
+-    strncpy(b->pins[31].name, "P31", MRAA_PIN_NAME_SIZE);
+-    b->pins[31].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
+-    b->pins[31].gpio.pinmap = 15;
++    b->pins[15].gpio.pinmap = 15;
++    gpio_mux_groups[15] = MUX_SPI_S;
+ 
+     // BUS DEFINITIONS
+     b->i2c_bus_count = 1;
+     b->def_i2c_bus = 0;
+-        b->i2c_bus[0].bus_id = 0;
+-    b->i2c_bus[0].sda = 20;
+-    b->i2c_bus[0].scl = 21;
++    b->i2c_bus[0].bus_id = 0;
++    b->i2c_bus[0].sda = 5;
++    b->i2c_bus[0].scl = 4;
+ 
+     b->spi_bus_count = 1;
+     b->def_spi_bus = 0;
+-    b->spi_bus[0].bus_id = 0;
+-    b->spi_bus[0].slave_s = 0;
+-    b->spi_bus[0].cs = 25;
+-    b->spi_bus[0].mosi = 22;
+-    b->spi_bus[0].miso = 23;
+-    b->spi_bus[0].sclk = 21;
++    b->spi_bus[0].bus_id = 32766;
++    b->spi_bus[0].slave_s = 1;
++    b->spi_bus[0].cs = 6;
++    b->spi_bus[0].mosi = 8;
++    b->spi_bus[0].miso = 9;
++    b->spi_bus[0].sclk = 7;
+ 
+     b->uart_dev_count = 3;
+     b->def_uart_dev = 0;
+-    b->uart_dev[0].rx = 18;
+-    b->uart_dev[0].tx = 19;
+-
+-    b->uart_dev[1].rx = 16;
+-    b->uart_dev[1].tx = 17;
+-
+-    b->uart_dev[2].rx = 9;
+-    b->uart_dev[2].tx = 8;
++    b->uart_dev[0].rx = 13;
++    b->uart_dev[0].tx = 12;
++    b->uart_dev[0].device_path = "/dev/ttyS0";
++    b->uart_dev[1].rx = 46;
++    b->uart_dev[1].tx = 45;
++    b->uart_dev[1].device_path = "/dev/ttyS1";
++    b->uart_dev[2].rx = 21;
++    b->uart_dev[2].tx = 20;
++    b->uart_dev[2].device_path = "/dev/ttyS2";
+ 
+     b->gpio_count = 0;
+-    int i;
+     for (i = 0; i < b->phy_pin_count; i++) {
+         if (b->pins[i].capabilites.gpio) {
+             b->gpio_count++;
+--- a/src/gpio/gpio.c
++++ b/src/gpio/gpio.c
+@@ -113,6 +113,8 @@
+         close(export);
+     }
+ 
++    mraa_gpio_use_mmaped(dev, 1);
++
+ init_internal_cleanup:
+     if (status != MRAA_SUCCESS) {
+         if (dev != NULL)

+ 0 - 10
libs/libradcli/Config.in

@@ -1,10 +0,0 @@
-# radcli avanced configuration
-
-menu "Configuration"
-	depends on PACKAGE_libradcli
-
-config RADCLI_TLS
-	bool "enable TLS support"
-	default y
-
-endmenu

+ 0 - 75
libs/libradcli/Makefile

@@ -1,75 +0,0 @@
-#
-# Copyright (C) 2015 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:=libradcli
-PKG_VERSION:=1.2.5
-PKG_RELEASE:=1
-
-PKG_SOURCE:=radcli-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://github.com/radcli/radcli/releases/download/$(PKG_VERSION)/
-PKG_MD5SUM:=b94e46e37668cc562ea5420d095a836b
-PKG_BUILD_DIR:=$(BUILD_DIR)/radcli-$(PKG_VERSION)
-
-PKG_INSTALL:=1
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/libradcli
-  SECTION:=libs
-  CATEGORY:=Libraries
-  TITLE:=A library for radius clients
-  URL:=http://radcli.github.io/radcli/
-  MAINTAINER:=Nikos Mavrogiannopoulos <nmav@gnutls.org>
-  DEPENDS:= +RADCLI_TLS:libgnutls +libnettle
-endef
-
-define Package/libradcli/decription
-  The radcli library is a library for writing RADIUS Clients. The library's
-  approach is to allow writing RADIUS-aware application in less than 50 lines
-  of C code. It was based originally on freeradius-client and is source 
-  compatible with it.
-endef
-
-CONFIGURE_ARGS+= \
-	--enable-legacy-compat
-
-ifneq ($(CONFIG_RADCLI_TLS),y)
-CONFIGURE_ARGS += --without-tls
-endif
-
-define Build/InstallDev
-	$(INSTALL_DIR) $(1)/usr/include/radcli
-	$(CP) \
-		$(PKG_INSTALL_DIR)/usr/include/radcli/radcli.h \
-		$(PKG_INSTALL_DIR)/usr/include/radcli/version.h \
-		$(1)/usr/include/radcli
-	$(CP) \
-		$(PKG_INSTALL_DIR)/usr/include/freeradius-client.h \
-		$(1)/usr/include/
-	$(INSTALL_DIR) $(1)/usr/lib
-	$(CP) \
-		$(PKG_INSTALL_DIR)/usr/lib/libradcli.so* \
-		$(PKG_INSTALL_DIR)/usr/lib/libfreeradius-client.so \
-		$(1)/usr/lib/
-endef
-
-define Package/libradcli/conffiles
-/etc/radcli/radiusclient.conf
-endef
-
-define Package/libradcli/install
-	$(INSTALL_DIR) $(1)/etc/radcli
-	$(INSTALL_CONF) $(PKG_BUILD_DIR)/etc/radiusclient.conf $(1)/etc/radcli/
-	$(INSTALL_DIR) $(1)/usr/lib
-	$(CP) \
-		$(PKG_INSTALL_DIR)/usr/lib/libradcli.so.* \
-		$(1)/usr/lib/
-endef
-
-$(eval $(call BuildPackage,libradcli))

+ 6 - 5
libs/libssh2/Makefile

@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2015-2016 OpenWrt.org
+# Copyright (C) 2015-2018 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -9,10 +9,10 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libssh2
 PKG_VERSION:=1.7.0
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://www.libssh2.org/download
+PKG_SOURCE_URL:=https://www.libssh2.org/download
 PKG_MD5SUM:=b01662a210e94cccf2f76094db7dac5c
 
 PKG_INSTALL:=1
@@ -26,7 +26,7 @@ define Package/libssh2
   SECTION:=libs
   CATEGORY:=Libraries
   TITLE:=SSH2 library
-  URL:=http://www.libssh2.org/
+  URL:=https://www.libssh2.org/
   DEPENDS:=+libopenssl +zlib
   MAINTAINER:=Jiri Slachta <jiri@slachta.eu>
 endef
@@ -39,7 +39,8 @@ TARGET_CFLAGS += $(FPIC)
 
 CONFIGURE_ARGS += \
 	--disable-examples-build \
-	--with-libssl-prefix=$(STAGING_DIR)/usr
+	--with-libssl-prefix=$(STAGING_DIR)/usr \
+	--with-libz-prefix=$(STAGING_DIR)/usr
 
 define Build/InstallDev
 	$(INSTALL_DIR) $(1)/usr/include

+ 2 - 2
libs/libtasn1/Makefile

@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libtasn1
-PKG_VERSION:=4.9
+PKG_VERSION:=4.12
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
-PKG_MD5SUM:=4f6f7a8fd691ac2b8307c8ca365bad711db607d4ad5966f6938a9d2ecd65c920
+PKG_HASH:=6753da2e621257f33f5b051cc114d417e5206a0818fe0b1ecfd6153f70934753
 PKG_LICENSE:=LGPLv2.1+
 PKG_LICENSE_FILES:=COPYING.LIB
 

+ 53 - 0
libs/libtins/Makefile

@@ -0,0 +1,53 @@
+#
+# Copyright (C) 2017 Steven Hessing
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libtins
+PKG_RELEASE:=1
+
+PKG_MAINTAINER:= Steven Hessing <steven.hessing@gmail.com>
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/mfontanini/libtins.git
+PKG_SOURCE_VERSION:=v3.5
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.xz
+PKG_HASH:=47cd7d659ffa75dcfc2172ef54151fd36dc87de9e0f04bb066f6b076a7df7b57
+PKG_MIRROR_HASH:=47cd7d659ffa75dcfc2172ef54151fd36dc87de9e0f04bb066f6b076a7df7b57
+
+PKG_LICENSE:=BSD-2-Clause
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
+PKG_BUILD_PARALLEL:=1
+
+CMAKE_INSTALL:=1
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+CMAKE_OPTIONS += -D_RUN_RESULT_VAR=FORCE
+CMAKE_OPTIONS += -DLIBTINS_ENABLE_WPA2=0
+CMAKE_OPTIONS += -DLIBTINS_ENABLE_CXX11=1
+
+define Package/libtins
+	SECTION:=net
+	CATEGORY:=Libraries
+	TITLE:=libtins 
+	URL:=http://libtins.github.io/
+	DEPENDS:=+libstdcpp +libpcap 
+endef
+
+define Package/libtins/description
+libtins is a high-level, multiplatform C++ network packet sniffing and crafting library.
+endef
+
+define Package/libtins/install
+    $(INSTALL_DIR) $(1)/usr/lib
+	$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libtins.so.3.5 $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libtins))

+ 112 - 0
libs/libwebsockets/Makefile

@@ -0,0 +1,112 @@
+#
+# Copyright (C) 2014-2015 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:=libwebsockets
+PKG_VERSION:=2.0.3
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_URL:=https://codeload.github.com/warmcat/libwebsockets/tar.gz/v$(PKG_VERSION)?
+PKG_MD5SUM:=a025156d606d90579e65d53ccd062a94
+
+
+PKG_SOURCE_VERSION:=v$(PKG_VERSION)
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_SOURCE_SUBDIR)
+
+PKG_LICENSE:=LGPL-2.1+exception
+PKG_LICENSE_FILES:=LICENSE
+
+CMAKE_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+CMAKE_OPTIONS += -DLWS_IPV6=$(if $(CONFIG_IPV6),ON,OFF)
+CMAKE_OPTIONS += -DLWS_WITHOUT_TESTAPPS=ON
+
+# other options worth noting
+# CMAKE_OPTIONS += -DLWS_WITHOUT_EXTENSIONS=ON
+# CMAKE_OPTIONS += -DLWS_WITHOUT_DAEMONIZE=ON
+# CMAKE_OPTIONS += -DLWS_WITHOUT_SERVER=ON
+# CMAKE_OPTIONS += -DLWS_WITHOUT_DEBUG=ON
+
+
+define Package/$(PKG_NAME)/Default
+	SECTION:=libs
+	CATEGORY:=Libraries
+	TITLE:=libwebsockets
+	PROVIDES:=libwebsockets
+	DEPENDS:=+zlib
+	URL:=https://libwebsockets.org
+	MAINTAINER:=Karl Palsson <karlp@etactica.com>
+endef
+
+define Package/libwebsockets-openssl
+	$(call Package/$(PKG_NAME)/Default)
+	TITLE += (OpenSSL)
+	DEPENDS += +libopenssl
+	VARIANT:=openssl
+endef
+
+define Package/libwebsockets-cyassl
+	$(call Package/$(PKG_NAME)/Default)
+	TITLE += (CyaSSL)
+	DEPENDS += +libcyassl
+	VARIANT:=cyassl
+endef
+
+define Package/libwebsockets-full
+	$(call Package/$(PKG_NAME)/Default)
+	TITLE += (Full - OpenSSL, libuv, plugins, CGI)
+	DEPENDS += +libopenssl +libuv
+	VARIANT:=full
+endef
+
+ifeq ($(BUILD_VARIANT),openssl)
+    CMAKE_OPTIONS += -DLWS_OPENSSL_CLIENT_CERTS=/etc/ssl/certs
+    CMAKE_OPTIONS += -DLWS_OPENSSL_SUPPORT=ON
+    CMAKE_OPTIONS += -DLWS_WITH_SSL=ON
+endif
+
+ifeq ($(BUILD_VARIANT),cyassl)
+    CMAKE_OPTIONS += -DLWS_OPENSSL_CLIENT_CERTS=/etc/ssl/certs
+    CMAKE_OPTIONS += -DLWS_OPENSSL_SUPPORT=ON
+    CMAKE_OPTIONS += -DLWS_WITH_SSL=ON
+# for cyassl, edit package/libs/cyassl/Makefile to include --enable-opensslextra
+# NOTE: it will compile without it, untested whether it it's needed?!
+    CMAKE_OPTIONS += -DLWS_USE_CYASSL=ON
+    CMAKE_OPTIONS += -DLWS_CYASSL_LIBRARIES=$(STAGING_DIR)/usr/lib/libcyassl.so
+    CMAKE_OPTIONS += -DLWS_CYASSL_INCLUDE_DIRS=$(STAGING_DIR)/usr/include
+endif
+
+ifeq ($(BUILD_VARIANT),full)
+    CMAKE_OPTIONS += -DLWS_OPENSSL_CLIENT_CERTS=/etc/ssl/certs
+    CMAKE_OPTIONS += -DLWS_OPENSSL_SUPPORT=ON
+    CMAKE_OPTIONS += -DLWS_WITH_SSL=ON
+    CMAKE_OPTIONS += -DLWS_WITH_LIBUV=ON
+    CMAKE_OPTIONS += -DLWS_WITH_PLUGINS=ON
+    CMAKE_OPTIONS += -DLWS_WITH_SERVER_STATUS=ON
+    CMAKE_OPTIONS += -DLWS_WITH_ACCESS_LOG=ON
+    CMAKE_OPTIONS += -DLWS_WITH_CGI=ON
+endif
+
+define Package/libwebsockets/install
+	$(INSTALL_DIR) $(1)/usr/lib
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libwebsockets.so* $(1)/usr/lib/
+endef
+
+Package/$(PKG_NAME)-cyassl/install = $(Package/$(PKG_NAME)/install)
+Package/$(PKG_NAME)-openssl/install = $(Package/$(PKG_NAME)/install)
+Package/$(PKG_NAME)-full/install = $(Package/$(PKG_NAME)/install)
+
+$(eval $(call BuildPackage,libwebsockets-openssl))
+$(eval $(call BuildPackage,libwebsockets-cyassl))
+$(eval $(call BuildPackage,libwebsockets-full))

+ 3 - 2
libs/libxslt/Makefile

@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2014 OpenWrt.org
+# Copyright (C) 2014 - 2018 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libxslt
 PKG_VERSION:=1.1.28
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:= \
@@ -64,6 +64,7 @@ define Package/xsltproc/description
 endef
 
 CONFIGURE_ARGS+= \
+	--disable-silent-rules \
 	--enable-shared \
 	--enable-static \
 	--without-python \

+ 48 - 0
libs/libxslt/patches/0005-Fix-a-couple-of-places-where-f-printf-parameters-wer.patch

@@ -0,0 +1,48 @@
+From: Daniel Veillard <veillard@redhat.com>
+Date: Wed, 30 Jan 2013 16:31:37 +0000
+Subject: Fix a couple of places where (f)printf parameters were broken
+
+As reported by Thomas Jarosch <thomas.jarosch@intra2net.com>
+---
+ python/libxslt.c    |   10 +++++-----
+ xsltproc/xsltproc.c |    2 +-
+ 2 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/python/libxslt.c b/python/libxslt.c
+index 6a4f1c3..8dd6c78 100644
+--- a/python/libxslt.c
++++ b/python/libxslt.c
+@@ -356,15 +356,15 @@ libxslt_xsltRegisterExtModuleElement(PyObject *self ATTRIBUTE_UNUSED,
+     PyObject *pyobj_element_f;
+     PyObject *pyobj_precomp_f;
+ 
+-#ifdef DEBUG_EXTENSIONS
+-    printf("libxslt_xsltRegisterExtModuleElement called\n",
+-	   name, ns_uri);
+-#endif
+-
+     if (!PyArg_ParseTuple(args, (char *)"szOO:registerExtModuleElement",
+ 		          &name, &ns_uri, &pyobj_precomp_f, &pyobj_element_f))
+         return(NULL);
+ 
++#ifdef DEBUG_EXTENSIONS
++    printf("libxslt_xsltRegisterExtModuleElement called: %s %s\n",
++	   name, ns_uri);
++#endif
++
+     if ((name == NULL) || (pyobj_element_f == NULL) || (pyobj_precomp_f == NULL)) {
+ 	py_retval = libxml_intWrap(-1);
+ 	return(py_retval);
+diff --git a/xsltproc/xsltproc.c b/xsltproc/xsltproc.c
+index 9ec4b76..33beddf 100644
+--- a/xsltproc/xsltproc.c
++++ b/xsltproc/xsltproc.c
+@@ -319,7 +319,7 @@ static void endTimer(char *format, ...)
+     va_start(ap, format);
+     vfprintf(stderr,format,ap);
+     va_end(ap);
+-    fprintf(stderr, " was not timed\n", msec);
++    fprintf(stderr, " was not timed\n");
+ #else
+   /* We don't have gettimeofday, time or stdarg.h, what crazy world is
+    * this ?!

+ 56 - 0
libs/libxslt/patches/0006-Initialize-pseudo-random-number-generator-with-curre.patch

@@ -0,0 +1,56 @@
+From: Nils Werner <wernerns@iis.fraunhofer.de>
+Date: Thu, 24 Jan 2013 18:44:03 +0000
+Subject: Initialize pseudo random number generator with current time or
+ optional command line parameter
+
+---
+ xsltproc/xsltproc.c |   15 +++++++++++++++
+ 1 file changed, 15 insertions(+)
+
+diff --git a/xsltproc/xsltproc.c b/xsltproc/xsltproc.c
+index 33beddf..7d1fe61 100644
+--- a/xsltproc/xsltproc.c
++++ b/xsltproc/xsltproc.c
+@@ -514,6 +514,7 @@ static void usage(const char *name) {
+     printf("\t--maxdepth val : increase the maximum depth (default %d)\n", xsltMaxDepth);
+     printf("\t--maxvars val : increase the maximum variables (default %d)\n", xsltMaxVars);
+     printf("\t--maxparserdepth val : increase the maximum parser depth\n");
++    printf("\t--seed-rand val : initialize pseudo random number generator with specific seed\n");
+ #ifdef LIBXML_HTML_ENABLED
+     printf("\t--html: the input document is(are) an HTML file(s)\n");
+ #endif
+@@ -556,6 +557,7 @@ main(int argc, char **argv)
+         return (1);
+     }
+ 
++    srand(time(NULL));
+     xmlInitMemory();
+ 
+     LIBXML_TEST_VERSION
+@@ -750,6 +752,15 @@ main(int argc, char **argv)
+                 if (value > 0)
+                     xmlParserMaxDepth = value;
+             }
++        } else if ((!strcmp(argv[i], "-seed-rand")) ||
++                   (!strcmp(argv[i], "--seed-rand"))) {
++            int value;
++
++            i++;
++            if (sscanf(argv[i], "%d", &value) == 1) {
++                if (value > 0)
++                    srand(value);
++            }
+         } else if ((!strcmp(argv[i],"-dumpextensions"))||
+ 			(!strcmp(argv[i],"--dumpextensions"))) {
+ 		dumpextensions++;
+@@ -786,6 +797,10 @@ main(int argc, char **argv)
+             (!strcmp(argv[i], "--maxparserdepth"))) {
+             i++;
+             continue;
++        } else if ((!strcmp(argv[i], "-seed-rand")) ||
++            (!strcmp(argv[i], "--seed-rand"))) {
++            i++;
++            continue;
+         } else if ((!strcmp(argv[i], "-o")) ||
+                    (!strcmp(argv[i], "-output")) ||
+                    (!strcmp(argv[i], "--output"))) {

+ 38 - 0
libs/libxslt/patches/0007-EXSLT-function-str-replace-is-broken-as-is.patch

@@ -0,0 +1,38 @@
+From: Nick Wellnhofer <wellnhofer@aevum.de>
+Date: Mon, 1 Jul 2013 13:10:10 +0000
+Subject: EXSLT function str:replace() is broken as-is
+
+the str:replace() function is no longer usable without a transform
+context. I take it from the bug report that it is not supposed to be used
+from plain XPath but only from XSLT according to the EXSLT specification.
+
+However, the previous implementation used to work in XPath and is still
+registered on an xmlXPathContext by the exsltStrXpathCtxtRegister()
+function. When called from plain XPath, it results in a memory error in
+line 526 (exsltStrReturnString()) of strings.c because xsltCreateRVT()
+returns NULL as an error indicator due to a NULL transform context being
+passed in, which was the return value from xsltXPathGetTransformContext() a
+bit further up (and the code doesn't validate that).
+
+Since fixing the function looks impossible, best is to remove it.
+---
+ libexslt/strings.c |    6 +-----
+ 1 file changed, 1 insertion(+), 5 deletions(-)
+
+diff --git a/libexslt/strings.c b/libexslt/strings.c
+index 045cc14..c0c7a18 100644
+--- a/libexslt/strings.c
++++ b/libexslt/strings.c
+@@ -838,11 +838,7 @@ exsltStrXpathCtxtRegister (xmlXPathContextPtr ctxt, const xmlChar *prefix)
+         && !xmlXPathRegisterFuncNS(ctxt,
+                                    (const xmlChar *) "concat",
+                                    (const xmlChar *) EXSLT_STRINGS_NAMESPACE,
+-                                   exsltStrConcatFunction)
+-        && !xmlXPathRegisterFuncNS(ctxt,
+-                                   (const xmlChar *) "replace",
+-                                   (const xmlChar *) EXSLT_STRINGS_NAMESPACE,
+-                                   exsltStrReplaceFunction)) {
++                                   exsltStrConcatFunction)) {
+         return 0;
+     }
+     return -1;

+ 43 - 0
libs/libxslt/patches/0008-Fix-quoting-of-xlocale-test-program-in-configure.in.patch

@@ -0,0 +1,43 @@
+From: Nick Wellnhofer <wellnhofer@aevum.de>
+Date: Tue, 30 Jul 2013 11:57:28 +0000
+Subject: Fix quoting of xlocale test program in configure.in
+
+Double square brackets aren't needed anymore, probably due to the
+changes in commit a2cd8a03.
+---
+ configure.in |   14 +++++++-------
+ 1 file changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/configure.in b/configure.in
+index 767e980..ac004fe 100644
+--- a/configure.in
++++ b/configure.in
+@@ -196,21 +196,21 @@ typedef locale_t xsltLocale;
+ #endif
+ ]],[[
+     xsltLocale locale;
+-    const char *src[[2]] = { "\xc3\x84rger", "Zeppelin" };
+-    char *dst[[2]];
++    const char *src[2] = { "\xc3\x84rger", "Zeppelin" };
++    char *dst[2];
+     size_t len, r;
+     int i;
+ 
+     locale = newlocale(LC_COLLATE_MASK, "en_US.utf8", NULL);
+     if (locale == NULL) exit(1);
+     for (i=0; i<2; ++i) {
+-        len = strxfrm_l(NULL, src[[i]], 0, locale) + 1;
+-        dst[[i]] = malloc(len);
+-        if(dst[[i]] == NULL) exit(1);
+-        r = strxfrm_l(dst[[i]], src[[i]], len, locale);
++        len = strxfrm_l(NULL, src[i], 0, locale) + 1;
++        dst[i] = malloc(len);
++        if(dst[i] == NULL) exit(1);
++        r = strxfrm_l(dst[i], src[i], len, locale);
+         if(r >= len) exit(1);
+     }
+-    if (strcmp(dst[[0]], dst[[1]]) >= 0) exit(1);
++    if (strcmp(dst[0], dst[1]) >= 0) exit(1);
+ 
+     exit(0);
+     return(0);

+ 29 - 0
libs/libxslt/patches/0009-Fix-for-type-confusion-in-preprocessing-attributes.patch

@@ -0,0 +1,29 @@
+From 7ca19df892ca22d9314e95d59ce2abdeff46b617 Mon Sep 17 00:00:00 2001
+From: Daniel Veillard <veillard@redhat.com>
+Date: Thu, 29 Oct 2015 19:33:23 +0800
+Subject: [PATCH] Fix for type confusion in preprocessing attributes
+
+CVE-2015-7995 http://www.openwall.com/lists/oss-security/2015/10/27/10
+We need to check that the parent node is an element before dereferencing
+its namespace
+---
+ libxslt/preproc.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/libxslt/preproc.c b/libxslt/preproc.c
+index 0eb80a0..7f69325 100644
+--- a/libxslt/preproc.c
++++ b/libxslt/preproc.c
+@@ -2249,7 +2249,8 @@ xsltStylePreCompute(xsltStylesheetPtr style, xmlNodePtr inst) {
+ 	} else if (IS_XSLT_NAME(inst, "attribute")) {
+ 	    xmlNodePtr parent = inst->parent;
+ 
+-	    if ((parent == NULL) || (parent->ns == NULL) ||
++	    if ((parent == NULL) ||
++	        (parent->type != XML_ELEMENT_NODE) || (parent->ns == NULL) ||
+ 		((parent->ns != inst->ns) &&
+ 		 (!xmlStrEqual(parent->ns->href, inst->ns->href))) ||
+ 		(!xmlStrEqual(parent->name, BAD_CAST "attribute-set"))) {
+-- 
+2.8.1
+

+ 62 - 0
libs/libxslt/patches/0010-Always-initialize-EXSLT-month-and-day-to-1.patch

@@ -0,0 +1,62 @@
+From 3309feb654036280d2355f8025150a69bfded6e2 Mon Sep 17 00:00:00 2001
+From: Nick Wellnhofer <wellnhofer@aevum.de>
+Date: Sun, 3 Jan 2016 16:45:24 +0100
+Subject: [PATCH] Always initialize EXSLT month and day to 1
+
+Fixes bug #757970
+https://bugzilla.gnome.org/show_bug.cgi?id=757970
+---
+ libexslt/date.c | 17 +++++++----------
+ 1 file changed, 7 insertions(+), 10 deletions(-)
+
+diff --git a/libexslt/date.c b/libexslt/date.c
+index 9ca993c..272c61b 100644
+--- a/libexslt/date.c
++++ b/libexslt/date.c
+@@ -667,6 +667,11 @@ exsltDateCreateDate (exsltDateType type)
+     }
+     memset (ret, 0, sizeof(exsltDateVal));
+ 
++    if (type != XS_DURATION) {
++        ret->value.date.mon = 1;
++        ret->value.date.day = 1;
++    }
++
+     if (type != EXSLT_UNKNOWN)
+         ret->type = type;
+ 
+@@ -1395,10 +1400,10 @@ _exsltDateTruncateDate (exsltDateValPtr dt, exsltDateType type)
+     }
+ 
+     if ((type & XS_GDAY) != XS_GDAY)
+-        dt->value.date.day = 0;
++        dt->value.date.day = 1;
+ 
+     if ((type & XS_GMONTH) != XS_GMONTH)
+-        dt->value.date.mon = 0;
++        dt->value.date.mon = 1;
+ 
+     if ((type & XS_GYEAR) != XS_GYEAR)
+         dt->value.date.year = 0;
+@@ -1473,18 +1478,10 @@ _exsltDateAdd (exsltDateValPtr dt, exsltDateValPtr dur)
+     d = &(dt->value.date);
+     u = &(dur->value.dur);
+ 
+-    /* normalization */
+-    if (d->mon == 0)
+-        d->mon = 1;
+-
+     /* normalize for time zone offset */
+     u->sec -= (d->tzo * 60);	/* changed from + to - (bug 153000) */
+     d->tzo = 0;
+ 
+-    /* normalization */
+-    if (d->day == 0)
+-        d->day = 1;
+-
+     /* month */
+     carry  = d->mon + u->mon;
+     r->mon = (unsigned int)MODULO_RANGE(carry, 1, 13);
+-- 
+2.8.1
+

+ 105 - 0
libs/libxslt/patches/0011-Fix-use-after-free-in-xsltDocumentFunctionLoadDocume.patch

@@ -0,0 +1,105 @@
+From fc1ff481fd01e9a65a921c542fed68d8c965e8a3 Mon Sep 17 00:00:00 2001
+From: Nick Wellnhofer <wellnhofer@aevum.de>
+Date: Thu, 25 Feb 2016 17:16:06 +0100
+Subject: [PATCH] Fix use-after-free in xsltDocumentFunctionLoadDocument
+
+Also fixes a memory leak in an unlikely error case.
+
+Fixes bug #758291
+https://bugzilla.gnome.org/show_bug.cgi?id=758291
+---
+ libxslt/functions.c         |  3 ++-
+ tests/docs/bug-185-data.xml |  5 +++++
+ tests/docs/bug-185.xml      |  2 ++
+ tests/general/bug-185.err   |  3 +++
+ tests/general/bug-185.out   |  0
+ tests/general/bug-185.xsl   | 14 ++++++++++++++
+ 6 files changed, 26 insertions(+), 1 deletion(-)
+ create mode 100644 tests/docs/bug-185-data.xml
+ create mode 100644 tests/docs/bug-185.xml
+ create mode 100644 tests/general/bug-185.err
+ create mode 100644 tests/general/bug-185.out
+ create mode 100644 tests/general/bug-185.xsl
+
+diff --git a/libxslt/functions.c b/libxslt/functions.c
+index 549649c..a5e7021 100644
+--- a/libxslt/functions.c
++++ b/libxslt/functions.c
+@@ -180,7 +180,6 @@ xsltDocumentFunctionLoadDocument(xmlXPathParserContextPtr ctxt, xmlChar* URI)
+     resObj = xmlXPtrEval(fragment, xptrctxt);
+     xmlXPathFreeContext(xptrctxt);
+ #endif
+-    xmlFree(fragment);
+ 
+     if (resObj == NULL)
+ 	goto out_fragment;
+@@ -204,6 +203,7 @@ xsltDocumentFunctionLoadDocument(xmlXPathParserContextPtr ctxt, xmlChar* URI)
+     }
+ 
+     valuePush(ctxt, resObj);
++    xmlFree(fragment);
+     return;
+ 
+ out_object:
+@@ -211,6 +211,7 @@ out_object:
+ 
+ out_fragment:
+     valuePush(ctxt, xmlXPathNewNodeSet(NULL));
++    xmlFree(fragment);
+ }
+ 
+ /**
+diff --git a/tests/docs/bug-185-data.xml b/tests/docs/bug-185-data.xml
+new file mode 100644
+index 0000000..166ef17
+--- /dev/null
++++ b/tests/docs/bug-185-data.xml
+@@ -0,0 +1,5 @@
++<!DOCTYPE test [ <!ATTLIST A id ID #REQUIRED> ] >
++<test>
++  <A id="X"/>
++  <A id="Y"/>
++</test>
+diff --git a/tests/docs/bug-185.xml b/tests/docs/bug-185.xml
+new file mode 100644
+index 0000000..72bfdc4
+--- /dev/null
++++ b/tests/docs/bug-185.xml
+@@ -0,0 +1,2 @@
++<?xml-stylesheet href="poc.xsl" type="text/xsl"?>
++<in>bug-185-data.xml#xpointer(id('X')/range-to(id('Y')))</in>
+diff --git a/tests/general/bug-185.err b/tests/general/bug-185.err
+new file mode 100644
+index 0000000..d7bbe92
+--- /dev/null
++++ b/tests/general/bug-185.err
+@@ -0,0 +1,3 @@
++runtime error: file ./bug-185.xsl line 7 element copy-of
++document() : XPointer does not select a node set: #xpointer(id('X')/range-to(id('Y')))
++no result for ./../docs/bug-185.xml
+diff --git a/tests/general/bug-185.out b/tests/general/bug-185.out
+new file mode 100644
+index 0000000..e69de29
+diff --git a/tests/general/bug-185.xsl b/tests/general/bug-185.xsl
+new file mode 100644
+index 0000000..1c5c7d1
+--- /dev/null
++++ b/tests/general/bug-185.xsl
+@@ -0,0 +1,14 @@
++<?xml version="1.0" encoding="utf-8"?>
++<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
++  <xsl:template match="in">
++    <annotation>
++      <xsl:copy-of select="."/>
++      <value>
++        <xsl:copy-of select="document(.)"/>
++      </value>
++    </annotation>
++  </xsl:template>
++  <xsl:template match="@*|node()">
++    <xsl:apply-templates/>
++  </xsl:template>
++</xsl:stylesheet>
+-- 
+2.8.1
+

+ 171 - 0
libs/libxslt/patches/0012-Fix-xsltNumberFormatGetMultipleLevel.patch

@@ -0,0 +1,171 @@
+From d182d8f6ba3071503d96ce17395c9d55871f0242 Mon Sep 17 00:00:00 2001
+From: Nick Wellnhofer <wellnhofer@aevum.de>
+Date: Tue, 22 Mar 2016 18:20:01 +0100
+Subject: [PATCH] Fix xsltNumberFormatGetMultipleLevel
+
+Namespace nodes are actually an xmlNs, not an xmlNode. They must be
+special-cased in xsltNumberFormatGetMultipleLevel to avoid an
+out-of-bounds heap access.
+
+Move the test whether a node matches the "count" pattern to a separate
+function to make the code more readable. As a side effect, we also
+compare expanded names when walking up the ancestor axis, fixing an
+insignificant bug.
+---
+ libxslt/numbers.c         | 82 +++++++++++++++++++++++++++--------------------
+ tests/docs/bug-186.xml    |  4 +++
+ tests/general/bug-186.out |  5 +++
+ tests/general/bug-186.xsl |  7 ++++
+ 4 files changed, 63 insertions(+), 35 deletions(-)
+ create mode 100644 tests/docs/bug-186.xml
+ create mode 100644 tests/general/bug-186.out
+ create mode 100644 tests/general/bug-186.xsl
+
+diff --git a/libxslt/numbers.c b/libxslt/numbers.c
+index e3209e0..184ee6f 100644
+--- a/libxslt/numbers.c
++++ b/libxslt/numbers.c
+@@ -532,6 +532,43 @@ xsltNumberFormatInsertNumbers(xsltNumberDataPtr data,
+ }
+ 
+ static int
++xsltTestCompMatchCount(xsltTransformContextPtr context,
++                       xmlNodePtr node,
++                       xsltCompMatchPtr countPat,
++                       xmlNodePtr cur)
++{
++    if (countPat != NULL) {
++        return xsltTestCompMatchList(context, node, countPat);
++    }
++    else {
++        /*
++         * 7.7 Numbering
++         *
++         * If count attribute is not specified, then it defaults to the
++         * pattern that matches any node with the same node type as the
++         * current node and, if the current node has an expanded-name, with
++         * the same expanded-name as the current node.
++         */
++        if (node->type != cur->type)
++            return 0;
++        if (node->type == XML_NAMESPACE_DECL)
++            /*
++             * Namespace nodes have no preceding siblings and no parents
++             * that are namespace nodes. This means that node == cur.
++             */
++            return 1;
++        /* TODO: Skip node types without expanded names like text nodes. */
++        if (!xmlStrEqual(node->name, cur->name))
++            return 0;
++        if (node->ns == cur->ns)
++            return 1;
++        if ((node->ns == NULL) || (cur->ns == NULL))
++            return 0;
++        return (xmlStrEqual(node->ns->href, cur->ns->href));
++    }
++}
++
++static int
+ xsltNumberFormatGetAnyLevel(xsltTransformContextPtr context,
+ 			    xmlNodePtr node,
+ 			    xsltCompMatchPtr countPat,
+@@ -562,21 +599,8 @@ xsltNumberFormatGetAnyLevel(xsltTransformContextPtr context,
+ 
+     while (cur != NULL) {
+ 	/* process current node */
+-	if (countPat == NULL) {
+-	    if ((node->type == cur->type) &&
+-		/* FIXME: must use expanded-name instead of local name */
+-		xmlStrEqual(node->name, cur->name)) {
+-		    if ((node->ns == cur->ns) ||
+-		        ((node->ns != NULL) &&
+-			 (cur->ns != NULL) &&
+-		         (xmlStrEqual(node->ns->href,
+-		             cur->ns->href) )))
+-		        cnt++;
+-	    }
+-	} else {
+-	    if (xsltTestCompMatchList(context, cur, countPat))
+-		cnt++;
+-	}
++	if (xsltTestCompMatchCount(context, cur, countPat, node))
++	    cnt++;
+ 	if ((fromPat != NULL) &&
+ 	    xsltTestCompMatchList(context, cur, fromPat)) {
+ 	    break; /* while */
+@@ -633,30 +657,18 @@ xsltNumberFormatGetMultipleLevel(xsltTransformContextPtr context,
+ 		xsltTestCompMatchList(context, ancestor, fromPat))
+ 		break; /* for */
+ 
+-	    if ((countPat == NULL && node->type == ancestor->type &&
+-		xmlStrEqual(node->name, ancestor->name)) ||
+-		xsltTestCompMatchList(context, ancestor, countPat)) {
++	    if (xsltTestCompMatchCount(context, ancestor, countPat, node)) {
+ 		/* count(preceding-sibling::*) */
+-		cnt = 0;
+-		for (preceding = ancestor;
++		cnt = 1;
++		for (preceding =
++                        xmlXPathNextPrecedingSibling(parser, ancestor);
+ 		     preceding != NULL;
+ 		     preceding =
+ 		        xmlXPathNextPrecedingSibling(parser, preceding)) {
+-		    if (countPat == NULL) {
+-			if ((preceding->type == ancestor->type) &&
+-			    xmlStrEqual(preceding->name, ancestor->name)){
+-			    if ((preceding->ns == ancestor->ns) ||
+-			        ((preceding->ns != NULL) &&
+-				 (ancestor->ns != NULL) &&
+-			         (xmlStrEqual(preceding->ns->href,
+-			             ancestor->ns->href) )))
+-			        cnt++;
+-			}
+-		    } else {
+-			if (xsltTestCompMatchList(context, preceding,
+-				                  countPat))
+-			    cnt++;
+-		    }
++
++	            if (xsltTestCompMatchCount(context, preceding, countPat,
++                                               node))
++			cnt++;
+ 		}
+ 		array[amount++] = (double)cnt;
+ 		if (amount >= max)
+diff --git a/tests/docs/bug-186.xml b/tests/docs/bug-186.xml
+new file mode 100644
+index 0000000..424db6b
+--- /dev/null
++++ b/tests/docs/bug-186.xml
+@@ -0,0 +1,4 @@
++<top xmlns:a="AAAA" xmlns:b="BBBB" xmlns:c="CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC">
++<foo/>
++<bar/>
++</top>
+diff --git a/tests/general/bug-186.out b/tests/general/bug-186.out
+new file mode 100644
+index 0000000..01a59f8
+--- /dev/null
++++ b/tests/general/bug-186.out
+@@ -0,0 +1,5 @@
++<?xml version="1.0"?>
++
++1111
++1111
++
+diff --git a/tests/general/bug-186.xsl b/tests/general/bug-186.xsl
+new file mode 100644
+index 0000000..9c491dd
+--- /dev/null
++++ b/tests/general/bug-186.xsl
+@@ -0,0 +1,7 @@
++<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
++ <xsl:template match="*/*">
++  <xsl:for-each select="namespace::*">
++   <xsl:number/>
++  </xsl:for-each>
++ </xsl:template>
++</xsl:stylesheet>
+-- 
+2.8.1
+

+ 26 - 0
libs/libxslt/patches/0013-Round-xsl-number-values-to-nearest-integer.patch

@@ -0,0 +1,26 @@
+From 345e0bfb1c1131155a32dfbdfc8f78d1c602dc40 Mon Sep 17 00:00:00 2001
+From: Nick Wellnhofer <wellnhofer@aevum.de>
+Date: Sun, 10 Apr 2016 12:50:02 +0200
+Subject: [PATCH] Round xsl:number values to nearest integer
+
+This matches XSLT 2.0 behavior.
+---
+ libxslt/numbers.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/libxslt/numbers.c b/libxslt/numbers.c
+index 184ee6f..eb087bc 100644
+--- a/libxslt/numbers.c
++++ b/libxslt/numbers.c
+@@ -440,6 +440,8 @@ xsltNumberFormatInsertNumbers(xsltNumberDataPtr data,
+     for (i = 0; i < numbers_max; i++) {
+ 	/* Insert number */
+ 	number = numbers[(numbers_max - 1) - i];
++        /* Round to nearest like XSLT 2.0 */
++        number = floor(number + 0.5);
+ 	if (i < tokens->nTokens) {
+ 	  /*
+ 	   * The "n"th format token will be used to format the "n"th
+-- 
+2.8.1
+

+ 51 - 0
libs/libxslt/patches/0014-Handle-negative-xsl-number-values.patch

@@ -0,0 +1,51 @@
+From 69ec3da1b653024aca6515ddd4adc91919dd188e Mon Sep 17 00:00:00 2001
+From: Nick Wellnhofer <wellnhofer@aevum.de>
+Date: Sun, 10 Apr 2016 12:51:57 +0200
+Subject: [PATCH] Handle negative xsl:number values
+
+According to XSLT 2.0, negative values are a non-recoverable dynamic error.
+Print an error message and treat negative values as zero.
+
+Fixes an OOB array access in xsltNumberFormatAlpha.
+---
+ libxslt/numbers.c | 17 ++++++++++++++++-
+ 1 file changed, 16 insertions(+), 1 deletion(-)
+
+diff --git a/libxslt/numbers.c b/libxslt/numbers.c
+index eb087bc..a3cabcf 100644
+--- a/libxslt/numbers.c
++++ b/libxslt/numbers.c
+@@ -246,7 +246,7 @@ xsltNumberFormatAlpha(xmlBufferPtr buffer,
+ 	number--;
+ 	*(--pointer) = alpha_list[((int)fmod(number, alpha_size))];
+ 	number /= alpha_size;
+-	if (fabs(number) < 1.0)
++	if (number < 1.0)
+ 	    break; /* for */
+     }
+     xmlBufferCCat(buffer, pointer);
+@@ -442,6 +442,21 @@ xsltNumberFormatInsertNumbers(xsltNumberDataPtr data,
+ 	number = numbers[(numbers_max - 1) - i];
+         /* Round to nearest like XSLT 2.0 */
+         number = floor(number + 0.5);
++        /*
++         * XSLT 1.0 isn't clear on how to handle negative numbers, but XSLT
++         * 2.0 says:
++         *
++         *     It is a non-recoverable dynamic error if any undiscarded item
++         *     in the atomized sequence supplied as the value of the value
++         *     attribute of xsl:number cannot be converted to an integer, or
++         *     if the resulting integer is less than 0 (zero).
++         */
++        if (number < 0.0) {
++            xsltTransformError(NULL, NULL, NULL,
++                    "xsl-number : negative value\n");
++            /* Recover by treating negative values as zero. */
++            number = 0.0;
++        }
+ 	if (i < tokens->nTokens) {
+ 	  /*
+ 	   * The "n"th format token will be used to format the "n"th
+-- 
+2.8.1
+

+ 75 - 0
libs/libxslt/patches/0015-Lower-bound-for-format-token-a.patch

@@ -0,0 +1,75 @@
+From 405034286fbdd6166229335b7203a41bf53b40fc Mon Sep 17 00:00:00 2001
+From: Nick Wellnhofer <wellnhofer@aevum.de>
+Date: Sun, 10 Apr 2016 13:11:31 +0200
+Subject: [PATCH] Lower bound for format token "a"
+
+Handle xsl:number with format "a" and value 0 according to XSLT 2.0.
+
+Fixes an OOB array access in xsltNumberFormatAlpha.
+---
+ libxslt/numbers.c | 33 ++++++++++++++++++++++++---------
+ 1 file changed, 24 insertions(+), 9 deletions(-)
+
+diff --git a/libxslt/numbers.c b/libxslt/numbers.c
+index a3cabcf..af52883 100644
+--- a/libxslt/numbers.c
++++ b/libxslt/numbers.c
+@@ -227,7 +227,8 @@ xsltNumberFormatDecimal(xmlBufferPtr buffer,
+ }
+ 
+ static void
+-xsltNumberFormatAlpha(xmlBufferPtr buffer,
++xsltNumberFormatAlpha(xsltNumberDataPtr data,
++		      xmlBufferPtr buffer,
+ 		      double number,
+ 		      int is_upper)
+ {
+@@ -237,6 +238,26 @@ xsltNumberFormatAlpha(xmlBufferPtr buffer,
+     char *alpha_list;
+     double alpha_size = (double)(sizeof(alpha_upper_list) - 1);
+ 
++    /*
++     * XSLT 1.0 isn't clear on how to handle zero, but XSLT 2.0 says:
++     *
++     *     For all format tokens other than the first kind above (one that
++     *     consists of decimal digits), there may be implementation-defined
++     *     lower and upper bounds on the range of numbers that can be
++     *     formatted using this format token; indeed, for some numbering
++     *     sequences there may be intrinsic limits. [...] Numbers that fall
++     *     outside this range must be formatted using the format token 1.
++     *
++     * The "a" token has an intrinsic lower limit of 1.
++     */
++    if (number < 1.0) {
++        xsltNumberFormatDecimal(buffer, number, '0', 1,
++                                data->digitsPerGroup,
++                                data->groupingCharacter,
++                                data->groupingCharacterLen);
++        return;
++    }
++
+     /* Build buffer from back */
+     pointer = &temp_string[sizeof(temp_string)];
+     *(--pointer) = 0;
+@@ -500,16 +521,10 @@ xsltNumberFormatInsertNumbers(xsltNumberDataPtr data,
+ 
+ 		switch (token->token) {
+ 		case 'A':
+-		    xsltNumberFormatAlpha(buffer,
+-					  number,
+-					  TRUE);
+-
++		    xsltNumberFormatAlpha(data, buffer, number, TRUE);
+ 		    break;
+ 		case 'a':
+-		    xsltNumberFormatAlpha(buffer,
+-					  number,
+-					  FALSE);
+-
++		    xsltNumberFormatAlpha(data, buffer, number, FALSE);
+ 		    break;
+ 		case 'I':
+ 		    xsltNumberFormatRoman(buffer,
+-- 
+2.8.1
+

+ 64 - 0
libs/libxslt/patches/0016-Lower-and-upper-bound-for-format-token-i.patch

@@ -0,0 +1,64 @@
+From 91d0540ac9beaa86719a05b749219a69baa0dd8d Mon Sep 17 00:00:00 2001
+From: Nick Wellnhofer <wellnhofer@aevum.de>
+Date: Sun, 10 Apr 2016 13:12:28 +0200
+Subject: [PATCH] Lower and upper bound for format token "i"
+
+Handle xsl:number with format "i" and value 0 according to XSLT 2.0.
+
+Also introduce an upper bound to fix a denial of service.
+---
+ libxslt/numbers.c | 25 ++++++++++++++++---------
+ 1 file changed, 16 insertions(+), 9 deletions(-)
+
+diff --git a/libxslt/numbers.c b/libxslt/numbers.c
+index af52883..e769c42 100644
+--- a/libxslt/numbers.c
++++ b/libxslt/numbers.c
+@@ -274,11 +274,24 @@ xsltNumberFormatAlpha(xsltNumberDataPtr data,
+ }
+ 
+ static void
+-xsltNumberFormatRoman(xmlBufferPtr buffer,
++xsltNumberFormatRoman(xsltNumberDataPtr data,
++		      xmlBufferPtr buffer,
+ 		      double number,
+ 		      int is_upper)
+ {
+     /*
++     * See discussion in xsltNumberFormatAlpha. Also use a reasonable upper
++     * bound to avoid denial of service.
++     */
++    if (number < 1.0 || number > 5000.0) {
++        xsltNumberFormatDecimal(buffer, number, '0', 1,
++                                data->digitsPerGroup,
++                                data->groupingCharacter,
++                                data->groupingCharacterLen);
++        return;
++    }
++
++    /*
+      * Based on an example by Jim Walsh
+      */
+     while (number >= 1000.0) {
+@@ -527,16 +540,10 @@ xsltNumberFormatInsertNumbers(xsltNumberDataPtr data,
+ 		    xsltNumberFormatAlpha(data, buffer, number, FALSE);
+ 		    break;
+ 		case 'I':
+-		    xsltNumberFormatRoman(buffer,
+-					  number,
+-					  TRUE);
+-
++		    xsltNumberFormatRoman(data, buffer, number, TRUE);
+ 		    break;
+ 		case 'i':
+-		    xsltNumberFormatRoman(buffer,
+-					  number,
+-					  FALSE);
+-
++		    xsltNumberFormatRoman(data, buffer, number, FALSE);
+ 		    break;
+ 		default:
+ 		    if (IS_DIGIT_ZERO(token->token)) {
+-- 
+2.8.1
+

+ 62 - 0
libs/libxslt/patches/0017-Fix-double-free-in-libexslt-hash-functions.patch

@@ -0,0 +1,62 @@
+From d8862309f08054218b28e2c8f5fb3cb2f650cac7 Mon Sep 17 00:00:00 2001
+From: Nick Wellnhofer <wellnhofer@aevum.de>
+Date: Wed, 20 Apr 2016 14:35:43 +0200
+Subject: [PATCH] Fix double free in libexslt hash functions
+
+Thanks to Nicolas Gregoire for the report.
+
+Fixes bug #765271:
+
+https://bugzilla.gnome.org/show_bug.cgi?id=765271
+---
+ libexslt/crypto.c             | 15 +++------------
+ tests/exslt/crypto/hash.1.out |  2 ++
+ tests/exslt/crypto/hash.1.xml |  5 +++++
+ 3 files changed, 10 insertions(+), 12 deletions(-)
+
+diff --git a/libexslt/crypto.c b/libexslt/crypto.c
+index 6aa9dd2..e13db8b 100644
+--- a/libexslt/crypto.c
++++ b/libexslt/crypto.c
+@@ -499,11 +499,8 @@ exsltCryptoMd4Function (xmlXPathParserContextPtr ctxt, int nargs) {
+     unsigned char hex[MD5_DIGEST_LENGTH * 2 + 1];
+ 
+     str_len = exsltCryptoPopString (ctxt, nargs, &str);
+-    if (str_len == 0) {
+-	xmlXPathReturnEmptyString (ctxt);
+-	xmlFree (str);
++    if (str_len == 0)
+ 	return;
+-    }
+ 
+     PLATFORM_HASH (ctxt, PLATFORM_MD4, (const char *) str, str_len,
+ 		   (char *) hash);
+@@ -532,11 +529,8 @@ exsltCryptoMd5Function (xmlXPathParserContextPtr ctxt, int nargs) {
+     unsigned char hex[MD5_DIGEST_LENGTH * 2 + 1];
+ 
+     str_len = exsltCryptoPopString (ctxt, nargs, &str);
+-    if (str_len == 0) {
+-	xmlXPathReturnEmptyString (ctxt);
+-	xmlFree (str);
++    if (str_len == 0)
+ 	return;
+-    }
+ 
+     PLATFORM_HASH (ctxt, PLATFORM_MD5, (const char *) str, str_len,
+ 		   (char *) hash);
+@@ -565,11 +559,8 @@ exsltCryptoSha1Function (xmlXPathParserContextPtr ctxt, int nargs) {
+     unsigned char hex[SHA1_DIGEST_LENGTH * 2 + 1];
+ 
+     str_len = exsltCryptoPopString (ctxt, nargs, &str);
+-    if (str_len == 0) {
+-	xmlXPathReturnEmptyString (ctxt);
+-	xmlFree (str);
++    if (str_len == 0)
+ 	return;
+-    }
+ 
+     PLATFORM_HASH (ctxt, PLATFORM_SHA1, (const char *) str, str_len,
+ 		   (char *) hash);
+-- 
+2.8.1
+

+ 33 - 0
libs/libxslt/patches/0018-Fix-buffer-overflow-in-exsltDateFormat.patch

@@ -0,0 +1,33 @@
+From 5d0c6565bab5b9b7efceb33b626916d22b4101a7 Mon Sep 17 00:00:00 2001
+From: Nick Wellnhofer <wellnhofer@aevum.de>
+Date: Thu, 28 Apr 2016 17:34:27 +0200
+Subject: [PATCH] Fix buffer overflow in exsltDateFormat
+
+Long years can overflow a stack-based buffer on 64-bit platforms by
+up to four bytes.
+
+Thanks to Nicolas Gregoire for the report.
+
+Fixes bug #765380:
+
+https://bugzilla.gnome.org/show_bug.cgi?id=765380
+---
+ libexslt/date.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libexslt/date.c b/libexslt/date.c
+index 272c61b..12c9919 100644
+--- a/libexslt/date.c
++++ b/libexslt/date.c
+@@ -1283,7 +1283,7 @@ exsltDateFormat (const exsltDateValPtr dt)
+     }
+ 
+     if (dt->type & XS_GYEAR) {
+-        xmlChar buf[20], *cur = buf;
++        xmlChar buf[100], *cur = buf;
+ 
+         FORMAT_GYEAR(dt->value.date.year, cur);
+         if (dt->type == XS_GYEARMONTH) {
+-- 
+2.8.1
+

+ 36 - 0
libs/libxslt/patches/0019-Fix-OOB-heap-read-in-xsltExtModuleRegisterDynamic.patch

@@ -0,0 +1,36 @@
+From 87c3d9ea214fc0503fd8130b6dd97431d69cc066 Mon Sep 17 00:00:00 2001
+From: Nick Wellnhofer <wellnhofer@aevum.de>
+Date: Thu, 5 May 2016 15:12:48 +0200
+Subject: [PATCH] Fix OOB heap read in xsltExtModuleRegisterDynamic
+
+xsltExtModuleRegisterDynamic would read a byte before the start of a
+string under certain circumstances. I looks like this piece code was
+supposed to strip characters from the end of the extension name, but
+it didn't have any effect. Don't read beyond the beginning of the
+string and actually strip unwanted characters.
+
+Found with afl-fuzz and ASan.
+---
+ libxslt/extensions.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/libxslt/extensions.c b/libxslt/extensions.c
+index 5ad73cb..ae6eef0 100644
+--- a/libxslt/extensions.c
++++ b/libxslt/extensions.c
+@@ -367,8 +367,11 @@ xsltExtModuleRegisterDynamic(const xmlChar * URI)
+         i++;
+     }
+ 
+-    if (*(i - 1) == '_')
++    /* Strip underscores from end of string. */
++    while (i > ext_name && *(i - 1) == '_') {
++        i--;
+         *i = '\0';
++    }
+ 
+     /* determine module directory */
+     ext_directory = (xmlChar *) getenv("LIBXSLT_PLUGINS_PATH");
+-- 
+2.8.1
+

+ 31 - 0
libs/libxslt/patches/0020-Fix-heap-overread-in-xsltFormatNumberConversion.patch

@@ -0,0 +1,31 @@
+From eb1030de31165b68487f288308f9d1810fed6880 Mon Sep 17 00:00:00 2001
+From: Nick Wellnhofer <wellnhofer@aevum.de>
+Date: Fri, 10 Jun 2016 14:23:58 +0200
+Subject: [PATCH] Fix heap overread in xsltFormatNumberConversion
+
+An empty decimal-separator could cause a heap overread. This can be
+exploited to leak a couple of bytes after the buffer that holds the
+pattern string.
+
+Found with afl-fuzz and ASan.
+---
+ libxslt/numbers.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/libxslt/numbers.c b/libxslt/numbers.c
+index d1549b4..e78c46b 100644
+--- a/libxslt/numbers.c
++++ b/libxslt/numbers.c
+@@ -1090,7 +1090,8 @@ xsltFormatNumberConversion(xsltDecimalFormatPtr self,
+     }
+ 
+     /* We have finished the integer part, now work on fraction */
+-    if (xsltUTF8Charcmp(the_format, self->decimalPoint) == 0) {
++    if ( (*the_format != 0) &&
++         (xsltUTF8Charcmp(the_format, self->decimalPoint) == 0) ) {
+         format_info.add_decimal = TRUE;
+ 	the_format += xsltUTF8Size(the_format);	/* Skip over the decimal */
+     }
+-- 
+2.10.2
+

+ 74 - 0
libs/libxslt/patches/0021-Check-for-integer-overflow-in-xsltAddTextString.patch

@@ -0,0 +1,74 @@
+From 08ab2774b870de1c7b5a48693df75e8154addae5 Mon Sep 17 00:00:00 2001
+From: Nick Wellnhofer <wellnhofer@aevum.de>
+Date: Thu, 12 Jan 2017 15:39:52 +0100
+Subject: [PATCH] Check for integer overflow in xsltAddTextString
+
+Limit buffer size in xsltAddTextString to INT_MAX. The issue can be
+exploited to trigger an out of bounds write on 64-bit systems.
+
+Originally reported to Chromium:
+
+https://crbug.com/676623
+---
+ libxslt/transform.c     | 25 ++++++++++++++++++++++---
+ libxslt/xsltInternals.h |  4 ++--
+ 2 files changed, 24 insertions(+), 5 deletions(-)
+
+diff --git a/libxslt/transform.c b/libxslt/transform.c
+index 519133fc..02bff34a 100644
+--- a/libxslt/transform.c
++++ b/libxslt/transform.c
+@@ -813,13 +813,32 @@ xsltAddTextString(xsltTransformContextPtr ctxt, xmlNodePtr target,
+         return(target);
+ 
+     if (ctxt->lasttext == target->content) {
++        int minSize;
+ 
+-	if (ctxt->lasttuse + len >= ctxt->lasttsize) {
++        /* Check for integer overflow accounting for NUL terminator. */
++        if (len >= INT_MAX - ctxt->lasttuse) {
++            xsltTransformError(ctxt, NULL, target,
++                "xsltCopyText: text allocation failed\n");
++            return(NULL);
++        }
++        minSize = ctxt->lasttuse + len + 1;
++
++        if (ctxt->lasttsize < minSize) {
+ 	    xmlChar *newbuf;
+ 	    int size;
++            int extra;
++
++            /* Double buffer size but increase by at least 100 bytes. */
++            extra = minSize < 100 ? 100 : minSize;
++
++            /* Check for integer overflow. */
++            if (extra > INT_MAX - ctxt->lasttsize) {
++                size = INT_MAX;
++            }
++            else {
++                size = ctxt->lasttsize + extra;
++            }
+ 
+-	    size = ctxt->lasttsize + len + 100;
+-	    size *= 2;
+ 	    newbuf = (xmlChar *) xmlRealloc(target->content,size);
+ 	    if (newbuf == NULL) {
+ 		xsltTransformError(ctxt, NULL, target,
+diff --git a/libxslt/xsltInternals.h b/libxslt/xsltInternals.h
+index 060b1783..5ad17719 100644
+--- a/libxslt/xsltInternals.h
++++ b/libxslt/xsltInternals.h
+@@ -1754,8 +1754,8 @@ struct _xsltTransformContext {
+      * Speed optimization when coalescing text nodes
+      */
+     const xmlChar  *lasttext;		/* last text node content */
+-    unsigned int    lasttsize;		/* last text node size */
+-    unsigned int    lasttuse;		/* last text node use */
++    int             lasttsize;		/* last text node size */
++    int             lasttuse;		/* last text node use */
+     /*
+      * Per Context Debugging
+      */
+-- 
+2.11.0
+

+ 73 - 0
libs/loudmouth/Makefile

@@ -0,0 +1,73 @@
+#
+# Copyright (C) 2007-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:=loudmouth
+PKG_VERSION:=1.5.3
+PKG_RELEASE:=1
+
+PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
+
+PKG_LICENSE:=LGPLv2.1
+PKG_LICENSE_FILES:=COPYING
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_URL:=https://github.com/mcabber/loudmouth.git
+PKG_SOURCE_VERSION:=$(PKG_VERSION)
+PKG_MD5SUM:=7616cf124a8d72d007e7475b5aeb20ad
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/loudmouth
+  SECTION:=libs
+  CATEGORY:=Libraries
+  DEPENDS:=+glib2 +libopenssl
+  TITLE:=loudmouth
+  URL:=https://github.com/mcabber/loudmouth
+endef
+
+define Package/loudmouth/description
+  Lightweight and easy-to-use C library for programming with the Jabber protocol
+endef
+
+CONFIGURE_ARGS += \
+	--with-ssl=openssl
+
+define Build/Configure
+	( cd $(PKG_BUILD_DIR); ./autogen.sh )
+	$(call Build/Configure/Default)
+endef
+
+define Build/InstallDev
+	$(INSTALL_DIR) $(1)/usr/include/
+	$(CP) \
+		$(PKG_INSTALL_DIR)/usr/include/loudmouth-1.0/ \
+		$(1)/usr/include/
+	$(INSTALL_DIR) $(1)/usr/lib/
+	$(CP) \
+		$(PKG_INSTALL_DIR)/usr/lib/*.so* \
+		$(1)/usr/lib/
+	$(INSTALL_DIR) $(1)/usr/lib/pkgconfig/
+	$(INSTALL_DATA) \
+		$(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc \
+		$(1)/usr/lib/pkgconfig/
+endef
+
+define Package/loudmouth/install
+	$(INSTALL_DIR) $(1)/usr/lib
+	$(CP) \
+		$(PKG_INSTALL_DIR)/usr/lib/*.so* \
+		$(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,loudmouth))

+ 2 - 2
libs/openldap/Makefile

@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=openldap
-PKG_VERSION:=2.4.44
+PKG_VERSION:=2.4.45
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
@@ -16,7 +16,7 @@ PKG_SOURCE_URL:=ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/ \
 	ftp://sunsite.cnlab-switch.ch/mirror/OpenLDAP/openldap-release/ \
 	ftp://ftp.nl.uu.net/pub/unix/db/openldap/openldap-release/ \
 	ftp://ftp.plig.org/pub/OpenLDAP/openldap-release/
-PKG_MD5SUM:=693ac26de86231f8dcae2b4e9d768e51
+PKG_MD5SUM:=00ff8301277cdfd0af728a6927042a13
 
 PKG_FIXUP:=autoreconf
 

+ 3 - 2
libs/p11-kit/Makefile

@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=p11-kit
 PKG_VERSION:=0.23.1
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_MAINTAINER:=Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
@@ -35,7 +35,8 @@ define Package/p11-kit/description
 endef
 
 CONFIGURE_ARGS+= \
-	--without-libffi
+	--without-libffi \
+	--disable-trust-module
 
 define Build/InstallDev
 	$(INSTALL_DIR) $(1)/usr/include/p11-kit-1/p11-kit/

+ 3 - 2
libs/pcre/Makefile

@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=pcre
-PKG_VERSION:=8.40
+PKG_VERSION:=8.41
 PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/
-PKG_MD5SUM:=41a842bf7dcecd6634219336e2167d1d
+PKG_MD5SUM:=c160d22723b1670447341b08c58981c1
 PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
 
 PKG_LICENSE:=BSD-3-Clause
@@ -53,6 +53,7 @@ CONFIGURE_ARGS += \
 	--enable-utf8 \
 	--enable-unicode-properties \
 	--enable-pcre16 \
+	--with-match-limit-recursion=16000 \
 
 ifneq ($(CONFIG_PACKAGE_libpcrecpp),)
   CONFIGURE_ARGS+= --enable-cpp

+ 0 - 53
libs/pcre/patches/001-CVE-2017-7186

@@ -1,53 +0,0 @@
-#CVE-2017-7186 patch
---- trunk/pcre_internal.h	2016/05/21 13:34:44	1649
-+++ trunk/pcre_internal.h	2017/02/24 17:30:30	1688
-@@ -2772,6 +2772,9 @@
- extern const pcre_uint16 PRIV(ucd_stage2)[];
- extern const pcre_uint32 PRIV(ucp_gentype)[];
- extern const pcre_uint32 PRIV(ucp_gbtable)[];
-+#ifdef COMPILE_PCRE32
-+extern const ucd_record  PRIV(dummy_ucd_record)[];
-+#endif
- #ifdef SUPPORT_JIT
- extern const int         PRIV(ucp_typerange)[];
- #endif
-@@ -2780,9 +2783,15 @@
- /* UCD access macros */
- 
- #define UCD_BLOCK_SIZE 128
--#define GET_UCD(ch) (PRIV(ucd_records) + \
-+#define REAL_GET_UCD(ch) (PRIV(ucd_records) + \
-         PRIV(ucd_stage2)[PRIV(ucd_stage1)[(int)(ch) / UCD_BLOCK_SIZE] * \
-         UCD_BLOCK_SIZE + (int)(ch) % UCD_BLOCK_SIZE])
-+        
-+#ifdef COMPILE_PCRE32
-+#define GET_UCD(ch) ((ch > 0x10ffff)? PRIV(dummy_ucd_record) : REAL_GET_UCD(ch))
-+#else
-+#define GET_UCD(ch) REAL_GET_UCD(ch)
-+#endif 
- 
- #define UCD_CHARTYPE(ch)    GET_UCD(ch)->chartype
- #define UCD_SCRIPT(ch)      GET_UCD(ch)->script
---- trunk/pcre_ucd.c	2014/06/19 07:51:39	1490
-+++ trunk/pcre_ucd.c	2017/02/24 17:30:30	1688
-@@ -38,6 +38,20 @@
- const pcre_uint32 PRIV(ucd_caseless_sets)[] = {0};
- #else
- 
-+/* If the 32-bit library is run in non-32-bit mode, character values
-+greater than 0x10ffff may be encountered. For these we set up a
-+special record. */
-+
-+#ifdef COMPILE_PCRE32
-+const ucd_record PRIV(dummy_ucd_record)[] = {{
-+  ucp_Common,    /* script */
-+  ucp_Cn,        /* type unassigned */
-+  ucp_gbOther,   /* grapheme break property */
-+  0,             /* case set */
-+  0,             /* other case */
-+  }};
-+#endif
-+
- /* When recompiling tables with a new Unicode version, please check the
- types in this structure definition from pcre_internal.h (the actual
- field names will be different):

+ 2 - 2
libs/postgresql/Makefile

@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=postgresql
-PKG_VERSION:=9.5.4
+PKG_VERSION:=9.5.10
 PKG_RELEASE:=4
 PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
 PKG_LICENSE:=PostgreSQL
@@ -18,7 +18,7 @@ PKG_SOURCE_URL:=\
 	https://ftp.postgresql.org/pub/source/v$(PKG_VERSION) \
 	http://ftp.postgresql.org/pub/source/v$(PKG_VERSION) \
 	ftp://ftp.postgresql.org/pub/source/v$(PKG_VERSION)
-PKG_MD5SUM:=cf5e571164ad66028ecd7dd8819e3765470d45bcd440d258b686be7e69c76ed0
+PKG_MD5SUM:=945d7ade094dded6b95495d8f1561a12ac9608276858ed30adf3c3658275f281
 PKG_BUILD_PARALLEL:=1
 PKG_USE_MIPS16:=0
 PKG_FIXUP:=autoreconf

+ 7 - 4
libs/sqlite3/Makefile

@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2006-2014 OpenWrt.org
+# Copyright (C) 2006-2018 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=sqlite
-PKG_VERSION:=3160000
-PKG_RELEASE:=1
+PKG_VERSION:=3190300
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-autoconf-$(PKG_VERSION).tar.gz
+PKG_HASH:=06129c03dced9f87733a8cba408871bd60673b8f93b920ba8d815efab0a06301
 PKG_SOURCE_URL:=http://www.sqlite.org/2017/
-PKG_MD5SUM:=5102404047054b2cec2f43463293f94dea39425d42bf386d24596ab4fac7c7ff
 
 PKG_LICENSE:=PUBLICDOMAIN
 PKG_LICENSE_FILES:=
@@ -68,6 +68,9 @@ $(call Package/sqlite3/Default/description)
  formats.
 endef
 
+# On uClibc libm needs to be linked in for ISNAN()
+TARGET_LDFLAGS += $(if $(CONFIG_USE_UCLIBC),-lm)
+
 TARGET_CFLAGS += $(FPIC) \
 	-DSQLITE_ENABLE_UNLOCK_NOTIFY=1 \
 	-DHAVE_ISNAN=1 \

+ 0 - 109
libs/tiff/Makefile

@@ -1,109 +0,0 @@
-#
-# Copyright (C) 2006-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:=tiff
-PKG_VERSION:=4.0.6
-PKG_RELEASE:=2
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://download.osgeo.org/libtiff
-PKG_MD5SUM:=d1d2e940dea0b5ad435f21f03d96dd72
-
-PKG_FIXUP:=autoreconf
-PKG_REMOVE_FILES:=autogen.sh aclocal.m4
-
-PKG_LICENSE:=BSD
-PKG_LICENSE_FILES:=COPYRIGHT
-
-PKG_INSTALL:=1
-
-PKG_CONFIG_DEPENDS:=CONFIG_PACKAGE_libtiffxx
-
-include $(INCLUDE_DIR)/uclibc++.mk
-include $(INCLUDE_DIR)/package.mk
-
-define Package/tiff/Default
-  TITLE:=TIFF
-  URL:=http://www.remotesensing.org/libtiff/
-  MAINTAINER:=Jiri Slachta <jiri@slachta.eu>
-endef
-
-define Package/libtiff
-$(call Package/tiff/Default)
-  SECTION:=libs
-  CATEGORY:=Libraries
-  TITLE+= library
-  DEPENDS:=+zlib +libjpeg
-endef
-
-define Package/libtiffxx
-$(call Package/tiff/Default)
-  SECTION:=libs
-  CATEGORY:=Libraries
-  TITLE+= library(c++ bindings)
-  DEPENDS:=+libtiff $(CXX_DEPENDS)
-endef
-
-define Package/tiff-utils
-$(call Package/tiff/Default)
-  SECTION:=utils
-  CATEGORY:=Utilities
-  SUBMENU:=Image Manipulation
-  TITLE+= utilities
-  DEPENDS:=+libtiff
-endef
-
-TARGET_CFLAGS += $(FPIC)
-
-define Build/Configure
-	$(call Build/Configure/Default, \
-		$(if $(CONFIG_PACKAGE_libtiffxx), \
-			--enable-cxx, \
-			--disable-cxx \
-		) \
-		--disable-lzma \
-		--enable-ccitt \
-		--enable-packbits \
-		--enable-lzw \
-		--enable-thunder \
-		--enable-next \
-		--enable-logluv \
-		--enable-mdi \
-		--enable-zlib \
-		--enable-jpeg \
-		--disable-old-jpeg \
-		--disable-jbig \
-		--without-x \
-	)
-endef
-
-define Build/InstallDev
-	$(INSTALL_DIR) $(1)/usr/{lib,include}
-	$(CP) $(PKG_INSTALL_DIR)/usr/lib/lib* $(1)/usr/lib/
-	$(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
-endef
-
-define Package/libtiff/install
-	$(INSTALL_DIR) $(1)/usr/lib
-	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libtiff.so.* $(1)/usr/lib/
-endef
-
-define Package/libtiffxx/install
-	$(INSTALL_DIR) $(1)/usr/lib
-	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libtiffxx.so.* $(1)/usr/lib/
-endef
-
-define Package/tiff-utils/install
-	$(INSTALL_DIR) $(1)/usr/bin
-	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
-endef
-
-$(eval $(call BuildPackage,libtiff))
-$(eval $(call BuildPackage,libtiffxx))
-$(eval $(call BuildPackage,tiff-utils))

+ 0 - 33
libs/tiff/patches/001-autoconf-compat.patch

@@ -1,33 +0,0 @@
-diff -rupN tiff-4.0.6/Makefile.am tiff-new/Makefile.am
---- tiff-4.0.6/Makefile.am	2015-09-06 21:30:46.179705536 +0200
-+++ tiff-new/Makefile.am	2016-04-05 14:26:09.539194844 +0200
-@@ -25,7 +25,7 @@
- 
- docdir = $(LIBTIFF_DOCDIR)
- 
--AUTOMAKE_OPTIONS = 1.12 dist-zip foreign
-+AUTOMAKE_OPTIONS = dist-zip foreign
- ACLOCAL_AMFLAGS = -I m4
- 
- docfiles = \
-@@ -61,7 +61,7 @@ distcheck-hook:
- 	rm -rf $(distdir)/_build/cmake
- 	rm -rf $(distdir)/_inst/cmake
- 
--SUBDIRS = port libtiff tools build contrib test man html
-+SUBDIRS = port libtiff tools build contrib
- 
- release:
- 	(rm -f $(top_srcdir)/RELEASE-DATE && echo $(LIBTIFF_RELEASE_DATE) > $(top_srcdir)/RELEASE-DATE)
-diff -rupN tiff-4.0.6/test/Makefile.am tiff-new/test/Makefile.am
---- tiff-4.0.6/test/Makefile.am	2015-09-01 04:41:07.598381354 +0200
-+++ tiff-new/test/Makefile.am	2016-04-05 14:26:39.763453075 +0200
-@@ -23,7 +23,7 @@
- 
- # Process this file with automake to produce Makefile.in.
- 
--AUTOMAKE_OPTIONS = 1.12 color-tests parallel-tests foreign
-+AUTOMAKE_OPTIONS = color-tests parallel-tests foreign
- 
- LIBTIFF = $(top_builddir)/libtiff/libtiff.la
- 

+ 0 - 136
libs/tiff/patches/002-CVE-2015-8665_and_CVE-2015-8683.patch

@@ -1,136 +0,0 @@
-From f3f0cad770593eaef0766e5be896a6a034fc6313 Mon Sep 17 00:00:00 2001
-From: erouault <erouault>
-Date: Sat, 26 Dec 2015 17:32:03 +0000
-Subject: [PATCH] * libtiff/tif_getimage.c: fix out-of-bound reads in
- TIFFRGBAImage interface in case of unsupported values of
- SamplesPerPixel/ExtraSamples for LogLUV / CIELab. Add explicit call to
- TIFFRGBAImageOK() in TIFFRGBAImageBegin(). Fix CVE-2015-8665 reported by
- limingxing and CVE-2015-8683 reported by zzf of Alibaba.
-
----
- ChangeLog              |  8 ++++++++
- libtiff/tif_getimage.c | 37 +++++++++++++++++++++++--------------
- 2 files changed, 31 insertions(+), 14 deletions(-)
-
-diff --git a/ChangeLog b/ChangeLog
-index a7d283a..4beb30b 100644
---- a/ChangeLog
-+++ b/ChangeLog
-@@ -1,3 +1,11 @@
-+2015-12-26  Even Rouault <even.rouault at spatialys.com>
-+
-+	* libtiff/tif_getimage.c: fix out-of-bound reads in TIFFRGBAImage
-+	interface in case of unsupported values of SamplesPerPixel/ExtraSamples
-+	for LogLUV / CIELab. Add explicit call to TIFFRGBAImageOK() in
-+	TIFFRGBAImageBegin(). Fix CVE-2015-8665 reported by limingxing and
-+	CVE-2015-8683 reported by zzf of Alibaba.
-+
- 2015-09-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>
- 
- 	* libtiff 4.0.6 released.
-diff --git a/libtiff/tif_getimage.c b/libtiff/tif_getimage.c
-index fd0a4f9..fae1e31 100644
---- a/libtiff/tif_getimage.c
-+++ b/libtiff/tif_getimage.c
-@@ -1,4 +1,4 @@
--/* $Id: tif_getimage.c,v 1.90 2015-06-17 01:34:08 bfriesen Exp $ */
-+/* $Id: tif_getimage.c,v 1.94 2015-12-26 17:32:03 erouault Exp $ */
- 
- /*
-  * Copyright (c) 1991-1997 Sam Leffler
-@@ -182,20 +182,22 @@ TIFFRGBAImageOK(TIFF* tif, char emsg[1024])
- 				    "Planarconfiguration", td->td_planarconfig);
- 				return (0);
- 			}
--			if( td->td_samplesperpixel != 3 )
-+			if( td->td_samplesperpixel != 3 || colorchannels != 3 )
-             {
-                 sprintf(emsg,
--                        "Sorry, can not handle image with %s=%d",
--                        "Samples/pixel", td->td_samplesperpixel);
-+                        "Sorry, can not handle image with %s=%d, %s=%d",
-+                        "Samples/pixel", td->td_samplesperpixel,
-+                        "colorchannels", colorchannels);
-                 return 0;
-             }
- 			break;
- 		case PHOTOMETRIC_CIELAB:
--            if( td->td_samplesperpixel != 3 || td->td_bitspersample != 8 )
-+            if( td->td_samplesperpixel != 3 || colorchannels != 3 || td->td_bitspersample != 8 )
-             {
-                 sprintf(emsg,
--                        "Sorry, can not handle image with %s=%d and %s=%d",
-+                        "Sorry, can not handle image with %s=%d, %s=%d and %s=%d",
-                         "Samples/pixel", td->td_samplesperpixel,
-+                        "colorchannels", colorchannels,
-                         "Bits/sample", td->td_bitspersample);
-                 return 0;
-             }
-@@ -255,6 +257,9 @@ TIFFRGBAImageBegin(TIFFRGBAImage* img, TIFF* tif, int stop, char emsg[1024])
- 	int colorchannels;
- 	uint16 *red_orig, *green_orig, *blue_orig;
- 	int n_color;
-+	
-+	if( !TIFFRGBAImageOK(tif, emsg) )
-+		return 0;
- 
- 	/* Initialize to normal values */
- 	img->row_offset = 0;
-@@ -2508,29 +2513,33 @@ PickContigCase(TIFFRGBAImage* img)
- 		case PHOTOMETRIC_RGB:
- 			switch (img->bitspersample) {
- 				case 8:
--					if (img->alpha == EXTRASAMPLE_ASSOCALPHA)
-+					if (img->alpha == EXTRASAMPLE_ASSOCALPHA &&
-+						img->samplesperpixel >= 4)
- 						img->put.contig = putRGBAAcontig8bittile;
--					else if (img->alpha == EXTRASAMPLE_UNASSALPHA)
-+					else if (img->alpha == EXTRASAMPLE_UNASSALPHA &&
-+							 img->samplesperpixel >= 4)
- 					{
- 						if (BuildMapUaToAa(img))
- 							img->put.contig = putRGBUAcontig8bittile;
- 					}
--					else
-+					else if( img->samplesperpixel >= 3 )
- 						img->put.contig = putRGBcontig8bittile;
- 					break;
- 				case 16:
--					if (img->alpha == EXTRASAMPLE_ASSOCALPHA)
-+					if (img->alpha == EXTRASAMPLE_ASSOCALPHA &&
-+						img->samplesperpixel >=4 )
- 					{
- 						if (BuildMapBitdepth16To8(img))
- 							img->put.contig = putRGBAAcontig16bittile;
- 					}
--					else if (img->alpha == EXTRASAMPLE_UNASSALPHA)
-+					else if (img->alpha == EXTRASAMPLE_UNASSALPHA &&
-+							 img->samplesperpixel >=4 )
- 					{
- 						if (BuildMapBitdepth16To8(img) &&
- 						    BuildMapUaToAa(img))
- 							img->put.contig = putRGBUAcontig16bittile;
- 					}
--					else
-+					else if( img->samplesperpixel >=3 )
- 					{
- 						if (BuildMapBitdepth16To8(img))
- 							img->put.contig = putRGBcontig16bittile;
-@@ -2539,7 +2548,7 @@ PickContigCase(TIFFRGBAImage* img)
- 			}
- 			break;
- 		case PHOTOMETRIC_SEPARATED:
--			if (buildMap(img)) {
-+			if (img->samplesperpixel >=4 && buildMap(img)) {
- 				if (img->bitspersample == 8) {
- 					if (!img->Map)
- 						img->put.contig = putRGBcontig8bitCMYKtile;
-@@ -2635,7 +2644,7 @@ PickContigCase(TIFFRGBAImage* img)
- 			}
- 			break;
- 		case PHOTOMETRIC_CIELAB:
--			if (buildMap(img)) {
-+			if (img->samplesperpixel == 3 && buildMap(img)) {
- 				if (img->bitspersample == 8)
- 					img->put.contig = initCIELabConversion(img);
- 				break;

+ 0 - 193
libs/tiff/patches/003-fix_potential_out-of-bound_writes_in_decode_functions.patch

@@ -1,193 +0,0 @@
-From 3899f0ab62dd307f63f87ec99aaf289e104f4070 Mon Sep 17 00:00:00 2001
-From: erouault <erouault>
-Date: Sun, 27 Dec 2015 16:25:11 +0000
-Subject: [PATCH] * libtiff/tif_luv.c: fix potential out-of-bound writes in
- decode functions in non debug builds by replacing assert()s by regular if
- checks (bugzilla #2522). Fix potential out-of-bound reads in case of short
- input data.
-
----
- ChangeLog         |  7 +++++++
- libtiff/tif_luv.c | 57 +++++++++++++++++++++++++++++++++++++++++++------------
- 2 files changed, 52 insertions(+), 12 deletions(-)
-
-diff --git a/ChangeLog b/ChangeLog
-index 4beb30b..b8aa23c 100644
---- a/ChangeLog
-+++ b/ChangeLog
-@@ -1,3 +1,10 @@
-+2015-12-27  Even Rouault <even.rouault at spatialys.com>
-+
-+	* libtiff/tif_luv.c: fix potential out-of-bound writes in decode
-+	functions in non debug builds by replacing assert()s by regular if
-+	checks (bugzilla #2522).
-+	Fix potential out-of-bound reads in case of short input data.
-+
- 2015-12-26  Even Rouault <even.rouault at spatialys.com>
- 
- 	* libtiff/tif_getimage.c: fix out-of-bound reads in TIFFRGBAImage
-diff --git a/libtiff/tif_luv.c b/libtiff/tif_luv.c
-index 4e328ba..60a174d 100644
---- a/libtiff/tif_luv.c
-+++ b/libtiff/tif_luv.c
-@@ -1,4 +1,4 @@
--/* $Id: tif_luv.c,v 1.40 2015-06-21 01:09:09 bfriesen Exp $ */
-+/* $Id: tif_luv.c,v 1.41 2015-12-27 16:25:11 erouault Exp $ */
- 
- /*
-  * Copyright (c) 1997 Greg Ward Larson
-@@ -202,7 +202,11 @@ LogL16Decode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
- 	if (sp->user_datafmt == SGILOGDATAFMT_16BIT)
- 		tp = (int16*) op;
- 	else {
--		assert(sp->tbuflen >= npixels);
-+		if(sp->tbuflen < npixels) {
-+			TIFFErrorExt(tif->tif_clientdata, module,
-+						 "Translation buffer too short");
-+			return (0);
-+		}
- 		tp = (int16*) sp->tbuf;
- 	}
- 	_TIFFmemset((void*) tp, 0, npixels*sizeof (tp[0]));
-@@ -211,9 +215,11 @@ LogL16Decode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
- 	cc = tif->tif_rawcc;
- 	/* get each byte string */
- 	for (shft = 2*8; (shft -= 8) >= 0; ) {
--		for (i = 0; i < npixels && cc > 0; )
-+		for (i = 0; i < npixels && cc > 0; ) {
- 			if (*bp >= 128) {		/* run */
--				rc = *bp++ + (2-128);   /* TODO: potential input buffer overrun when decoding corrupt or truncated data */
-+				if( cc < 2 )
-+					break;
-+				rc = *bp++ + (2-128);
- 				b = (int16)(*bp++ << shft);
- 				cc -= 2;
- 				while (rc-- && i < npixels)
-@@ -223,6 +229,7 @@ LogL16Decode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
- 				while (--cc && rc-- && i < npixels)
- 					tp[i++] |= (int16)*bp++ << shft;
- 			}
-+		}
- 		if (i != npixels) {
- #if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
- 			TIFFErrorExt(tif->tif_clientdata, module,
-@@ -268,13 +275,17 @@ LogLuvDecode24(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
- 	if (sp->user_datafmt == SGILOGDATAFMT_RAW)
- 		tp = (uint32 *)op;
- 	else {
--		assert(sp->tbuflen >= npixels);
-+		if(sp->tbuflen < npixels) {
-+			TIFFErrorExt(tif->tif_clientdata, module,
-+						 "Translation buffer too short");
-+			return (0);
-+		}
- 		tp = (uint32 *) sp->tbuf;
- 	}
- 	/* copy to array of uint32 */
- 	bp = (unsigned char*) tif->tif_rawcp;
- 	cc = tif->tif_rawcc;
--	for (i = 0; i < npixels && cc > 0; i++) {
-+	for (i = 0; i < npixels && cc >= 3; i++) {
- 		tp[i] = bp[0] << 16 | bp[1] << 8 | bp[2];
- 		bp += 3;
- 		cc -= 3;
-@@ -325,7 +336,11 @@ LogLuvDecode32(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
- 	if (sp->user_datafmt == SGILOGDATAFMT_RAW)
- 		tp = (uint32*) op;
- 	else {
--		assert(sp->tbuflen >= npixels);
-+		if(sp->tbuflen < npixels) {
-+			TIFFErrorExt(tif->tif_clientdata, module,
-+						 "Translation buffer too short");
-+			return (0);
-+		}
- 		tp = (uint32*) sp->tbuf;
- 	}
- 	_TIFFmemset((void*) tp, 0, npixels*sizeof (tp[0]));
-@@ -334,11 +349,13 @@ LogLuvDecode32(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
- 	cc = tif->tif_rawcc;
- 	/* get each byte string */
- 	for (shft = 4*8; (shft -= 8) >= 0; ) {
--		for (i = 0; i < npixels && cc > 0; )
-+		for (i = 0; i < npixels && cc > 0; ) {
- 			if (*bp >= 128) {		/* run */
-+				if( cc < 2 )
-+					break;
- 				rc = *bp++ + (2-128);
- 				b = (uint32)*bp++ << shft;
--				cc -= 2;                /* TODO: potential input buffer overrun when decoding corrupt or truncated data */
-+				cc -= 2;
- 				while (rc-- && i < npixels)
- 					tp[i++] |= b;
- 			} else {			/* non-run */
-@@ -346,6 +363,7 @@ LogLuvDecode32(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
- 				while (--cc && rc-- && i < npixels)
- 					tp[i++] |= (uint32)*bp++ << shft;
- 			}
-+		}
- 		if (i != npixels) {
- #if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
- 			TIFFErrorExt(tif->tif_clientdata, module,
-@@ -413,6 +431,7 @@ LogLuvDecodeTile(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
- static int
- LogL16Encode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
- {
-+	static const char module[] = "LogL16Encode";
- 	LogLuvState* sp = EncoderState(tif);
- 	int shft;
- 	tmsize_t i;
-@@ -433,7 +452,11 @@ LogL16Encode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
- 		tp = (int16*) bp;
- 	else {
- 		tp = (int16*) sp->tbuf;
--		assert(sp->tbuflen >= npixels);
-+		if(sp->tbuflen < npixels) {
-+			TIFFErrorExt(tif->tif_clientdata, module,
-+						 "Translation buffer too short");
-+			return (0);
-+		}
- 		(*sp->tfunc)(sp, bp, npixels);
- 	}
- 	/* compress each byte string */
-@@ -506,6 +529,7 @@ LogL16Encode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
- static int
- LogLuvEncode24(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
- {
-+	static const char module[] = "LogLuvEncode24";
- 	LogLuvState* sp = EncoderState(tif);
- 	tmsize_t i;
- 	tmsize_t npixels;
-@@ -521,7 +545,11 @@ LogLuvEncode24(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
- 		tp = (uint32*) bp;
- 	else {
- 		tp = (uint32*) sp->tbuf;
--		assert(sp->tbuflen >= npixels);
-+		if(sp->tbuflen < npixels) {
-+			TIFFErrorExt(tif->tif_clientdata, module,
-+						 "Translation buffer too short");
-+			return (0);
-+		}
- 		(*sp->tfunc)(sp, bp, npixels);
- 	}
- 	/* write out encoded pixels */
-@@ -553,6 +581,7 @@ LogLuvEncode24(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
- static int
- LogLuvEncode32(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
- {
-+	static const char module[] = "LogLuvEncode32";
- 	LogLuvState* sp = EncoderState(tif);
- 	int shft;
- 	tmsize_t i;
-@@ -574,7 +603,11 @@ LogLuvEncode32(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
- 		tp = (uint32*) bp;
- 	else {
- 		tp = (uint32*) sp->tbuf;
--		assert(sp->tbuflen >= npixels);
-+		if(sp->tbuflen < npixels) {
-+			TIFFErrorExt(tif->tif_clientdata, module,
-+						 "Translation buffer too short");
-+			return (0);
-+		}
- 		(*sp->tfunc)(sp, bp, npixels);
- 	}
- 	/* compress each byte string */

+ 0 - 72
libs/tiff/patches/004-fix_potential_out-of-bound_write_in_NeXTDecode.patch

@@ -1,72 +0,0 @@
-From 237c9c18b0b3479950e54a755ae428bf0f55f754 Mon Sep 17 00:00:00 2001
-From: erouault <erouault>
-Date: Sun, 27 Dec 2015 16:55:20 +0000
-Subject: [PATCH] * libtiff/tif_next.c: fix potential out-of-bound write in
- NeXTDecode() triggered by http://lcamtuf.coredump.cx/afl/vulns/libtiff5.tif
- (bugzilla #2508)
-
----
- ChangeLog          |  6 ++++++
- libtiff/tif_next.c | 12 +++++++++---
- 2 files changed, 15 insertions(+), 3 deletions(-)
-
-diff --git a/ChangeLog b/ChangeLog
-index b8aa23c..04926a3 100644
---- a/ChangeLog
-+++ b/ChangeLog
-@@ -1,5 +1,11 @@
- 2015-12-27  Even Rouault <even.rouault at spatialys.com>
- 
-+	* libtiff/tif_next.c: fix potential out-of-bound write in NeXTDecode()
-+	triggered by http://lcamtuf.coredump.cx/afl/vulns/libtiff5.tif
-+	(bugzilla #2508)
-+
-+2015-12-27  Even Rouault <even.rouault at spatialys.com>
-+
- 	* libtiff/tif_luv.c: fix potential out-of-bound writes in decode
- 	functions in non debug builds by replacing assert()s by regular if
- 	checks (bugzilla #2522).
-diff --git a/libtiff/tif_next.c b/libtiff/tif_next.c
-index 17e0311..1248caa 100644
---- a/libtiff/tif_next.c
-+++ b/libtiff/tif_next.c
-@@ -1,4 +1,4 @@
--/* $Id: tif_next.c,v 1.16 2014-12-29 12:09:11 erouault Exp $ */
-+/* $Id: tif_next.c,v 1.17 2015-12-27 16:55:20 erouault Exp $ */
- 
- /*
-  * Copyright (c) 1988-1997 Sam Leffler
-@@ -37,7 +37,7 @@
- 	case 0:	op[0]  = (unsigned char) ((v) << 6); break;	\
- 	case 1:	op[0] |= (v) << 4; break;	\
- 	case 2:	op[0] |= (v) << 2; break;	\
--	case 3:	*op++ |= (v);	   break;	\
-+	case 3:	*op++ |= (v);	   op_offset++; break;	\
- 	}					\
- }
- 
-@@ -106,6 +106,7 @@ NeXTDecode(TIFF* tif, uint8* buf, tmsize_t occ, uint16 s)
- 			uint32 imagewidth = tif->tif_dir.td_imagewidth;
-             if( isTiled(tif) )
-                 imagewidth = tif->tif_dir.td_tilewidth;
-+            tmsize_t op_offset = 0;
- 
- 			/*
- 			 * The scanline is composed of a sequence of constant
-@@ -122,10 +123,15 @@ NeXTDecode(TIFF* tif, uint8* buf, tmsize_t occ, uint16 s)
- 				 * bounds, potentially resulting in a security
- 				 * issue.
- 				 */
--				while (n-- > 0 && npixels < imagewidth)
-+				while (n-- > 0 && npixels < imagewidth && op_offset < scanline)
- 					SETPIXEL(op, grey);
- 				if (npixels >= imagewidth)
- 					break;
-+                if (op_offset >= scanline ) {
-+                    TIFFErrorExt(tif->tif_clientdata, module, "Invalid data for scanline %ld",
-+                        (long) tif->tif_row);
-+                    return (0);
-+                }
- 				if (cc == 0)
- 					goto bad;
- 				n = *bp++, cc--;

+ 0 - 11
libs/tiff/patches/005-fix-ftell-macro.patch

@@ -1,11 +0,0 @@
---- a/libtiff/tiffiop.h
-+++ b/libtiff/tiffiop.h
-@@ -284,7 +284,7 @@ struct tiff {
- */
- #if defined(HAVE_FSEEKO)
- #  define fseek(stream,offset,whence)  fseeko(stream,offset,whence)
--#  define ftell(stream,offset,whence)  ftello(stream,offset,whence)
-+#  define ftell(stream)  ftello(stream)
- #endif
- #endif
- #if defined(__WIN32__) && \

+ 59 - 0
mail/nail/Makefile

@@ -0,0 +1,59 @@
+#
+# Copyright (C) 2007-2014 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:=nail
+PKG_VERSION:=12.5
+PKG_RELEASE:=2
+PKG_LICENSE:=BSD-2-Clause
+
+PKG_SOURCE:=heirloom-mailx_$(PKG_VERSION).orig.tar.gz
+PKG_SOURCE_URL:=http://ftp.de.debian.org/debian/pool/main/h/heirloom-mailx/
+PKG_MD5SUM:=29a6033ef1412824d02eb9d9213cb1f2
+PKG_BUILD_DIR:=$(BUILD_DIR)/heirloom-mailx-$(PKG_VERSION)
+
+PKG_INSTALL:=0
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/nail
+  SECTION:=mail
+  CATEGORY:=Mail
+  TITLE:=Heirloom mailx (nail)
+  URL:=http://heirloom.sourceforge.net/mailx.html
+  MAINTAINER:=Dmitry V. Zimin <pfzim@mail.ru>
+  DEPENDS:=+libopenssl
+endef
+
+define Package/nail/description
+  Heirloom mailx (formerly known as "nail") is intended provide
+  the functionality of the POSIX mailx command with additional
+  support for MIME messages, IMAP (including caching), POP3,
+  SMTP, S/MIME, message threading/sorting, scoring, and filtering
+endef
+
+define Package/nail/conffiles
+/etc/nail.rc
+endef
+
+define Build/Install
+	$(INSTALL_DIR) $(PKG_INSTALL_DIR)/usr/bin
+	$(CP) $(PKG_BUILD_DIR)/mailx $(PKG_INSTALL_DIR)/usr/bin/
+	$(INSTALL_DIR) $(PKG_INSTALL_DIR)/etc
+	$(CP) $(PKG_BUILD_DIR)/nail.rc $(PKG_INSTALL_DIR)/etc/
+endef
+
+define Package/nail/install
+	$(INSTALL_DIR) $(1)/usr/bin
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
+	$(INSTALL_DIR) $(1)/etc
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/etc/* $(1)/etc/
+endef
+
+$(eval $(call BuildPackage,nail))
+

+ 22 - 0
mail/nail/patches/100-handle-openssl-without-sslv2-sslv3.patch

@@ -0,0 +1,22 @@
+--- a/openssl.c
++++ b/openssl.c
+@@ -216,11 +216,17 @@ ssl_select_method(const char *uhp)
+ 
+ 	cp = ssl_method_string(uhp);
+ 	if (cp != NULL) {
++#ifndef OPENSSL_NO_SSL2
+ 		if (equal(cp, "ssl2"))
+ 			method = SSLv2_client_method();
+-		else if (equal(cp, "ssl3"))
++		else
++#endif
++#ifndef OPENSSL_NO_SSL3
++		if (equal(cp, "ssl3"))
+ 			method = SSLv3_client_method();
+-		else if (equal(cp, "tls1"))
++		else
++#endif
++		if (equal(cp, "tls1"))
+ 			method = TLSv1_client_method();
+ 		else {
+ 			fprintf(stderr, catgets(catd, CATSET, 244,

+ 0 - 473
multimedia/ffmpeg/Config.in

@@ -1,473 +0,0 @@
-if PACKAGE_libffmpeg-custom
-
-config FFMPEG_CUSTOM_PATENTED
-	bool "Include patented codecs and technologies"
-	default BUILD_PATENTED
-
-comment "Profiles"
-
-config FFMPEG_CUSTOM_FFSERVER_SUPPORT
-	bool "Include support for ffserver (FFmpeg streaming server)"
-	select FFMPEG_CUSTOM_MUXER_ffm
-	select FFMPEG_CUSTOM_DEMUXER_ffm
-	select FFMPEG_CUSTOM_DEMUXER_rtsp
-	select FFMPEG_CUSTOM_PROTOCOL_rtp
-
-config FFMPEG_CUSTOM_MINIDLNA_SUPPORT
-	bool "Include support for minidlna"
-	depends on FFMPEG_CUSTOM_PATENTED
-	select FFMPEG_CUSTOM_DECODER_aac
-	select FFMPEG_CUSTOM_DECODER_ac3
-	select FFMPEG_CUSTOM_DECODER_flac
-	select FFMPEG_CUSTOM_DECODER_h264
-	select FFMPEG_CUSTOM_DECODER_hevc
-	select FFMPEG_CUSTOM_DECODER_jpegls
-	select FFMPEG_CUSTOM_DECODER_mp3
-	select FFMPEG_CUSTOM_DECODER_mpeg1video
-	select FFMPEG_CUSTOM_DECODER_mpeg2video
-	select FFMPEG_CUSTOM_DECODER_mpeg4
-	select FFMPEG_CUSTOM_DECODER_mpegvideo
-	select FFMPEG_CUSTOM_DECODER_png
-	select FFMPEG_CUSTOM_DECODER_opus
-	select FFMPEG_CUSTOM_DECODER_vc1
-	select FFMPEG_CUSTOM_DECODER_vorbis
-	select FFMPEG_CUSTOM_DECODER_wmav1
-	select FFMPEG_CUSTOM_DECODER_wmav2
-	select FFMPEG_CUSTOM_DEMUXER_avi
-	select FFMPEG_CUSTOM_DEMUXER_flac
-	select FFMPEG_CUSTOM_DEMUXER_matroska
-	select FFMPEG_CUSTOM_DEMUXER_mov
-	select FFMPEG_CUSTOM_DEMUXER_mp3
-	select FFMPEG_CUSTOM_DEMUXER_mpegts
-	select FFMPEG_CUSTOM_DEMUXER_mpegvideo
-	select FFMPEG_CUSTOM_DEMUXER_ogg
-	select FFMPEG_CUSTOM_PROTOCOL_file
-
-config FFMPEG_CUSTOM_AUDIO_DEC_SUPPORT
-	bool "Include support for most audio decoding requirements"
-	depends on FFMPEG_CUSTOM_PATENTED
-	select FFMPEG_CUSTOM_DECODER_aac
-	select FFMPEG_CUSTOM_DECODER_aac_latm
-	select FFMPEG_CUSTOM_DECODER_ac3
-	select FFMPEG_CUSTOM_SELECT_adpcm
-	select FFMPEG_CUSTOM_DECODER_alac
-	select FFMPEG_CUSTOM_DECODER_amrnb
-	select FFMPEG_CUSTOM_DECODER_amrwb
-	select FFMPEG_CUSTOM_DECODER_ape
-	select FFMPEG_CUSTOM_DECODER_atrac3
-	select FFMPEG_CUSTOM_DECODER_flac
-	select FFMPEG_CUSTOM_DECODER_mp2
-	select FFMPEG_CUSTOM_DECODER_mp3
-	select FFMPEG_CUSTOM_DECODER_mpc7
-	select FFMPEG_CUSTOM_DECODER_mpc8
-	select FFMPEG_CUSTOM_DECODER_opus
-	select FFMPEG_CUSTOM_DECODER_pcm_s16be
-	select FFMPEG_CUSTOM_DECODER_pcm_s16le
-	select FFMPEG_CUSTOM_DECODER_vorbis
-	select FFMPEG_CUSTOM_DECODER_wavpack
-	select FFMPEG_CUSTOM_DECODER_wmav1
-	select FFMPEG_CUSTOM_DECODER_wmav2
-	select FFMPEG_CUSTOM_DECODER_wmalossless
-	select FFMPEG_CUSTOM_DECODER_wmapro
-	select FFMPEG_CUSTOM_DECODER_zlib
-	select FFMPEG_CUSTOM_DEMUXER_aac
-	select FFMPEG_CUSTOM_DEMUXER_ac3
-	select FFMPEG_CUSTOM_DEMUXER_aiff
-	select FFMPEG_CUSTOM_DEMUXER_amr
-	select FFMPEG_CUSTOM_DEMUXER_ape
-	select FFMPEG_CUSTOM_DEMUXER_avi
-	select FFMPEG_CUSTOM_DEMUXER_flac
-	select FFMPEG_CUSTOM_DEMUXER_ffm
-	select FFMPEG_CUSTOM_DEMUXER_matroska
-	select FFMPEG_CUSTOM_DEMUXER_mp3
-	select FFMPEG_CUSTOM_DEMUXER_mov
-	select FFMPEG_CUSTOM_DEMUXER_mpc
-	select FFMPEG_CUSTOM_DEMUXER_mpc8
-	select FFMPEG_CUSTOM_DEMUXER_mpegts
-	select FFMPEG_CUSTOM_DEMUXER_ogg
-	select FFMPEG_CUSTOM_DEMUXER_rm
-	select FFMPEG_CUSTOM_DEMUXER_rtsp
-	select FFMPEG_CUSTOM_DEMUXER_rtp
-	select FFMPEG_CUSTOM_DEMUXER_sdp
-	select FFMPEG_CUSTOM_DEMUXER_wav
-	select FFMPEG_CUSTOM_DEMUXER_wv
-	select FFMPEG_CUSTOM_PARSER_aac
-	select FFMPEG_CUSTOM_PARSER_aac_latm
-	select FFMPEG_CUSTOM_PARSER_ac3
-	select FFMPEG_CUSTOM_PARSER_flac
-	select FFMPEG_CUSTOM_PARSER_mpegaudio
-	select FFMPEG_CUSTOM_PARSER_opus
-	select FFMPEG_CUSTOM_PROTOCOL_file
-	select FFMPEG_CUSTOM_PROTOCOL_http
-	select FFMPEG_CUSTOM_PROTOCOL_rtp
-	select FFMPEG_CUSTOM_PROTOCOL_tcp
-	select FFMPEG_CUSTOM_PROTOCOL_udp
-
-comment "External Libraries"
-
-config FFMPEG_CUSTOM_SELECT_mp3lame
-	bool "MP3 LAME"
-	depends on FFMPEG_CUSTOM_PATENTED
-	depends on PACKAGE_lame-lib
-	select FFMPEG_CUSTOM_DECODER_mp3
-	select FFMPEG_CUSTOM_MUXER_mp3
-	select FFMPEG_CUSTOM_DEMUXER_mp3
-
-config FFMPEG_CUSTOM_SELECT_libopus
-	bool "Opus"
-
-config FFMPEG_CUSTOM_SELECT_x264
-	bool "x264"
-	depends on FFMPEG_CUSTOM_PATENTED
-	depends on PACKAGE_libx264
-	select FFMPEG_CUSTOM_DECODER_h264
-	select FFMPEG_CUSTOM_MUXER_h264
-	select FFMPEG_CUSTOM_DEMUXER_h264
-	select FFMPEG_CUSTOM_PARSER_h264
-
-comment "Encoders"
-
-config FFMPEG_CUSTOM_ENCODER_ac3
-	bool "AC3"
-	depends on FFMPEG_CUSTOM_PATENTED
-	select FFMPEG_CUSTOM_PARSER_ac3
-
-config FFMPEG_CUSTOM_ENCODER_jpegls
-	bool "JPEG-LS"
-
-config FFMPEG_CUSTOM_ENCODER_mpeg1video
-	bool "MPEG-1 Video"
-
-config FFMPEG_CUSTOM_ENCODER_mpeg2video
-	bool "MPEG-2 Video"
-	depends on FFMPEG_CUSTOM_PATENTED
-
-config FFMPEG_CUSTOM_ENCODER_mpeg4
-	bool "MPEG-4"
-	depends on FFMPEG_CUSTOM_PATENTED
-
-config FFMPEG_CUSTOM_ENCODER_pcm_s16be
-	bool "PCM signed 16-bit big-endian"
-
-config FFMPEG_CUSTOM_ENCODER_pcm_s16le
-	bool "PCM signed 16-bit little-endian"
-
-config FFMPEG_CUSTOM_ENCODER_png
-	bool "PNG"
-	select FFMPEG_CUSTOM_ENCODER_zlib
-
-config FFMPEG_CUSTOM_ENCODER_vorbis
-	bool "Vorbis"
-
-config FFMPEG_CUSTOM_ENCODER_zlib
-	bool "Zlib"
-
-comment "Decoders"
-
-config FFMPEG_CUSTOM_DECODER_aac
-	bool "AAC (Advanced Audio Coding)"
-	depends on FFMPEG_CUSTOM_PATENTED
-	select FFMPEG_CUSTOM_PARSER_aac
-
-config FFMPEG_CUSTOM_SELECT_adpcm
-	bool "ADPCM (multiple types)"
-
-config FFMPEG_CUSTOM_DECODER_ac3
-	bool "AC3"
-	depends on FFMPEG_CUSTOM_PATENTED
-	select FFMPEG_CUSTOM_PARSER_ac3
-
-config FFMPEG_CUSTOM_DECODER_alac
-	bool "ALAC"
-
-config FFMPEG_CUSTOM_DECODER_amrnb
-	bool "AMR-NB"
-	select FFMPEG_CUSTOM_DEMUXER_amr
-
-config FFMPEG_CUSTOM_DECODER_amrwb
-	bool "AMR-WB"
-	select FFMPEG_CUSTOM_DEMUXER_amr
-
-config FFMPEG_CUSTOM_DECODER_ape
-	bool "APE"
-
-config FFMPEG_CUSTOM_DECODER_atrac3
-	bool "ATRAC3"
-	depends on FFMPEG_CUSTOM_PATENTED
-
-config FFMPEG_CUSTOM_DECODER_flac
-	bool "FLAC"
-	select FFMPEG_CUSTOM_PARSER_flac
-
-config FFMPEG_CUSTOM_DECODER_gif
-	bool "GIF"
-
-config FFMPEG_CUSTOM_DECODER_h264
-	bool "H.264"
-	depends on FFMPEG_CUSTOM_PATENTED
-
-config FFMPEG_CUSTOM_DECODER_hevc
-	bool "HEVC / H.265 Video"
-	depends on FFMPEG_CUSTOM_PATENTED
-
-config FFMPEG_CUSTOM_DECODER_jpegls
-	bool "JPEG-LS"
-
-config FFMPEG_CUSTOM_DECODER_mp2
-	bool "MP2 (MPEG Audio Layer 2)"
-	depends on FFMPEG_CUSTOM_PATENTED
-
-config FFMPEG_CUSTOM_DECODER_mp3
-	bool "MP3 (MPEG Audio Layer 2)"
-	depends on FFMPEG_CUSTOM_PATENTED
-
-config FFMPEG_CUSTOM_DECODER_mpegvideo
-	bool "MPEG Video"
-
-config FFMPEG_CUSTOM_DECODER_mpeg1video
-	bool "MPEG-1 Video"
-
-config FFMPEG_CUSTOM_DECODER_mpeg2video
-	bool "MPEG-2 Video"
-	depends on FFMPEG_CUSTOM_PATENTED
-
-config FFMPEG_CUSTOM_DECODER_mpeg4
-	bool "MPEG-4"
-	depends on FFMPEG_CUSTOM_PATENTED
-
-config FFMPEG_CUSTOM_DECODER_mpc7
-	bool "Musepack 7"
-	select FFMPEG_CUSTOM_DEMUXER_mpc
-
-config FFMPEG_CUSTOM_DECODER_mpc8
-	bool "Musepack 8"
-	select FFMPEG_CUSTOM_DEMUXER_mpc8
-
-config FFMPEG_CUSTOM_DECODER_opus
-	bool "Opus"
-
-config FFMPEG_CUSTOM_DECODER_pcm_s16be
-	bool "PCM signed 16-bit big-endian"
-
-config FFMPEG_CUSTOM_DECODER_pcm_s16le
-	bool "PCM signed 16-bit little-endian"
-
-config FFMPEG_CUSTOM_DECODER_png
-	bool "PNG"
-	select FFMPEG_CUSTOM_DECODER_zlib
-
-config FFMPEG_CUSTOM_DECODER_vc1
-	bool "VC-1 / WMV9"
-	depends on FFMPEG_CUSTOM_PATENTED
-
-config FFMPEG_CUSTOM_DECODER_vorbis
-	bool "Vorbis"
-	select FFMPEG_CUSTOM_DEMUXER_ogg
-
-config FFMPEG_CUSTOM_DECODER_wavpack
-	bool "Wavpack"
-
-config FFMPEG_CUSTOM_DECODER_wmav1
-	bool "WMAv1"
-	depends on FFMPEG_CUSTOM_PATENTED
-
-config FFMPEG_CUSTOM_DECODER_wmav2
-	bool "WMAv2"
-	depends on FFMPEG_CUSTOM_PATENTED
-
-config FFMPEG_CUSTOM_DECODER_zlib
-	bool "Zlib"
-
-comment "Muxers"
-
-config FFMPEG_CUSTOM_MUXER_ac3
-	bool "AC3"
-	depends on FFMPEG_CUSTOM_PATENTED
-
-config FFMPEG_CUSTOM_MUXER_ffm
-	bool "FFM (ffserver live feed)"
-
-config FFMPEG_CUSTOM_MUXER_h264
-	bool "H.264 Raw Video"
-	depends on FFMPEG_CUSTOM_PATENTED
-
-config FFMPEG_CUSTOM_MUXER_hevc
-	bool "HEVC / H265 Raw Video"
-	depends on FFMPEG_CUSTOM_PATENTED
-
-config FFMPEG_CUSTOM_MUXER_mp3
-	bool "MP3 (MPEG Audio Layer 3)"
-
-config FFMPEG_CUSTOM_MUXER_mp4
-	bool "MP4"
-
-config FFMPEG_CUSTOM_MUXER_mpeg1video
-	bool "MPEG-1 Video"
-
-config FFMPEG_CUSTOM_MUXER_mpeg2video
-	bool "MPEG-2 Video"
-
-config FFMPEG_CUSTOM_MUXER_mpegts
-	bool "MPEG-2 (TS)"
-
-config FFMPEG_CUSTOM_MUXER_ogg
-	bool "Ogg"
-
-config FFMPEG_CUSTOM_MUXER_rtp
-	bool "RTP"
-
-comment "Demuxers"
-
-config FFMPEG_CUSTOM_DEMUXER_aac
-	bool "AAC"
-
-config FFMPEG_CUSTOM_DEMUXER_avi
-	bool "AVI (Audio Video Interleave)"
-
-config FFMPEG_CUSTOM_DEMUXER_ac3
-	bool "AC3"
-
-config FFMPEG_CUSTOM_DEMUXER_amr
-	bool "AMR"
-
-config FFMPEG_CUSTOM_DEMUXER_ape
-	bool "APE"
-
-config FFMPEG_CUSTOM_DEMUXER_flac
-	bool "FLAC"
-
-config FFMPEG_CUSTOM_DEMUXER_ffm
-	bool "FFM (ffserver live feed)"
-
-config FFMPEG_CUSTOM_DEMUXER_h264
-	bool "H.264 Raw Video"
-	depends on FFMPEG_CUSTOM_PATENTED
-
-config FFMPEG_CUSTOM_DEMUXER_hevc
-	bool "HEVC / H265 Raw Video"
-	depends on FFMPEG_CUSTOM_PATENTED
-
-config FFMPEG_CUSTOM_DEMUXER_matroska
-	bool "Matroska (MKA,MKV)"
-	select FFMPEG_CUSTOM_DECODER_zlib
-
-config FFMPEG_CUSTOM_DEMUXER_mov
-	bool "MOV/MP4/M4A/3GP/3G2/MJ2"
-	select FFMPEG_CUSTOM_DECODER_zlib
-
-config FFMPEG_CUSTOM_DEMUXER_mp3
-	bool "MP3 (MPEG Audio Layer 3)"
-	select FFMPEG_CUSTOM_PARSER_mpegaudio
-
-config FFMPEG_CUSTOM_DEMUXER_mpegvideo
-	bool "MPEG Video"
-
-config FFMPEG_CUSTOM_DEMUXER_mpegps
-	bool "MPEG-2 (PS)"
-
-config FFMPEG_CUSTOM_DEMUXER_mpegts
-	bool "MPEG-2 (TS)"
-
-config FFMPEG_CUSTOM_DEMUXER_mpc
-	bool "Musepack"
-
-config FFMPEG_CUSTOM_DEMUXER_mpc8
-	bool "Musepack 8"
-
-config FFMPEG_CUSTOM_DEMUXER_ogg
-	bool "Ogg"
-
-config FFMPEG_CUSTOM_DEMUXER_rm
-	bool "RM"
-	help
-	  RealMedia format demuxer
-
-config FFMPEG_CUSTOM_DEMUXER_rtsp
-	bool "RTSP"
-	select FFMPEG_CUSTOM_DEMUXER_rm
-	select FFMPEG_CUSTOM_DEMUXER_sdp
-	select FFMPEG_CUSTOM_DEMUXER_rtp
-
-config FFMPEG_CUSTOM_DEMUXER_sdp
-	bool "SDP"
-	select FFMPEG_CUSTOM_DEMUXER_mpegts
-
-config FFMPEG_CUSTOM_DEMUXER_rtp
-	bool "RTP"
-
-config FFMPEG_CUSTOM_DEMUXER_vc1
-	bool "VC-1 / WMV9 Raw Video"
-	depends on FFMPEG_CUSTOM_PATENTED
-
-config FFMPEG_CUSTOM_DEMUXER_wav
-	bool "WAV"
-
-config FFMPEG_CUSTOM_DEMUXER_wv
-	bool "WV"
-
-comment "Parsers"
-
-config FFMPEG_CUSTOM_PARSER_aac
-	bool "AAC (Advanced Audio Coding)"
-	depends on FFMPEG_CUSTOM_PATENTED
-
-config FFMPEG_CUSTOM_PARSER_ac3
-	bool "AC3"
-
-config FFMPEG_CUSTOM_PARSER_flac
-	bool "FLAC"
-
-config FFMPEG_CUSTOM_PARSER_h264
-	bool "H.264"
-	depends on FFMPEG_CUSTOM_PATENTED
-	select FFMPEG_CUSTOM_DECODER_h264
-
-config FFMPEG_CUSTOM_PARSER_hevc
-	bool "HEVC / H265"
-	depends on FFMPEG_CUSTOM_PATENTED
-	select FFMPEG_CUSTOM_DECODER_hevc
-
-config FFMPEG_CUSTOM_PARSER_mpegaudio
-	bool "MPEG Audio"
-
-config FFMPEG_CUSTOM_PARSER_mpegvideo
-	bool "MPEG Video"
-
-config FFMPEG_CUSTOM_PARSER_mpeg4video
-	bool "MPEG-4 Video"
-
-config FFMPEG_CUSTOM_PARSER_opus
-	bool "Opus"
-
-config FFMPEG_CUSTOM_PARSER_vc1
-	bool "VC-1 / WMV9"
-	depends on FFMPEG_CUSTOM_PATENTED
-	select FFMPEG_CUSTOM_DECODER_vc1
-
-comment "Protocols"
-
-config FFMPEG_CUSTOM_PROTOCOL_file
-	bool "file:"
-
-config FFMPEG_CUSTOM_PROTOCOL_http
-	bool "http:"
-
-config FFMPEG_CUSTOM_PROTOCOL_icecast
-	bool "icecast:"
-	select FFMPEG_CUSTOM_PROTOCOL_http
-
-config FFMPEG_CUSTOM_PROTOCOL_pipe
-	bool "pipe:"
-
-config FFMPEG_CUSTOM_PROTOCOL_rtp
-	bool "rtp:"
-	select FFMPEG_CUSTOM_PROTOCOL_udp
-
-config FFMPEG_CUSTOM_PROTOCOL_tcp
-	bool "tcp:"
-
-config FFMPEG_CUSTOM_PROTOCOL_udp
-	bool "udp:"
-
-
-endif

+ 0 - 645
multimedia/ffmpeg/Makefile

@@ -1,645 +0,0 @@
-#
-# Copyright (C) 2006-2017 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:=ffmpeg
-PKG_VERSION:=3.2.2
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_SOURCE_URL:=https://ffmpeg.org/releases/
-PKG_MD5SUM:=e34d1b92c5d844f2a3611c741a6dba18
-PKG_HASH:=3f01bd1fe1a17a277f8c84869e5d9192b4b978cb660872aa2b54c3cc8a2fedfc
-PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
-
-PKG_LICENSE:=LGPL-2.1+ GPL-2+ LGPL-3
-PKG_LICENSE_FILES:=COPYING.GPLv2 COPYING.GPLv3 COPYING.LGPLv2.1 COPYING.LGPLv3
-
-FFMPEG_CUSTOM_ENCODERS:= \
-	ac3 \
-	jpegls \
-	mpeg1video \
-	mpeg2video \
-	mpeg4 \
-	pcm_s16be \
-	pcm_s16le \
-	png \
-	vorbis \
-	zlib \
-
-FFMPEG_CUSTOM_DECODERS:= \
-	aac \
-	ac3 \
-	alac \
-	amrnb \
-	amrwb \
-	ape \
-	atrac3 \
-	flac \
-	gif \
-	h264 \
-	hevc \
-	jpegls \
-	mp2 \
-	mp3 \
-	mpeg1video \
-	mpeg2video \
-	mpeg4 \
-	mpegvideo \
-	mpc7 \
-	mpc8 \
-	pcm_s16be \
-	pcm_s16le \
-	png \
-	vc1 \
-	vorbis \
-	wavpack \
-	wmav1 \
-	wmav2 \
-	zlib \
-
-FFMPEG_CUSTOM_MUXERS:= \
-	ac3 \
-	ffm \
-	h264 \
-	hevc \
-	mp3 \
-	mp4 \
-	mpeg1video \
-	mpeg2video \
-	mpegts \
-	ogg \
-	rtp \
-
-FFMPEG_CUSTOM_DEMUXERS:= \
-	aac \
-	ac3 \
-	amr \
-	ape \
-	avi \
-	flac \
-	ffm \
-	h264 \
-	hevc \
-	matroska \
-	mov \
-	mp3 \
-	mpegps \
-	mpegts \
-	mpegvideo \
-	mpc \
-	mpc8 \
-	ogg \
-	rm \
-	rtsp \
-	rtp \
-	sdp \
-	v4l2 \
-	vc1 \
-	wav \
-	wv \
-
-FFMPEG_CUSTOM_PARSERS:= \
-	aac \
-	flac \
-	ac3 \
-	h264 \
-	hevc \
-	mpegaudio \
-	mpeg4video \
-	mpegvideo \
-	vc1 \
-
-FFMPEG_CUSTOM_PROTOCOLS:= \
-	file http icecast pipe rtp tcp udp
-
-FFMPEG_MINI_DECODERS:= \
-	aac \
-	ac3 \
-	flac \
-	h264 \
-	hevc \
-	jpegls \
-	mp3 \
-	mpeg1video \
-	mpeg2video \
-	mpeg4 \
-	mpegvideo \
-	opus \
-	png \
-	vc1 \
-	vorbis \
-	wmav1 \
-	wmav2 \
-
-FFMPEG_MINI_DEMUXERS:= \
-	avi \
-	flac \
-	matroska \
-	mov \
-	mp3 \
-	mpegts \
-	mpegvideo \
-	ogg \
-
-FFMPEG_MINI_PROTOCOLS:= \
-	file \
-
-FFMPEG_AUDIO_DECODERS:= \
-	aac \
-	aac_latm \
-	ac3 \
-	adpcm_* \
-	alac \
-	amrnb \
-	amrwb \
-	ape \
-	atrac3 \
-	flac \
-	mp2 \
-	mp3* \
-	mpc7 \
-	mpc8 \
-	opus \
-	pcm_* \
-	vorbis \
-	wavpack \
-	wmav1 \
-	wmav2 \
-	wmalossless \
-	wmapro \
-	zlib \
-
-FFMPEG_AUDIO_DEMUXERS:= \
-	aac \
-	ac3 \
-	aiff \
-	amr \
-	ape \
-	avi \
-	flac \
-	ffm \
-	matroska \
-	mp3 \
-	mov \
-	mpc \
-	mpc8 \
-	mpegts \
-	ogg \
-	rm \
-	rtsp \
-	rtp \
-	sdp \
-	wav \
-	wv \
-
-FFMPEG_AUDIO_PARSERS:= \
-	aac \
-	aac_latm \
-	ac3 \
-	flac \
-	mpegaudio \
-	opus \
-
-FFMPEG_AUDIO_PROTOCOLS:= \
-	file http icecast rtp tcp udp
-
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
-
-PKG_CONFIG_DEPENDS:= \
-	$(patsubst %,CONFIG_FFMPEG_CUSTOM_ENCODER_%,$(FFMPEG_CUSTOM_ENCODERS)) \
-	$(patsubst %,CONFIG_FFMPEG_CUSTOM_DECODER_%,$(FFMPEG_CUSTOM_DECODERS)) \
-	$(patsubst %,CONFIG_FFMPEG_CUSTOM_MUXER_%,$(FFMPEG_CUSTOM_DEMUXERS)) \
-	$(patsubst %,CONFIG_FFMPEG_CUSTOM_DEMUXER_%,$(FFMPEG_CUSTOM_DEMUXERS)) \
-	$(patsubst %,CONFIG_FFMPEG_CUSTOM_PARSER_%,$(FFMPEG_CUSTOM_PARSERS)) \
-	$(patsubst %,CONFIG_FFMPEG_CUSTOM_PROTOCOL_%,$(FFMPEG_CUSTOM_PROTOCOLS))
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/ffmpeg/Default
- TITLE:=FFmpeg
- URL:=http://ffmpeg.mplayerhq.hu/
-endef
-
-define Package/ffmpeg/Default/description
- FFmpeg is a a software package that can record, convert and stream digital
- audio and video in numerous formats.
-endef
-
-
-define Package/ffmpeg
-$(call Package/ffmpeg/Default)
- SECTION:=multimedia
- CATEGORY:=Multimedia
- TITLE+= program
- DEPENDS+= +libpthread +libffmpeg-full
- VARIANT:=full
-endef
-
-define Package/ffmpeg/description
-$(call Package/ffmpeg/Default/description)
- .
- This package contains the FFmpeg command line tool.
-endef
-
-
-define Package/ffprobe
-$(call Package/ffmpeg/Default)
- SECTION:=multimedia
- CATEGORY:=Multimedia
- TITLE+= CLI media identifier
- DEPENDS+= +libffmpeg-full
- VARIANT:=full
-endef
-
-define Package/ffprobe/description
-$(call Package/ffmpeg/Default/description)
- .
- This package contains the FFprobe command line tool.
-endef
-
-
-define Package/ffserver
-$(call Package/ffserver/Default)
- SECTION:=multimedia
- CATEGORY:=Multimedia
- TITLE+= streaming server
- DEPENDS+= +libpthread +libffmpeg-full
- VARIANT:=full
-endef
-
-define Package/ffserver/description
-$(call Package/ffmpeg/Default/description)
- .
- This package contains the FFmpeg streaming server.
-endef
-
-define Package/libffmpeg/Default
-$(call Package/ffmpeg/Default)
- SECTION:=libs
- CATEGORY:=Libraries
- TITLE+= libraries
- DEPENDS+= @BUILD_PATENTED +libpthread +zlib +libbz2
- PROVIDES:= libffmpeg
-endef
-
-
-define Package/libffmpeg-custom
-$(call Package/libffmpeg/Default)
- TITLE+= (custom)
- DEPENDS+= +FFMPEG_CUSTOM_SELECT_libopus:libopus \
-           +PACKAGE_libx264:libx264 +PACKAGE_lame-lib:lame-lib
-
- VARIANT:=custom
- MENU:=1
-endef
-
-define Package/libffmpeg-custom/config
-source "$(SOURCE)/Config.in"
-endef
-
-define Package/libffmpeg-custom/description
-$(call Package/ffmpeg/Default/description)
- .
- This package contains customized FFmpeg shared libraries.
-endef
-
-
-define Package/libffmpeg-audio-dec
-$(call Package/libffmpeg/Default)
- TITLE+= (audio)
- VARIANT:=audio-dec
-endef
-
-define Package/libffmpeg-audio-dec/description
-$(call Package/ffmpeg/Default/description)
- .
- This package contains FFmpeg shared libraries for audio decoding
-endef
-
-
-define Package/libffmpeg-full
-$(call Package/libffmpeg/Default)
- TITLE+= (full)
- DEPENDS+= +alsa-lib +PACKAGE_libx264:libx264 +PACKAGE_lame-lib:lame-lib +libopus
- VARIANT:=full
-endef
-
-define Package/libffmpeg-full/description
-$(call Package/ffmpeg/Default/description)
- .
- This package contains full-featured FFmpeg shared libraries.
-endef
-
-
-define Package/libffmpeg-mini
-$(call Package/libffmpeg/Default)
- TITLE+= (mini)
- VARIANT:=mini
-endef
-
-define Package/libffmpeg-mini/description
-$(call Package/ffmpeg/Default/description)
- .
- This package contains minimal-featured FFmpeg shared libraries.
-endef
-
-
-FFMPEG_CONFIGURE:= \
-	CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(FPIC)" \
-	LDFLAGS="$(TARGET_LDFLAGS)" \
-	./configure \
-	--enable-cross-compile \
-	--cross-prefix="$(TARGET_CROSS)" \
-	--arch="$(ARCH)" \
-	--target-os=linux \
-	--prefix="/usr" \
-	--pkg-config="pkg-config" \
-	--enable-shared \
-	--enable-static \
-	--enable-small \
-	--enable-pthreads \
-	--enable-zlib \
-	--disable-doc \
-	--disable-debug \
-	\
-	--enable-gpl \
-	--enable-version3 \
-	\
-	--disable-dxva2 \
-	--disable-lzma \
-	--disable-vaapi \
-	--disable-vda \
-	--disable-vdpau \
-	--disable-outdevs
-
-ifeq ($(CONFIG_SOFT_FLOAT),y)
-FFMPEG_CONFIGURE += \
-	--disable-altivec \
-	--disable-vsx \
-	--disable-power8 \
-	--disable-amd3dnow \
-	--disable-amd3dnowext \
-	--disable-mmx \
-	--disable-mmxext \
-	--disable-sse \
-	--disable-sse2 \
-	--disable-sse3 \
-	--disable-ssse3 \
-	--disable-sse4 \
-	--disable-sse42 \
-	--disable-avx \
-	--disable-xop \
-	--disable-fma3 \
-	--disable-fma4 \
-	--disable-avx2 \
-	--disable-aesni \
-	--disable-armv5te \
-	--disable-armv6 \
-	--disable-armv6t2 \
-	--disable-inline-asm \
-	--disable-mipsdsp \
-	--disable-mipsdspr2 \
-	--disable-mipsfpu \
-	--disable-msa \
-	--disable-mmi \
-	--disable-fast-unaligned \
-	--disable-runtime-cpudetect
-
-else ifneq ($(findstring arm,$(CONFIG_ARCH)),)
-FFMPEG_CONFIGURE += \
-	--disable-runtime-cpudetect
-else ifneq ($(findstring powerpc,$(CONFIG_ARCH)),)
-FFMPEG_CONFIGURE += \
-	--disable-altivec
-endif
-
-ifneq ($(CONFIG_YASM),y)
-FFMPEG_CONFIGURE += \
-	--disable-yasm
-
-endif
-
-#selectibly disable optimizations according to arch/cpu type
-ifneq ($(findstring arm,$(CONFIG_ARCH)),)
-	ifeq (,$(findstring vfp,$(CONFIG_TARGET_OPTIMIZATION)))
-		FFMPEG_CONFIGURE+= \
-			--disable-vfp
-	endif
-	ifeq (,$(findstring neon,$(CONFIG_TARGET_OPTIMIZATION)))
-		FFMPEG_CONFIGURE+= \
-			--disable-neon
-	endif
-
-endif
-
-ifeq ($(BUILD_VARIANT),full)
-	FFMPEG_CONFIGURE+= \
-		--enable-libopus --enable-decoder=libopus \
-		$(if $(CONFIG_PACKAGE_libx264),--enable-libx264) \
-		$(if $(CONFIG_PACKAGE_lame-lib),--enable-libmp3lame)
-endif
-
-ifeq ($(BUILD_VARIANT),custom)
-
-  FFMPEG_ENABLE= \
-	$(foreach c, $(2), \
-		$(if $($(3)_$(c)),--enable-$(1)="$(c)") \
-	)
-
-  FFMPEG_CONFIGURE+= \
-	--disable-programs \
-	--disable-avfilter \
-	--disable-postproc \
-	--disable-swresample \
-	--disable-swscale \
-	--disable-everything \
-	$(call FFMPEG_ENABLE,encoder,$(FFMPEG_CUSTOM_ENCODERS),CONFIG_FFMPEG_CUSTOM_ENCODER) \
-	$(call FFMPEG_ENABLE,decoder,$(FFMPEG_CUSTOM_DECODERS),CONFIG_FFMPEG_CUSTOM_DECODER) \
-	$(call FFMPEG_ENABLE,muxer,$(FFMPEG_CUSTOM_MUXERS),CONFIG_FFMPEG_CUSTOM_MUXER) \
-	$(call FFMPEG_ENABLE,demuxer,$(FFMPEG_CUSTOM_DEMUXERS),CONFIG_FFMPEG_CUSTOM_DEMUXER) \
-	$(call FFMPEG_ENABLE,parser,$(FFMPEG_CUSTOM_PARSERS),CONFIG_FFMPEG_CUSTOM_PARSER) \
-	$(call FFMPEG_ENABLE,protocol,$(FFMPEG_CUSTOM_PROTOCOLS),CONFIG_FFMPEG_CUSTOM_PROTOCOL) \
-
-ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_adpcm),y)
-  FFMPEG_CONFIGURE+= \
-	--enable-decoder=adpcm_ima_wav \
-	--enable-decoder=adpcm_ima_qt \
-	--enable-decoder=adpcm_ms \
-
-endif
-
-ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libopus),y)
-  FFMPEG_CONFIGURE+= \
-	--enable-libopus --enable-decoder=libopus
-endif
-
-ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_x264),y)
-  FFMPEG_CONFIGURE+= \
-	--enable-libx264
-endif
-
-ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_mp3lame),y)
-  FFMPEG_CONFIGURE+= \
-	--enable-libmp3lame
-endif
-
-endif
-
-ifeq ($(BUILD_VARIANT),audio-dec)
-
-  FFMPEG_ENABLE= \
-	$(foreach c, $(2), \
-		--enable-$(1)="$(c)" \
-	)
-
-  FFMPEG_CONFIGURE+= \
-	--disable-programs \
-	--disable-avfilter \
-	--disable-postproc \
-	--disable-swresample \
-	--disable-swscale \
-	--disable-everything \
-	$(call FFMPEG_ENABLE,decoder,$(FFMPEG_AUDIO_DECODERS)) \
-	$(call FFMPEG_ENABLE,demuxer,$(FFMPEG_AUDIO_DEMUXERS)) \
-	$(call FFMPEG_ENABLE,parser,$(FFMPEG_AUDIO_PARSERS)) \
-	$(call FFMPEG_ENABLE,protocol,$(FFMPEG_AUDIO_PROTOCOLS)) \
-	--disable-decoder=pcm_bluray,pcm_dvd \
-
-endif
-
-ifeq ($(BUILD_VARIANT),mini)
-
-  FFMPEG_ENABLE= \
-	$(foreach c, $(2), \
-		--enable-$(1)="$(c)" \
-	)
-
-  FFMPEG_CONFIGURE+= \
-	--disable-programs \
-	--disable-avdevice \
-	--disable-avfilter \
-	--disable-postproc \
-	--disable-swresample \
-	--disable-swscale \
-	--disable-everything \
-	$(call FFMPEG_ENABLE,decoder,$(FFMPEG_MINI_DECODERS)) \
-	$(call FFMPEG_ENABLE,demuxer,$(FFMPEG_MINI_DEMUXERS)) \
-	$(call FFMPEG_ENABLE,protocol,$(FFMPEG_MINI_PROTOCOLS)) \
-
-endif
-
-ifneq ($(CONFIG_TARGET_x86),)
-  TARGET_CFLAGS += -fomit-frame-pointer
-endif
-
-define Build/Configure
-	( cd $(PKG_BUILD_DIR); $(FFMPEG_CONFIGURE) )
-endef
-
-define Build/Compile
-	$(MAKE) -C $(PKG_BUILD_DIR) \
-		DESTDIR="$(PKG_INSTALL_DIR)" \
-		all install
-endef
-
-define Build/InstallDev/custom
-	$(INSTALL_DIR) $(1)/usr/include
-	$(CP) $(PKG_INSTALL_DIR)/usr/include/lib{avcodec,avdevice,avformat,avutil} $(1)/usr/include/
-	$(INSTALL_DIR) $(1)/usr/lib
-	$(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avformat,avutil}.{a,so*} $(1)/usr/lib/
-	$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
-	$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lib{avcodec,avdevice,avformat,avutil}.pc $(1)/usr/lib/pkgconfig/
-endef
-
-define Build/InstallDev/full
-	$(INSTALL_DIR) $(1)/usr/include
-	$(CP) $(PKG_INSTALL_DIR)/usr/include/lib{avcodec,avdevice,avfilter,avformat,avutil,postproc,swresample,swscale} $(1)/usr/include/
-	$(INSTALL_DIR) $(1)/usr/lib
-	$(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avfilter,avformat,avutil,postproc,swresample,swscale}.{a,so*} $(1)/usr/lib/
-	$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
-	$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lib{avcodec,avdevice,avfilter,avformat,avutil,postproc,swresample,swscale}.pc $(1)/usr/lib/pkgconfig/
-endef
-
-define Build/InstallDev/mini
-	$(INSTALL_DIR) $(1)/usr/include
-	$(CP) $(PKG_INSTALL_DIR)/usr/include/lib{avcodec,avformat,avutil} $(1)/usr/include/
-	$(INSTALL_DIR) $(1)/usr/lib
-	$(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avformat,avutil}.{a,so*} $(1)/usr/lib/
-	$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
-	$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lib{avcodec,avformat,avutil}.pc $(1)/usr/lib/pkgconfig/
-endef
-
-Build/InstallDev/audio-dec = $(Build/InstallDev/custom)
-
-# XXX: attempt at installing "best" dev files available
-ifeq ($(BUILD_VARIANT),custom)
-  # XXX: only install "custom" dev files if -full & -mini are not selected
-  ifeq ($(CONFIG_PACKAGE_libffmpeg-full)$(CONFIG_PACKAGE_libffmpeg-mini),)
-    Build/InstallDev = $(Build/InstallDev/custom)
-  endif
-endif
-ifeq ($(BUILD_VARIANT),audio-dec)
-  # XXX: only install "audio-dec" dev files if -full & -mini are not selected
-  ifeq ($(CONFIG_PACKAGE_libffmpeg-full)$(CONFIG_PACKAGE_libffmpeg-mini),)
-    Build/InstallDev = $(Build/InstallDev/audio-dec)
-  endif
-endif
-ifeq ($(BUILD_VARIANT),full)
-  # XXX: always install "full" dev files if -full is selected
-  Build/InstallDev = $(Build/InstallDev/full)
-endif
-ifeq ($(BUILD_VARIANT),mini)
-  # XXX: only install "mini" dev files if -full is not selected
-  ifeq ($(CONFIG_PACKAGE_libffmpeg-full),)
-    Build/InstallDev = $(Build/InstallDev/mini)
-  endif
-endif
-
-define Package/ffmpeg/install
-	$(INSTALL_DIR) $(1)/usr/bin
-	$(CP) $(PKG_INSTALL_DIR)/usr/bin/ffmpeg $(1)/usr/bin/
-endef
-
-define Package/ffprobe/install
-	$(INSTALL_DIR) $(1)/usr/bin
-	$(CP) $(PKG_INSTALL_DIR)/usr/bin/ffprobe $(1)/usr/bin/
-endef
-
-define Package/ffserver/install
-	$(INSTALL_DIR) $(1)/usr/bin
-	$(CP) $(PKG_INSTALL_DIR)/usr/bin/ffserver $(1)/usr/bin/
-endef
-
-define Package/libffmpeg-custom/install
-	$(INSTALL_DIR) $(1)/usr/lib
-	$(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avformat,avutil}.so.* $(1)/usr/lib/
-endef
-
-define Package/libffmpeg-full/install
-	$(INSTALL_DIR) $(1)/usr/lib
-	$(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avfilter,avformat,avutil,postproc,swresample,swscale}.so.* $(1)/usr/lib/
-endef
-
-define Package/libffmpeg-mini/install
-	$(INSTALL_DIR) $(1)/usr/lib
-	$(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avformat,avutil}.so.* $(1)/usr/lib/
-endef
-
-Package/libffmpeg-audio-dec/install = $(Package/libffmpeg-custom/install)
-
-$(eval $(call BuildPackage,ffmpeg))
-$(eval $(call BuildPackage,ffprobe))
-$(eval $(call BuildPackage,ffserver))
-$(eval $(call BuildPackage,libffmpeg-audio-dec))
-$(eval $(call BuildPackage,libffmpeg-full))
-$(eval $(call BuildPackage,libffmpeg-mini))
-ifneq ($(CONFIG_ALL),y)
-   $(eval $(call BuildPackage,libffmpeg-custom))
-endif

+ 0 - 277
multimedia/gst1-plugins-bad/Makefile

@@ -1,277 +0,0 @@
-#
-# Copyright (C) 2011-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:=gst1-plugins-bad
-PKG_VERSION:=1.8.2
-PKG_RELEASE:=1
-
-PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org> \
-		Ted Hess <thess@kitschensync.net>
-
-PKG_LICENSE:=LGPLv2 GPLv2
-PKG_LICENSE_FILES:=COPYING.LIB COPYING
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/gst-plugins-bad-$(PKG_VERSION)
-PKG_SOURCE:=gst-plugins-bad-$(PKG_VERSION).tar.xz
-PKG_SOURCE_URL:=http://gstreamer.freedesktop.org/src/gst-plugins-bad/
-PKG_MD5SUM:=d7995317530c8773ec088f94d9320909d41da61996b801ebacce9a56af493f97
-
-PKG_BUILD_DEPENDS:= libgstreamer1 gstreamer1-plugins-base
-
-PKG_FIXUP:=autoreconf
-PKG_INSTALL:=1
-
-include $(INCLUDE_DIR)/package.mk
-include $(INCLUDE_DIR)/nls.mk
-
-GST_BAD_LIBS:=
-GST_BAD_MODULES:=
-
-define Package/gstreamer1-bad/Default
-  CATEGORY:=Multimedia
-  SECTION:=multimedia
-  TITLE:=GStreamer
-  URL:=http://gstreamer.freedesktop.org/
-  DEPENDS:= +libgstreamer1 $(ICONV_DEPENDS)
-endef
-
-define Package/gstreamer1-bad/description/Default
- GStreamer open source multimedia framework
-endef
-
-
-define Package/gst1-plugins-bad
-$(call Package/gstreamer1-bad/Default)
-  TITLE+= plugins collection (bad)
-  DEPENDS+= $(GST_DEPENDS)
-  HIDDEN:=1
-endef
-
-define Package/gts1-plugins-bad/description
-$(call Package/gstreamer1-bad/description/Default)
- .
- This meta package contains only dependencies to the other plugins from
- the bad plugins collection.
-endef
-
-define Package/gstreamer1-plugins-bad
-  $(call Package/gstreamer1-bad/Default)
-  TITLE+= plugins collection (bad)
-  DEPENDS:=+ALL:gst1-plugins-bad +gstreamer1-plugins-base
-endef
-
-define Package/gstreamer1-plugins-bad/config
-    menu "Select GStreamer bad modules and libraries"
-      depends on PACKAGE_gstreamer1-plugins-bad
-
-
-    config gst1-plugins-bad-all
-      bool "Include all GStreamer bad plugins"
-      select PACKAGE_gst1-plugins-bad
-
-    comment "Modules"
-
-   $(foreach mod,$(GST_BAD_MODULES), \
-    config PACKAGE_gst1-mod-$(mod)
-      prompt "GStreamer $(mod) module"
-
-   )
-
-    comment "Libraries"
-
-   $(foreach lib,$(GST_BAD_LIBS), \
-    config PACKAGE_libgst1$(lib)
-      prompt "GStreamer $(lib) library"
-
-   )
-
-  endmenu
-
-endef
-
-GST_VERSION:=1.0
-
-CONFIGURE_ARGS += \
-	--disable-debug \
-	--disable-examples \
-	--disable-nls	\
-	\
-	--disable-directsound \
-	--disable-directdraw \
-	--disable-osx_video \
-	--disable-quicktime \
-	--disable-vcd \
-	--disable-assrender \
-	--disable-apexsink \
-	--disable-bz2 \
-	--disable-dc1394 \
-	--disable-directfb \
-	--disable-dts \
-	--disable-resindvd \
-	--disable-faac \
-	--disable-faad \
-	--disable-flite \
-	--disable-gsm \
-	--disable-kate \
-	--disable-ladspa \
-	--disable-lv2 \
-	--disable-modplug \
-	--disable-mimic \
-	--disable-libmms \
-	--disable-mpeg2enc \
-	--disable-mplex \
-	--disable-musepack \
-	--disable-mythtv \
-	--disable-nas \
-	--disable-neon \
-	--disable-ofa \
-	--disable-rsvg \
-	--disable-timidity \
-	--disable-wildmidi \
-	--disable-sdl \
-	--disable-sdltest \
-	--disable-sndfile \
-	--disable-soundtouch \
-	--disable-spc \
-	--disable-gme \
-	--disable-xvid \
-	--disable-dvb \
-	--disable-wininet \
-	--disable-acm \
-	--disable-vdpau \
-	--disable-schro \
-	--disable-zbar \
-	--disable-srtp \
-	\
-	--without-libiconv-prefix \
-	--without-libintl-prefix \
-	--with-libgcrypt-prefix="$(STAGING_DIR)/usr" \
-	--without-x \
-
-TARGET_CFLAGS+= -std=gnu99
-
-EXTRA_LDFLAGS+= \
-	-Wl,-rpath-link=$(STAGING_DIR)/usr/lib \
-	$(if $(ICONV_FULL),-liconv) \
-
-
-define Package/gst1-plugins-bad/install
-	/bin/true
-endef
-
-# 1: short name
-# 2: description
-# 3: dependencies on other gstreamer libraries (short name)
-# 4: dependencies on other packages
-define GstBuildLibrary
-
-  GST_DEPENDS += +libgst1$(1)
-
-  GST_BAD_LIBS+= $(1)
-  define Package/libgst1$(1)
-    $(call Package/gstreamer1-bad/Default)
-    TITLE+= $(2) library (base)
-    DEPENDS+= $$(foreach p,$(3),+libgst1$$(p)) $(4)
-    HIDDEN:=1
-  endef
-
-  define Package/libgst1$(1)/description
-   $(call Package/gstreamer1-bad/description/Default)
-   .
-   This package contains the GStreamer $(2) library.
-  endef
-
-  define Package/libgst1$(1)/install
-	$(INSTALL_DIR) $$(1)/usr/lib
-	( cd $(PKG_INSTALL_DIR); $(CP) \
-		./usr/lib/libgst$(1)-$(GST_VERSION).so.* \
-		$$(1)/usr/lib/ \
-	)
-  endef
-
-  $$(eval $$(call BuildPackage,libgst1$(1)))
-endef
-
-$(eval $(call GstBuildLibrary,adaptivedemux,adaptivedemux,app uridownloader,))
-$(eval $(call GstBuildLibrary,photography,photography,,))
-$(eval $(call GstBuildLibrary,basecamerabinsrc,basecamerabinsrc,app,))
-$(eval $(call GstBuildLibrary,uridownloader,uridownloader,,))
-$(eval $(call GstBuildLibrary,badbase,badbase,,))
-
-# 1: short name
-# 2: description
-# 3: dependencies on other gstreamer libraries (short name)
-# 4: dependencies on other gstreamer plugins (short name)
-# 5: dependencies on other packages
-define GstBuildPlugin
-
-  GST_DEPENDS += +gst1-mod-$(1)
-
-  GST_BAD_MODULES+= $(1)
-
-  define Package/gst1-mod-$(1)
-    $(call Package/gstreamer1-bad/Default)
-    TITLE+= $(2) plugin (bad)
-    DEPENDS+= $$(foreach p,$(3),+libgst1$$(p)) $$(foreach p,$(4),+gst1-mod-$$(p)) $(5)
-    HIDDEN:=1
-  endef
-
-  define Package/gst1-mod-$(1)/description
-   $(call Package/gstreamer1-bad/description/Default)
-   .
-   This package contains the GStreamer $(2) plugin.
-  endef
-
-  define Package/gst1-mod-$(1)/install
-	$(INSTALL_DIR) $$(1)/usr/lib/gstreamer-$(GST_VERSION)
-	( cd $(PKG_INSTALL_DIR); $(CP) \
-		./usr/lib/gstreamer-$(GST_VERSION)/libgst$(1).so* \
-		$$(1)/usr/lib/gstreamer-$(GST_VERSION)/ \
-	)
-  endef
-
-  $$(eval $$(call BuildPackage,gst1-mod-$(1)))
-endef
-
-$(eval $(call GstBuildPlugin,adpcmdec,adpcm decoding support,audio,,))
-$(eval $(call GstBuildPlugin,adpcmenc,adpcm encoding support,audio,,))
-$(eval $(call GstBuildPlugin,aiff,aiff support,audio tag,,))
-$(eval $(call GstBuildPlugin,asfmux,asf muxing support,rtp,,))
-$(eval $(call GstBuildPlugin,autoconvert,autoconvert support,,,))
-$(eval $(call GstBuildPlugin,bayer,bayer support,video,,))
-$(eval $(call GstBuildPlugin,camerabin2,camerabin support,basecamerabinsrc photography pbutils app,,))
-$(eval $(call GstBuildPlugin,dataurisrc,dataurisrc support,,,))
-$(eval $(call GstBuildPlugin,debugutilsbad,debugutils support,video,,))
-$(eval $(call GstBuildPlugin,dvdspu,dvdspu support,video,,))
-$(eval $(call GstBuildPlugin,fbdevsink,fbdev support,video,,))
-$(eval $(call GstBuildPlugin,festival,festival support,audio,,))
-$(eval $(call GstBuildPlugin,hls,HLS support,pbutils adaptivedemux,multifile,+libnettle))
-$(eval $(call GstBuildPlugin,frei0r,frei0r support,controller video,,))
-$(eval $(call GstBuildPlugin,id3tag,id3tag support,tag,,))
-$(eval $(call GstBuildPlugin,jpegformat,jpegformat support,tag,,))
-$(eval $(call GstBuildPlugin,mpegpsdemux,mpegpsdemux support,pbutils,,))
-$(eval $(call GstBuildPlugin,mpegpsmux,mpegpsmux support,,,))
-#$(eval $(call GstBuildPlugin,mpegtsdemux,mpegtsdemux support,mpegts pbutils,,))
-#$(eval $(call GstBuildPlugin,mpegtsmux,mpegtsmux support,video,,))
-$(eval $(call GstBuildPlugin,mxf,mxf support,badbase audio video,,))
-$(eval $(call GstBuildPlugin,opusparse,OPUS streams library,pbutils,,+libopus))
-$(eval $(call GstBuildPlugin,pcapparse,pcapparse support,,,))
-$(eval $(call GstBuildPlugin,pnm,pnm support,video,,))
-$(eval $(call GstBuildPlugin,rawparse,rawparse support,audio video,,))
-$(eval $(call GstBuildPlugin,rfbsrc,librfb support,video,,))
-$(eval $(call GstBuildPlugin,sdpelem,sdp support,rtp sdp,,))
-$(eval $(call GstBuildPlugin,segmentclip,segmentclip support,audio,,))
-$(eval $(call GstBuildPlugin,shm,POSIX shared memory source and sink,,,+librt))
-$(eval $(call GstBuildPlugin,siren,siren support,audio rtp,,))
-$(eval $(call GstBuildPlugin,speed,speed support,audio,,))
-$(eval $(call GstBuildPlugin,subenc,subenc support,controller,,))
-#$(eval $(call GstBuildPlugin,srtp,srtp support,rtp,,+libsrtp))
-
-$(eval $(call BuildPackage,gstreamer1-plugins-bad))
-$(eval $(call BuildPackage,gst1-plugins-bad))

+ 0 - 26
multimedia/gst1-plugins-bad/patches/001-no-translations.patch

@@ -1,26 +0,0 @@
---- a/configure.ac
-+++ b/configure.ac
-@@ -3717,7 +3717,6 @@ ext/x265/Makefile
- ext/xvid/Makefile
- ext/zbar/Makefile
- ext/dtls/Makefile
--po/Makefile.in
- docs/Makefile
- docs/plugins/Makefile
- docs/libs/Makefile
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -2,11 +2,11 @@ DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-d
- 
- SUBDIRS = \
- 	gst-libs gst sys ext pkgconfig \
--	m4 common docs tests po tools
-+	m4 common docs tests tools
- 
- DIST_SUBDIRS = \
- 	gst gst-libs sys ext pkgconfig \
--	m4 common docs tests po tools
-+	m4 common docs tests tools
- 
- # include before EXTRA_DIST for win32 assignment
- include $(top_srcdir)/common/win32.mak

+ 0 - 57
multimedia/gst1-plugins-bad/patches/002-no-tests.patch

@@ -1,57 +0,0 @@
---- a/configure.ac
-+++ b/configure.ac
-@@ -3617,38 +3617,6 @@ sys/wasapi/Makefile
- sys/wininet/Makefile
- sys/winks/Makefile
- sys/winscreencap/Makefile
--tests/Makefile
--tests/check/Makefile
--tests/files/Makefile
--tests/examples/Makefile
--tests/examples/avsamplesink/Makefile
--tests/examples/camerabin2/Makefile
--tests/examples/codecparsers/Makefile
--tests/examples/directfb/Makefile
--tests/examples/gl/Makefile
--tests/examples/gl/cocoa/Makefile
--tests/examples/gl/clutter/Makefile
--tests/examples/gl/generic/Makefile
--tests/examples/gl/generic/cube/Makefile
--tests/examples/gl/generic/cubeyuv/Makefile
--tests/examples/gl/generic/doublecube/Makefile
--tests/examples/gl/generic/recordgraphic/Makefile
--tests/examples/gl/gtk/Makefile
--tests/examples/gl/gtk/gtkvideooverlay/Makefile
--tests/examples/gl/gtk/3dvideo/Makefile
--tests/examples/gl/gtk/filternovideooverlay/Makefile
--tests/examples/gl/gtk/filtervideooverlay/Makefile
--tests/examples/gl/gtk/fxtest/Makefile
--tests/examples/gl/gtk/switchvideooverlay/Makefile
--tests/examples/gl/qt/Makefile
--tests/examples/gl/sdl/Makefile
--tests/examples/gtk/Makefile
--tests/examples/mpegts/Makefile
--tests/examples/mxf/Makefile
--tests/examples/opencv/Makefile
--tests/examples/uvch264/Makefile
--tests/examples/waylandsink/Makefile
--tests/icles/Makefile
- ext/voamrwbenc/Makefile
- ext/voaacenc/Makefile
- ext/assrender/Makefile
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -2,11 +2,11 @@ DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-d
- 
- SUBDIRS = \
- 	gst-libs gst sys ext pkgconfig \
--	m4 common docs tests tools
-+	m4 common docs tools
- 
- DIST_SUBDIRS = \
- 	gst gst-libs sys ext pkgconfig \
--	m4 common docs tests tools
-+	m4 common docs tools
- 
- # include before EXTRA_DIST for win32 assignment
- include $(top_srcdir)/common/win32.mak

+ 237 - 0
multimedia/gst1-plugins-good/Makefile

@@ -0,0 +1,237 @@
+#
+# Copyright (C) 2009-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:=gst1-plugins-good
+PKG_VERSION:=1.8.2
+PKG_RELEASE:=1
+
+PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org> \
+		Ted Hess <thess@kitschensync.net>
+
+PKG_LICENSE:=LGPLv2
+PKG_LICENSE_FILES:=COPYING
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/gst-plugins-good-$(PKG_VERSION)
+PKG_SOURCE:=gst-plugins-good-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=http://gstreamer.freedesktop.org/src/gst-plugins-good/
+PKG_MD5SUM:=8d7549118a3b7a009ece6bb38a05b66709c551d32d2adfd89eded4d1d7a23944
+
+PKG_BUILD_DEPENDS:= libgstreamer1 gstreamer1-plugins-base
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+
+GST_GOOD_MODULES:=
+
+define Package/gstreamer1-good/Default
+  CATEGORY:=Multimedia
+  SECTION:=multimedia
+  TITLE:=GStreamer
+  URL:=http://gstreamer.freedesktop.org/
+  DEPENDS:= +libgstreamer1 $(ICONV_DEPENDS)
+endef
+
+define Package/gstreamer1-good/description/Default
+ GStreamer open source multimedia framework
+endef
+
+
+define Package/gst1-plugins-good
+$(call Package/gstreamer1-good/Default)
+  TITLE+= plugins collection (good)
+  DEPENDS+= $(GST_DEPENDS)
+  HIDDEN:=1
+endef
+
+define Package/gst1-plugins-good/description
+$(call Package/gstreamer1-good/description/Default)
+ .
+ This meta package contains only dependencies to the other plugins from
+ the good plugins collection.
+endef
+
+
+define Package/gstreamer1-plugins-good
+  $(call Package/gstreamer1-good/Default)
+  TITLE+= plugins collection (good)
+  DEPENDS:=+ALL:gst1-plugins-good +gstreamer1-plugins-base
+endef
+
+define Package/gstreamer1-plugins-good/config
+    menu "Select GStreamer good modules"
+      depends on PACKAGE_gstreamer1-plugins-good
+
+
+    config gst1-plugins-good-all
+      bool "Include all GStreamer good plugins"
+      select PACKAGE_gst1-plugins-good
+
+    comment "Modules"
+
+   $(foreach mod,$(GST_GOOD_MODULES), \
+    config PACKAGE_gst1-mod-$(mod)
+      prompt "GStreamer $(mod) module"
+
+   )
+
+  endmenu
+
+endef
+
+GST_VERSION:=1.0
+
+CONFIGURE_ARGS += \
+	--disable-debug \
+	--disable-examples \
+	\
+	--disable-aalib \
+	--disable-annodex \
+	--disable-bz2 \
+	--disable-cairo \
+	--disable-directsound \
+	--disable-dv1394 \
+	--disable-esd \
+	--disable-gconf \
+	--disable-gconftool \
+	--disable-gdk_pixbuf \
+	--disable-hal \
+	--disable-libcaca \
+	--disable-libdv \
+	--disable-osx_audio \
+	--disable-osx_video \
+	--disable-pulse \
+	--disable-qtdemux \
+	--disable-rtspmanager \
+	--disable-shout2 \
+	--disable-sunaudio \
+	--disable-wavpack \
+	--disable-x \
+	--disable-xshm \
+	--disable-xvideo \
+	--disable-y4m \
+	--disable-zlib \
+	\
+	--without-libiconv-prefix \
+	--without-libintl-prefix \
+	--without-x \
+
+EXTRA_LDFLAGS+= \
+	-Wl,-rpath-link=$(STAGING_DIR)/usr/lib \
+	$(if $(ICONV_FULL),-liconv) \
+
+
+define Package/gst1-plugins-good/install
+	/bin/true
+endef
+
+
+# 1: short name
+# 2: description
+# 3: dependencies on other gstreamer libraries (short name)
+# 4: dependencies on other gstreamer plugins (short name)
+# 5: dependencies on other packages
+define GstBuildPlugin
+
+  GST_DEPENDS += +gst1-mod-$(1)
+
+  GST_GOOD_MODULES+= $(1)
+
+  define Package/gst1-mod-$(1)
+    $(call Package/gstreamer1-good/Default)
+    TITLE+= $(2) plugin (good)
+    DEPENDS+= $$(foreach p,$(3),+libgst1$$(p)) $$(foreach p,$(4),+gst1-mod-$$(p)) $(5)
+    HIDDEN:=1
+  endef
+
+  define Package/gst1-mod-$(1)/description
+   $(call Package/gstreamer1-good/description/Default)
+   .
+   This package contains the GStreamer $(2) plugin.
+  endef
+
+  define Package/gst1-mod-$(1)/install
+	$(INSTALL_DIR) $$(1)/usr/lib/gstreamer-$(GST_VERSION)
+	( cd $(PKG_INSTALL_DIR); $(CP) \
+		./usr/lib/gstreamer-$(GST_VERSION)/libgst$(1).so* \
+		$$(1)/usr/lib/gstreamer-$(GST_VERSION)/ \
+	)
+  endef
+
+  $$(eval $$(call BuildPackage,gst1-mod-$(1)))
+endef
+
+#$(eval $(call GstBuildPlugin,1394,IEEE 1394 support,,,))
+$(eval $(call GstBuildPlugin,alaw,alaw codec,audio,,))
+$(eval $(call GstBuildPlugin,alpha,alpha support,video,,))
+$(eval $(call GstBuildPlugin,alphacolor,alphacolor support,video,,))
+$(eval $(call GstBuildPlugin,apetag,apetag support,audio pbutils tag video,,))
+$(eval $(call GstBuildPlugin,audiofx,audio effects,audio fft controller,,))
+$(eval $(call GstBuildPlugin,audioparsers,audioparsers,audio tag pbutils,,))
+$(eval $(call GstBuildPlugin,auparse,auparse,audio tag pbutils,,))
+$(eval $(call GstBuildPlugin,autodetect,format auto-detection,,,))
+$(eval $(call GstBuildPlugin,avi,avi support,audio riff tag video,,))
+$(eval $(call GstBuildPlugin,cutter,audio cutter,audio,,))
+$(eval $(call GstBuildPlugin,debug,debugging,,,))
+$(eval $(call GstBuildPlugin,deinterlace,deinterlace support,video,,))
+$(eval $(call GstBuildPlugin,dtmf,dtmf support,rtp,,))
+#$(eval $(call GstBuildPlugin,dv,dv support,audio tag video,,))
+$(eval $(call GstBuildPlugin,effectv,effectvsupport,video,,))
+$(eval $(call GstBuildPlugin,equalizer,audio equalizer,audio controller,,))
+$(eval $(call GstBuildPlugin,flac,FLAC codec,audio pbutils tag,,+libflac))
+$(eval $(call GstBuildPlugin,flv,flv codec,audio pbutils tag video,,))
+$(eval $(call GstBuildPlugin,flxdec,flx codec,,,))
+#$(eval $(call GstBuildPlugin,gdkpixbuf,gdkpixbuf support,video,,))
+$(eval $(call GstBuildPlugin,goom2k1,goom support,audio video pbutils,,))
+$(eval $(call GstBuildPlugin,goom,goom support,audio video pbutils,,))
+$(eval $(call GstBuildPlugin,icydemux,icy demuxer,audio tag,,))
+$(eval $(call GstBuildPlugin,id3demux,ID3v1/v2 demuxer,pbutils tag,,))
+$(eval $(call GstBuildPlugin,imagefreeze,imagefreeze support,,,))
+$(eval $(call GstBuildPlugin,interleave,audio interleave,audio,,))
+$(eval $(call GstBuildPlugin,isomp4,isomp4 support,audio pbutils riff rtp tag video,,))
+#$(eval $(call GstBuildPlugin,jack,jack support,audio,,))
+$(eval $(call GstBuildPlugin,jpeg,jpeg support,video,,+libjpeg))
+$(eval $(call GstBuildPlugin,level,audio level,audio,,))
+$(eval $(call GstBuildPlugin,matroska,matroska support,audio pbutils riff tag video,,))
+$(eval $(call GstBuildPlugin,mulaw,mulaw support,audio,,))
+$(eval $(call GstBuildPlugin,multifile,multiple files access,video,,))
+$(eval $(call GstBuildPlugin,multipart,multipart stream handling,,,))
+$(eval $(call GstBuildPlugin,navigationtest,navigationtest support,video,,))
+$(eval $(call GstBuildPlugin,oss4audio,OSS 4 audio support,audio tag,,))
+$(eval $(call GstBuildPlugin,ossaudio,OSS audio support,audio,,))
+$(eval $(call GstBuildPlugin,png,png support,video,,+libpng))
+#$(eval $(call GstBuildPlugin,pulse,pulse support,audio pbutils tag video,,))
+$(eval $(call GstBuildPlugin,replaygain,volume normalization,pbutils,,))
+$(eval $(call GstBuildPlugin,rtpmanager,RTP manager,audio net rtp tag pbutils video,,))
+$(eval $(call GstBuildPlugin,rtp,RTP,audio rtp tag pbutils video,,))
+$(eval $(call GstBuildPlugin,rtsp,RTSP,net rtp rtsp sdp,,))
+$(eval $(call GstBuildPlugin,shapewipe,shapewipe support,video,,))
+#$(eval $(call GstBuildPlugin,shout2,shout2 support,,,))
+$(eval $(call GstBuildPlugin,smpte,smpte support,video,,))
+$(eval $(call GstBuildPlugin,souphttpsrc,soup input,audio tag,,+libsoup))
+$(eval $(call GstBuildPlugin,spectrum,spectrum data output,audio fft,,))
+#$(eval $(call GstBuildPlugin,speex,speex support,audio tag,,))
+#$(eval $(call GstBuildPlugin,sty4menc,sty4menc support,video,,))
+#$(eval $(call GstBuildPlugin,taglib,taglib support,tag,,))
+$(eval $(call GstBuildPlugin,udp,UDP,net,,))
+$(eval $(call GstBuildPlugin,video4linux2,video4linux2 support,video allocators,,+libv4l))
+$(eval $(call GstBuildPlugin,videobox,videobox support,video,,))
+$(eval $(call GstBuildPlugin,videocrop,videocrop support,video,,))
+$(eval $(call GstBuildPlugin,videofilter,videofilter support,video,,))
+$(eval $(call GstBuildPlugin,videomixer,videomixer support,video,,))
+$(eval $(call GstBuildPlugin,vpx,vpx support,tag video,,+libvpx))
+$(eval $(call GstBuildPlugin,wavenc,Wav encoder,riff,,))
+#$(eval $(call GstBuildPlugin,wavpack,Wav packer,audio riff tag,,))
+$(eval $(call GstBuildPlugin,wavparse,Wav parser,audio riff tag,,))
+#$(eval $(call GstBuildPlugin,ximagesrc,ximagesrc support,video,,))
+
+$(eval $(call BuildPackage,gstreamer1-plugins-good))
+$(eval $(call BuildPackage,gst1-plugins-good))

+ 20 - 0
multimedia/gst1-plugins-good/patches/001-no-translations.patch

@@ -0,0 +1,20 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -1049,7 +1049,6 @@ sys/sunaudio/Makefile
+ sys/v4l2/Makefile
+ sys/waveform/Makefile
+ sys/ximage/Makefile
+-po/Makefile.in
+ tests/Makefile
+ tests/check/Makefile
+ tests/examples/Makefile
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -4,7 +4,6 @@ ALWAYS_SUBDIRS =		\
+ 	gst sys ext 		\
+ 	tests			\
+ 	docs			\
+-	po			\
+ 	common			\
+ 	m4			\
+ 	pkgconfig

+ 34 - 0
multimedia/gst1-plugins-good/patches/002-no-tests.patch

@@ -0,0 +1,34 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -1049,21 +1049,6 @@ sys/sunaudio/Makefile
+ sys/v4l2/Makefile
+ sys/waveform/Makefile
+ sys/ximage/Makefile
+-tests/Makefile
+-tests/check/Makefile
+-tests/examples/Makefile
+-tests/examples/audiofx/Makefile
+-tests/examples/cairo/Makefile
+-tests/examples/equalizer/Makefile
+-tests/examples/jack/Makefile
+-tests/examples/level/Makefile
+-tests/examples/pulse/Makefile
+-tests/examples/rtp/Makefile
+-tests/examples/shapewipe/Makefile
+-tests/examples/spectrum/Makefile
+-tests/examples/v4l2/Makefile
+-tests/files/Makefile
+-tests/icles/Makefile
+ common/Makefile
+ common/m4/Makefile
+ m4/Makefile
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -2,7 +2,6 @@ DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-d
+ 
+ ALWAYS_SUBDIRS =		\
+ 	gst sys ext 		\
+-	tests			\
+ 	docs			\
+ 	common			\
+ 	m4			\

+ 22 - 0
multimedia/gst1-plugins-good/patches/003-no-docs.patch

@@ -0,0 +1,22 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -1052,9 +1052,6 @@ sys/ximage/Makefile
+ common/Makefile
+ common/m4/Makefile
+ m4/Makefile
+-docs/Makefile
+-docs/plugins/Makefile
+-docs/version.entities
+ pkgconfig/Makefile
+ pkgconfig/gstreamer-plugins-good-uninstalled.pc
+ gst-plugins-good.spec
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -2,7 +2,6 @@ DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-d
+ 
+ ALWAYS_SUBDIRS =		\
+ 	gst sys ext 		\
+-	docs			\
+ 	common			\
+ 	m4			\
+ 	pkgconfig

+ 0 - 177
multimedia/gst1-plugins-ugly/Makefile

@@ -1,177 +0,0 @@
-#
-# Copyright (C) 2009-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:=gst1-plugins-ugly
-PKG_VERSION:=1.8.2
-PKG_RELEASE:=1
-
-PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org> \
-		Ted Hess <thess@kitschensync.net>
-
-PKG_LICENSE:=LGPLv2
-PKG_LICENSE_FILES:=COPYING
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/gst-plugins-ugly-$(PKG_VERSION)
-PKG_SOURCE:=gst-plugins-ugly-$(PKG_VERSION).tar.xz
-PKG_SOURCE_URL:=http://gstreamer.freedesktop.org/src/gst-plugins-ugly/
-PKG_MD5SUM:=9c5b33a2a98fc1d6d6c99a1b536b1fb2de45f53cc8bf8ab85a8b8141fed1a8ac
-
-PKG_BUILD_DEPENDS:= libgstreamer1 gstreamer1-plugins-base
-PKG_CONFIG_DEPENDS:= \
-	CONFIG_PACKAGE_gst1-mod-asf \
-	CONFIG_PACKAGE_gst1-mod-lame \
-	CONFIG_PACKAGE_gst1-mod-mad \
-	CONFIG_PACKAGE_gst1-mod-mpeg2dec \
-
-PKG_FIXUP:=autoreconf
-PKG_INSTALL:=1
-
-include $(INCLUDE_DIR)/package.mk
-include $(INCLUDE_DIR)/nls.mk
-
-GST_UGLY_MODULES:=
-
-define Package/gstreamer1-ugly/Default
-  CATEGORY:=Multimedia
-  SECTION:=multimedia
-  TITLE:=GStreamer
-  URL:=http://gstreamer.freedesktop.org/
-  DEPENDS:= +libgstreamer1 $(ICONV_DEPENDS)
-endef
-
-define Package/gstreamer1-ugly/description/Default
- GStreamer open source multimedia framework
-endef
-
-
-define Package/gst1-plugins-ugly
-$(call Package/gstreamer1-ugly/Default)
-  TITLE+= plugins collection (ugly)
-  DEPENDS+= $(GST_DEPENDS)
-  HIDDEN:=1
-endef
-
-define Package/gts-plugins-ugly/description
-$(call Package/gstreamer1-ugly/description/Default)
- .
- This meta package contains only dependencies to the other plugins from
- the ugly plugins collection.
-endef
-
-
-define Package/gstreamer1-plugins-ugly
-  $(call Package/gstreamer1-ugly/Default)
-  TITLE+= plugins collection (ugly)
-  DEPENDS:=+ALL:gst1-plugins-ugly +gstreamer1-plugins-base
-endef
-
-define Package/gstreamer1-plugins-ugly/config
-    menu "Select GStreamer ugly modules"
-      depends on PACKAGE_gstreamer1-plugins-ugly
-
-
-    config gst1-plugins-ugly-all
-      bool "Include all GStreamer ugly plugins"
-      select PACKAGE_gst1-plugins-ugly
-
-    comment "Modules"
-
-   $(foreach mod,$(GST_UGLY_MODULES), \
-    config PACKAGE_gst1-mod-$(mod)
-      prompt "GStreamer $(mod) module"
-
-   )
-
-  endmenu
-
-endef
-
-GST_COND_SELECT = $(patsubst %,$(if $(CONFIG_PACKAGE_gst1-mod-$(1)),--enable,--disable)-%,$(1))
-
-GST_VERSION:=1.0
-
-CONFIGURE_ARGS += \
-	--disable-debug \
-	--disable-examples \
-	\
-	--disable-a52dec \
-	--disable-amrnb \
-	--disable-amrwb \
-	$(call GST_COND_SELECT,asf) \
-	--disable-cdio \
-	--disable-dvdlpcmdec \
-	--disable-dvdread \
-	--disable-dvdsub \
-	--disable-iec958 \
-	$(call GST_COND_SELECT,lame) \
-	$(call GST_COND_SELECT,mad) \
-	$(call GST_COND_SELECT,mpeg2dec) \
-	--disable-mpegaudioparse \
-	--disable-mpegstream \
-	--disable-realmedia \
-	--disable-sidplay \
-	--disable-synaesthesia \
-	--disable-twolame \
-	--disable-x264 \
-	\
-	--without-libiconv-prefix \
-	--without-libintl-prefix \
-
-EXTRA_LDFLAGS+= \
-	-Wl,-rpath-link=$(STAGING_DIR)/usr/lib \
-	$(if $(ICONV_FULL),-liconv) \
-
-
-define Package/gst1-plugins-ugly/install
-	/bin/true
-endef
-
-
-# 1: short name
-# 2: description
-# 3: dependencies on other gstreamer libraries (short name)
-# 4: dependencies on other gstreamer plugins (short name)
-# 5: dependencies on other packages
-define GstBuildPlugin
-
-  GST_DEPENDS += +gst1-mod-$(1)
-
-  GST_UGLY_MODULES+= $(1)
-
-  define Package/gst1-mod-$(1)
-    $(call Package/gstreamer1-ugly/Default)
-    TITLE+= $(2) plugin (ugly)
-    DEPENDS+= +libgstreamer1 $$(foreach p,$(3),+libgst1$$(p)) $$(foreach p,$(4),+gst1-mod-$$(p)) $(5)
-    HIDDEN:=1
-  endef
-
-  define Package/gst1-mod-$(1)/description
-   $(call Package/gstreamer1-ugly/description/Default)
-   .
-   This package contains the GStreamer $(2) plugin.
-  endef
-
-  define Package/gst1-mod-$(1)/install
-	$(INSTALL_DIR) $$(1)/usr/lib/gstreamer-$(GST_VERSION)
-	( cd $(PKG_INSTALL_DIR); $(CP) \
-		./usr/lib/gstreamer-$(GST_VERSION)/libgst$(1).so* \
-		$$(1)/usr/lib/gstreamer-$(GST_VERSION)/ \
-	)
-  endef
-
-  $$(eval $$(call BuildPackage,gst1-mod-$(1)))
-endef
-
-$(eval $(call GstBuildPlugin,asf,ASF demuxer,audio video riff rtp rtsp sdp tag,,))
-$(eval $(call GstBuildPlugin,lame,MP3 encoder (using LAME),audio,,+lame-lib))
-$(eval $(call GstBuildPlugin,mad,MP3 decoder (using MAD),audio tag,,+libid3tag +libmad))
-$(eval $(call GstBuildPlugin,mpeg2dec,MPEG decoder,video,,+libmpeg2))
-
-$(eval $(call BuildPackage,gstreamer1-plugins-ugly))
-$(eval $(call BuildPackage,gst1-plugins-ugly))

+ 0 - 23
multimedia/gst1-plugins-ugly/patches/001-no-translations.patch

@@ -1,23 +0,0 @@
-diff -u --recursive gst-plugins-ugly-1.6.2-vanilla/configure.ac gst-plugins-ugly-1.6.2/configure.ac
---- gst-plugins-ugly-1.6.2-vanilla/configure.ac	2016-01-01 10:47:06.333623730 -0500
-+++ gst-plugins-ugly-1.6.2/configure.ac	2016-01-01 10:47:20.211613708 -0500
-@@ -470,7 +470,6 @@
- tests/Makefile
- tests/check/Makefile
- m4/Makefile
--po/Makefile.in
- pkgconfig/Makefile
- pkgconfig/gstreamer-plugins-ugly-uninstalled.pc
- gst-plugins-ugly.spec
-diff -u --recursive gst-plugins-ugly-1.6.2-vanilla/Makefile.am gst-plugins-ugly-1.6.2/Makefile.am
---- gst-plugins-ugly-1.6.2-vanilla/Makefile.am	2016-01-01 10:47:06.333623730 -0500
-+++ gst-plugins-ugly-1.6.2/Makefile.am	2016-01-01 10:47:14.523210855 -0500
-@@ -1,7 +1,7 @@
- DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc
- 
- SUBDIRS = \
--	gst-libs gst ext docs m4 tests common pkgconfig po
-+	gst-libs gst ext docs m4 tests common pkgconfig
- 
- # include before EXTRA_DIST for win32 assignment
- include $(top_srcdir)/common/win32.mak

+ 0 - 23
multimedia/gst1-plugins-ugly/patches/002-no-tests.patch

@@ -1,23 +0,0 @@
---- a/configure.ac
-+++ b/configure.ac
-@@ -478,9 +478,6 @@ ext/x264/Makefile
- docs/Makefile
- docs/plugins/Makefile
- docs/version.entities
--tests/Makefile
--tests/check/Makefile
--tests/files/Makefile
- m4/Makefile
- pkgconfig/Makefile
- pkgconfig/gstreamer-plugins-ugly-uninstalled.pc
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -1,7 +1,7 @@
- DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc
- 
- SUBDIRS = \
--	gst-libs gst ext docs m4 tests common pkgconfig
-+	gst-libs gst ext docs m4 common pkgconfig
- 
- # include before EXTRA_DIST for win32 assignment
- include $(top_srcdir)/common/win32.mak

+ 0 - 23
multimedia/gst1-plugins-ugly/patches/003-no-docs.patch

@@ -1,23 +0,0 @@
---- a/configure.ac
-+++ b/configure.ac
-@@ -475,9 +475,6 @@ ext/mpg123/Makefile
- ext/sidplay/Makefile
- ext/twolame/Makefile
- ext/x264/Makefile
--docs/Makefile
--docs/plugins/Makefile
--docs/version.entities
- m4/Makefile
- pkgconfig/Makefile
- pkgconfig/gstreamer-plugins-ugly-uninstalled.pc
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -1,7 +1,7 @@
- DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc
- 
- SUBDIRS = \
--	gst-libs gst ext docs m4 common pkgconfig
-+	gst-libs gst ext m4 common pkgconfig
- 
- # include before EXTRA_DIST for win32 assignment
- include $(top_srcdir)/common/win32.mak

+ 0 - 85
multimedia/minidlna/Makefile

@@ -1,85 +0,0 @@
-#
-# Copyright (C) 2010-2014 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:=minidlna
-PKG_VERSION:=1.1.5
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=@SF/minidlna
-PKG_MD5SUM:=1970e553a1eb8a3e7e302e2ce292cbc4
-PKG_LICENSE:=GPL-2.0 BSD-3-Clause
-PKG_LICENSE_FILES:=COPYING LICENCE.miniupnpd
-
-PKG_MAINTAINER:=Knyazkov Dmitry <medavedik@gmail.com>
-
-PKG_BUILD_PARALLEL:=0
-PKG_BUILD_DEPENDS:=util-linux
-
-include $(INCLUDE_DIR)/package.mk
-include $(INCLUDE_DIR)/nls.mk
-
-define Package/minidlna
-  SECTION:=multimedia
-  CATEGORY:=Multimedia
-  TITLE:=UPnP A/V & DLNA Media Server
-  URL:=http://minidlna.sourceforge.net/
-  DEPENDS:= +libpthread +libexif +libjpeg +libsqlite3 +libffmpeg \
-  	+libid3tag +libflac +libvorbis +libuuid \
-  	$(ICONV_DEPENDS) $(INTL_DEPENDS)
-endef
-
-define Package/minidlna/description
-  MiniDLNA (aka ReadyDLNA) is server software with the aim of
-  being fully compliant with DLNA/UPnP-AV clients.
-endef
-
-define Package/minidlna/conffiles
-/etc/config/minidlna
-endef
-
-TARGET_CPPFLAGS += \
-	-I$(STAGING_DIR)/usr/include \
-	-I$(STAGING_DIR)/usr/include/FLAC \
-	-I$(STAGING_DIR)/usr/include/libexif \
-	-I$(STAGING_DIR)/usr/include/uuid \
-	-I$(STAGING_DIR)/usr/include/vorbis \
-	-I$(ICONV_PREFIX)/include \
-	-I$(INTL_PREFIX)/include \
-	-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 \
-
-TARGET_LDFLAGS += \
-	-L$(ICONV_PREFIX)/lib \
-	-L$(INTL_PREFIX)/lib \
-	-Wl,-rpath-link=$(STAGING_DIR)/usr/lib \
-
-MAKE_FLAGS +=\
-	CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
-	LDFLAGS="$(TARGET_LDFLAGS)" \
-	ICONV_LIBS="-liconv $(if $(INTL_FULL),-lintl)" \
-
-CONFIGURE_ARGS +=\
-	--with-libiconv-prefix="$(ICONV_PREFIX)" \
-	--with-libintl-prefix="$(INTL_PREFIX)" \
-	--with-os-name="OpenWrt Linux" \
-	--with-os-version="$(LINUX_VERSION)" \
-	--with-os-url="http://openwrt.org/" \
-	--with-db-path="/var/run/minidlna" \
-	--with-log-path="/var/log" \
-
-define Package/minidlna/install
-	$(INSTALL_DIR) $(1)/usr/bin
-	$(INSTALL_BIN) $(PKG_BUILD_DIR)/minidlnad $(1)/usr/bin/minidlna
-	$(INSTALL_DIR) $(1)/etc/init.d
-	$(INSTALL_BIN) ./files/minidlna.init $(1)/etc/init.d/minidlna
-	$(INSTALL_DIR) $(1)/etc/config
-	$(INSTALL_CONF) ./files/minidlna.config $(1)/etc/config/minidlna
-endef
-
-$(eval $(call BuildPackage,minidlna))

+ 0 - 17
multimedia/minidlna/files/minidlna.config

@@ -1,17 +0,0 @@
-config minidlna config
-	option 'enabled' '1'
-	option port '8200'
-	option interface 'br-lan'
-	option friendly_name 'OpenWrt DLNA Server'
-	option db_dir '/var/run/minidlna'
-	option log_dir '/var/log'
-	option inotify '1'
-	option enable_tivo '0'
-	option strict_dlna '0'
-	option presentation_url ''
-	option notify_interval '900'
-	option serial '12345678'
-	option model_number '1'
-	option root_container '.'
-	list media_dir '/mnt'
-	option album_art_names 'Cover.jpg/cover.jpg/AlbumArtSmall.jpg/albumartsmall.jpg/AlbumArt.jpg/albumart.jpg/Album.jpg/album.jpg/Folder.jpg/folder.jpg/Thumb.jpg/thumb.jpg'

+ 0 - 97
multimedia/minidlna/files/minidlna.init

@@ -1,97 +0,0 @@
-#!/bin/sh /etc/rc.common
-# Copyright (C) 2010 OpenWrt.org
-
-START=50
-
-SERVICE_USE_PID=1
-SERVICE_PID_FILE=/var/run/minidlna/minidlna.pid
-
-MINIDLNA_CONFIG_FILE="/tmp/minidlna.conf"
-
-minidlna_cfg_append() {
-	echo "$1" >> "$MINIDLNA_CONFIG_FILE"
-}
-
-minidlna_cfg_addbool() {
-	local cfg="$1"
-	local key="$2"
-	local def="$3"
-	local val
-
-	config_get_bool val "$cfg" "$key" "$def"
-	[ "$val" -gt 0 ] && val="yes" || val="no"
-	minidlna_cfg_append "$key=$val"
-}
-
-minidlna_cfg_addstr() {
-	local cfg="$1"
-	local key="$2"
-	local def="$3"
-	local val
-
-	config_get val "$cfg" "$key" "$def"
-	[ -n "$val" ] && minidlna_cfg_append "$key=$val"
-}
-
-minidlna_cfg_add_media_dir() {
-	local val=$1
-
-	minidlna_cfg_append "media_dir=$val"
-}
-
-minidlna_create_config() {
-	local cfg=$1
-	local port
-	local interface
-
-	config_get port $cfg port
-	config_get interface $cfg interface
-
-	[ -z "$interface" -o -t "$port" ] && return 1
-
-	echo "# this file is generated automatically, don't edit" > "$MINIDLNA_CONFIG_FILE"
-
-	minidlna_cfg_append "port=$port"
-	minidlna_cfg_append "network_interface=$interface"
-
-	minidlna_cfg_addstr $cfg friendly_name
-	minidlna_cfg_addstr $cfg db_dir
-	minidlna_cfg_addstr $cfg log_dir
-	minidlna_cfg_addbool $cfg inotify '1'
-	minidlna_cfg_addbool $cfg enable_tivo '0'
-	minidlna_cfg_addbool $cfg strict_dlna '0'
-	minidlna_cfg_addstr $cfg album_art_names
-	minidlna_cfg_addstr $cfg presentation_url
-	minidlna_cfg_addstr $cfg notify_interval '900'
-	minidlna_cfg_addstr $cfg serial '12345678'
-	minidlna_cfg_addstr $cfg model_number '1'
-	minidlna_cfg_addstr $cfg minissdpsocket
-	minidlna_cfg_addstr $cfg root_container '.'
-	config_list_foreach "$cfg" "media_dir" minidlna_cfg_add_media_dir
-
-	return 0
-}
-
-start() {
-	local enabled
-	local db_dir
-	local log_dir
-
-	config_load 'minidlna'
-	config_get_bool enabled config 'enabled' '0'
-
-	[ "$enabled" -gt 0 ] || return 1
-
-	minidlna_create_config config || return 1
-	
-	config_get db_dir config 'db_dir' '/var/run/minidlna'
-	config_get log_dir config 'log_dir' '/var/log'
-
-	mkdir -m 0755 -p $db_dir
-	mkdir -m 0755 -p $log_dir
-	service_start /usr/bin/minidlna -f "$MINIDLNA_CONFIG_FILE"
-}
-
-stop() {
-	service_stop /usr/bin/minidlna
-}

+ 0 - 19
multimedia/minidlna/patches/010-libav-fix.patch

@@ -1,19 +0,0 @@
---- a/libav.h
-+++ b/libav.h
-@@ -167,7 +167,7 @@
- static inline int
- lav_is_thumbnail_stream(AVStream *s, uint8_t **data, int *size)
- {
--#if LIBAVFORMAT_VERSION_INT >= ((54<<16)+(6<<8))
-+/*if LIBAVFORMAT_VERSION_INT >= ((54<<16)+(6<<8))
- 	if (s->disposition & AV_DISPOSITION_ATTACHED_PIC &&
- 	    s->codec->codec_id == AV_CODEC_ID_MJPEG)
- 	{
-@@ -177,6 +177,6 @@
- 			*size = s->attached_pic.size;
- 		return 1;
- 	}
--#endif
-+endif*/
- 	return 0;
- }

+ 5 - 4
net/acme/Makefile

@@ -8,9 +8,9 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=acme
-PKG_SOURCE_VERSION:=6d84da588b98733dd9c4f5b88440281ab1eb4989
-PKG_VERSION:=1.4
-PKG_RELEASE:=1
+PKG_SOURCE_VERSION:=7b40cbe8c1a52041351524bcde4b37665a7cdf79
+PKG_VERSION:=1.5
+PKG_RELEASE:=2
 PKG_LICENSE:=GPLv3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE).tar.xz
@@ -25,7 +25,7 @@ include $(INCLUDE_DIR)/package.mk
 define Package/acme
   SECTION:=net
   CATEGORY:=Network
-  DEPENDS:=+curl +ca-certificates +openssl-util +netcat
+  DEPENDS:=+curl +ca-bundle +openssl-util +netcat
   TITLE:=ACME (Letsencrypt) client
   PKGARCH:=all
   MAINTAINER:=Toke Høiland-Jørgensen <toke@toke.dk>
@@ -90,6 +90,7 @@ uci -q get ucitrack.@acme[0] > /dev/null && {
   uci delete ucitrack.@acme[0]
   uci commit
 }
+exit 0
 endef
 
 

+ 4 - 0
net/acme/files/run.sh

@@ -10,7 +10,11 @@
 
 CHECK_CRON=$1
 ACME=/usr/lib/acme/acme.sh
+# We export both ca variables in an attempts to keep backwards
+# compatibility with older versions of curl that was linked against
+# openssl
 export SSL_CERT_DIR=/etc/ssl/certs
+export CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
 export NO_TIMESTAMP=1
 
 UHTTPD_LISTEN_HTTP=

+ 6 - 4
net/adblock/Makefile

@@ -1,12 +1,12 @@
 #
-# Copyright (c) 2015-2017 Dirk Brenken (dev@brenken.org)
+# Copyright (c) 2015-2018 Dirk Brenken (dev@brenken.org)
 # This is free software, licensed under the GNU General Public License v3.
 #
 
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=adblock
-PKG_VERSION:=2.6.2
+PKG_VERSION:=3.4.3
 PKG_RELEASE:=1
 PKG_LICENSE:=GPL-3.0+
 PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
@@ -16,12 +16,13 @@ include $(INCLUDE_DIR)/package.mk
 define Package/adblock
 	SECTION:=net
 	CATEGORY:=Network
-	TITLE:=Powerful adblock script to block ad/abuse domains
+	TITLE:=Powerful adblock script to block ad/abuse domains by using DNS
+	DEPENDS:=+jshn +jsonfilter
 	PKGARCH:=all
 endef
 
 define Package/adblock/description
-Powerful adblock script to block ad/abuse domains via dnsmasq or unbound dns backend.
+Powerful adblock script to block ad/abuse domains via dnsmasq, unbound, named, kresd or dnscrypt-proxy.
 The script supports many domain blacklist sites plus manual black- and whitelist overrides.
 Please see https://github.com/openwrt/packages/blob/master/net/adblock/files/README.md for further information.
 
@@ -53,6 +54,7 @@ define Package/adblock/install
 	$(INSTALL_CONF) ./files/adblock.conf $(1)/etc/config/adblock
 
 	$(INSTALL_DIR) $(1)/etc/adblock
+	$(INSTALL_CONF) ./files/adblock.notify $(1)/etc/adblock/
 	$(INSTALL_CONF) ./files/adblock.blacklist $(1)/etc/adblock/
 	$(INSTALL_CONF) ./files/adblock.whitelist $(1)/etc/adblock/
 endef

+ 146 - 102
net/adblock/files/README.md

@@ -4,11 +4,13 @@
 A lot of people already use adblocker plugins within their desktop browsers, but what if you are using your (smart) phone, tablet, watch or any other wlan gadget...getting rid of annoying ads, trackers and other abuse sites (like facebook ;-) is simple: block them with your router. When the dns server on your router receives dns requests, you will sort out queries that ask for the resource records of ad servers and return a simple 'NXDOMAIN'. This is nothing but **N**on-e**X**istent Internet or Intranet domain name, if domain name is unable to resolved using the dns server, a condition called the 'NXDOMAIN' occurred.  
 
 ## Main Features
-* support of the following domain block list sources (free for private usage, for commercial use please check their individual licenses):
+* support of the following domain blocklist sources (free for private usage, for commercial use please check their individual licenses):
     * [adaway](https://adaway.org)
     * => infrequent updates, approx. 400 entries (enabled by default)
     * [adguard](https://adguard.com)
     * => numerous updates on the same day, approx. 12.000 entries
+    * [bitcoin](https://github.com/hoshsadiq/adblock-nocoin-list)
+    * => infrequent updates, approx. 15 entries
     * [blacklist]()
     * => static local blacklist, located by default in '/etc/adblock/adblock.blacklist'
     * [disconnect](https://disconnect.me)
@@ -25,20 +27,22 @@ A lot of people already use adblocker plugins within their desktop browsers, but
     * => daily updates, approx. 1.500 entries
     * [openphish](https://openphish.com)
     * => numerous updates on the same day, approx. 1.800 entries
-    * [palevo tracker](https://palevotracker.abuse.ch)
-    * => daily updates, approx. 15 entries
     * [ransomware tracker](https://ransomwaretracker.abuse.ch)
     * => daily updates, approx. 150 entries
     * [reg_cn](https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt)
     * => regional blocklist for China, daily updates, approx. 1.600 entries
+    * [reg_de](https://easylist-downloads.adblockplus.org/easylistgermany+easylist.txt)
+    * => regional blocklist for Germany, daily updates, approx. 9.200 entries
+    * [reg_id](https://easylist-downloads.adblockplus.org/abpindo+easylist.txt)
+    * => regional blocklist for Indonesia, daily updates, approx. 800 entries
+    * [reg_nl](https://easylist-downloads.adblockplus.org/easylistdutch+easylist.txt)
+    * => regional blocklist for the Netherlands, weekly updates, approx. 1300 entries
     * [reg_pl](http://adblocklist.org)
     * => regional blocklist for Poland, daily updates, approx. 50 entries
     * [reg_ro](https://easylist-downloads.adblockplus.org/rolist+easylist.txt)
     * => regional blocklist for Romania, weekly updates, approx. 600 entries
     * [reg_ru](https://code.google.com/p/ruadlist)
     * => regional blocklist for Russia, weekly updates, approx. 2.000 entries
-    * [securemecca](http://www.securemecca.com)
-    * => infrequent updates, approx. 25.000 entries
     * [shallalist](http://www.shallalist.de) (categories "adv" "costtraps" "spyware" "tracker" "warez" enabled by default)
     * => daily updates, approx. 32.000 entries (a short description of all shallalist categories can be found [online](http://www.shallalist.de/categories.html))
     * [spam404](http://www.spam404.com)
@@ -57,26 +61,31 @@ A lot of people already use adblocker plugins within their desktop browsers, but
     * => daily updates, approx. 440 entries
 * zero-conf like automatic installation & setup, usually no manual changes needed
 * simple but yet powerful adblock engine: adblock does not use error prone external iptables rulesets, http pixel server instances and things like that
-* automatically selects dnsmasq or unbound as dns backend
-* automatically selects uclient-fetch or wget as download utility (other tools like curl or aria2c are supported as well)
-* support http only mode (without installed ssl library) for all non-SSL blocklist sources
-* automatically supports a wide range of router modes, even AP modes are supported
+* supports five different dns backends / blocklist formats: dnsmasq, unbound, named (bind), kresd and dnscrypt-proxy
+* supports six different download utilities: uclient-fetch, wget, curl, aria2c, wget-nossl, busybox-wget
+* provides 'http only' mode without installed ssl library for all non-SSL blocklist sources
+* supports a wide range of router modes, even AP modes are supported
 * full IPv4 and IPv6 support
-* supports tld compression (top level domain compression), this feature removes thousands of needless host entries from the block lists and lowers the memory footprint for the dns backends
-* each block list source will be updated and processed separately
-* block list source parsing by fast & flexible regex rulesets
-* overall duplicate removal in separate block lists
+* provides top level domain compression ('tld compression'), this feature removes thousands of needless host entries from the blocklist and lowers the memory footprint for the dns backends
+* blocklist source parsing by fast & flexible regex rulesets
+* overall duplicate removal in central blocklist 'adb_list.overall'
 * additional whitelist for manual overrides, located by default in /etc/adblock/adblock.whitelist
-* quality checks during block list update to ensure a reliable dns backend service
+* quality checks during blocklist update to ensure a reliable dns backend service
 * minimal status & error logging to syslog, enable debug logging to receive more output
 * procd based init system support (start/stop/restart/reload/suspend/resume/query/status)
-* procd based hotplug support, the adblock start will be solely triggered by network interface triggers
-* suspend & resume adblock actions temporarily without block list reloading
-* runtime information available via LuCI & via 'status' init command
+* procd network interface trigger support or classic time based startup
+* keep the dns cache intact after adblock processing (currently supported by unbound and named)
+* conditional dns backend restarts by old/new blocklist comparison with sha256sum (default) or md5sum
+* suspend & resume adblock actions temporarily without blocklist reloading
+* output comprehensive runtime information via LuCI or via 'status' init command
 * query function to quickly identify blocked (sub-)domains, e.g. for whitelisting
+* strong LuCI support
 * optional: force dns requests to local resolver
 * optional: force overall sort / duplicate removal for low memory devices (handle with care!)
-* optional: automatic block list backup & restore, backups will be (de-)compressed and restored on the fly in case of any runtime error
+* optional: automatic blocklist backup & restore, they will be used in case of download errors or during startup in backup mode
+* optional: 'backup mode' to re-use blocklist backups during startup, get fresh lists only via reload or restart action
+* optional: 'whitelist mode' to block access to all domains except those explicitly listed in the whitelist file
+* optional: send notification emails in case of a processing error or if the overall domain count is &le; 0
 * optional: add new adblock sources on your own via uci config
 
 ## Prerequisites
@@ -84,91 +93,136 @@ A lot of people already use adblocker plugins within their desktop browsers, but
 * a usual setup with an enabled dns backend at minimum - dump AP modes without a working dns backend are _not_ supported
 * a download utility:
     * to support all blocklist sources a full version (with ssl support) of 'wget', 'uclient-fetch' with one of the 'libustream-*' ssl libraries, 'aria2c' or 'curl' is required
-    * for limited devices with real memory constraints, adblock provides also a plain http option and supports wget-nossl and uclient-fetch (without libustream-ssl), too
+    * for limited devices with real memory constraints, adblock provides also a 'http only' option and supports wget-nossl and uclient-fetch (without libustream-ssl) as well
     * for more configuration options see examples below
 
-## LEDE trunk Installation & Usage
-* install 'adblock' (_opkg install adblock_) and that's it - the adblock start will be automatically triggered by procd interface trigger
+## Installation & Usage
+* install 'adblock' (_opkg install adblock_)
+* at minimum configure the appropriate dns backend ('dnsmasq' by default) and enable the adblock service in _/etc/config/adblock_
 * control the adblock service manually with _/etc/init.d/adblock_ start/stop/restart/reload/suspend/resume/status or use the LuCI frontend
-* enable/disable your favored block list sources in _/etc/config/adblock_ - 'adaway', 'disconnect' and 'yoyo' are enabled by default
 
 ## LuCI adblock companion package
-* for easy management of the various block list sources and all other adblock options you can also use a nice & efficient LuCI frontend
+* for easy management of the various blocklist sources and all other adblock options you should use the provided LuCI frontend
 * install 'luci-app-adblock' (_opkg install luci-app-adblock_)
 * the application is located in LuCI under 'Services' menu
 
 ## Tweaks
 * **runtime information:** the adblock status is available via _/etc/init.d/adblock status_ (see example below)
 * **debug logging:** for script debugging please set the config option 'adb\_debug' to '1' and check the runtime output with _logread -e "adblock"_
-* **storage expansion:** to process and store all block list sources at once it might helpful to enlarge your temp directory with a swap partition => see [openwrt wiki](https://wiki.openwrt.org/doc/uci/fstab) for further details
+* **storage expansion:** to process and store all blocklist sources at once it might helpful to enlarge your temp directory with a swap partition => see [openwrt wiki](https://wiki.openwrt.org/doc/uci/fstab) for further details
 * **add white- / blacklist entries:** add domain white- or blacklist entries to always-allow or -deny certain (sub) domains, by default both lists are empty and located in _/etc/adblock_. Please add one domain per line - ip addresses, wildcards & regex are _not_ allowed (see example below)
-* **backup & restore block lists:** enable this feature, to restore automatically the latest compressed backup of your block lists in case of any processing error (e.g. a single block list source is not available during update). Please use an (external) solid partition and _not_ your volatile router temp directory for this
+* **backup & restore blocklists:** enable this feature, to restore automatically the latest compressed backup of your blocklists in case of any processing error (e.g. a single blocklist source is not available during update). Please use an (external) solid partition and _not_ your volatile router temp directory for this
 * **scheduled list updates:** for a scheduled call of the adblock service add an appropriate crontab entry (see example below)
-* **restrict procd interface trigger:** restrict the procd interface trigger to a (list of) certain interface(s) (default: wan). To disable it at all, remove all entries
+* **change startup behaviour:** by default the startup will be triggered by the 'wan' procd interface trigger. Choose 'none' to disable automatic startups, 'timed' to use a classic timeout (default 30 sec.) or select another trigger interface.
 * **suspend & resume adblocking:** to quickly switch the adblock service 'on' or 'off', simply use _/etc/init.d/adblock [suspend|resume]_
-* **domain query:** to query the active block lists for a specific domain, please run _/etc/init.d/adblock query `<DOMAIN>`_ (see example below)
-* **add new list sources:** you could add new block list sources on your own via uci config, all you need is a source url and an awk one-liner (see example below)
+* **domain query:** to query the active blocklist for a specific domain, please run _/etc/init.d/adblock query `<DOMAIN>`_ (see example below)
+* **add new list sources:** you could add new blocklist sources on your own via uci config, all you need is a source url and an awk one-liner (see example below)
 * **disable active dns probing in windows 10:** to prevent a yellow exclamation mark on your internet connection icon (which wrongly means connected, but no internet), please change the following registry key/value from "1" to "0" _HKLM\SYSTEM\CurrentControlSet\Services\NlaSvc\Parameters\Internet\EnableActiveProbing_
 
 ## Further adblock config options
-* usually the pre-configured adblock setup works quite well and no manual config overrides are needed, all listed options apply to the 'global' config section:
-    * adb\_enabled => main switch to enable/disable adblock service (default: '1', enabled)
+* usually the pre-configured adblock setup works quite well and no manual overrides are needed
+* the following options apply to the 'global' config section:
+    * adb\_enabled => main switch to enable/disable adblock service (default: '0', disabled)
     * adb\_debug => enable/disable adblock debug output (default: '0', disabled)
-    * adb\_iface => set the procd interface trigger to a (list of) lan / wan interface(s) (default: 'wan')
-    * adb\_fetch => full path to a different download utility, see example below (default: not set, use wget)
-    * adb\_fetchparm => options for the download utility, see example below (default: not set, use wget options)
-    * adb\_triggerdelay => additional trigger delay in seconds before adblock processing starts (default: '2')
+    * adb\_fetchutil => name of the used download utility: 'uclient-fetch', 'wget', 'curl', 'aria2c', 'wget-nossl'. 'busybox' (default: 'uclient-fetch')
+    * adb\_fetchparm => special config options for the download utility (default: not set)
+    * adb\_dns => select the dns backend for your environment: 'dnsmasq', 'unbound', 'named', 'kresd' or 'dnscrypt-proxy' (default: 'dnsmasq')
+    * adb\_dnsdir => target directory for the generated blocklist 'adb_list.overall' (default: not set, use dns backend default)
+    * adb\_trigger => set the startup trigger to a certain interface, to 'timed' or to 'none' (default: 'wan')
+
+* the following options apply to the 'extra' config section:
+    * adb\_triggerdelay => additional trigger delay in seconds before adblock processing begins (default: '1')
     * adb\_forcedns => force dns requests to local resolver (default: '0', disabled)
     * adb\_forcesrt => force overall sort on low memory devices with less than 64 MB RAM (default: '0', disabled)
+    * adb\_backup_mode => do not automatically update blocklists during startup, use backups instead (default: '0', disabled)
+    * adb\_whitelist_mode => block access to all domains except those explicitly listed in the whitelist file (default: '0', disabled)
+    * adb\_dnsflush => flush DNS cache after adblock processing, i.e. enable the old restart behavior (default: '0', disabled)
+    * adb\_notify => send notification emails in case of a processing error or if the overall domain count is &le; 0 (default: '0', disabled)
+    * adb\_notifycnt => Raise minimum domain count email notification trigger (default: '0')
 
 ## Examples
 **change default dns backend to 'unbound':**
+
+Adblock deposits the final blocklist 'adb_list.overall' in '/var/lib/unbound' where unbound can find them in its jail.  
+To preserve the DNS cache after adblock processing you need to install 'unbound-control'.  
+  
+**change default dns backend to 'named' (bind):**
+
+Adblock deposits the final blocklist 'adb_list.overall' in '/var/lib/bind'.  
+To preserve the DNS cache after adblock processing you need to install & configure 'bind-rdnc'.  
+To use the blocklist please modify '/etc/bind/named.conf':
 <pre><code>
-Adblock detects the presence of an active unbound dns backend and the block lists will be automatically pulled in by unbound.
-The adblock script deposits the sorted and filtered block lists in '/var/lib/unbound' where unbound can find them in its jail.
-If you use manual configuration for unbound, then just include the following line in your 'server:' clause:
+in the 'options' namespace add:
+  response-policy { zone "rpz"; };
 
-  include: "/var/lib/unbound/adb_list.*"
+and at the end of the file add:
+  zone "rpz" {
+    type master;
+    file "/var/lib/bind/adb_list.overall";
+    allow-query { none; };
+    allow-transfer { none; };
+  };
 </code></pre>
   
-**configuration for different download utilities:**
-<pre><code>
-wget (default):
-  option adb_fetch="/usr/bin/wget"
-  option adb_fetchparm="--no-config --quiet --no-cache --no-cookies --max-redirect=0 --timeout=10 --no-check-certificate -O"
+**change default dns backend to 'kresd':**
 
-aria2c:
-  option adb_fetch '/usr/bin/aria2c'
-  option adb_fetchparm '-q --timeout=10 --allow-overwrite=true --auto-file-renaming=false --check-certificate=false -o'
+The knot-resolver (kresd) is only available on Turris Omnia devices.  
+Adblock deposits the final blocklist 'adb_list.overall' in '/etc/kresd', no further configuration needed.
+  
+**change default dns backend to 'dnscrypt-proxy':**
 
-uclient-fetch:
-  option adb_fetch '/bin/uclient-fetch'
-  option adb_fetchparm '-q --timeout=10 --no-check-certificate -O'
+The required 'blacklist' option of dnscrypt-proxy is not enabled by default, because the package will be compiled without plugins support.  
+Take a custom LEDE build with plugins support to use this feature. Adblock deposits the final blocklist 'adb_list.overall' in '/tmp'.  
+To use the blocklist please modify '/etc/config/dnscrypt-proxy' per instance:
+<pre><code>
+  list blacklist 'domains:/tmp/adb_list.overall'
+</code></pre>
+  
+**enable email notification via msmtp:**
 
-curl:
-  option adb_fetch '/usr/bin/curl'
-  option adb_fetchparm '-s --connect-timeout 10 --insecure -o'
+To use the email notification you have to install & configure the package 'msmtp'.  
+Modify the file '/etc/msmtprc':
+<pre><code>
+[...]
+defaults
+auth            on
+tls             on
+tls_certcheck   off
+timeout         5
+syslog          LOG_MAIL
+[...]
+account         adb_notify
+host            smtp.gmail.com
+port            587
+from            dev.adblock@gmail.com
+user            dev.adblock
+password        xxx
 </code></pre>
+Edit the file '/etc/adblock/adblock.notify' and change at least the 'mail_receiver'.  
+Finally make this file executable via 'chmod' and test it directly. If no more errors come up you can comment 'mail_debug', too.
   
 **receive adblock runtime information:**
+
 <pre><code>
-root@blackhole:~# /etc/init.d/adblock status
+/etc/init.d/adblock status
 ::: adblock runtime information
- status          : active
- adblock_version : 2.6.0
- blocked_domains : 113711
- fetch_info      : wget (built-in)
- dns_backend     : dnsmasq
- last_rundate    : 12.04.2017 13:08:26
- system          : LEDE Reboot SNAPSHOT r3900-399d5cf532
+  + adblock_status  : enabled
+  + adblock_version : 3.4.0
+  + overall_domains : 5167 (normal/backup mode)
+  + fetch_utility   : wget (built-in)
+  + dns_backend     : kresd (/etc/kresd)
+  + last_rundate    : 27.12.2017 20:52:35
+  + system_release  : Turris Omnia, OpenWrt omnia 15.05/3.9.1
 </code></pre>
   
 **cronjob for a regular block list update (/etc/crontabs/root):**
+
 <pre><code>
-0 06 * * *    /etc/init.d/adblock start
+0 06 * * *    /etc/init.d/adblock reload
 </code></pre>
   
 **blacklist entry (/etc/adblock/adblock.blacklist):**
+
 <pre><code>
 ads.example.com
 
@@ -183,10 +237,11 @@ This entry does not block:
 </code></pre>
   
 **whitelist entry (/etc/adblock/adblock.whitelist):**
+
 <pre><code>
 here.com
 
-This entry removes the following (sub)domains from the block lists:
+This entry removes the following (sub)domains from the blocklist:
   maps.here.com
   here.com
 
@@ -195,53 +250,42 @@ This entry does not remove:
   www.adwhere.com
 </code></pre>
   
-**query active block lists for a certain (sub-)domain, e.g. for whitelisting:**
+**query the active blocklist for a certain (sub-)domain, e.g. for whitelisting:**
+
+The query function checks against the submitted (sub-)domain and recurses automatically to the upper top level domain. For every (sub-)domain it returns the first ten relevant results.
 <pre><code>
-/etc/init.d/adblock query example.www.doubleclick.net
-::: distinct results for domain 'example.www.doubleclick.net'
- no match
-::: distinct results for domain 'www.doubleclick.net'
- adb_list.sysctl      : www.doubleclick.net
-::: distinct results for domain 'doubleclick.net'
- adb_list.adaway      : ad-g.doubleclick.net
- adb_list.securemecca : 1168945.fls.doubleclick.net
- adb_list.sysctl      : 1435575.fls.doubleclick.net
- adb_list.whocares    : 3ad.doubleclick.net
-
-The query function checks against the submitted (sub-)domain and recurses automatically to the upper top level domain(s).
-For every domain it returns the overall count plus a distinct list of active block lists with the first relevant result.
-In the example above whitelist "www.doubleclick.net" to free the submitted domain.
+/etc/init.d/adblock query www.example.google.com
+::: max. ten results for domain 'www.example.google.com'
+  - no match
+::: max. ten results for domain 'example.google.com'
+  - no match
+::: max. ten results for domain 'google.com'
+  + analytics.google.com
+  + googleadapis.l.google.com
+  + pagead.l.google.com
+  + partnerad.l.google.com
+  + ssl-google-analytics.l.google.com
+  + video-stats.video.google.com
+  + www-google-analytics.l.google.com
 </code></pre>
   
-**add a new block list source:**
-<pre><code>
-1. the easy way ...
-example: https://easylist-downloads.adblockplus.org/rolist+easylist.txt
-adblock already supports an easylist source, called 'ruadlist'. To add the additional local easylist
-as a new source, copy the existing config source 'ruadlist' section and change only
-the source name, the url and the description - that's all!
+**add a new blocklist source:**
 
-config source 'rolist'
+1. the easy way ...  
+example: https://easylist-downloads.adblockplus.org/rolist+easylist.txt  
+Adblock already supports an easylist source, called 'reg_ru'. To add the additional local easylist as a new source, copy the existing config source section and change only
+the source name, the url and the description - that's all!
+<pre><code>
+config source 'reg_ro'
   option enabled '0'
   option adb_src 'https://easylist-downloads.adblockplus.org/rolist+easylist.txt'
-  option adb_src_rset '{FS=\"[|^]\"} \$0 ~/^\|\|([A-Za-z0-9_-]+\.){1,}[A-Za-z]+\^$/{print tolower(\$3)}'
-  option adb_src_desc 'focus on romanian ad related domains plus generic easylist additions, weekly updates, approx. 600 entries'
-
-2. a bit harder ...
-to add a really new source with different domain/host format you have to write a suitable
-awk one-liner on your own, so basic awk skills are needed. As a starting point check the already
-existing awk strings (adb_src_rset) in adblock config, maybe you need only small changes for your individual list.
-Download the desired list and test your new awk string locally with:
-  cat new.list | awk 'fs__individual search__search core__result'
-  'fs' => field separator (optional)
-  'individual search' => individual search part to filter out needless list information
-  'search core' => always '([A-Za-z0-9_-]+\.){1,}[A-Za-z]+', this is part of all list sources and should be unchanged
-  'result' => always '{print tolower(\$n)}', only the output column 'n' may vary
-the output result should be a sequential list with one domain/host per line - nothing more.
-
-If your awk one-liner works quite well, add a new source section in adblock config and test your new source
+  option adb_src_rset 'BEGIN{FS=\"[|^]\"}\$0~/^\|\|([[:alnum:]_-]+\.){1,}[[:alpha:]]+\^("\\\$third-party")?$/{print tolower(\$3)}'
+  option adb_src_desc 'focus on romanian ads plus generic easylist additions, weekly updates, approx. 9.400 entries'
 </code></pre>
-  
+
+2. a bit harder ...  
+To add a really new source with different domain/host format you have to write a suitable awk one-liner on your own, so basic awk skills are needed. As a starting point check the already existing awk rulesets 'adb_src_rset' in the config file, probably you need only small changes for your individual list. Download the desired list and test your new awk string locally. The output result should be a sequential list with one domain/host per line - nothing more. If your awk one-liner works quite well, add a new source section to the adblock config file and test the new source.  
+
 ## Support
 Please join the adblock discussion in this [forum thread](https://forum.lede-project.org/t/adblock-2-x-support-thread/507) or contact me by mail <dev@brenken.org>  
 

+ 77 - 66
net/adblock/files/adblock.conf

@@ -2,125 +2,136 @@
 # see 'https://github.com/openwrt/packages/blob/master/net/adblock/files/README.md'
 
 config adblock 'global'
-	option adb_enabled '1'
+	option adb_enabled '0'
+	option adb_dns 'dnsmasq'
+	option adb_fetchutil 'uclient-fetch'
+	option adb_trigger 'wan'
+
+config adblock 'extra'
 	option adb_debug '0'
 	option adb_forcesrt '0'
 	option adb_forcedns '0'
-	option adb_iface 'wan'
-	option adb_triggerdelay '2'
-	option adb_whitelist '/etc/adblock/adblock.whitelist'
-	option adb_whitelist_rset '\$1 ~/^([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\"^\"\$1\"\\\|[.]\"\$1)}'
 	option adb_backup '0'
-	option adb_backupdir '/mnt'
-	option adb_rtfile '/tmp/adb_runtime.json'
 
 config source 'adaway'
 	option enabled '1'
 	option adb_src 'https://adaway.org/hosts.txt'
-	option adb_src_rset '\$0 ~/^127\.0\.0\.1[ \t]+([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$2)}'
+	option adb_src_rset '\$0~/^127\.0\.0\.1[[:space:]]+([[:alnum:]_-]+\.){1,}[[:alpha:]]+([[:space:]]|$)/{print tolower(\$2)}'
 	option adb_src_desc 'focus on mobile ads, infrequent updates, approx. 400 entries'
 
 config source 'adguard'
 	option enabled '0'
-	option adb_src 'https://raw.githubusercontent.com/AdguardTeam/AdguardDNS/master/Filters/filter.txt'
-	option adb_src_rset '{FS=\"[|^]\"} \$0 ~/^\|\|([A-Za-z0-9_-]+\.){1,}[A-Za-z]+\^$/{print tolower(\$3)}'
-	option adb_src_desc 'combined adguard dns filter list, approx. 12.000 entries'
+	option adb_src 'https://filters.adtidy.org/windows/filters/15.txt'
+	option adb_src_rset 'BEGIN{FS=\"[/|^|\r]\"}\$0~/^\|\|([[:alnum:]_-]+\.){1,}[[:alpha:]]+([\/\^\r]|$)/{print tolower(\$3)}'
+	option adb_src_desc 'combined adguard dns filter list, frequent updates, approx. 15.700 entries'
 
-config source 'blacklist'
+config source 'bitcoin'
 	option enabled '0'
+	option adb_src 'https://raw.githubusercontent.com/hoshsadiq/adblock-nocoin-list/master/hosts.txt'
+	option adb_src_rset '\$0~/^0\.0\.0\.0[[:space:]]+([[:alnum:]_-]+\.){1,}[[:alpha:]]+([[:space:]]|$)/{print tolower(\$2)}'
+	option adb_src_desc 'focus on malicious bitcoin mining sites, infrequent updates, approx. 20 entries'
+
+config source 'blacklist'
+	option enabled '1'
 	option adb_src '/etc/adblock/adblock.blacklist'
-	option adb_src_rset '\$1 ~/^([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$1)}'
-	option adb_src_desc 'static local domain blacklist (always deny these domains)'
+	option adb_src_rset '\$0~/^([[:alnum:]_-]+\.){1,}[[:alpha:]]+([[:space:]]|$)/{print tolower(\$1)}'
+	option adb_src_desc 'static local domain blacklist, always deny these domains'
 
 config source 'disconnect'
 	option enabled '1'
 	option adb_src 'https://s3.amazonaws.com/lists.disconnect.me/simple_malvertising.txt'
-	option adb_src_rset '\$1 ~/^([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$1)}'
-	option adb_src_desc 'mozilla driven blocklist, numerous updates on the same day, approx. 6.500 entries'
+	option adb_src_rset '\$0~/^([[:alnum:]_-]+\.){1,}[[:alpha:]]+([[:space:]]|$)/{print tolower(\$1)}'
+	option adb_src_desc 'mozilla driven blocklist, numerous updates on the same day, approx. 4.600 entries'
 
 config source 'dshield'
 	option enabled '0'
 	option adb_src 'https://www.dshield.org/feeds/suspiciousdomains_Low.txt'
-	option adb_src_rset '\$1 ~/^([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$1)}'
-	option adb_src_desc 'generic blocklist, daily updates, approx. 4.500 entries'
+	option adb_src_rset '\$0~/^([[:alnum:]_-]+\.){1,}[[:alpha:]]+([[:space:]]|$)/{print tolower(\$1)}'
+	option adb_src_desc 'generic blocklist, daily updates, approx. 3.500 entries'
 
 config source 'feodo'
 	option enabled '0'
 	option adb_src 'https://feodotracker.abuse.ch/blocklist/?download=domainblocklist'
-	option adb_src_rset '\$1 ~/^([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$1)}'
+	option adb_src_rset '\$0~/^([[:alnum:]_-]+\.){1,}[[:alpha:]]+([[:space:]]|$)/{print tolower(\$1)}'
 	option adb_src_desc 'focus on feodo botnet, daily updates, approx. 0-10 entries'
 
 config source 'hphosts'
 	option enabled '0'
 	option adb_src 'https://hosts-file.net/ad_servers.txt'
-	option adb_src_rset '\$0 ~/^127\.0\.0\.1[ \t]+([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$2)}'
-	option adb_src_desc 'broad blocklist, monthly updates, approx. 50.000 entries'
+	option adb_src_rset '\$0~/^127\.0\.0\.1[[:space:]]+([[:alnum:]_-]+\.){1,}[[:alpha:]]+([[:space:]]|$)/{print tolower(\$2)}'
+	option adb_src_desc 'broad blocklist, monthly updates, approx. 19.200 entries'
 
 config source 'malware'
 	option enabled '0'
-	option adb_src 'https://mirror.cedia.org.ec/malwaredomains/justdomains'
-	option adb_src_rset '\$1 ~/^([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$1)}'
-	option adb_src_desc 'broad blocklist, daily updates, approx. 16.000 entries'
+	option adb_src 'https://mirror.espoch.edu.ec/malwaredomains/justdomains'
+	option adb_src_rset '\$0~/^([[:alnum:]_-]+\.){1,}[[:alpha:]]+([[:space:]]|$)/{print tolower(\$1)}'
+	option adb_src_desc 'broad blocklist, daily updates, approx. 18.300 entries'
 
 config source 'malwarelist'
 	option enabled '0'
 	option adb_src 'http://www.malwaredomainlist.com/hostslist/hosts.txt'
-	option adb_src_rset '\$0 ~/^127\.0\.0\.1[ \t]+([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$2)}'
-	option adb_src_desc 'focus on malware, daily updates, approx. 1.500 entries'
+	option adb_src_rset '\$0~/^127\.0\.0\.1[[:space:]]+([[:alnum:]_-]+\.){1,}[[:alpha:]]+([[:space:]]|$)/{print tolower(\$2)}'
+	option adb_src_desc 'focus on malware, daily updates, approx. 1.200 entries'
 
 config source 'openphish'
 	option enabled '0'
 	option adb_src 'https://openphish.com/feed.txt'
-	option adb_src_rset '{FS=\"/\"} \$3 ~/^([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$3)}'
-	option adb_src_desc 'focus on phishing, numerous updates on the same day, approx. 1.800 entries'
-
-config source 'palevo'
-	option enabled '0'
-	option adb_src 'https://palevotracker.abuse.ch/blocklists.php?download=domainblocklist'
-	option adb_src_rset '\$1 ~/^([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$1)}'
-	option adb_src_desc 'focus on palevo worm, daily updates, approx. 15 entries'
+	option adb_src_rset 'BEGIN{FS=\"/\"}\$0~/^http[s]?:\/\/([[:alnum:]_-]+\.){1,}[[:alpha:]]+(\/|$)/{print tolower(\$3)}'
+	option adb_src_desc 'focus on phishing, numerous updates on the same day, approx. 2.400 entries'
 
 config source 'ransomware'
 	option enabled '0'
 	option adb_src 'https://ransomwaretracker.abuse.ch/downloads/RW_DOMBL.txt'
-	option adb_src_rset '\$1 ~/^([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$1)}'
-	option adb_src_desc 'focus on ransomware, numerous updates on the same day, approx. 130 entries'
+	option adb_src_rset '\$0~/^([[:alnum:]_-]+\.){1,}[[:alpha:]]+([[:space:]]|\r|$)/{print tolower(\$1)}'
+	option adb_src_desc 'focus on ransomware, numerous updates on the same day, approx. 1900 entries'
 
 config source 'reg_cn'
 	option enabled '0'
 	option adb_src 'https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt'
-	option adb_src_rset '{FS=\"[|^]\"} \$0 ~/^\|\|([A-Za-z0-9_-]+\.){1,}[A-Za-z]+\^$/{print tolower(\$3)}'
-	option adb_src_desc 'focus on chinese ads, daily updates, approx. 1.600 entries'
+	option adb_src_rset 'BEGIN{FS=\"[|^]\"}\$0~/^\|\|([[:alnum:]_-]+\.){1,}[[:alpha:]]+\^("\\\$third-party")?$/{print tolower(\$3)}'
+	option adb_src_desc 'focus on chinese ads plus generic easylist additions, daily updates, approx. 11.700 entries'
+
+config source 'reg_de'
+	option enabled '0'
+	option adb_src 'https://easylist-downloads.adblockplus.org/easylistgermany+easylist.txt'
+	option adb_src_rset 'BEGIN{FS=\"[|^]\"}\$0~/^\|\|([[:alnum:]_-]+\.){1,}[[:alpha:]]+\^("\\\$third-party")?$/{print tolower(\$3)}'
+	option adb_src_desc 'focus on german ads plus generic easylist additions, daily updates, approx. 9.200 entries'
+
+config source 'reg_id'
+	option enabled '0'
+	option adb_src 'https://easylist-downloads.adblockplus.org/abpindo+easylist.txt'
+	option adb_src_rset 'BEGIN{FS=\"[|^]\"}\$0~/^\|\|([[:alnum:]_-]+\.){1,}[[:alpha:]]+\^("\\\$third-party")?$/{print tolower(\$3)}'
+	option adb_src_desc 'focus on indonesian ads plus generic easylist additions, weekly updates, approx. 9.600 entries'
+
+config source 'reg_nl'
+	option enabled '0'
+	option adb_src 'https://easylist-downloads.adblockplus.org/easylistdutch+easylist.txt'
+	option adb_src_rset 'BEGIN{FS=\"[|^]\"}\$0~/^\|\|([[:alnum:]_-]+\.){1,}[[:alpha:]]+\^("\\\$third-party")?$/{print tolower(\$3)}'
+	option adb_src_desc 'focus on dutch ads plus generic easylist additions, weekly updates, approx. 9.400 entries'
 
 config source 'reg_pl'
 	option enabled '0'
 	option adb_src 'http://adblocklist.org/adblock-pxf-polish.txt'
-	option adb_src_rset '{FS=\"[|^]\"} \$0 ~/^\|\|([A-Za-z0-9_-]+\.){1,}[A-Za-z]+\^$/{print tolower(\$3)}'
-	option adb_src_desc 'focus on polish ads, daily updates, approx. 50 entries'
+	option adb_src_rset 'BEGIN{FS=\"[|^]\"}\$0~/^\|\|([[:alnum:]_-]+\.){1,}[[:alpha:]]+\^("\\\$third-party")?$/{print tolower(\$3)}'
+	option adb_src_desc 'focus on polish ads, daily updates, approx. 90 entries'
 
 config source 'reg_ro'
 	option enabled '0'
 	option adb_src 'https://easylist-downloads.adblockplus.org/rolist+easylist.txt'
-	option adb_src_rset '{FS=\"[|^]\"} \$0 ~/^\|\|([A-Za-z0-9_-]+\.){1,}[A-Za-z]+\^$/{print tolower(\$3)}'
-	option adb_src_desc 'focus on romanian ads plus generic easylist additions, weekly updates, approx. 600 entries'
+	option adb_src_rset 'BEGIN{FS=\"[|^]\"}\$0~/^\|\|([[:alnum:]_-]+\.){1,}[[:alpha:]]+\^("\\\$third-party")?$/{print tolower(\$3)}'
+	option adb_src_desc 'focus on romanian ads plus generic easylist additions, weekly updates, approx. 9.400 entries'
 
 config source 'reg_ru'
 	option enabled '0'
 	option adb_src 'https://easylist-downloads.adblockplus.org/ruadlist+easylist.txt'
-	option adb_src_rset '{FS=\"[|^]\"} \$0 ~/^\|\|([A-Za-z0-9_-]+\.){1,}[A-Za-z]+\^$/{print tolower(\$3)}'
-	option adb_src_desc 'focus on russian ads plus generic easylist additions, weekly updates, approx. 2.000 entries'
-
-config source 'securemecca'
-	option enabled '0'
-	option adb_src 'http://securemecca.com/Downloads/hosts.txt'
-	option adb_src_rset '\$0 ~/^127\.0\.0\.1[ \t]+([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$2)}'
-	option adb_src_desc 'broad blocklist, infrequent updates, approx. 25.000 entries'
+	option adb_src_rset 'BEGIN{FS=\"[|^]\"}\$0~/^\|\|([[:alnum:]_-]+\.){1,}[[:alpha:]]+\^("\\\$third-party")?$/{print tolower(\$3)}'
+	option adb_src_desc 'focus on russian ads plus generic easylist additions, weekly updates, approx. 14.500 entries'
 
 config source 'shalla'
 	option enabled '0'
 	option adb_src 'http://www.shallalist.de/Downloads/shallalist.tar.gz'
-	option adb_src_rset '{FS=\"/\"} \$1 ~/^([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$1)}'
-	option adb_src_desc 'broad blocklist subdivided in different categories, daily updates, approx. 32.000 entries'
+	option adb_src_rset '\$0~/^([[:alnum:]_-]+\.){1,}[[:alpha:]]+([[:space:]]|$)/{print tolower(\$1)}'
+	option adb_src_desc 'broad blocklist subdivided in different categories, daily updates, approx. 31.700 entries'
 	list adb_src_cat 'adv'
 	list adb_src_cat 'costtraps'
 	list adb_src_cat 'spyware'
@@ -130,41 +141,41 @@ config source 'shalla'
 config source 'spam404'
 	option enabled '0'
 	option adb_src 'https://raw.githubusercontent.com/Dawsey21/Lists/master/main-blacklist.txt'
-	option adb_src_rset '\$1 ~/^([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$1)}'
-	option adb_src_desc 'generic blocklist, infrequent updates, approx. 5.000 entries'
+	option adb_src_rset '\$0~/^([[:alnum:]_-]+\.){1,}[[:alpha:]]+([[:space:]]|$)/{print tolower(\$1)}'
+	option adb_src_desc 'generic blocklist, infrequent updates, approx. 6.000 entries'
 
 config source 'sysctl' 
 	option enabled '0'
 	option adb_src 'http://sysctl.org/cameleon/hosts'
-	option adb_src_rset '\$0 ~/^127\.0\.0\.1[ \t]+([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$2)}'
-	option adb_src_desc 'broad blocklist, weekly updates, approx. 21.000 entries'
+	option adb_src_rset '\$0~/^127\.0\.0\.1[[:space:]]+([[:alnum:]_-]+\.){1,}[[:alpha:]]+([[:space:]]|$)/{print tolower(\$2)}'
+	option adb_src_desc 'broad blocklist, weekly updates, approx. 16.500 entries'
 
 config source 'whocares'
 	option enabled '0'
 	option adb_src 'http://someonewhocares.org/hosts/hosts'
-	option adb_src_rset '\$0 ~/^127\.0\.0\.1[ \t]+([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$2)}'
-	option adb_src_desc 'broad blocklist, weekly updates, approx. 12.000 entries'
+	option adb_src_rset '\$0~/^127\.0\.0\.1[[:space:]]+([[:alnum:]_-]+\.){1,}[[:alpha:]]+([[:space:]]|$)/{print tolower(\$2)}'
+	option adb_src_desc 'broad blocklist, weekly updates, approx. 10.000 entries'
 
 config source 'winspy'
 	option enabled '0'
 	option adb_src 'https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/win10/spy.txt'
-	option adb_src_rset '\$0 ~/^0\.0\.0\.0[ \t]+([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$2)}'
-	option adb_src_desc 'focus on windows spy & telemetry, infrequent updates, approx. 140 entries'
+	option adb_src_rset '\$0~/^0\.0\.0\.0[[:space:]]+([[:alnum:]_-]+\.){1,}[[:alpha:]]+([[:space:]]|$)/{print tolower(\$2)}'
+	option adb_src_desc 'focus on windows spy & telemetry domains, infrequent updates, approx. 300 entries'
 
 config source 'winhelp'
 	option enabled '0'
 	option adb_src 'http://winhelp2002.mvps.org/hosts.txt'
-	option adb_src_rset '\$0 ~/^0\.0\.0\.0[ \t]+([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$2)}'
-	option adb_src_desc 'broad blocklist, infrequent updates, approx. 15.000 entries'
+	option adb_src_rset '\$0~/^0\.0\.0\.0[[:space:]]+([[:alnum:]_-]+\.){1,}[[:alpha:]]+([[:space:]]|$)/{print tolower(\$2)}'
+	option adb_src_desc 'broad blocklist, infrequent updates, approx. 13.000 entries'
 
 config source 'yoyo'
 	option enabled '1'
 	option adb_src 'https://pgl.yoyo.org/adservers/serverlist.php?hostformat=nohtml&showintro=0&mimetype=plaintext'
-	option adb_src_rset '\$1 ~/^([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$1)}'
-	option adb_src_desc 'focus on ad related domains, weekly updates, approx. 2.500 entries'
+	option adb_src_rset '\$0~/^([[:alnum:]_-]+\.){1,}[[:alpha:]]+([[:space:]]|$)/{print tolower(\$1)}'
+	option adb_src_desc 'focus on ad related domains, weekly updates, approx. 2.400 entries'
 
 config source 'zeus'
 	option enabled '0'
 	option adb_src 'https://zeustracker.abuse.ch/blocklist.php?download=domainblocklist'
-	option adb_src_rset '\$1 ~/^([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$1)}'
-	option adb_src_desc 'focus on zeus botnet, daily updates, approx. 440 entries'
+	option adb_src_rset '\$0~/^([[:alnum:]_-]+\.){1,}[[:alpha:]]+([[:space:]]|$)/{print tolower(\$1)}'
+	option adb_src_desc 'focus on zeus botnet, daily updates, approx. 400 entries'

+ 42 - 14
net/adblock/files/adblock.init

@@ -1,7 +1,7 @@
 #!/bin/sh /etc/rc.common
 #
 
-START=50
+START=30
 USE_PROCD=1
 
 EXTRA_COMMANDS="suspend resume query status"
@@ -12,30 +12,40 @@ EXTRA_HELP="	suspend	Suspend adblock processing
 
 adb_init="/etc/init.d/adblock"
 adb_script="/usr/bin/adblock.sh"
+adb_pidfile="/var/run/adblock.pid"
 
 boot()
 {
     adb_boot=1
-    ubus -t 30 wait_for network.interface 2>/dev/null
     rc_procd start_service
 }
 
 start_service()
 {
-    if [ $("${adb_init}" enabled; printf ${?}) -eq 0 ]
+    if [ $("${adb_init}" enabled; printf "%u" ${?}) -eq 0 ]
     then
         if [ -n "${adb_boot}" ]
         then
-            return 0
+            local trigger="$(uci_get adblock.global.adb_trigger)"
+            if [ "${trigger}" != "timed" ]
+            then
+                return 0
+            fi
         fi
         procd_open_instance "adblock"
         procd_set_param command "${adb_script}" "${@}"
+        procd_set_param pidfile "${adb_pidfile}"
         procd_set_param stdout 1
         procd_set_param stderr 1
         procd_close_instance
     fi
 }
 
+reload_service()
+{
+    rc_procd start_service reload
+}
+
 stop_service()
 {
     rc_procd "${adb_script}" stop
@@ -49,34 +59,52 @@ restart()
 
 suspend()
 {
+    [ -s "${adb_pidfile}" ] && return 1
     rc_procd "${adb_script}" suspend
 }
 
 resume()
 {
+    [ -s "${adb_pidfile}" ] && return 1
     rc_procd "${adb_script}" resume
 }
 
 query()
 {
+    [ -s "${adb_pidfile}" ] && return 1
     rc_procd "${adb_script}" query "${1}"
 }
 
 status()
 {
-    rc_procd "${adb_script}" status
+    local key keylist value rtfile="$(uci_get adblock.extra.adb_rtfile)"
+
+    rtfile="${rtfile:-"/tmp/adb_runtime.json"}"
+    if [ -s "${rtfile}" ]
+    then
+        printf "%s\n" "::: adblock runtime information"
+        json_load "$(cat "${rtfile}" 2>/dev/null)"
+        json_select data
+        json_get_keys keylist
+        for key in ${keylist}
+        do
+            json_get_var value "${key}"
+            printf "  + %-15s : %s\n" "${key}" "${value}"
+        done
+    else
+        printf "%s\n" "::: no adblock runtime information available"
+    fi
 }
 
 service_triggers()
 {
-    local iface="$(uci -q get adblock.global.adb_iface)"
-    local delay="$(uci -q get adblock.global.adb_triggerdelay)"
+    local trigger="$(uci_get adblock.global.adb_trigger)"
+    local delay="$(uci_get adblock.extra.adb_triggerdelay)"
 
-    PROCD_RELOAD_DELAY=$((${delay:=2} * 1000))
-    for name in ${iface}
-    do
-        procd_add_interface_trigger "interface.*.up" "${name}" "${adb_init}" start
-    done
-    PROCD_RELOAD_DELAY=1000
-    procd_add_config_trigger "config.change" "adblock" "${adb_init}" start
+    if [ "${trigger}" != "none" ] && [ "${trigger}" != "timed" ]
+    then
+        PROCD_RELOAD_DELAY=$((${delay:-2} * 1000))
+        procd_add_interface_trigger "interface.*.up" "${trigger}" "${adb_init}" start
+    fi
+    procd_add_reload_trigger "adblock"
 }

+ 56 - 0
net/adblock/files/adblock.notify

@@ -0,0 +1,56 @@
+#!/bin/sh
+#
+# adblock send mail script for mstmp
+# written by Dirk Brenken (dev@brenken.org)
+# Please note: you have to install and configure the package 'mstmp' before using this script.
+
+# This is free software, licensed under the GNU General Public License v3.
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+LC_ALL=C
+PATH="/usr/sbin:/usr/bin:/sbin:/bin"
+mail_ver="1.0.1"
+mail_daemon="$(command -v msmtp)"
+mail_profile="adb_notify"
+mail_debug="--debug"
+mail_rc=1
+
+if [ ! -x "${mail_daemon}" ]
+then
+    mail_daemon="$(command -v sendmail)"
+fi
+
+if [ -f "/var/log/messages" ]
+then
+    logfile="$(cat /var/log/messages | grep "adblock-")"
+else
+    logfile="$(logread -e "adblock-")"
+fi
+
+# mail header
+#
+mail_sender="no-reply@adblock"
+mail_receiver="!!!ChangeMe!!!"
+mail_topic="adblock notification"
+mail_head="From: ${mail_sender}\nTo: ${mail_receiver}\nSubject: ${mail_topic}\nReply-to: ${mail_sender}\n\n"
+
+# mail body
+#
+mail_text="adblock status, generated at $(date 2>&1)!"
+mail_text="${mail_text}\n++\n++ System Information ++\n++\n$(cat /etc/banner 2>&1)"
+mail_text="${mail_text}\n\n++\n++ Adblock Information ++\n++\n$(/etc/init.d/adblock status 2>&1)"
+mail_text="${mail_text}\n\n++\n++ Logfile Information ++\n++\n${logfile}\n++\n++\n"
+
+# send mail
+#
+if [ -x "${mail_daemon}" ]
+then
+    printf "%b" "${mail_head}${mail_text}" 2>/dev/null | "${mail_daemon}" ${mail_debug} -a "${mail_profile}" "${mail_receiver}" >/dev/null 2>&1
+    mail_rc=${?}
+    logger -p "info" -t "adblock-notify-[${mail_ver}]" "mail sent to '${mail_receiver}' with rc '${mail_rc}'"
+else
+    logger -p "err" -t "adblock-notify-[${mail_ver}]" "msmtp mail daemon not found"
+fi
+
+exit ${mail_rc}

File diff suppressed because it is too large
+ 610 - 225
net/adblock/files/adblock.sh


Some files were not shown because too many files changed in this diff