Browse Source

Revert package feed back

RISCi_ATOM 6 years ago
parent
commit
9810a4e618
100 changed files with 5808 additions and 8160 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. 9 11
      admin/zabbix/files/mac80211
  5. 42 0
      devel/lpc21isp/Makefile
  6. 264 0
      lang/python/Makefile
  7. 10 0
      lang/python/files/python-version.mk
  8. 25 0
      lang/python/patches/001-enable-zlib.patch
  9. 14 0
      lang/python/patches/002-do-not-add-include-dirs-when-cross-compiling.patch
  10. 20 0
      lang/python/patches/003-do-not-compile-tests-at-build.patch
  11. 22 0
      lang/python/patches/004-do-not-write-bytes-codes.patch
  12. 14 0
      lang/python/patches/006-remove-debian-multiarch-support.patch
  13. 54 0
      lang/python/patches/008-distutils-use-python-sysroot.patch
  14. 34 0
      lang/python/patches/009-do-not-use-dblib_dir-when-cross-compiling.patch
  15. 15 0
      lang/python/patches/010-do-not-add-rt-lib-dirs-when-cross-compiling.patch
  16. 12 0
      lang/python/patches/011-remove-setupterm-definition.patch
  17. 753 0
      lang/ruby/Makefile
  18. 91 0
      libs/alsa-lib/Makefile
  19. 3 3
      libs/gnutls/Makefile
  20. 106 0
      libs/icu/Makefile
  21. 10 0
      libs/libradcli/Config.in
  22. 75 0
      libs/libradcli/Makefile
  23. 5 6
      libs/libssh2/Makefile
  24. 2 2
      libs/libtasn1/Makefile
  25. 152 0
      libs/libxslt/Makefile
  26. 2 2
      libs/openldap/Makefile
  27. 2 3
      libs/p11-kit/Makefile
  28. 2 3
      libs/pcre/Makefile
  29. 53 0
      libs/pcre/patches/001-CVE-2017-7186
  30. 231 0
      libs/postgresql/Makefile
  31. 4 7
      libs/sqlite3/Makefile
  32. 109 0
      libs/tiff/Makefile
  33. 33 0
      libs/tiff/patches/001-autoconf-compat.patch
  34. 136 0
      libs/tiff/patches/002-CVE-2015-8665_and_CVE-2015-8683.patch
  35. 193 0
      libs/tiff/patches/003-fix_potential_out-of-bound_writes_in_decode_functions.patch
  36. 72 0
      libs/tiff/patches/004-fix_potential_out-of-bound_write_in_NeXTDecode.patch
  37. 11 0
      libs/tiff/patches/005-fix-ftell-macro.patch
  38. 0 59
      mail/nail/Makefile
  39. 0 22
      mail/nail/patches/100-handle-openssl-without-sslv2-sslv3.patch
  40. 473 0
      multimedia/ffmpeg/Config.in
  41. 645 0
      multimedia/ffmpeg/Makefile
  42. 277 0
      multimedia/gst1-plugins-bad/Makefile
  43. 26 0
      multimedia/gst1-plugins-bad/patches/001-no-translations.patch
  44. 57 0
      multimedia/gst1-plugins-bad/patches/002-no-tests.patch
  45. 177 0
      multimedia/gst1-plugins-ugly/Makefile
  46. 23 0
      multimedia/gst1-plugins-ugly/patches/001-no-translations.patch
  47. 23 0
      multimedia/gst1-plugins-ugly/patches/002-no-tests.patch
  48. 23 0
      multimedia/gst1-plugins-ugly/patches/003-no-docs.patch
  49. 85 0
      multimedia/minidlna/Makefile
  50. 17 0
      multimedia/minidlna/files/minidlna.config
  51. 97 0
      multimedia/minidlna/files/minidlna.init
  52. 19 0
      multimedia/minidlna/patches/010-libav-fix.patch
  53. 4 5
      net/acme/Makefile
  54. 0 4
      net/acme/files/run.sh
  55. 4 6
      net/adblock/Makefile
  56. 102 146
      net/adblock/files/README.md
  57. 66 77
      net/adblock/files/adblock.conf
  58. 14 42
      net/adblock/files/adblock.init
  59. 0 56
      net/adblock/files/adblock.notify
  60. 225 610
      net/adblock/files/adblock.sh
  61. 148 0
      net/cjdns/Makefile
  62. 127 0
      net/cjdns/files/cjdns.defaults
  63. 32 0
      net/cjdns/files/cjdns.init
  64. 30 0
      net/cjdns/files/cjdrouteconf
  65. 105 0
      net/cjdns/lua/cjdns/admin.lua
  66. 7 0
      net/cjdns/lua/cjdns/common.lua
  67. 12 0
      net/cjdns/lua/cjdns/init.lua
  68. 289 0
      net/cjdns/lua/cjdns/uci.lua
  69. 102 0
      net/cjdns/lua/cjdns/udp.lua
  70. 0 14
      net/freeradius2/Config.in
  71. 0 636
      net/freeradius2/Makefile
  72. 0 29
      net/freeradius2/files/radiusd.init
  73. 0 12
      net/freeradius2/patches/001-fix-makefile.patch
  74. 0 613
      net/freeradius2/patches/002-config.patch
  75. 0 4257
      net/freeradius2/patches/004-ldap_configure.patch
  76. 0 17
      net/freeradius2/patches/008-honor_ccpflags.patch
  77. 0 40
      net/freeradius2/patches/010-disbale-openssl-check.patch
  78. 2 2
      net/git/Makefile
  79. 3 3
      net/haproxy/Makefile
  80. 0 299
      net/haproxy/patches/0001-BUG-MINOR-peers-peer-synchronization-issue-with-seve.patch
  81. 0 36
      net/haproxy/patches/0002-BUG-MINOR-lua-In-error-case-the-safe-mode-is-not-rem.patch
  82. 0 59
      net/haproxy/patches/0003-BUG-MINOR-lua-executes-the-function-destroying-the-L.patch
  83. 0 97
      net/haproxy/patches/0004-BUG-MAJOR-lua-socket-resources-not-detroyed-when-the.patch
  84. 0 46
      net/haproxy/patches/0005-BUG-MEDIUM-lua-bad-memory-access.patch
  85. 0 64
      net/haproxy/patches/0006-DOC-update-CONTRIBUTING-regarding-optional-parts-and.patch
  86. 0 36
      net/haproxy/patches/0007-DOC-update-the-list-of-OpenSSL-versions-in-the-READM.patch
  87. 0 129
      net/haproxy/patches/0008-MINOR-tools-add-a-portable-timegm-alternative.patch
  88. 0 38
      net/haproxy/patches/0009-BUILD-lua-replace-timegm-with-my_timegm-to-fix-build.patch
  89. 0 32
      net/haproxy/patches/0010-DOC-Updated-51Degrees-git-URL-to-point-to-a-stable-v.patch
  90. 0 33
      net/haproxy/patches/0011-BUG-MINOR-http-Set-the-response-error-state-in-http_.patch
  91. 0 100
      net/haproxy/patches/0012-MINOR-http-Reorder-rewrite-checks-in-http_resync_sta.patch
  92. 0 153
      net/haproxy/patches/0013-MINOR-http-Switch-requests-responses-in-TUNNEL-mode-.patch
  93. 0 118
      net/haproxy/patches/0014-BUG-MEDIUM-http-Switch-HTTP-responses-in-TUNNEL-mode.patch
  94. 0 43
      net/haproxy/patches/0015-BUG-MAJOR-http-Fix-possible-infinity-loop-in-http_sy.patch
  95. 0 45
      net/haproxy/patches/0016-BUG-MINOR-lua-Fix-Server.get_addr-port-values.patch
  96. 0 34
      net/haproxy/patches/0017-BUG-MINOR-lua-Correctly-use-INET6_ADDRSTRLEN-in-Serv.patch
  97. 0 45
      net/haproxy/patches/0018-BUG-MINOR-lua-always-detach-the-tcp-http-tasks-befor.patch
  98. 0 51
      net/horst/Makefile
  99. 4 5
      net/https-dns-proxy/Makefile
  100. 2 2
      net/jool/Makefile

+ 5 - 5
admin/monit/Makefile

@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=monit
-PKG_VERSION:=5.24.0
+PKG_VERSION:=5.18
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_HASH:=754d1f0e165e5a26d4639a6a83f44ccf839e381f2622e0946d5302fa1f2d2414
-PKG_SOURCE_URL:=https://mmonit.com/monit/dist
+PKG_SOURCE_URL:=http://mmonit.com/monit/dist
+PKG_MD5SUM:=a1bfac0fbb83439435f8616200d2364d
 
 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 +zlib
+  DEPENDS:= +libpthread
   TITLE:=System services monitoring utility
-  URL:=https://mmonit.com/monit/
+  URL:=http://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
-@@ -13852,14 +13852,7 @@ fi
+@@ -13849,14 +13849,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.2.6
+PKG_VERSION:=3.0.3
 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

+ 9 - 11
admin/zabbix/files/mac80211

@@ -15,15 +15,13 @@ 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
-
-# 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
+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
 

+ 42 - 0
devel/lpc21isp/Makefile

@@ -0,0 +1,42 @@
+#
+# 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))

+ 264 - 0
lang/python/Makefile

@@ -0,0 +1,264 @@
+#
+# 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
+
+# For PYTHON_VERSION
+include ./files/python-version.mk
+
+PKG_NAME:=python
+PKG_VERSION:=$(PYTHON_VERSION).$(PYTHON_VERSION_MICRO)
+PKG_RELEASE:=4
+
+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_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
+
+# This file provides the necsessary host build variables
+include ./files/python-host.mk
+
+# For PyPackage
+include ./files/python-package.mk
+
+PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
+HOST_BUILD_PARALLEL:=1
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/Python-$(PKG_VERSION)
+HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/Python-$(PKG_VERSION)
+
+PKG_BUILD_DEPENDS:=python/host
+HOST_BUILD_DEPENDS:=bzip2/host expat/host
+
+include $(INCLUDE_DIR)/host-build.mk
+include $(INCLUDE_DIR)/package.mk
+
+define Package/python/Default
+  SUBMENU:=Python
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Python $(PYTHON_VERSION) programming language
+  URL:=https://www.python.org/
+  MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
+endef
+
+define Package/python/Default/description
+ Python is a dynamic object-oriented programming language that can be used
+ for many kinds of software development. It offers strong support for
+ integration with other languages and tools, comes with extensive standard
+ libraries, and can be learned in a few days. Many Python programmers
+ report substantial productivity gains and feel the language encourages
+ the development of higher quality, more maintainable code.
+endef
+
+define Package/python-base
+$(call Package/python/Default)
+  TITLE:=Python $(PYTHON_VERSION) interpreter
+  DEPENDS:=+libpthread +zlib
+endef
+
+define Package/python-base/description
+  This package contains only the interpreter and the bare minimum
+  for the interpreter to start.
+endef
+
+define Package/python-light
+$(call Package/python/Default)
+  TITLE:=Python $(PYTHON_VERSION) light installation
+  DEPENDS:=+python-base +libffi +libbz2
+endef
+
+define Package/python-light/description
+  This package is essentially the python-base package plus
+  a few of the rarely used (and big) libraries stripped out
+  into separate packages.
+endef
+
+PYTHON_LIB_FILES_DEL:=
+PYTHON_PACKAGES:=
+PYTHON_PACKAGES_DEPENDS:=
+define PyBasePackage
+  PYTHON_PACKAGES+=$(1)
+  ifeq ($(3),)
+    PYTHON_PACKAGES_DEPENDS+=$(1)
+  endif
+  PYTHON_LIB_FILES_DEL+=$(2)
+  define PyPackage/$(1)/filespec
+    $(subst $(space),$(newline),$(foreach lib_file,$(2),+|$(lib_file)))
+  endef
+endef
+
+include ./files/python-package-*.mk
+
+define Package/python
+$(call Package/python/Default)
+  DEPENDS:=+python-light $(foreach package,$(PYTHON_PACKAGES_DEPENDS),+$(package))
+endef
+
+define Package/python/description
+  This package contains the (almost) full Python install.
+  It's python-light + all other packages.
+endef
+
+MAKE_FLAGS+=\
+	CROSS_COMPILE=yes \
+	LD="$(TARGET_CC)" \
+	PGEN=pgen2
+
+EXTRA_CFLAGS+= \
+	-DNDEBUG -fno-inline
+EXTRA_LDFLAGS+= \
+	-L$(PKG_BUILD_DIR)
+
+ENABLE_IPV6:=
+ifeq ($(CONFIG_IPV6),y)
+	ENABLE_IPV6 += --enable-ipv6
+endif
+
+PYTHON_FOR_BUILD:= \
+	_PYTHON_PROJECT_BASE=$(PKG_BUILD_DIR) \
+	_PYTHON_HOST_PLATFORM=linux2 \
+	PYTHONPATH="$(PKG_BUILD_DIR)/Lib:$(PKG_BUILD_DIR)/build/lib.linux2-$(PYTHON_VERSION)" \
+	_PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata \
+	$(HOST_PYTHON_BIN)
+
+CONFIGURE_ARGS+= \
+	--sysconfdir=/etc \
+	--enable-shared \
+	--without-cxx-main \
+	--with-threads \
+	--with-system-ffi \
+	--without-pymalloc \
+	PYTHON_FOR_BUILD="$(PYTHON_FOR_BUILD)" \
+	$(ENABLE_IPV6) \
+	CONFIG_SITE="$(PKG_BUILD_DIR)/config.site" \
+	OPT="$(TARGET_CFLAGS)"
+
+define Build/Prepare
+	$(call Build/Prepare/Default)
+	$(CP) ./files/config.site $(PKG_BUILD_DIR)/config.site
+endef
+
+define Build/InstallDev
+	$(INSTALL_DIR) $(STAGING_DIR)/mk/
+	$(INSTALL_DIR) $(1)/usr/include/ $(1)/usr/lib/ $(1)/usr/lib/pkgconfig
+	$(INSTALL_DIR) $(1)/usr/lib/python$(PYTHON_VERSION)/
+	$(INSTALL_DATA) \
+		./files/python-package.mk \
+		./files/python-host.mk \
+		./files/python-version.mk \
+		$(STAGING_DIR)/mk/
+	$(CP) \
+		$(PKG_INSTALL_DIR)/usr/include/python$(PYTHON_VERSION) \
+		$(1)/usr/include/
+	$(CP) \
+		$(HOST_PYTHON_LIB_DIR) \
+		$(PKG_INSTALL_DIR)/usr/lib/libpython$(PYTHON_VERSION).so* \
+		$(1)/usr/lib/
+	$(CP) \
+		$(HOST_PYTHON_DIR)/lib/pkgconfig/python.pc \
+		$(HOST_PYTHON_DIR)/lib/pkgconfig/python2.pc \
+		$(HOST_PYTHON_DIR)/lib/pkgconfig/python-$(PYTHON_VERSION).pc \
+		$(1)/usr/lib/pkgconfig
+	$(CP) \
+		$(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON_VERSION)/config \
+		$(1)/usr/lib/python$(PYTHON_VERSION)/
+endef
+
+PYTHON_BASE_LIB_FILES:= \
+	/usr/lib/python$(PYTHON_VERSION)/_abcoll.py \
+	/usr/lib/python$(PYTHON_VERSION)/_sysconfigdata.py \
+	/usr/lib/python$(PYTHON_VERSION)/_weakrefset.py \
+	/usr/lib/python$(PYTHON_VERSION)/abc.py \
+	/usr/lib/python$(PYTHON_VERSION)/copy_reg.py \
+	/usr/lib/python$(PYTHON_VERSION)/genericpath.py \
+	/usr/lib/python$(PYTHON_VERSION)/linecache.py \
+	/usr/lib/python$(PYTHON_VERSION)/posixpath.py \
+	/usr/lib/python$(PYTHON_VERSION)/os.py \
+	/usr/lib/python$(PYTHON_VERSION)/re.py \
+	/usr/lib/python$(PYTHON_VERSION)/site.py \
+	/usr/lib/python$(PYTHON_VERSION)/sre_compile.py \
+	/usr/lib/python$(PYTHON_VERSION)/sre_constants.py \
+	/usr/lib/python$(PYTHON_VERSION)/sre_parse.py \
+	/usr/lib/python$(PYTHON_VERSION)/sysconfig.py \
+	/usr/lib/python$(PYTHON_VERSION)/stat.py \
+	/usr/lib/python$(PYTHON_VERSION)/traceback.py \
+	/usr/lib/python$(PYTHON_VERSION)/types.py \
+	/usr/lib/python$(PYTHON_VERSION)/UserDict.py \
+	/usr/lib/python$(PYTHON_VERSION)/warnings.py
+
+PYTHON_LIB_FILES_DEL+=$(PYTHON_BASE_LIB_FILES)
+
+define PyPackage/python-base/filespec
++|/usr/bin/python$(PYTHON_VERSION)
+$(subst $(space),$(newline),$(foreach lib_file,$(PYTHON_BASE_LIB_FILES),+|$(lib_file)))
+endef
+
+define PyPackage/python-light/filespec
++|/usr/lib/python$(PYTHON_VERSION)
+-|/usr/lib/python$(PYTHON_VERSION)/distutils/cygwinccompiler.py
+-|/usr/lib/python$(PYTHON_VERSION)/distutils/command/wininst*
+-|/usr/lib/python$(PYTHON_VERSION)/ensurepip
+-|/usr/lib/python$(PYTHON_VERSION)/idlelib
+-|/usr/lib/python$(PYTHON_VERSION)/lib-tk
+-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_testcapi.so
+-|/usr/lib/python$(PYTHON_VERSION)/pdb.doc
+-|/usr/lib/python$(PYTHON_VERSION)/test
+-|/usr/lib/python$(PYTHON_VERSION)/webbrowser.py
+-|/usr/lib/python$(PYTHON_VERSION)/*/test
+-|/usr/lib/python$(PYTHON_VERSION)/*/tests
+-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/readline.so
+$(subst $(space),$(newline),$(foreach lib_file,$(PYTHON_LIB_FILES_DEL),-|$(lib_file)))
+endef
+
+define PyPackage/python-base/install
+	$(LN) python$(PYTHON_VERSION) $(1)/usr/bin/python
+	$(LN) python$(PYTHON_VERSION) $(1)/usr/bin/python2
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libpython$(PYTHON_VERSION).so* $(1)/usr/lib/
+endef
+
+define PyPackage/python/filespec
+-|$(PYTHON_PKG_DIR)
+endef
+
+HOST_LDFLAGS += \
+	$$$$(pkg-config --static --libs libcrypto libssl)
+
+HOST_CONFIGURE_ARGS+= \
+	--without-cxx-main \
+	--without-pymalloc \
+	--with-threads \
+	--prefix=$(HOST_PYTHON_DIR) \
+	--exec-prefix=$(HOST_PYTHON_DIR) \
+	--with-system-expat=$(STAGING_DIR_HOSTPKG) \
+	--with-system-ffi=no \
+	CONFIG_SITE=
+
+define Host/Install
+	$(MAKE) -C $(HOST_BUILD_DIR) install
+	$(INSTALL_DIR) $(HOST_PYTHON_DIR)/bin/
+	$(INSTALL_BIN) $(HOST_BUILD_DIR)/Parser/pgen $(HOST_PYTHON_DIR)/bin/pgen2
+endef
+
+$(eval $(call HostBuild))
+
+$(foreach package, $(PYTHON_PACKAGES),  \
+	$(eval $(call PyPackage,$(package))) \
+	$(eval $(call BuildPackage,$(package))) \
+)
+
+$(eval $(call PyPackage,python-base))
+$(eval $(call PyPackage,python-light))
+$(eval $(call PyPackage,python))
+
+$(eval $(call BuildPackage,python-base))
+$(eval $(call BuildPackage,python-light))
+$(eval $(call BuildPackage,python))

+ 10 - 0
lang/python/files/python-version.mk

@@ -0,0 +1,10 @@
+#
+# Copyright (C) 2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+PYTHON_VERSION:=2.7
+PYTHON_VERSION_MICRO:=13
+

+ 25 - 0
lang/python/patches/001-enable-zlib.patch

@@ -0,0 +1,25 @@
+From 6eeab87bc852481e599325549c854b701bf2e39f Mon Sep 17 00:00:00 2001
+From: Alexandru Ardelean <aa@ocedo.com>
+Date: Thu, 25 Sep 2014 18:18:29 +0300
+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
+ # Andrew Kuchling's zlib module.
+ # This require zlib 1.1.3 (or later).
+ # See http://www.gzip.org/zlib/
+-#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
++zlib zlibmodule.c -lz
+ 
+ # Interface to the Expat XML parser
+ #
+-- 
+1.8.4.5
+

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

@@ -0,0 +1,14 @@
+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):
+                         add_dir_to_list(dir_list, directory)
+ 
+         if os.path.normpath(sys.prefix) != '/usr' \
+-                and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
++                and not sysconfig.get_config_var('PYTHONFRAMEWORK') \
++                and not cross_compiling:
+             # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework
+             # (PYTHONFRAMEWORK is set) to avoid # linking problems when
+             # building a framework with different architectures than

+ 20 - 0
lang/python/patches/003-do-not-compile-tests-at-build.patch

@@ -0,0 +1,20 @@
+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
+ 		done; \
+ 	done
+ 	$(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
++ifeq (@COMPILE_ALL_TESTS@,yes)
+ 	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
+ 		$(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
++endif
+ 
+ # Create the PLATDIR source directory, if one wasn't distributed..
+ $(srcdir)/Lib/$(PLATDIR):

+ 22 - 0
lang/python/patches/004-do-not-write-bytes-codes.patch

@@ -0,0 +1,22 @@
+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 */
+ 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) */
+-int Py_DontWriteBytecodeFlag; /* Suppress writing bytecode files (*.py[co]) */
++int Py_DontWriteBytecodeFlag = 1; /* Suppress writing bytecode files (*.py[co]) */
+ 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)
+     if ((p = Py_GETENV("PYTHONOPTIMIZE")) && *p != '\0')
+         Py_OptimizeFlag = add_flag(Py_OptimizeFlag, p);
+     if ((p = Py_GETENV("PYTHONDONTWRITEBYTECODE")) && *p != '\0')
+-        Py_DontWriteBytecodeFlag = add_flag(Py_DontWriteBytecodeFlag, p);
++        Py_DontWriteBytecodeFlag = atoi(p);
+     /* The variable is only tested for existence here; _PyRandom_Init will
+        check its value further. */
+     if ((p = Py_GETENV("PYTHONHASHSEED")) && *p != '\0')

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

@@ -0,0 +1,14 @@
+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.

+ 54 - 0
lang/python/patches/008-distutils-use-python-sysroot.patch

@@ -0,0 +1,54 @@
+Adjust library/header paths for cross-compilation
+
+When cross-compiling third-party extensions, the get_python_inc() or
+get_python_lib() can be called, to return the path to headers or
+libraries. However, they use the sys.prefix of the host Python, which
+returns incorrect paths when cross-compiling (paths pointing to host
+headers and libraries).
+
+In order to fix this, we introduce the _python_sysroot, _python_prefix
+and _python_exec_prefix variables, that allow to override these
+values, and get correct header/library paths when cross-compiling
+third-party Python modules.
+
+The _python_sysroot variable is also used to prefix the LIBDIR value
+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 @@
+ from distutils.errors import DistutilsPlatformError
+ 
+ # These are needed in a couple of spots, so just compute them once.
+-PREFIX = os.path.normpath(sys.prefix)
+-EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
++if "_python_sysroot" in os.environ:
++    _sysroot=os.environ.get('_python_sysroot')
++    PREFIX = os.path.normpath(_sysroot + os.environ.get('_python_prefix'))
++    EXEC_PREFIX = os.path.normpath(_sysroot + os.environ.get('_python_exec_prefix'))
++else:
++    PREFIX = os.path.normpath(sys.prefix)
++    EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
+ 
+ # 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 @@
+         if (sysconfig.get_config_var('Py_ENABLE_SHARED')):
+             if not sysconfig.python_build:
+                 # building third party extensions
+-                self.library_dirs.append(sysconfig.get_config_var('LIBDIR'))
++                libdir = sysconfig.get_config_var('LIBDIR')
++                if "_python_sysroot" in os.environ:
++                    libdir = os.environ.get("_python_sysroot") + libdir
++                self.library_dirs.append(libdir)
+             else:
+                 # building python standard extensions
+                 self.library_dirs.append('.')

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

@@ -0,0 +1,34 @@
+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):
+                         if db_setup_debug: print "db lib: ", dblib, "not found"
+ 
+         except db_found:
++            rt_dblib_dir = None if cross_compiling else dblib_dir
+             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):
+             exts.append(Extension('_bsddb', ['_bsddb.c'],
+                                   depends = ['bsddb.h'],
+                                   library_dirs=dblib_dir,
+-                                  runtime_library_dirs=dblib_dir,
++                                  runtime_library_dirs=rt_dblib_dir,
+                                   include_dirs=db_incs,
+                                   libraries=dblibs))
+         else:
+@@ -1292,10 +1293,11 @@ class PyBuildExt(build_ext):
+                             break
+                 elif cand == "bdb":
+                     if db_incs is not None:
++                        rt_dblib_dir = None if cross_compiling else dblib_dir
+                         print "building dbm using bdb"
+                         dbmext = Extension('dbm', ['dbmmodule.c'],
+                                            library_dirs=dblib_dir,
+-                                           runtime_library_dirs=dblib_dir,
++                                           runtime_library_dirs=rt_dblib_dir,
+                                            include_dirs=db_incs,
+                                            define_macros=[
+                                                ('HAVE_BERKDB_H', None),

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

@@ -0,0 +1,15 @@
+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):
+         # 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).
++        rt_lib_dirs = [] if cross_compiling else self.compiler.runtime_library_dirs
+         for env_var, arg_name, dir_list in (
+-                ('LDFLAGS', '-R', self.compiler.runtime_library_dirs),
++                ('LDFLAGS', '-R', rt_lib_dirs),
+                 ('LDFLAGS', '-L', self.compiler.library_dirs),
+                 ('CPPFLAGS', '-I', self.compiler.include_dirs)):
+             env_val = sysconfig.get_config_var(env_var)

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

@@ -0,0 +1,12 @@
+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";
+     #defines many common symbols (such as "lines") which breaks the
+     curses module in other ways.  So the code will just specify
+     explicit prototypes here. */
+-extern int setupterm(char *,int,int *);
+ #ifdef __sgi
+ #include <term.h>
+ #endif

+ 753 - 0
lang/ruby/Makefile

@@ -0,0 +1,753 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+# Copyright (C) 2017 Luiz Angelo Daros de Luca <luizluca@gmail.com>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+# To Do:
+#  - dirs not removed when uninstalling! opkg bug?
+#
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=ruby
+PKG_VERSION:=2.4.1
+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_MAINTAINER:=Luiz Angelo Daros de Luca <luizluca@gmail.com>
+PKG_LICENSE:=BSD-2-Clause
+PKG_LICENSE_FILES:=COPYING
+
+PKG_BUILD_DEPENDS:=ruby/host
+PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
+PKG_FIXUP:=autoreconf
+
+include $(INCLUDE_DIR)/host-build.mk
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+
+HOST_CONFIGURE_ARGS += \
+	--disable-install-doc \
+	--disable-install-rdoc \
+	--disable-install-capi \
+	--without-gmp \
+	--with-out-ext=-test-/array/resize,-test-/bignum,-test-/bug-3571,-test-/bug-5832,-test-/bug_reporter,-test-/class,-test-/debug,-test-/dln/empty,-test-/exception,-test-/fatal,-test-/file,-test-/float,-test-/funcall,-test-/gvl/call_without_gvl,-test-/hash,-test-/integer,-test-/iseq_load,-test-/iter,-test-/load/dot.dot,-test-/marshal/compat,-test-/marshal/internal_ivar,-test-/marshal/usr,-test-/memory_status,-test-/method,-test-/notimplement,-test-/num2int,-test-/path_to_class,-test-/popen_deadlock,-test-/postponed_job,-test-/printf,-test-/proc,-test-/rational,-test-/recursion,-test-/st/foreach,-test-/st/numhash,-test-/st/update,-test-/string,-test-/struct,-test-/symbol,-test-/time,-test-/tracepoint,-test-/typeddata,-test-/vm,-test-/wait_for_single_fd,-test-/win32/console,-test-/win32/dln,-test-/win32/fd_setsize,bigdecimal,cgi/escape,continuation,coverage,dbm,etc,fcntl,fiber,fiddle,gdbm,io/console,io/nonblock,io/wait,json,json/generator,json/parser,mathn/complex,mathn/rational,nkf,objspace,openssl,pathname,pty,racc/cparse,rbconfig/sizeof,readline,ripper,rubyvm,sdbm,socket,syslog,win32,win32ole,win32/resolv,zlib
+
+# Does not compile with this. Workaround is --without-gmp
+# https://bugs.ruby-lang.org/issues/11940
+	#--with-static-linked-ext \
+
+# even not used, host build with restricted exts results in gems not being
+# compiled for target (probably some cross compiling problem like checking
+# host for selecting target features)
+#	--with-out-ext \
+#	--with-ext=thread,stringio \
+
+CONFIGURE_ARGS += \
+	--enable-shared \
+	--enable-static \
+	--disable-rpath \
+	$(call autoconf_bool,CONFIG_IPV6,ipv6) \
+	--disable-install-doc \
+	--disable-install-capi \
+	--with-ruby-version=minor \
+	--with-iconv-dir=$(ICONV_PREFIX) \
+	--with-out-ext=win32,win32ole
+
+ifndef CONFIG_RUBY_DIGEST_USE_OPENSSL
+CONFIGURE_ARGS += \
+	--with-bundled-sha1\
+	--with-bundled-md5\
+	--with-bundled-rmd160\
+	--with-bundled-sha2 \
+
+endif
+
+TARGET_LDFLAGS += -L$(PKG_BUILD_DIR)
+
+# Ruby uses DLDFLAGS and not LDFLAGS for libraries. LDFLAGS is only for execs.
+# However, DLDFLAGS from configure is not passed to Makefile when target is linux.
+# XLDFLAGS is used by both libraries and execs. This is somehow brute force but
+# it will fix when some LD_FLAGS is needed for libraries. As side effect, it will
+# duplicate ld args for binaries.
+CONFIGURE_VARS += XLDFLAGS="$(TARGET_LDFLAGS)"
+
+MAKE_FLAGS += \
+	DESTDIR="$(PKG_INSTALL_DIR)" \
+	SHELL="/bin/bash"
+
+define Build/InstallDev
+	( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
+		. \
+	) | ( cd $(1); $(TAR) -xf - )
+endef
+
+define Host/Install
+	# When ruby version is updated, make install asks in some cases before replace
+	# an existing different file. Remove them before install and avoid the interaction
+	rm -f $(STAGING_DIR_HOSTPKG)/bin/rake
+	$(call Host/Install/Default)
+endef
+
+define Package/ruby/Default
+  SUBMENU:=Ruby
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Ruby scripting language
+  URL:=http://www.ruby-lang.org/
+endef
+
+define Package/ruby/Default/description
+ Ruby is the interpreted scripting language for quick and easy
+ object-oriented programming.  It has many features to process text files
+ and to do system management tasks (as in perl).  It is simple,
+ straight-forward, and extensible.
+
+endef
+
+define Package/ruby
+$(call Package/ruby/Default)
+  TITLE+= (interpreter)
+  DEPENDS:=+libruby
+endef
+
+define Package/ruby/description
+$(call Package/ruby/Default/description)
+endef
+
+define RubyDependency
+    $(eval \
+        $(call Package/Default)
+        $(call Package/ruby-$(1))
+        FILTER_CONFIG:=$$(strip \
+            $$(foreach config_dep, \
+                $$(filter @%, \
+                    $$(foreach v, \
+                        $$(DEPENDS), \
+                        $$(if $$(findstring :,$$v),,$$v) \
+                    ) \
+                ), \
+                $$(subst @,,$$(config_dep)) \
+            ) \
+        )
+        ifneq (,$$(FILTER_CONFIG))
+           FILTER_CONFIG:=($$(subst $$(space),&&,$$(FILTER_CONFIG))):
+        endif
+    ) \
+    +$(FILTER_CONFIG)ruby-$(1)
+endef
+
+define Package/ruby/config
+    comment "Standard Library"
+      depends on PACKAGE_ruby
+
+    config PACKAGE_ruby-stdlib
+      depends on PACKAGE_ruby
+      default m if ALL
+      prompt "Select Ruby Complete Standard Library (ruby-stdlib)"
+
+endef
+
+define Package/ruby/install
+	$(INSTALL_DIR) $(1)/usr/bin
+	$(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_ABI_VERSION)
+	$(INSTALL_DIR) $(1)/usr/lib/ruby/vendor_ruby/$(PKG_ABI_VERSION)
+	$(INSTALL_DIR) $(1)/usr/lib/ruby/site_ruby/$(PKG_ABI_VERSION)
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ruby $(1)/usr/lib/ruby/ruby$(PKG_ABI_VERSION)-bin
+	$(INSTALL_BIN) ./files/ruby $(1)/usr/bin/ruby
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/vendor_ruby/$(PKG_ABI_VERSION)/* $(1)/usr/lib/ruby/vendor_ruby/$(PKG_ABI_VERSION)/
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/site_ruby/$(PKG_ABI_VERSION)/* $(1)/usr/lib/ruby/site_ruby/$(PKG_ABI_VERSION)/
+	$(SED) "s%@RUBY_LIBPATH@%/usr/lib/ruby/$(PKG_ABI_VERSION)%" $(1)/usr/bin/ruby
+	$(SED) "s%@RUBY_BINPATH@%/usr/lib/ruby/ruby$(PKG_ABI_VERSION)-bin%" $(1)/usr/bin/ruby
+endef
+
+define Package/libruby
+$(call Package/ruby/Default)
+  SUBMENU:=
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE+= (shared library)
+  DEPENDS+= +libpthread +librt +libgmp
+  ABI_VERSION:=$(PKG_ABI_VERSION)
+endef
+define Package/libruby/install
+	$(INSTALL_DIR) $(1)/usr/lib
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libruby.so.* $(1)/usr/lib/
+endef
+
+RUBY_STDLIB :=
+define Package/ruby-stdlib
+$(call Package/ruby/Default)
+  TITLE:=Ruby standard libraries (metadata for all stdlib subsets)
+  DEPENDS:=ruby $(foreach subpackage,$(RUBY_STDLIB),$(strip $(call RubyDependency,$(subpackage))))
+  HIDDEN:=1
+endef
+
+define Package/ruby-stdlib/description
+ This metapackage currently install all ruby-* packages,
+ providing a complete Ruby Standard Library.
+
+endef
+
+# nothing to do
+define Package/ruby-stdlib/install
+	/bin/true
+endef
+
+define Package/ruby-bigdecimal/files
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/bigdecimal.so
+/usr/lib/ruby/$(PKG_ABI_VERSION)/bigdecimal/
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/specifications/default/bigdecimal-*.gemspec
+endef
+
+define Package/ruby-cgi/files
+/usr/lib/ruby/$(PKG_ABI_VERSION)/cgi
+/usr/lib/ruby/$(PKG_ABI_VERSION)/cgi.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/cgi/escape.so
+endef
+
+define Package/ruby-csv/files
+/usr/lib/ruby/$(PKG_ABI_VERSION)/csv.rb
+endef
+
+define Package/ruby-datetime/files
+/usr/lib/ruby/$(PKG_ABI_VERSION)/time.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/date.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/date_core.so
+endef
+
+define Package/ruby-dbm/description
+ The DBM class provides a wrapper to a Unix-style dbm or Database Manager library.
+ This package provides dbm.so file.
+
+endef
+define Package/ruby-dbm/files
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/dbm.so
+endef
+
+define Package/ruby-debuglib/files
+/usr/lib/ruby/$(PKG_ABI_VERSION)/profile.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/profiler.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/debug.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/tracer.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/benchmark.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/objspace.so
+endef
+
+define Package/ruby-did-you-mean/files
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/specifications/did_you_mean-*.gemspec
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/did_you_mean-*/
+endef
+define Package/ruby-did-you-mean/files-excluded
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/did_you_mean-*/benchmark
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/did_you_mean-*/doc
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/did_you_mean-*/evaluation
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/did_you_mean-*/test
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/did_you_mean-*/*.md
+endef
+
+define Package/ruby-digest/description
+ Provides digest* files. Can be configured to use OpenSSL or
+ bundled hash functions.
+
+endef
+define Package/ruby-digest/config
+
+	config RUBY_DIGEST_USE_OPENSSL
+		bool "Use OpenSSL functions for ruby digest hash functions"
+        depends on PACKAGE_ruby-digest
+		help
+			Ruby can use OpenSSL hash functions or compile alternative implementations. Using
+			OpenSSL saves about 30KBytes (less when compressed) but requires OpenSSL (that
+			is way bigger than that). However, if OpenSSL is already needed by another usage,
+			as ruby-openssl or any other non ruby package, it is better to mark this option.
+		default n
+
+endef
+define Package/ruby-digest/files
+/usr/lib/ruby/$(PKG_ABI_VERSION)/digest
+/usr/lib/ruby/$(PKG_ABI_VERSION)/digest.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/digest.so
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/digest/*
+endef
+
+define Package/ruby-drb/files
+/usr/lib/ruby/$(PKG_ABI_VERSION)/drb.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/drb
+endef
+
+define Package/ruby-enc/files
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/enc/encdb.so
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/enc/iso_8859_1.so
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/enc/utf_*.so
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/enc/euc_jp.so
+endef
+
+define Package/ruby-enc-extra/files
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/enc
+endef
+define Package/ruby-enc-extra/files-excluded
+$(call Package/ruby-enc/files)
+endef
+
+define Package/ruby-erb/files
+/usr/bin/erb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/erb.rb
+endef
+
+define Package/ruby-fiddle/files
+/usr/lib/ruby/$(PKG_ABI_VERSION)/fiddle.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/fiddle/
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/fiddle.so
+endef
+
+define Package/ruby-filelib/files
+/usr/lib/ruby/$(PKG_ABI_VERSION)/tmpdir.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/tempfile.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/pathname.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/pathname.so
+/usr/lib/ruby/$(PKG_ABI_VERSION)/find.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/fileutils.rb
+endef
+
+define Package/ruby-gdbm/files
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/gdbm.so
+endef
+
+define Package/ruby-gems/files
+/usr/lib/ruby/$(PKG_ABI_VERSION)/ubygems.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/rubygems.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/rubygems
+endef
+define Package/ruby-gems/files-excluded
+/usr/lib/ruby/$(PKG_ABI_VERSION)/rubygems/test_case.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/rubygems/package/tar_test_case.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/rubygems/installer_test_case.rb
+endef
+define Package/ruby-gems/install
+	$(INSTALL_DIR) $(1)/usr/bin
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gem $(1)/usr/bin/
+	$(INSTALL_DIR) $(1)/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/specifications/default
+	$(INSTALL_DIR) $(1)/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems
+	$(INSTALL_DIR) $(1)/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/doc
+	$(INSTALL_DIR) $(1)/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/cache
+	$(INSTALL_DIR) $(1)/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/extensions
+	$(INSTALL_DIR) $(1)/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/build_info
+	$(call RubyBuildPackage/install,gems,$(1))
+endef
+
+define Package/ruby-io-console/files
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/io/console.so
+/usr/lib/ruby/$(PKG_ABI_VERSION)/io/console/
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/specifications/default/io-console-*.gemspec
+endef
+
+define Package/ruby-irb/files
+/usr/lib/ruby/$(PKG_ABI_VERSION)/irb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/irb.rb
+endef
+define Package/ruby-irb/install
+	$(INSTALL_DIR) $(1)/usr/bin
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/irb $(1)/usr/bin/
+	$(call RubyBuildPackage/install,irb,$(1))
+endef
+
+define Package/ruby-json/files
+/usr/lib/ruby/$(PKG_ABI_VERSION)/json.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/json
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/json
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/specifications/default/json-*.gemspec
+endef
+define Package/ruby-json/files-excluded
+$(call Package/ruby-psych/files)
+endef
+
+define Package/ruby-logger/files
+/usr/lib/ruby/$(PKG_ABI_VERSION)/logger.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/syslog/logger.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/syslog.so
+endef
+
+define Package/ruby-math/files
+/usr/lib/ruby/$(PKG_ABI_VERSION)/prime.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/mathn.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/cmath.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/mathn
+/usr/lib/ruby/$(PKG_ABI_VERSION)/matrix.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/matrix
+endef
+
+define Package/ruby-minitest/files
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/specifications/minitest-*.gemspec
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/minitest-*
+endef
+define Package/ruby-minitest/files-excluded
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/minitest-*/test
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/minitest-*/*.rdoc
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/minitest-*/*.txt
+endef
+
+define Package/ruby-misc/files
+/usr/lib/ruby/$(PKG_ABI_VERSION)/English.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/abbrev.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/base64.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/delegate.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/e2mmap.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/expect.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/getoptlong.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/open3.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/ostruct.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/scanf.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/securerandom.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/set.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/shellwords.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/tsort.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/weakref.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/continuation.so
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/coverage.so
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/etc.so
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/fcntl.so
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/fiber.so
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/pty.so
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/stringio.so
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/strscan.so
+endef
+
+define Package/ruby-mkmf/files
+/usr/lib/ruby/$(PKG_ABI_VERSION)/mkmf.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/un.rb
+endef
+
+define Package/ruby-multithread/files
+/usr/lib/ruby/$(PKG_ABI_VERSION)/monitor.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/timeout.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/thwait.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/mutex_m.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/sync.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/io/wait.so
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/io/nonblock.so
+endef
+
+define Package/ruby-net/files
+/usr/lib/ruby/$(PKG_ABI_VERSION)/open-uri.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/net/*
+endef
+
+define Package/ruby-net-telnet/files
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/specifications/net-telnet-*.gemspec
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/net-telnet-*/
+endef
+define Package/ruby-net-telnet/files-excluded
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/net-telnet-*/*.md
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/net-telnet-*/*.txt
+endef
+
+define Package/ruby-nkf/files
+/usr/lib/ruby/$(PKG_ABI_VERSION)/kconv.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/nkf.so
+endef
+
+define Package/ruby-openssl/files
+/usr/lib/ruby/$(PKG_ABI_VERSION)/openssl
+/usr/lib/ruby/$(PKG_ABI_VERSION)/openssl.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/openssl.so
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/specifications/default/openssl-*.gemspec
+endef
+
+define Package/ruby-optparse/files
+/usr/lib/ruby/$(PKG_ABI_VERSION)/optparse.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/optionparser.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/optparse
+endef
+
+define Package/ruby-patterns/files
+/usr/lib/ruby/$(PKG_ABI_VERSION)/observer.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/singleton.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/forwardable.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/forwardable
+endef
+
+define Package/ruby-powerassert/files
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/specifications/power_assert-*.gemspec
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/power_assert-*
+endef
+define Package/ruby-powerassert/files-excluded
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/power_assert-*/test
+endef
+
+define Package/ruby-prettyprint/files
+/usr/lib/ruby/$(PKG_ABI_VERSION)/pp.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/prettyprint.rb
+endef
+
+define Package/ruby-pstore/files
+/usr/lib/ruby/$(PKG_ABI_VERSION)/pstore.rb
+endef
+
+define Package/ruby-psych/files
+/usr/lib/ruby/$(PKG_ABI_VERSION)/psych
+/usr/lib/ruby/$(PKG_ABI_VERSION)/psych.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/psych.so
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/specifications/default/psych-*.gemspec
+endef
+
+define Package/ruby-racc/files
+/usr/lib/ruby/$(PKG_ABI_VERSION)/racc
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/racc/*.so
+endef
+
+define Package/ruby-rake/files
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/specifications/rake-*.gemspec
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/rake-*/
+endef
+define Package/ruby-rake/files-excluded
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/rake-*/doc
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/rake-*/*.rdoc
+endef
+define Package/ruby-rake/install
+	$(INSTALL_DIR) $(1)/usr/bin
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/rake $(1)/usr/bin/;
+	$(call RubyBuildPackage/install,rake,$(1))
+endef
+
+define Package/ruby-rbconfig/files
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/rbconfig.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/rbconfig/*
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/rbconfig/*.so
+endef
+
+define Package/ruby-rdoc/files
+	/usr/lib/ruby/$(PKG_ABI_VERSION)/rdoc.rb
+	/usr/lib/ruby/$(PKG_ABI_VERSION)/rdoc
+	/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/rdoc-*
+	/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/specifications/default/rdoc-*.gemspec
+endef
+define Package/ruby-rdoc/files-excluded
+	/usr/lib/ruby/$(PKG_ABI_VERSION)/rdoc/test_case.rb
+	/usr/lib/ruby/$(PKG_ABI_VERSION)/rdoc/markup/formatter_test_case.rb
+	/usr/lib/ruby/$(PKG_ABI_VERSION)/rdoc/markup/text_formatter_test_case.rb
+endef
+define Package/ruby-rdoc/install
+	$(INSTALL_DIR) $(1)/usr/bin
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/rdoc $(1)/usr/bin/
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ri $(1)/usr/bin/
+	$(call RubyBuildPackage/install,rdoc,$(1))
+endef
+
+define Package/ruby-readline/files
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/readline.so
+endef
+
+define Package/ruby-rexml/files
+/usr/lib/ruby/$(PKG_ABI_VERSION)/rexml
+endef
+
+define Package/ruby-rinda/files
+/usr/lib/ruby/$(PKG_ABI_VERSION)/rinda
+endef
+
+define Package/ruby-ripper/files
+/usr/lib/ruby/$(PKG_ABI_VERSION)/ripper.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/ripper
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/ripper.so
+endef
+
+define Package/ruby-rss/files
+/usr/lib/ruby/$(PKG_ABI_VERSION)/rss
+/usr/lib/ruby/$(PKG_ABI_VERSION)/rss.rb
+endef
+
+define Package/ruby-sdbm/files
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/sdbm.so
+endef
+
+define Package/ruby-shell/files
+/usr/lib/ruby/$(PKG_ABI_VERSION)/shell.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/shell
+endef
+
+define Package/ruby-socket/files
+/usr/lib/ruby/$(PKG_ABI_VERSION)/ipaddr.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/resolv-replace.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/resolv.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/socket.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/socket.so
+endef
+
+define Package/ruby-testunit/files
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/specifications/test-unit-*.gemspec
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/test-unit-*
+endef
+define Package/ruby-testunit/files-excluded
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/test-unit-*/doc
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/test-unit-*/test
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/test-unit-*/sample
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/test-unit-*/*.md
+endef
+
+define Package/ruby-unicodenormalize/files
+/usr/lib/ruby/$(PKG_ABI_VERSION)/unicode_normalize.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/unicode_normalize
+endef
+
+define Package/ruby-uri/files
+/usr/lib/ruby/$(PKG_ABI_VERSION)/uri.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/uri
+endef
+
+define Package/ruby-webrick/files
+/usr/lib/ruby/$(PKG_ABI_VERSION)/webrick
+/usr/lib/ruby/$(PKG_ABI_VERSION)/webrick.rb
+endef
+
+define Package/ruby-xmlrpc/files
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/xmlrpc-*
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/specifications/xmlrpc-*.gemspec
+endef
+define Package/ruby-xmlrpc/files-excluded
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/xmlrpc-0.2.1/*.md
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/xmlrpc-0.2.1/*.txt
+endef
+
+define Package/ruby-yaml/files
+/usr/lib/ruby/$(PKG_ABI_VERSION)/yaml
+/usr/lib/ruby/$(PKG_ABI_VERSION)/yaml.rb
+endef
+
+define Package/ruby-zlib/files
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/zlib.so
+endef
+
+RUBY_FILES = $(strip $(call Package/ruby-$(1)/files))
+RUBY_FILES_EXCLUDED = $(strip $(call Package/ruby-$(1)/files-excluded))
+
+# 1: short name
+# 2: install dir
+define RubyBuildPackage/install
+	( \
+	  cd $(PKG_INSTALL_DIR) && \
+	  $(TAR) -cf - \
+	    $(if $(RUBY_FILES_EXCLUDED),--exclude-from <(ls -1d $(patsubst /%,%,$(RUBY_FILES_EXCLUDED)))) \
+	    --files-from <(ls -1d $(patsubst /%,%,$(RUBY_FILES))) \
+	) | ( \
+	  [ -n "$(2)" ] && cd $(2) && $(TAR) -xf - \
+	)
+endef
+
+# 1: short name
+# 2: description
+# 3: dependencies on other packages
+define RubyBuildPackage
+  RUBY_STDLIB += $(1)
+
+  # Package definition
+  ifndef Package/ruby-$(1)
+    define Package/ruby-$(1)
+      $(call Package/ruby/Default)
+      TITLE:=Ruby $(2)
+      DEPENDS:=ruby $(3)
+    endef
+  endif
+
+  ifndef Package/ruby-$(1)/description
+    define Package/ruby-$(1)/description
+      This package contains the ruby $(2).
+
+    endef
+  endif
+
+  # Description
+  ifndef Package/ruby-$(1)/install
+    ifndef Package/ruby-$(1)/files
+       $$(error It must exists either a Package/ruby-$(1)/install or Package/ruby-$(1)/files)
+    endif
+
+    define Package/ruby-$(1)/description +=
+
+Provides:
+$(patsubst /%,
+ - /%,$(RUBY_FILES))
+
+    endef
+
+    ifneq ($(RUBY_FILES_EXCLUDED),)
+      define Package/ruby-$(1)/description +=
+
+Except:
+$(patsubst /%,
+ - /%,$(RUBY_FILES_EXCLUDED))
+
+      endef
+    endif
+
+    Package/ruby-$(1)/install=$(call RubyBuildPackage/install,$(1),$$(1))
+  endif
+
+  $$(eval $$(call BuildPackage,ruby-$(1)))
+endef
+
+$(eval $(call BuildPackage,libruby))
+$(eval $(call BuildPackage,ruby))
+$(eval $(call RubyBuildPackage,bigdecimal,Arbitrary-precision decimal floating-point library,))
+$(eval $(call RubyBuildPackage,cgi,CGI support toolkit,+ruby-filelib +ruby-pstore))
+$(eval $(call RubyBuildPackage,csv,CSV library,+ruby-patterns +ruby-datetime +ruby-enc +ruby-misc))
+$(eval $(call RubyBuildPackage,datetime,date library))
+$(eval $(call RubyBuildPackage,dbm,support for dbm,+libdb47))
+$(eval $(call RubyBuildPackage,debuglib,debug library,+ruby-prettyprint))
+$(eval $(call RubyBuildPackage,did-you-mean,did you mean? experience,+ruby-misc))
+$(eval $(call RubyBuildPackage,digest,Digest Library,+RUBY_DIGEST_USE_OPENSSL:libopenssl))
+$(eval $(call RubyBuildPackage,drb,distributed object system,+ruby-filelib +ruby-patterns +ruby-socket))
+$(eval $(call RubyBuildPackage,enc,character re-coding library charset (small subset),))
+$(eval $(call RubyBuildPackage,enc-extra,character re-coding library charset (extra subset),+ruby-enc))
+$(eval $(call RubyBuildPackage,erb,(embedded interpreter),+ruby-cgi))
+$(eval $(call RubyBuildPackage,fiddle,libffi wrapper,+libffi))
+$(eval $(call RubyBuildPackage,filelib,file utils library,+ruby-enc +ruby-misc))
+$(eval $(call RubyBuildPackage,gdbm,support for gdbm,+libgdbm))
+$(eval $(call RubyBuildPackage,gems,gems packet management,+ruby-net +ruby-rdoc))
+$(eval $(call RubyBuildPackage,io-console,Console interface,))
+$(eval $(call RubyBuildPackage,irb,(interactive shell),+ruby-debuglib +ruby-filelib +ruby-math))
+$(eval $(call RubyBuildPackage,json,support for JSON,+ruby-datetime +ruby-misc))
+$(eval $(call RubyBuildPackage,logger,logger and syslog library,+ruby-multithread))
+$(eval $(call RubyBuildPackage,math,math library,+ruby-patterns +ruby-misc))
+$(eval $(call RubyBuildPackage,minitest,Gem minitest,+ruby-gems))
+$(eval $(call RubyBuildPackage,misc,standard libraries subset (miscellaneous files),))
+$(eval $(call RubyBuildPackage,mkmf,makefile library,+ruby-filelib +ruby-optparse +ruby-rbconfig))
+$(eval $(call RubyBuildPackage,multithread,multithread library,+ruby-misc))
+$(eval $(call RubyBuildPackage,net,Network Protocols Library,+ruby-datetime +ruby-digest +ruby-filelib +ruby-uri))
+$(eval $(call RubyBuildPackage,net-telnet,telnet client,+ruby-net))
+$(eval $(call RubyBuildPackage,nkf,Network Kanji Filter,+ruby-enc))
+$(eval $(call RubyBuildPackage,openssl,support for openssl,+ruby-enc +ruby-multithread +libopenssl))
+$(eval $(call RubyBuildPackage,optparse,command-line option analysis,+ruby-misc))
+$(eval $(call RubyBuildPackage,patterns,design patterns implementation,))
+$(eval $(call RubyBuildPackage,powerassert,Gem power_assert,+ruby-ripper +ruby-debuglib))
+$(eval $(call RubyBuildPackage,prettyprint,PrettyPrint library,+ruby-misc))
+$(eval $(call RubyBuildPackage,pstore,file based persistence,+ruby-digest +ruby-enc))
+$(eval $(call RubyBuildPackage,psych,YAML parser and emitter,+ruby-bigdecimal +ruby-datetime +ruby-misc +ruby-enc +libyaml))
+$(eval $(call RubyBuildPackage,racc,LALR parser generator,))
+$(eval $(call RubyBuildPackage,rake,Rake (make replacement),+ruby-filelib +ruby-optparse +ruby-patterns +ruby-rbconfig +ruby-multithread))
+$(eval $(call RubyBuildPackage,rbconfig,RbConfig,))
+$(eval $(call RubyBuildPackage,rdoc,documentation generator,+ruby-erb +ruby-irb +ruby-json +ruby-racc +ruby-rake +ruby-yaml +ruby-zlib))
+$(eval $(call RubyBuildPackage,readline,support for readline,+libncurses +libreadline))
+$(eval $(call RubyBuildPackage,rexml,XML toolkit,+ruby-patterns +ruby-enc +ruby-misc))
+$(eval $(call RubyBuildPackage,rinda,Linda paradigm implementation,+ruby-drb))
+$(eval $(call RubyBuildPackage,ripper,script parser,))
+$(eval $(call RubyBuildPackage,rss,RSS toolkit,+ruby-net +ruby-nkf +ruby-rexml))
+$(eval $(call RubyBuildPackage,sdbm,simple file-based key-value dbm implementation,))
+$(eval $(call RubyBuildPackage,shell,idiomatic Ruby interface,+ruby-patterns +ruby-multithread))
+$(eval $(call RubyBuildPackage,socket,socket support,+ruby-multithread))
+$(eval $(call RubyBuildPackage,testunit,Gem test-unit,+ruby-csv +ruby-erb +ruby-optparse +ruby-powerassert +ruby-rexml +ruby-yaml))
+$(eval $(call RubyBuildPackage,unicodenormalize,String additions for Unicode normalization,+ruby-enc +ruby-enc-extra))
+$(eval $(call RubyBuildPackage,uri,library to handle URI,+ruby-socket +ruby-enc))
+$(eval $(call RubyBuildPackage,webrick,Web server toolkit,+ruby-erb +ruby-net +ruby-patterns +ruby-rbconfig))
+$(eval $(call RubyBuildPackage,xmlrpc,XML-RPC toolkit,+ruby-rexml +ruby-webrick))
+$(eval $(call RubyBuildPackage,yaml,YAML toolkit,+ruby-dbm +ruby-pstore +ruby-psych))
+$(eval $(call RubyBuildPackage,zlib,support for zlib,+zlib))
+$(eval $(call BuildPackage,ruby-stdlib))
+$(eval $(call HostBuild))

+ 91 - 0
libs/alsa-lib/Makefile

@@ -0,0 +1,91 @@
+#
+# 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:=alsa-lib
+PKG_VERSION:=1.1.0
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=ftp://ftp.alsa-project.org/pub/lib/ \
+		http://alsa.cybermirror.org/lib/
+PKG_MD5SUM:=69515ca73c3c4a212ef45160dea846c1
+PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>, \
+		Peter Wagner <tripolar@gmx.at>
+
+PKG_LICENSE:=LGPLv2.1 GPLv2
+PKG_LICENSE_FILES:=COPYING aserver/COPYING
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+PKG_USE_MIPS16:=0
+PKG_CHECK_FORMAT_SECURITY:=0
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/alsa-lib
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=ALSA (Advanced Linux Sound Architecture) library
+  URL:=http://www.alsa-project.org/
+  DEPENDS:=@AUDIO_SUPPORT +kmod-sound-core +libpthread +librt
+endef
+
+define Package/alsa-lib/description
+ This is the library package for alsa, needed by some userspace programs.
+ You must have enabled the ALSA support in the kernel.
+endef
+
+TARGET_CFLAGS += $(FPIC)
+
+CONFIGURE_ARGS+= \
+		--disable-python \
+		--disable-debug \
+		--without-debug \
+		$(SOFT_FLOAT_CONFIG_OPTION) \
+		--with-versioned=no
+
+define Build/InstallDev
+	$(INSTALL_DIR) $(1)/usr/include/
+	$(CP) \
+		$(PKG_INSTALL_DIR)/usr/include/alsa \
+		$(1)/usr/include/
+
+	$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+	$(CP) \
+		$(PKG_INSTALL_DIR)/usr/lib/libasound.{la,so*} \
+		$(1)/usr/lib/
+	$(INSTALL_DATA) \
+		$(PKG_INSTALL_DIR)/usr/lib/pkgconfig/alsa.pc \
+		$(1)/usr/lib/pkgconfig/
+
+	$(INSTALL_DIR) $(1)/usr/share/aclocal
+	$(INSTALL_DATA) \
+		$(PKG_INSTALL_DIR)/usr/share/aclocal/alsa.m4 \
+		$(1)/usr/share/aclocal/
+endef
+
+define Package/alsa-lib/install
+	$(INSTALL_DIR) $(1)/usr/lib
+	$(CP) \
+		$(PKG_INSTALL_DIR)/usr/lib/libasound.so.* \
+		$(1)/usr/lib/
+
+	$(INSTALL_DIR) $(1)/usr/share/alsa/{cards,pcm}
+	$(INSTALL_DATA) \
+		$(PKG_INSTALL_DIR)/usr/share/alsa/alsa.conf \
+		$(1)/usr/share/alsa/
+	$(INSTALL_DATA) \
+		$(PKG_INSTALL_DIR)/usr/share/alsa/pcm/* \
+		$(1)/usr/share/alsa/pcm/
+	$(CP) \
+		$(PKG_INSTALL_DIR)/usr/share/alsa/cards/* \
+		$(1)/usr/share/alsa/cards/
+endef
+
+$(eval $(call BuildPackage,alsa-lib))

+ 3 - 3
libs/gnutls/Makefile

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

+ 106 - 0
libs/icu/Makefile

@@ -0,0 +1,106 @@
+#
+# 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:=icu4c
+PKG_VERSION:=58.2
+PKG_RELEASE:=2
+
+PKG_SOURCE:=$(PKG_NAME)-58_2-src.tgz
+PKG_SOURCE_URL:=http://download.icu-project.org/files/$(PKG_NAME)/$(PKG_VERSION)
+PKG_MD5SUM:=fac212b32b7ec7ab007a12dff1f3aea1
+
+PKG_LICENSE:=ICU-1.8.1+
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_MAINTAINER:=Hirokazu MORIKAWA <morikw2@gmail.com>
+
+PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+
+PKG_BUILD_DEPENDS:=icu/host
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/host-build.mk
+
+TAR_OPTIONS+= icu/source --strip-components 2
+TAR_CMD=$(HOST_TAR) -C $(1) $(TAR_OPTIONS)
+
+define Package/icu
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=International Components for Unicode
+  URL:=http://icu-project.org
+  DEPENDS:=+libstdcpp +libpthread
+endef
+
+CONFIGURE_CMD:= ./runConfigureICU
+CONFIGURE_VARS:=
+CONFIGURE_ARGS:= \
+	Linux/gcc \
+	--disable-debug \
+	--enable-release \
+	--enable-shared \
+	--enable-static \
+	--enable-draft \
+	--enable-renaming \
+	--disable-tracing \
+	--disable-extras \
+	--enable-dyload \
+	--disable-tools \
+	--disable-tests \
+	--disable-samples \
+	--with-cross-build="$(HOST_BUILD_DIR)" \
+	--prefix=/usr
+
+HOST_CONFIGURE_CMD:= ./runConfigureICU
+HOST_CONFIGURE_VARS:=
+HOST_CONFIGURE_ARGS:= \
+	Linux/gcc \
+	--disable-debug \
+	--enable-release \
+	--enable-shared \
+	--enable-static \
+	--enable-draft \
+	--enable-renaming \
+	--disable-tracing \
+	--disable-extras \
+	--enable-dyload \
+	--prefix=$(HOST_BUILD_PREFIX)
+
+define Build/InstallDev
+	$(INSTALL_DIR) \
+		$(1)/usr/include
+
+	$(CP) \
+		$(PKG_INSTALL_DIR)/usr/include/* \
+		$(1)/usr/include/
+
+	$(INSTALL_DIR) \
+		$(1)/usr/lib
+
+	$(CP) \
+		$(PKG_INSTALL_DIR)/usr/lib/* \
+		$(1)/usr/lib/
+endef
+
+define Host/install
+endef
+
+define Package/icu/install
+	$(INSTALL_DIR) \
+		$(1)/usr/lib
+
+	$(CP) \
+		$(PKG_INSTALL_DIR)/usr/lib/*.so.* \
+		$(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,icu))
+$(eval $(call HostBuild))

+ 10 - 0
libs/libradcli/Config.in

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

+ 75 - 0
libs/libradcli/Makefile

@@ -0,0 +1,75 @@
+#
+# 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))

+ 5 - 6
libs/libssh2/Makefile

@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2015-2018 OpenWrt.org
+# Copyright (C) 2015-2016 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:=2
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://www.libssh2.org/download
+PKG_SOURCE_URL:=http://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:=https://www.libssh2.org/
+  URL:=http://www.libssh2.org/
   DEPENDS:=+libopenssl +zlib
   MAINTAINER:=Jiri Slachta <jiri@slachta.eu>
 endef
@@ -39,8 +39,7 @@ TARGET_CFLAGS += $(FPIC)
 
 CONFIGURE_ARGS += \
 	--disable-examples-build \
-	--with-libssl-prefix=$(STAGING_DIR)/usr \
-	--with-libz-prefix=$(STAGING_DIR)/usr
+	--with-libssl-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.12
+PKG_VERSION:=4.9
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
-PKG_HASH:=6753da2e621257f33f5b051cc114d417e5206a0818fe0b1ecfd6153f70934753
+PKG_MD5SUM:=4f6f7a8fd691ac2b8307c8ca365bad711db607d4ad5966f6938a9d2ecd65c920
 PKG_LICENSE:=LGPLv2.1+
 PKG_LICENSE_FILES:=COPYING.LIB
 

+ 152 - 0
libs/libxslt/Makefile

@@ -0,0 +1,152 @@
+#
+# Copyright (C) 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:=libxslt
+PKG_VERSION:=1.1.28
+PKG_RELEASE:=2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:= \
+	http://xmlsoft.org/sources/ \
+	ftp://fr.rpmfind.net/pub/libxml/
+PKG_MD5SUM:=9667bf6f9310b957254fdcf6596600b7
+
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=COPYING
+
+PKG_MAINTAINER:=Jiri Slachta <jiri@slachta.eu>
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libxslt
+  SECTION:=libs
+  CATEGORY:=Libraries
+  DEPENDS:=+libxml2
+  TITLE:=Gnome XSLT library
+  URL:=http://xmlsoft.org/XSLT/
+endef
+
+define Package/libxslt/description
+ A library for XML transformation using XSLT.
+endef
+
+define Package/libexslt
+  SECTION:=libs
+  CATEGORY:=Libraries
+  DEPENDS:=+libxslt
+  TITLE:=Gnome XSLT library Extension
+  URL:=http://xmlsoft.org/XSLT/EXSLT/
+endef
+
+define Package/libexslt/description
+ An extension for XSLT.
+endef
+
+define Package/xsltproc
+  SECTION:=utils
+  CATEGORY:=Utilities
+  DEPENDS:=+libxml2 +libxslt +libexslt
+  TITLE:=Gnome XSLT xsltproc Utility
+  URL:=http://xmlsoft.org/XSLT/
+endef
+
+define Package/xsltproc/description
+ XSLT XML transformation utility.
+endef
+
+CONFIGURE_ARGS+= \
+	--enable-shared \
+	--enable-static \
+	--without-python \
+	--without-crypto \
+	--without-debug \
+	--without-mem-debug \
+	--without-debugger \
+
+TARGET_CFLAGS += $(FPIC)
+
+define Build/InstallDev/Xslt
+	$(INSTALL_DIR) $(1)/usr/bin $(2)/bin $(1)/usr/include/libxslt \
+		$(1)/usr/include/libexslt $(1)/usr/lib \
+		$(1)/usr/lib/pkgconfig $(2)/share/aclocal
+
+	$(INSTALL_BIN) \
+		$(PKG_INSTALL_DIR)/usr/bin/xslt-config \
+		$(2)/bin/
+
+	ln -sf $(STAGING_DIR)/host/bin/xslt-config $(1)/usr/bin/xslt-config
+
+	$(SED) \
+		's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' \
+		$(2)/bin/xslt-config
+
+	$(INSTALL_DATA) \
+		$(PKG_INSTALL_DIR)/usr/include/libxslt/* \
+		$(1)/usr/include/libxslt/
+
+	$(CP) \
+		$(PKG_INSTALL_DIR)/usr/lib/libxslt.{la,a,so*} \
+		$(1)/usr/lib/
+
+	$(INSTALL_DATA) \
+		$(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libxslt.pc \
+		$(1)/usr/lib/pkgconfig/
+
+	$(INSTALL_DATA) \
+		$(PKG_INSTALL_DIR)/usr/share/aclocal/* \
+		$(2)/share/aclocal
+endef
+
+define Build/InstallDev/Exslt
+	$(INSTALL_DIR) $(1)/usr/include/libexslt $(1)/usr/lib/pkgconfig
+	$(INSTALL_DATA) \
+		$(PKG_INSTALL_DIR)/usr/include/libexslt/* \
+		$(1)/usr/include/libexslt/
+
+	$(CP) \
+		$(PKG_INSTALL_DIR)/usr/lib/libexslt.{la,a,so*} \
+		$(1)/usr/lib/
+
+	$(INSTALL_DATA) \
+		$(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libexslt.pc \
+		$(1)/usr/lib/pkgconfig/
+endef
+
+define Build/InstallDev
+	 $(if $(CONFIG_PACKAGE_libxslt),$(call Build/InstallDev/Xslt,$(1),$(2)))
+	 $(if $(CONFIG_PACKAGE_libexslt),$(call Build/InstallDev/Exslt,$(1),$(2)))
+endef
+
+define Package/libxslt/install
+	$(INSTALL_DIR) $(1)/usr/lib
+	$(CP) \
+		$(PKG_INSTALL_DIR)/usr/lib/libxslt.so.* \
+		$(1)/usr/lib/
+endef
+
+define Package/libexslt/install
+	$(INSTALL_DIR) $(1)/usr/lib
+	$(CP) \
+		$(PKG_INSTALL_DIR)/usr/lib/libexslt.so.* \
+		$(1)/usr/lib/
+endef
+
+define Package/xsltproc/install
+	$(INSTALL_DIR) $(1)/usr/bin
+	$(INSTALL_BIN) \
+		$(PKG_INSTALL_DIR)/usr/bin/xsltproc \
+		$(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,libxslt))
+$(eval $(call BuildPackage,libexslt))
+$(eval $(call BuildPackage,xsltproc))

+ 2 - 2
libs/openldap/Makefile

@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=openldap
-PKG_VERSION:=2.4.45
+PKG_VERSION:=2.4.44
 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:=00ff8301277cdfd0af728a6927042a13
+PKG_MD5SUM:=693ac26de86231f8dcae2b4e9d768e51
 
 PKG_FIXUP:=autoreconf
 

+ 2 - 3
libs/p11-kit/Makefile

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

+ 2 - 3
libs/pcre/Makefile

@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=pcre
-PKG_VERSION:=8.41
+PKG_VERSION:=8.40
 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:=c160d22723b1670447341b08c58981c1
+PKG_MD5SUM:=41a842bf7dcecd6634219336e2167d1d
 PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
 
 PKG_LICENSE:=BSD-3-Clause
@@ -53,7 +53,6 @@ CONFIGURE_ARGS += \
 	--enable-utf8 \
 	--enable-unicode-properties \
 	--enable-pcre16 \
-	--with-match-limit-recursion=16000 \
 
 ifneq ($(CONFIG_PACKAGE_libpcrecpp),)
   CONFIGURE_ARGS+= --enable-cpp

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

@@ -0,0 +1,53 @@
+#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):

+ 231 - 0
libs/postgresql/Makefile

@@ -0,0 +1,231 @@
+#
+# Copyright (C) 2006-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:=postgresql
+PKG_VERSION:=9.5.4
+PKG_RELEASE:=4
+PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+PKG_LICENSE:=PostgreSQL
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+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_BUILD_PARALLEL:=1
+PKG_USE_MIPS16:=0
+PKG_FIXUP:=autoreconf
+PKG_MACRO_PATHS:=config
+PKG_BUILD_DEPENDS += postgresql/host
+
+include $(INCLUDE_DIR)/host-build.mk
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libpq
+  SECTION:=libs
+  CATEGORY:=Libraries
+  DEPENDS:=+zlib +libreadline +libpthread +libncursesw
+  TITLE:=PostgreSQL client library
+  URL:=http://www.postgresql.org/
+  SUBMENU:=database
+endef
+
+define Package/libpq/description
+PostgreSQL client library.
+endef
+
+define Package/pgsql-cli
+  SECTION:=utils
+  CATEGORY:=Utilities
+  DEPENDS:=+libpq +librt
+  TITLE:=Command Line Interface (CLI) to PostgreSQL databases
+  URL:=http://www.postgresql.org/
+  SUBMENU:=database
+endef
+
+define Package/pgsql-cli/description
+Command Line Interface (CLI) to PostgreSQL databases.
+endef
+
+define Package/pgsql-cli-extra
+  SECTION:=utils
+  CATEGORY:=Utilities
+  DEPENDS:=+libpq +librt
+  TITLE:=Command Line extras for PostgreSQL databases
+  URL:=http://www.postgresql.org/
+  SUBMENU:=database
+endef
+
+define Package/pgsql-cli-extra/description
+Command Line extras for PostgreSQL databases.
+endef
+
+define Package/pgsql-server
+  SECTION:=utils
+  CATEGORY:=Utilities
+  DEPENDS:=+libpq +librt +pgsql-cli
+  TITLE:=PostgreSQL databases Server
+  URL:=http://www.postgresql.org/
+  SUBMENU:=database
+  USERID:=postgres=5432:postgres=5432
+endef
+
+define Package/pgsql-server/description
+PostgreSQL databases Server.
+endef
+
+PGSQL_CLI_EXTRA_BIN := \
+	clusterdb	\
+	createdb	\
+	createlang	\
+	createuser	\
+	dropdb		\
+	droplang	\
+	dropuser	\
+	pgbench		\
+	reindexdb	\
+	vacuumdb
+
+PGSQL_CONFIG_VARS:= \
+	pgac_cv_snprintf_long_long_int_format="%lld" \
+	pgac_cv_snprintf_size_t_support=yes
+
+ifeq ($(CONFIG_USE_UCLIBC),y)
+# PostgreSQL does not build against uClibc with locales
+# enabled, due to an uClibc bug, see
+# http://lists.uclibc.org/pipermail/uclibc/2014-April/048326.html
+# so overwrite automatic detection and disable locale support
+PGSQL_CONFIG_VARS+= \
+		pgac_cv_type_locale_t=no
+endif
+
+TARGET_CONFIGURE_OPTS+=$(PGSQL_CONFIG_VARS)
+
+HOST_CONFIGURE_ARGS += \
+			$(DISABLE_NLS) \
+			--disable-rpath \
+			--without-bonjour \
+			--without-gssapi \
+			--without-ldap \
+			--without-openssl \
+			--without-pam \
+			--without-perl \
+			--without-python \
+			--without-readline \
+			--without-tcl \
+			--with-zlib="yes" \
+			--enable-depend
+
+CONFIGURE_ARGS += \
+			--disable-rpath \
+			--without-bonjour \
+			--without-gssapi \
+			--without-ldap \
+			--without-openssl \
+			--without-pam \
+			--without-perl \
+			--without-python \
+			--without-tcl \
+			--with-zlib="yes" \
+			--enable-depend \
+			$(if $(CONFIG_TARGET_avr32),--disable-spinlocks)
+
+# Need a native ecpg ,pg_config, and zic for build
+define Host/Compile
+	$(MAKE) -C $(HOST_BUILD_DIR)/src/interfaces/ecpg/preproc CC="$(HOSTCC)"
+	$(MAKE) -C $(HOST_BUILD_DIR)/src/timezone CC="$(HOSTCC)"
+	$(MAKE) -C $(HOST_BUILD_DIR)/src/bin/pg_config CC="$(HOSTCC)"
+endef
+
+define Host/Install
+	$(INSTALL_DIR) $(STAGING_DIR)/usr/bin/
+	$(INSTALL_BIN) $(HOST_BUILD_DIR)/src/bin/pg_config/pg_config $(STAGING_DIR)/usr/bin/
+	$(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/bin/
+	$(INSTALL_BIN) $(HOST_BUILD_DIR)/src/interfaces/ecpg/preproc/ecpg $(STAGING_DIR_HOSTPKG)/bin/
+	$(INSTALL_BIN) $(HOST_BUILD_DIR)/src/timezone/zic $(STAGING_DIR_HOSTPKG)/bin/
+endef
+
+define Build/Configure
+	$(Build/Configure/Default)
+	$(SED) 's@ECPG = ../../preproc/ecpg@ECPG = $(STAGING_DIR_HOSTPKG)/bin/ecpg@' $(PKG_BUILD_DIR)/src/interfaces/ecpg/test/Makefile.regress
+endef
+
+TARGET_CFLAGS += $(FPIC) -lpthread
+
+# because PROFILE means something else in the project Makefile
+unexport PROFILE
+
+define Build/Compile
+	+$(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)" \
+		DESTDIR="$(PKG_INSTALL_DIR)" \
+		all
+	+$(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)" \
+		DESTDIR="$(PKG_INSTALL_DIR)" \
+		install
+endef
+
+define Package/libpq/install
+	$(INSTALL_DIR) $(1)/usr/lib
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libpq.so.* $(1)/usr/lib/
+endef
+
+define Package/pgsql-cli/install
+	$(INSTALL_DIR) $(1)/usr/bin
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/psql $(1)/usr/bin/
+endef
+
+define Package/pgsql-cli-extra/install
+	$(INSTALL_DIR) $(1)/usr/bin
+	$(INSTALL_BIN) $(foreach bin,$(PGSQL_CLI_EXTRA_BIN),$(PKG_INSTALL_DIR)/usr/bin/$(bin)) $(1)/usr/bin/
+endef
+
+define Package/pgsql-server/install
+	$(INSTALL_DIR) $(1)/usr/bin
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/pg_* $(PKG_INSTALL_DIR)/usr/bin/postgres \
+			$(PKG_INSTALL_DIR)/usr/bin/initdb $(1)/usr/bin/
+	ln -sf postgres $(1)/usr/bin/postmaster
+
+	$(INSTALL_DIR) $(1)/usr/share/postgresql
+	$(CP) $(PKG_INSTALL_DIR)/usr/share/postgresql/* \
+		$(1)/usr/share/postgresql
+
+	$(INSTALL_DIR) $(1)/usr/lib
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/postgresql \
+		$(1)/usr/lib/
+
+	$(INSTALL_DIR) $(1)/lib/functions
+	$(INSTALL_BIN) ./files/postgresql.sh $(1)/lib/functions/
+
+	$(INSTALL_DIR) $(1)/etc/config
+	$(INSTALL_DATA) ./files/postgresql.config $(1)/etc/config/postgresql
+
+	$(INSTALL_DIR) $(1)/etc/init.d
+	$(INSTALL_BIN) ./files/postgresql.init $(1)/etc/init.d/postgresql
+endef
+
+define Build/InstallDev
+	$(INSTALL_DIR) $(1)/usr/bin
+	$(INSTALL_DIR) $(1)/usr/include
+	$(CP) $(PKG_INSTALL_DIR)/usr/include/libpq $(1)/usr/include/
+	$(CP) $(PKG_INSTALL_DIR)/usr/include/libpq-fe.h $(1)/usr/include/
+	$(CP) $(PKG_INSTALL_DIR)/usr/include/pg_config.h $(1)/usr/include/
+	$(CP) $(PKG_INSTALL_DIR)/usr/include/pg_config_manual.h $(1)/usr/include/
+	$(CP) $(PKG_INSTALL_DIR)/usr/include/postgres_ext.h $(1)/usr/include/
+	$(CP) $(PKG_INSTALL_DIR)/usr/include/pg_config_ext.h $(1)/usr/include/
+	$(CP) $(PKG_INSTALL_DIR)/usr/include/postgresql $(1)/usr/include/
+	$(INSTALL_DIR) $(1)/usr/lib
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libpq.{a,so*} $(1)/usr/lib/
+endef
+
+$(eval $(call HostBuild))
+$(eval $(call BuildPackage,libpq))
+$(eval $(call BuildPackage,pgsql-cli))
+$(eval $(call BuildPackage,pgsql-cli-extra))
+$(eval $(call BuildPackage,pgsql-server))

+ 4 - 7
libs/sqlite3/Makefile

@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2006-2018 OpenWrt.org
+# Copyright (C) 2006-2014 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:=3190300
-PKG_RELEASE:=2
+PKG_VERSION:=3160000
+PKG_RELEASE:=1
 
 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,9 +68,6 @@ $(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 \

+ 109 - 0
libs/tiff/Makefile

@@ -0,0 +1,109 @@
+#
+# 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))

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

@@ -0,0 +1,33 @@
+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
+ 

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

@@ -0,0 +1,136 @@
+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;

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

@@ -0,0 +1,193 @@
+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 */

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

@@ -0,0 +1,72 @@
+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--;

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

@@ -0,0 +1,11 @@
+--- 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__) && \

+ 0 - 59
mail/nail/Makefile

@@ -1,59 +0,0 @@
-#
-# 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))
-

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

@@ -1,22 +0,0 @@
---- 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,

+ 473 - 0
multimedia/ffmpeg/Config.in

@@ -0,0 +1,473 @@
+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

+ 645 - 0
multimedia/ffmpeg/Makefile

@@ -0,0 +1,645 @@
+#
+# 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

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

@@ -0,0 +1,277 @@
+#
+# 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))

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

@@ -0,0 +1,26 @@
+--- 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

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

@@ -0,0 +1,57 @@
+--- 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

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

@@ -0,0 +1,177 @@
+#
+# 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))

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

@@ -0,0 +1,23 @@
+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

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

@@ -0,0 +1,23 @@
+--- 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

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

@@ -0,0 +1,23 @@
+--- 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

+ 85 - 0
multimedia/minidlna/Makefile

@@ -0,0 +1,85 @@
+#
+# 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))

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

@@ -0,0 +1,17 @@
+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'

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

@@ -0,0 +1,97 @@
+#!/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
+}

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

@@ -0,0 +1,19 @@
+--- 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;
+ }

+ 4 - 5
net/acme/Makefile

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

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

@@ -10,11 +10,7 @@
 
 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=

+ 4 - 6
net/adblock/Makefile

@@ -1,12 +1,12 @@
 #
-# Copyright (c) 2015-2018 Dirk Brenken (dev@brenken.org)
+# Copyright (c) 2015-2017 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:=3.4.3
+PKG_VERSION:=2.6.2
 PKG_RELEASE:=1
 PKG_LICENSE:=GPL-3.0+
 PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
@@ -16,13 +16,12 @@ include $(INCLUDE_DIR)/package.mk
 define Package/adblock
 	SECTION:=net
 	CATEGORY:=Network
-	TITLE:=Powerful adblock script to block ad/abuse domains by using DNS
-	DEPENDS:=+jshn +jsonfilter
+	TITLE:=Powerful adblock script to block ad/abuse domains
 	PKGARCH:=all
 endef
 
 define Package/adblock/description
-Powerful adblock script to block ad/abuse domains via dnsmasq, unbound, named, kresd or dnscrypt-proxy.
+Powerful adblock script to block ad/abuse domains via dnsmasq or unbound dns backend.
 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.
 
@@ -54,7 +53,6 @@ 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

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

@@ -4,13 +4,11 @@
 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 blocklist sources (free for private usage, for commercial use please check their individual licenses):
+* support of the following domain block list 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)
@@ -27,22 +25,20 @@ 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)
@@ -61,31 +57,26 @@ 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
-* 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
+* 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
 * full IPv4 and IPv6 support
-* 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'
+* 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
 * additional whitelist for manual overrides, located by default in /etc/adblock/adblock.whitelist
-* quality checks during blocklist update to ensure a reliable dns backend service
+* quality checks during block list 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 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
+* 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
 * 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 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: automatic block list backup & restore, backups will be (de-)compressed and restored on the fly in case of any runtime error
 * optional: add new adblock sources on your own via uci config
 
 ## Prerequisites
@@ -93,136 +84,91 @@ 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 'http only' option and supports wget-nossl and uclient-fetch (without libustream-ssl) as well
+    * 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 more configuration options see examples below
 
-## 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_
+## LEDE trunk Installation & Usage
+* install 'adblock' (_opkg install adblock_) and that's it - the adblock start will be automatically triggered by procd interface trigger
 * 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 blocklist sources and all other adblock options you should use the provided LuCI frontend
+* for easy management of the various block list sources and all other adblock options you can also use a nice & efficient 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 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
+* **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
 * **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 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
+* **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
 * **scheduled list updates:** for a scheduled call of the adblock service add an appropriate crontab entry (see example below)
-* **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.
+* **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
 * **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 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)
+* **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)
 * **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 overrides are needed
-* the following options apply to the 'global' config section:
-    * adb\_enabled => main switch to enable/disable adblock service (default: '0', disabled)
+* 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)
     * adb\_debug => enable/disable adblock debug output (default: '0', disabled)
-    * 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\_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\_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>
-in the 'options' namespace add:
-  response-policy { zone "rpz"; };
+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:
 
-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; };
-  };
+  include: "/var/lib/unbound/adb_list.*"
 </code></pre>
   
-**change default dns backend to 'kresd':**
+**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"
 
-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':**
+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 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:**
+uclient-fetch:
+  option adb_fetch '/bin/uclient-fetch'
+  option adb_fetchparm '-q --timeout=10 --no-check-certificate -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
+curl:
+  option adb_fetch '/usr/bin/curl'
+  option adb_fetchparm '-s --connect-timeout 10 --insecure -o'
 </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>
-/etc/init.d/adblock status
+root@blackhole:~# /etc/init.d/adblock status
 ::: adblock runtime information
-  + 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
+ 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
 </code></pre>
   
 **cronjob for a regular block list update (/etc/crontabs/root):**
-
 <pre><code>
-0 06 * * *    /etc/init.d/adblock reload
+0 06 * * *    /etc/init.d/adblock start
 </code></pre>
   
 **blacklist entry (/etc/adblock/adblock.blacklist):**
-
 <pre><code>
 ads.example.com
 
@@ -237,11 +183,10 @@ 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 blocklist:
+This entry removes the following (sub)domains from the block lists:
   maps.here.com
   here.com
 
@@ -250,42 +195,53 @@ This entry does not remove:
   www.adwhere.com
 </code></pre>
   
-**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.
+**query active block lists for a certain (sub-)domain, e.g. for whitelisting:**
 <pre><code>
-/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
+/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.
 </code></pre>
   
-**add a new blocklist source:**
-
-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!
+**add a new block list source:**
 <pre><code>
-config source 'reg_ro'
+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!
+
+config source 'rolist'
   option enabled '0'
   option adb_src 'https://easylist-downloads.adblockplus.org/rolist+easylist.txt'
-  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'
+  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
 </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>  
 

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

@@ -2,136 +2,125 @@
 # see 'https://github.com/openwrt/packages/blob/master/net/adblock/files/README.md'
 
 config adblock 'global'
-	option adb_enabled '0'
-	option adb_dns 'dnsmasq'
-	option adb_fetchutil 'uclient-fetch'
-	option adb_trigger 'wan'
-
-config adblock 'extra'
+	option adb_enabled '1'
 	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[[:space:]]+([[:alnum:]_-]+\.){1,}[[:alpha:]]+([[:space:]]|$)/{print tolower(\$2)}'
+	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 mobile ads, infrequent updates, approx. 400 entries'
 
 config source 'adguard'
 	option enabled '0'
-	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 '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'
+	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'
 
 config source 'blacklist'
-	option enabled '1'
+	option enabled '0'
 	option adb_src '/etc/adblock/adblock.blacklist'
-	option adb_src_rset '\$0~/^([[:alnum:]_-]+\.){1,}[[:alpha:]]+([[:space:]]|$)/{print tolower(\$1)}'
-	option adb_src_desc 'static local domain blacklist, always deny these domains'
+	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)'
 
 config source 'disconnect'
 	option enabled '1'
 	option adb_src 'https://s3.amazonaws.com/lists.disconnect.me/simple_malvertising.txt'
-	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'
+	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'
 
 config source 'dshield'
 	option enabled '0'
 	option adb_src 'https://www.dshield.org/feeds/suspiciousdomains_Low.txt'
-	option adb_src_rset '\$0~/^([[:alnum:]_-]+\.){1,}[[:alpha:]]+([[:space:]]|$)/{print tolower(\$1)}'
-	option adb_src_desc 'generic blocklist, daily updates, approx. 3.500 entries'
+	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'
 
 config source 'feodo'
 	option enabled '0'
 	option adb_src 'https://feodotracker.abuse.ch/blocklist/?download=domainblocklist'
-	option adb_src_rset '\$0~/^([[:alnum:]_-]+\.){1,}[[:alpha:]]+([[:space:]]|$)/{print tolower(\$1)}'
+	option adb_src_rset '\$1 ~/^([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{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[[:space:]]+([[:alnum:]_-]+\.){1,}[[:alpha:]]+([[:space:]]|$)/{print tolower(\$2)}'
-	option adb_src_desc 'broad blocklist, monthly updates, approx. 19.200 entries'
+	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'
 
 config source 'malware'
 	option enabled '0'
-	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'
+	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'
 
 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[[:space:]]+([[:alnum:]_-]+\.){1,}[[:alpha:]]+([[:space:]]|$)/{print tolower(\$2)}'
-	option adb_src_desc 'focus on malware, daily updates, approx. 1.200 entries'
+	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'
 
 config source 'openphish'
 	option enabled '0'
 	option adb_src 'https://openphish.com/feed.txt'
-	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'
+	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'
 
 config source 'ransomware'
 	option enabled '0'
 	option adb_src 'https://ransomwaretracker.abuse.ch/downloads/RW_DOMBL.txt'
-	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'
+	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'
 
 config source 'reg_cn'
 	option enabled '0'
 	option adb_src 'https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt'
-	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'
+	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'
 
 config source 'reg_pl'
 	option enabled '0'
 	option adb_src 'http://adblocklist.org/adblock-pxf-polish.txt'
-	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'
+	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'
 
 config source 'reg_ro'
 	option enabled '0'
 	option adb_src 'https://easylist-downloads.adblockplus.org/rolist+easylist.txt'
-	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'
+	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'
 
 config source 'reg_ru'
 	option enabled '0'
 	option adb_src 'https://easylist-downloads.adblockplus.org/ruadlist+easylist.txt'
-	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'
+	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'
 
 config source 'shalla'
 	option enabled '0'
 	option adb_src 'http://www.shallalist.de/Downloads/shallalist.tar.gz'
-	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'
+	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'
 	list adb_src_cat 'adv'
 	list adb_src_cat 'costtraps'
 	list adb_src_cat 'spyware'
@@ -141,41 +130,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 '\$0~/^([[:alnum:]_-]+\.){1,}[[:alpha:]]+([[:space:]]|$)/{print tolower(\$1)}'
-	option adb_src_desc 'generic blocklist, infrequent updates, approx. 6.000 entries'
+	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'
 
 config source 'sysctl' 
 	option enabled '0'
 	option adb_src 'http://sysctl.org/cameleon/hosts'
-	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'
+	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'
 
 config source 'whocares'
 	option enabled '0'
 	option adb_src 'http://someonewhocares.org/hosts/hosts'
-	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'
+	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'
 
 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[[:space:]]+([[:alnum:]_-]+\.){1,}[[:alpha:]]+([[:space:]]|$)/{print tolower(\$2)}'
-	option adb_src_desc 'focus on windows spy & telemetry domains, infrequent updates, approx. 300 entries'
+	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'
 
 config source 'winhelp'
 	option enabled '0'
 	option adb_src 'http://winhelp2002.mvps.org/hosts.txt'
-	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'
+	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'
 
 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 '\$0~/^([[:alnum:]_-]+\.){1,}[[:alpha:]]+([[:space:]]|$)/{print tolower(\$1)}'
-	option adb_src_desc 'focus on ad related domains, weekly updates, approx. 2.400 entries'
+	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'
 
 config source 'zeus'
 	option enabled '0'
 	option adb_src 'https://zeustracker.abuse.ch/blocklist.php?download=domainblocklist'
-	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'
+	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'

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

@@ -1,7 +1,7 @@
 #!/bin/sh /etc/rc.common
 #
 
-START=30
+START=50
 USE_PROCD=1
 
 EXTRA_COMMANDS="suspend resume query status"
@@ -12,40 +12,30 @@ 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 "%u" ${?}) -eq 0 ]
+    if [ $("${adb_init}" enabled; printf ${?}) -eq 0 ]
     then
         if [ -n "${adb_boot}" ]
         then
-            local trigger="$(uci_get adblock.global.adb_trigger)"
-            if [ "${trigger}" != "timed" ]
-            then
-                return 0
-            fi
+            return 0
         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
@@ -59,52 +49,34 @@ 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()
 {
-    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
+    rc_procd "${adb_script}" status
 }
 
 service_triggers()
 {
-    local trigger="$(uci_get adblock.global.adb_trigger)"
-    local delay="$(uci_get adblock.extra.adb_triggerdelay)"
+    local iface="$(uci -q get adblock.global.adb_iface)"
+    local delay="$(uci -q get adblock.global.adb_triggerdelay)"
 
-    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"
+    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
 }

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

@@ -1,56 +0,0 @@
-#!/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
+ 225 - 610
net/adblock/files/adblock.sh


+ 148 - 0
net/cjdns/Makefile

@@ -0,0 +1,148 @@
+#
+# Copyright (C) 2014,2015 Hyperboria.net
+#
+# You may redistribute this program and/or modify it under the terms of
+# the GNU General Public License as published by the Free Software Foundation,
+# either version 3 of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=cjdns
+PKG_VERSION:=0.17
+PKG_RELEASE:=3
+
+PKG_SOURCE_URL:=https://github.com/hyperboria/cjdns.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=40e87d9419c19063e772e39c7c59a8a8771c5ee8
+PKG_LICENSE:=GPL-3.0
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.bz2
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_SOURCE_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+
+define Package/cjdns
+	SECTION:=net
+	CATEGORY:=Network
+	SUBMENU:=Routing and Redirection
+	TITLE:=Encrypted near-zero-conf mesh routing protocol
+	URL:=https://github.com/hyperboria/cjdns
+	MAINTAINER:=Lars Gierth <larsg@systemli.org>
+	DEPENDS:=@IPV6 +kmod-tun +libnl-tiny +libpthread +librt \
+		+libuci-lua +lua-bencode +dkjson +luasocket +lua-sha2
+endef
+
+define Package/cjdns/description
+	Cjdns implements an encrypted IPv6 network using public-key cryptography \
+	for address allocation and a distributed hash table for routing. \
+	This provides near-zero-configuration networking, and prevents many \
+	of the security and scalability issues that plague existing networks.
+endef
+
+define Package/cjdns-tests
+	SECTION:=net
+	CATEGORY:=Network
+	SUBMENU:=Routing and Redirection
+	TITLE:=cjdns test cases
+	URL:=https://github.com/hyperboria/cjdns
+	MAINTAINER:=Lars Gierth <larsg@systemli.org>
+	DEPENDS:=+libpthread +librt
+endef
+
+define Package/cjdns-test/description
+	cjdns test cases
+endef
+
+define Build/Configure
+endef
+
+PKG_DO_VARS:=CJDNS_RELEASE_VERSION=$(PKG_SOURCE_VERSION)
+
+ifneq ($(CONFIG_KERNEL_SECCOMP_FILTER),y)
+PKG_DO_VARS+= Seccomp_NO=1
+endif
+
+ifneq ($(CONFIG_USE_UCLIBC),)
+PKG_DO_VARS+= UCLIBC=1
+endif
+
+define Build/Compile
+	$(INSTALL_DIR) $(PKG_BUILD_DIR)/tmp
+	CROSS="true" \
+	CC="$(TARGET_CC)" \
+	AR="$(TARGET_AR)" \
+	RANLIB="$(TARGET_RANLIB)" \
+	CFLAGS="$(TARGET_CFLAGS)" \
+	LDFLAGS="$(TARGET_LDFLAGS)" \
+	SYSTEM="linux" \
+	TARGET_ARCH="$(CONFIG_ARCH)" \
+	SSP_SUPPORT="$(CONFIG_SSP_SUPPORT)" \
+	GYP_ADDITIONAL_ARGS="-f make-linux" \
+	CJDNS_BUILD_TMPDIR="$(PKG_BUILD_DIR)/tmp" \
+	$(PKG_DO_VARS) \
+	$(PKG_BUILD_DIR)/do
+endef
+
+define Package/cjdns/install
+	$(INSTALL_DIR) \
+		$(1)/usr/sbin \
+		$(1)/usr/bin \
+		$(1)/etc/config \
+		$(1)/etc/init.d \
+		$(1)/etc/uci-defaults \
+		$(1)/usr/lib/lua/cjdns
+
+	$(INSTALL_BIN) \
+		./files/cjdrouteconf \
+		$(1)/usr/bin
+
+	$(INSTALL_BIN) \
+		$(PKG_BUILD_DIR)/cjdroute \
+		$(1)/usr/sbin
+
+	$(INSTALL_BIN) \
+		$(PKG_BUILD_DIR)/publictoip6 \
+		$(1)/usr/bin
+
+	$(INSTALL_BIN) \
+		./files/cjdns.init \
+		$(1)/etc/init.d/cjdns
+
+	$(INSTALL_BIN) \
+		./files/cjdns.defaults \
+		$(1)/etc/uci-defaults/cjdns
+
+	$(CP) \
+		./lua/cjdns/* \
+		$(1)/usr/lib/lua/cjdns
+endef
+
+define Package/cjdns/postinst
+#!/bin/sh
+if [ -z $${IPKG_INSTROOT} ] ; then
+	( . /etc/uci-defaults/cjdns ) && rm -f /etc/uci-defaults/cjdns
+	# TODO: we should have an 'Enable' button instead
+	/etc/init.d/cjdns enabled || /etc/init.d/cjdns enable
+	exit 0
+fi
+endef
+
+define Package/cjdns-tests/install
+	$(INSTALL_DIR) $(1)/usr/bin
+	$(INSTALL_BIN) \
+		$(PKG_BUILD_DIR)/build_linux/test_testcjdroute_c \
+		$(1)/usr/bin
+endef
+
+$(eval $(call BuildPackage,cjdns))
+$(eval $(call BuildPackage,cjdns-tests))

+ 127 - 0
net/cjdns/files/cjdns.defaults

@@ -0,0 +1,127 @@
+#!/bin/sh
+
+# if there is an existing config, our work is already done
+uci get cjdns.cjdns.ipv6 >/dev/null 2>&1
+if [ $? -ne 0 ]; then
+
+  # register commit handler
+  uci -q batch <<-EOF >/dev/null
+    delete ucitrack.@cjdns[-1]
+    add ucitrack cjdns
+    set ucitrack.@cjdns[-1].init=cjdns
+    commit ucitrack
+EOF
+
+  # generate configuration
+  touch /etc/config/cjdns
+  cjdroute --genconf | cjdroute --cleanconf | cjdrouteconf set
+
+  # make sure config is present (might fail for any reason)
+  uci get cjdns.cjdns.ipv6 >/dev/null 2>&1
+  if [ $? -ne 0 ]; then
+    exit 1
+  fi
+
+  # enable auto-peering on ethernet interface lan, if existing
+  uci get network.lan | grep interface >/dev/null 2>&1
+  if [ $? -eq 0 ]; then
+    uci get network.lan.type | grep bridge >/dev/null 2>&1
+    if [ $? -eq 0 ]; then
+      # most routers will set up an ethernet bridge for the lan
+      ifname="br-lan"
+    else
+      # docker containers don't have permission to create bridges by default,
+      # so we bind to the underlying interface instead (likely eth0)
+      ifname=`uci get network.lan.ifname`
+    fi
+    uci -q batch <<-EOF >/dev/null
+      add cjdns eth_interface
+      set cjdns.@eth_interface[-1].beacon=2
+      set cjdns.@eth_interface[-1].bind=$ifname
+EOF
+  fi
+  # set the tun interface name
+  uci set cjdns.cjdns.tun_device=tuncjdns
+
+  # create the network interface
+  uci -q batch <<-EOF >/dev/null
+    set network.cjdns=interface
+    set network.cjdns.ifname=tuncjdns
+    set network.cjdns.proto=none
+EOF
+
+  # firewall rules by @dangowrt -- thanks <3
+
+  # create the firewall zone
+  uci -q batch <<-EOF >/dev/null
+    add firewall zone
+    set firewall.@zone[-1].name=cjdns
+    add_list firewall.@zone[-1].network=cjdns
+    set firewall.@zone[-1].input=REJECT
+    set firewall.@zone[-1].output=ACCEPT
+    set firewall.@zone[-1].forward=REJECT
+    set firewall.@zone[-1].conntrack=1
+    set firewall.@zone[-1].family=ipv6
+EOF
+
+  # allow ICMP from cjdns zone, e.g. ping6
+  uci -q batch <<-EOF >/dev/null
+    add firewall rule
+    set firewall.@rule[-1].name='Allow-ICMPv6-cjdns'
+    set firewall.@rule[-1].src=cjdns
+    set firewall.@rule[-1].proto=icmp
+    add_list firewall.@rule[-1].icmp_type=echo-request
+    add_list firewall.@rule[-1].icmp_type=echo-reply
+    add_list firewall.@rule[-1].icmp_type=destination-unreachable
+    add_list firewall.@rule[-1].icmp_type=packet-too-big
+    add_list firewall.@rule[-1].icmp_type=time-exceeded
+    add_list firewall.@rule[-1].icmp_type=bad-header
+    add_list firewall.@rule[-1].icmp_type=unknown-header-type
+    set firewall.@rule[-1].limit='1000/sec'
+    set firewall.@rule[-1].family=ipv6
+    set firewall.@rule[-1].target=ACCEPT
+EOF
+
+  # allow SSH from cjdns zone, needs to be explicitly enabled
+  uci -q batch <<-EOF >/dev/null
+    add firewall rule
+    set firewall.@rule[-1].enabled=0
+    set firewall.@rule[-1].name='Allow-SSH-cjdns'
+    set firewall.@rule[-1].src=cjdns
+    set firewall.@rule[-1].proto=tcp
+    set firewall.@rule[-1].dest_port=22
+    set firewall.@rule[-1].target=ACCEPT
+EOF
+
+  # allow LuCI access from cjdns zone, needs to be explicitly enabled
+  uci -q batch <<-EOF >/dev/null
+    add firewall rule
+    set firewall.@rule[-1].enabled=0
+    set firewall.@rule[-1].name='Allow-HTTP-cjdns'
+    set firewall.@rule[-1].src=cjdns
+    set firewall.@rule[-1].proto=tcp
+    set firewall.@rule[-1].dest_port=80
+    set firewall.@rule[-1].target=ACCEPT
+EOF
+
+  # allow UDP peering from wan zone, if it exists
+  uci show network.wan >/dev/null 2>&1
+  if [ $? -eq 0 ]; then
+    peeringPort=`uci get cjdns.@udp_interface[0].port`
+    uci -q batch <<-EOF >/dev/null
+      add firewall rule
+      set firewall.@rule[-1].name='Allow-cjdns-wan'
+      set firewall.@rule[-1].src=wan
+      set firewall.@rule[-1].proto=udp
+      set firewall.@rule[-1].dest_port=$peeringPort
+      set firewall.@rule[-1].target=ACCEPT
+EOF
+  fi
+
+  uci commit cjdns
+  uci commit firewall
+  uci commit network
+
+fi
+
+exit 0

+ 32 - 0
net/cjdns/files/cjdns.init

@@ -0,0 +1,32 @@
+#!/bin/sh /etc/rc.common
+
+START=90
+STOP=85
+
+USE_PROCD=1
+
+start_service()
+{
+	[ -f /etc/uci-defaults/cjdns ] && ( . /etc/uci-defaults/cjdns )
+
+	procd_open_instance
+	procd_set_param respawn
+	procd_set_param command /bin/ash -c "cjdrouteconf get | tee /tmp/etc/cjdroute.conf | cjdroute --nobg | logger -t cjdns"
+	procd_close_instance
+}
+
+stop_service()
+{
+	killall cjdroute
+}
+
+reload_service()
+{
+	# cat /tmp/etc/cjdroute.conf | cjdrouteconf reload
+	restart
+}
+
+service_triggers()
+{
+	procd_add_reload_trigger cjdns
+}

+ 30 - 0
net/cjdns/files/cjdrouteconf

@@ -0,0 +1,30 @@
+#!/usr/bin/env lua
+
+dkjson = require("dkjson")
+cjdns = require("cjdns")
+require("cjdns/uci")
+
+function help()
+  print("JSON interface to /etc/config/cjdns\n\nExamples: \
+    cjdrouteconf get > /tmp/etc/cjdroute.conf \
+    cat /tmp/etc/cjdroute.conf | cjdrouteconf set \
+    uci changes \
+    cjdrouteconf get | cjdroute")
+end
+
+if arg[1] == "get" then
+  local json = dkjson.encode(cjdns.uci.get(), { indent = true })
+  print(json)
+elseif arg[1] == "set" then
+  local json = io.stdin:read("*a")
+  local obj, pos, err = dkjson.decode(json, 1, nil)
+
+  if obj then
+    cjdns.uci.set(obj)
+  else
+    print("dkjson: " .. err .. " (try cjdroute --cleanconf)")
+    os.exit(1)
+  end
+else
+  help()
+end

+ 105 - 0
net/cjdns/lua/cjdns/admin.lua

@@ -0,0 +1,105 @@
+-- Cjdns admin module for Lua
+-- Written by Philip Horger
+
+common = require 'cjdns/common'
+
+AdminInterface = {}
+AdminInterface.__index = AdminInterface
+common.AdminInterface = AdminInterface
+
+function AdminInterface.new(properties)
+    properties = properties or {}
+
+    properties.host     = properties.host or "127.0.0.1"
+    properties.port     = properties.port or 11234
+    properties.password = properties.password or nil
+    properties.config   = properties.config   or common.ConfigFile.new("/etc/cjdroute.conf", false)
+    properties.timeout  = properties.timeout  or 2
+
+    properties.udp      = common.UDPInterface.new(properties)
+
+    return setmetatable(properties, AdminInterface)
+end
+
+function AdminInterface:send(object)
+    local bencoded, err = bencode.encode(object)
+    if err then
+        return nil, err
+    end
+
+    local sock_obj = assert(socket.udp())
+    sock_obj:settimeout(self.timeout)
+
+    local _, err = sock_obj:sendto(bencoded, self.host, self.port)
+    if err then
+        return nil, err
+    end
+
+    return sock_obj
+end
+
+function AdminInterface:recv(sock_obj)
+    local retrieved, err = sock_obj:receive()
+    if not retrieved then
+        return nil, "ai:recv > " .. err
+    end
+    local bencoded, err = bencode.decode(retrieved)
+    if bencoded then
+        return bencoded
+    else
+        return nil, "ai:recv > " .. err
+    end
+end
+
+function AdminInterface:call(request)
+    local sock_obj, err = self:send(request)
+    if err then
+        return nil, "ai:call > " .. err
+    end
+
+    return self:recv(sock_obj)
+end
+
+function AdminInterface:getCookie()
+    local cookie_response, err = self:call({ q = "cookie" })
+    if not cookie_response then
+        return nil, "ai:getCookie > " .. err
+    end
+    return cookie_response.cookie
+end
+
+function AdminInterface:auth(request)
+    local funcname = request.q
+    local args = {}
+    for k, v in pairs(request) do
+        args[k] = v
+    end
+
+    -- Step 1: Get cookie
+    local cookie, err = self:getCookie()
+    if err then
+        return nil, err
+    end
+
+    -- Step 2: Calculate hash1 (password + cookie)
+    local plaintext1 = self.password .. cookie
+    local hash1 = sha2.sha256hex(plaintext1)
+
+    -- Step 3: Calculate hash2 (intermediate stage request)
+    local request = {
+        q      = "auth",
+        aq     = funcname,
+        args   = args,
+        hash   = hash1,
+        cookie = cookie
+    }
+    local plaintext2, err = bencode.encode(request)
+    if err then
+        return nil, err
+    end
+    local hash2 = sha2.sha256hex(plaintext2)
+
+    -- Step 4: Update hash in request, then ship it out
+    request.hash = hash2
+    return self:call(request)
+end

+ 7 - 0
net/cjdns/lua/cjdns/common.lua

@@ -0,0 +1,7 @@
+-- Cjdns admin module for Lua
+-- Written by Philip Horger
+
+-- This table is preserved over multiple imports, and collects
+-- submodules import-by-import via init.lua.
+
+return {}

+ 12 - 0
net/cjdns/lua/cjdns/init.lua

@@ -0,0 +1,12 @@
+-- Cjdns admin module for Lua
+-- Written by Philip Horger
+
+bencode = require "bencode" -- https://bitbucket.org/wilhelmy/lua-bencode/
+dkjson  = require "dkjson"  -- http://dkolf.de/src/dkjson-lua.fsl/home
+socket  = require "socket"  -- http://w3.impa.br/~diego/software/luasocket/
+sha2    = require "sha2"    -- https://code.google.com/p/sha2/
+
+require "cjdns/admin"
+require "cjdns/udp"
+
+return require "cjdns/common"

+ 289 - 0
net/cjdns/lua/cjdns/uci.lua

@@ -0,0 +1,289 @@
+common = require("cjdns/common")
+uci    = require("uci")
+
+UCI = {}
+common.uci = UCI
+
+--- Return the configuration defaults as a table suitable for JSON output
+--
+-- Mostly taken from cjdroute --genconf
+-- @return table with configuration defaults
+function UCI.defaults()
+  return {
+    security = {
+      { setuser = "nobody", keepNetAdmin = 1 },
+      { chroot = "/var/run/" },
+      { nofiles = 0 },
+      { noforks = 1 },
+      { seccomp = 0 },
+      { setupComplete = 1 }
+    },
+    router = {
+        ipTunnel = { outgoingConnections = {}, allowedConnections = {} },
+        interface = { type = "TUNInterface" }
+    },
+    interfaces = { UDPInterface = {}, ETHInterface = {} },
+    authorizedPasswords = {},
+    logging = { logTo = "stdout" }
+  }
+end
+
+--- Return the cjdns configuration as a table suitable for JSON output
+--
+-- Iterates over cjdns, eth_interface, udp_interface, eth_peer, udp_peer,
+-- and password sections. Doesn't include IPTunnel related options yet.
+-- @return table with cjdns configuration
+function UCI.get()
+  local obj = UCI.defaults()
+
+  local cursor = uci.cursor()
+
+  local config = cursor:get_all("cjdns", "cjdns")
+  if not config then return obj end
+
+  obj.ipv6 = config.ipv6
+  obj.publicKey = config.public_key
+  obj.privateKey = config.private_key
+  obj.admin = {
+    bind = config.admin_address .. ":" .. config.admin_port,
+    password = config.admin_password }
+
+  if config.tun_device and string.len(config.tun_device) > 0 then
+    obj.router.interface.tunDevice = config.tun_device
+  end
+
+  for i,section in pairs(obj.security) do
+    if type(section.seccomp) == "number" then
+      obj.security[i].seccomp = tonumber(config.seccomp)
+    end
+  end
+
+  cursor:foreach("cjdns", "iptunnel_outgoing", function(outgoing)
+    table.insert(obj.router.ipTunnel.outgoingConnections, outgoing.public_key)
+  end)
+
+  cursor:foreach("cjdns", "iptunnel_allowed", function(allowed)
+    entry = { publicKey = allowed.public_key }
+    if allowed.ipv4 then
+      entry["ip4Address"] = allowed.ipv4
+    end
+    if allowed.ipv6 then
+      entry["ip6Address"] = allowed.ipv6
+    end
+    table.insert(obj.router.ipTunnel.allowedConnections, entry)
+  end)
+
+  cursor:foreach("cjdns", "eth_interface", function(eth_interface)
+    table.insert(obj.interfaces.ETHInterface, {
+      bind = eth_interface.bind,
+      beacon = tonumber(eth_interface.beacon),
+      connectTo = {}
+    })
+  end)
+
+  cursor:foreach("cjdns", "udp_interface", function(udp_interface)
+    table.insert(obj.interfaces.UDPInterface, {
+      bind = udp_interface.address .. ":" .. udp_interface.port,
+      connectTo = {}
+    })
+  end)
+
+  cursor:foreach("cjdns", "eth_peer", function(eth_peer)
+    if not eth_peer.address == "" then
+      local i = tonumber(eth_peer.interface)
+      obj.interfaces.ETHInterface[i].connectTo[eth_peer.address] = {
+        publicKey = eth_peer.public_key,
+        password = eth_peer.password
+      }
+    end
+  end)
+
+  cursor:foreach("cjdns", "udp_peer", function(udp_peer)
+    local bind = udp_peer.address .. ":" .. udp_peer.port
+    local i = tonumber(udp_peer.interface)
+    obj.interfaces.UDPInterface[i].connectTo[bind] = {
+      user = udp_peer.user,
+      publicKey = udp_peer.public_key,
+      password = udp_peer.password
+    }
+  end)
+
+  cursor:foreach("cjdns", "password", function(password)
+    table.insert(obj.authorizedPasswords, {
+      password = password.password,
+      user = password.user,
+      contact = password.contact
+    })
+  end)
+
+  return obj
+end
+
+--- Parse and save updated configuration from JSON input
+--
+-- Transforms general settings, ETHInterface, UDPInterface, connectTo, and
+-- authorizedPasswords fields into UCI sections, and replaces the UCI config's
+-- contents with them.
+-- @param table JSON input
+-- @return Boolean whether saving succeeded
+function UCI.set(obj)
+  local cursor = uci.cursor()
+
+  for i, section in pairs(cursor:get_all("cjdns")) do
+    cursor:delete("cjdns", section[".name"])
+  end
+
+  local admin_address, admin_port = string.match(obj.admin.bind, "^(.*):(.*)$")
+  UCI.cursor_section(cursor, "cjdns", "cjdns", "cjdns", {
+    ipv6 = obj.ipv6,
+    public_key = obj.publicKey,
+    private_key = obj.privateKey,
+    admin_password = obj.admin.password,
+    admin_address = admin_address,
+    admin_port = admin_port
+  })
+
+  if obj.router.interface.tunDevice then
+    UCI.cursor_section(cursor, "cjdns", "cjdns", "cjdns", {
+      tun_device = tostring(obj.router.interface.tunDevice)
+    })
+  end
+
+  if obj.security then
+    for i,section in pairs(obj.security) do
+      for key,value in pairs(section) do
+        if key == "seccomp" then
+          UCI.cursor_section(cursor, "cjdns", "cjdns", "cjdns", {
+            seccomp = tonumber(value)
+          })
+        end
+      end
+    end
+  end
+
+  if obj.router.ipTunnel.outgoingConnections then
+    for i,public_key in pairs(obj.router.ipTunnel.outgoingConnections) do
+      UCI.cursor_section(cursor, "cjdns", "iptunnel_outgoing", nil, {
+        public_key = public_key
+      })
+    end
+  end
+
+  if obj.router.ipTunnel.allowedConnections then
+    for i,allowed in pairs(obj.router.ipTunnel.allowedConnections) do
+      entry = { public_key = allowed.publicKey }
+      if allowed.ip4Address then
+        entry["ipv4"] = allowed.ip4Address
+      end
+      if allowed.ip6Address then
+        entry["ipv6"] = allowed.ip6Address
+      end
+
+      UCI.cursor_section(cursor, "cjdns", "iptunnel_allowed", nil, entry)
+    end
+  end
+
+  if obj.interfaces.ETHInterface then
+    for i,interface in pairs(obj.interfaces.ETHInterface) do
+      UCI.cursor_section(cursor, "cjdns", "eth_interface", nil, {
+        bind = interface.bind,
+        beacon = tostring(interface.beacon)
+      })
+
+      if interface.connectTo then
+        for peer_address,peer in pairs(interface.connectTo) do
+          UCI.cursor_section(cursor, "cjdns", "eth_peer", nil, {
+            interface = i,
+            address = peer_address,
+            public_key = peer.publicKey,
+            password = peer.password
+          })
+        end
+      end
+    end
+  end
+
+  if obj.interfaces.UDPInterface then
+    for i,interface in pairs(obj.interfaces.UDPInterface) do
+      local address, port = string.match(interface.bind, "^(.*):(.*)$")
+      UCI.cursor_section(cursor, "cjdns", "udp_interface", nil, {
+        address = address,
+        port = port
+      })
+
+      if interface.connectTo then
+        for peer_bind,peer in pairs(interface.connectTo) do
+          local peer_address, peer_port = string.match(peer_bind, "^(.*):(.*)$")
+          UCI.cursor_section(cursor, "cjdns", "udp_peer", nil, {
+            interface = i,
+            address = peer_address,
+            port = peer_port,
+            user = peer.user,
+            public_key = peer.publicKey,
+            password = peer.password
+          })
+        end
+      end
+    end
+  end
+
+  if obj.authorizedPasswords then
+    for i,password in pairs(obj.authorizedPasswords) do
+      local user = password.user
+      if not user or string.len(user) == 0 then
+        user = "user-" .. UCI.random_string(6)
+      end
+
+      UCI.cursor_section(cursor, "cjdns", "password", nil, {
+        password = password.password,
+        user = user,
+        contact = password.contact
+      })
+    end
+  end
+
+  return cursor:save("cjdns")
+end
+
+--- Simple backport of Cursor:section from luci.model.uci
+--
+-- Backport reason: we don't wanna depend on LuCI.
+-- @param Cursor the UCI cursor to operate on
+-- @param string name of the config
+-- @param string type of the section
+-- @param string name of the section (optional)
+-- @param table config values
+function UCI.cursor_section(cursor, config, type, section, values)
+  if section then
+    cursor:set(config, section, type)
+  else
+    section = cursor:add("cjdns", type)
+  end
+
+  for k,v in pairs(values) do
+    cursor:set(config, section, k, v)
+  end
+end
+
+function UCI.makeInterface()
+  local cursor = uci.cursor()
+
+  local config = cursor:get_all("cjdns", "cjdns")
+  if not config then return nil end
+
+  return common.AdminInterface.new({
+    host = config.admin_address,
+    port = config.admin_port,
+    password = config.admin_password,
+    config = UCI.get(),
+    timeout = 2
+  })
+end
+
+function UCI.random_string(length)
+  -- tr -cd 'A-Za-z0-9' < /dev/urandom
+  local urandom = io.popen("tr -cd 'A-Za-z0-9' 2> /dev/null < /dev/urandom", "r")
+  local string = urandom:read(length)
+  urandom:close()
+  return string
+end

+ 102 - 0
net/cjdns/lua/cjdns/udp.lua

@@ -0,0 +1,102 @@
+-- Cjdns admin module for Lua
+-- Written by Philip Horger
+
+common = require 'cjdns/common'
+
+UDPInterface = {}
+UDPInterface.__index = UDPInterface
+common.UDPInterface = UDPInterface
+
+function UDPInterface.new(ai, config, ptype)
+    properties = {
+        ai     = ai,
+        config = config or ai.config,
+        ptype  = ptype or "ai"
+    }
+
+    return setmetatable(properties, UDPInterface)
+end
+
+function UDPInterface:call(name, args)
+    local func = self[name .. "_" .. self.ptype]
+    return func(self, unpack(args))
+end
+
+function UDPInterface:newBind(...)
+    return self:call("newBind", arg)
+end
+
+function UDPInterface:beginConnection(...)
+    return self:call("beginConnection", arg)
+end
+
+function UDPInterface:newBind_ai(address)
+    local response, err = self.ai:auth({
+        q = "UDPInterface_new",
+        bindAddress = address
+    })
+    if not response then
+        return nil, err
+    elseif response.error ~= "none" then
+        return nil, response.error
+    elseif response.interfaceNumber then
+        return response.interfaceNumber
+    else
+        return nil, "bad response format"
+    end
+end
+
+function UDPInterface:newBind_config(address)
+    local udpif       = self.config.contents.interfaces.UDPInterface
+    local new_interface = {
+        bind = address,
+        connectTo = {}
+    }
+    table.insert(udpif, new_interface)
+    return (#udpif - 1), new_interface
+end
+
+function UDPInterface:newBind_perm(...)
+    return
+        self:newBind_config(unpack(arg)),
+        self:newBind_ai(unpack(arg))
+end
+
+function UDPInterface:beginConnection_ai(pubkey, addr, password, interface)
+    local request = {
+        q = "UDPInterface_beginConnection",
+        publicKey = pubkey,
+        address   = addr,
+        password  = password
+    }
+    if interface then
+        request.interfaceNumber = interface
+    end
+
+    local response, err = self.ai:auth(request)
+    if not response then
+        return nil, err
+    elseif response.error == "none" then
+        -- Unfortunately, no real success indicator either.
+        return "No error"
+    else
+        return nil, response.error
+    end
+end
+
+function UDPInterface:beginConnection_config(pubkey, addr, password, interface)
+    local udpif       = self.config.contents.interfaces.UDPInterface
+    local connections = udpif[(interface or 0) + 1].connectTo
+    local this_conn   = {
+        password  = password,
+        publicKey = pubkey
+    }
+    connections[addr] = this_conn
+    return this_conn -- allows adding metadata fields afterwards
+end
+
+function UDPInterface:beginConnection_perm(...)
+    return
+        self:beginConnection_config(unpack(arg)),
+        self:beginConnection_ai(unpack(arg))
+end

+ 0 - 14
net/freeradius2/Config.in

@@ -1,14 +0,0 @@
-# FreeRADIUS avanced configuration
-
-choice
-	prompt "SSL library"
-	default FREERADIUS_OPENSSL
-	depends on PACKAGE_freeradius2-common
-
-config FREERADIUS_NOSSL
-	bool "No SSL support"
-
-config FREERADIUS_OPENSSL
-	bool "OpenSSL"
-
-endchoice

+ 0 - 636
net/freeradius2/Makefile

@@ -1,636 +0,0 @@
-#
-# Copyright (C) 2008-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:=freeradius2
-PKG_VERSION:=2.2.9
-PKG_RELEASE:=1
-
-PKG_SOURCE:=freeradius-server-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=\
-	ftp://ftp.freeradius.org/pub/freeradius/ \
-	ftp://ftp.freeradius.org/pub/freeradius/old/
-PKG_MD5SUM:=d1398327ba4e23c75da06d8a0e01096b
-PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
-PKG_LICENSE:=GPL-2.0
-PKG_LICENSE_FILES:=COPYRIGHT LICENSE
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/freeradius-server-$(PKG_VERSION)
-PKG_FIXUP:=autoreconf
-PKG_CHECK_FORMAT_SECURITY:=0
-
-PKG_CONFIG_DEPENDS := \
-  FREERADIUS_OPENSSL \
-  FREERADIUS_NOSSL
-
-PKG_CHECK_FORMAT_SECURITY:=0
-include $(INCLUDE_DIR)/package.mk
-
-define Package/freeradius2/config
-  source "$(SOURCE)/Config.in"
-endef
-
-define Package/freeradius2/Default
-  SECTION:=net
-  CATEGORY:=Network
-  URL:=http://freeradius.org/
-  SUBMENU:=FreeRADIUS (version 2)
-endef
-
-define Package/freeradius2
-  $(call Package/freeradius2/Default)
-  DEPENDS:=+libltdl +libreadline +freeradius2-common
-  TITLE:=A flexible RADIUS server (version 2)
-endef
-
-define Package/freeradius2/conffiles
-/etc/freeradius2/clients.conf
-/etc/freeradius2/radiusd.conf
-/etc/freeradius2/sites/default
-endef
-
-define Package/freeradius2-democerts
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2
-  TITLE:=Demo certificates to test the server
-endef
-
-define Package/freeradius2-common
-  $(call Package/freeradius2/Default)
-  TITLE:=common files
-  DEPENDS:=+libpthread +FREERADIUS_OPENSSL:libopenssl +zlib
-endef
-
-define Package/freeradius2-mod-chap
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2
-  TITLE:=CHAP module
-endef
-
-define Package/freeradius2-mod-chap/conffiles
-/etc/freeradius2/modules/chap
-endef
-
-define Package/freeradius2-mod-detail
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2
-  TITLE:=Detailed accounting module
-endef
-
-define Package/freeradius2-mod-detail/conffiles
-/etc/freeradius2/modules/detail
-endef
-
-define Package/freeradius2-mod-eap
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2
-  TITLE:=Base EAP module
-endef
-
-define Package/freeradius2-mod-eap/conffiles
-/etc/freeradius2/eap.conf
-endef
-
-define Package/freeradius2-mod-eap-gtc
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2-mod-eap
-  TITLE:=EAP/GTC module
-endef
-
-define Package/freeradius2-mod-eap-md5
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2-mod-eap
-  TITLE:=EAP/MD5 module
-endef
-
-define Package/freeradius2-mod-eap-mschapv2
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2-mod-eap +freeradius2-mod-mschap
-  TITLE:=EAP/MS-CHAPv2 module
-endef
-
-define Package/freeradius2-mod-eap-peap
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2-mod-eap @FREERADIUS_OPENSSL
-  TITLE:=EAP/PEAP module
-endef
-
-define Package/freeradius2-mod-eap-tls
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2-mod-eap @FREERADIUS_OPENSSL
-  TITLE:=EAP/TLS module
-endef
-
-define Package/freeradius2-mod-eap-ttls
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2-mod-eap-tls
-  TITLE:=EAP/TTLS module
-endef
-
-define Package/freeradius2-mod-exec
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2
-  TITLE:=EXEC module
-endef
-
-define Package/freeradius2-mod-exec/conffiles
-/etc/freeradius2/modules/exec
-endef
-
-define Package/freeradius2-mod-expiration
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2
-  TITLE:=Expiration module
-endef
-
-define Package/freeradius2-mod-expiration/conffiles
-/etc/freeradius2/modules/expiration
-endef
-
-define Package/freeradius2-mod-always
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2
-  TITLE:=Always module
-endef
-
-define Package/freeradius2-mod-always/conffiles
-/etc/freeradius2/modules/always
-endef
-
-define Package/freeradius2-mod-expr
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2
-  TITLE:=EXPR module
-endef
-
-define Package/freeradius2-mod-expr/conffiles
-/etc/freeradius2/modules/expr
-endef
-
-define Package/freeradius2-mod-attr-filter
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2
-  TITLE:=ATTR filter module
-endef
-
-define Package/freeradius2-mod-attr-filter/conffiles
-/etc/freeradius2/modules/attr_filter
-/etc/freeradius2/attrs
-/etc/freeradius2/attrs.access_reject
-/etc/freeradius2/attrs.accounting_response
-/etc/freeradius2/attrs.pre-proxy
-endef
-
-define Package/freeradius2-mod-attr-rewrite
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2
-  TITLE:=ATTR rewrite module
-endef
-
-define Package/freeradius2-mod-attr-rewrite/conffiles
-/etc/freeradius2/modules/attr_rewrite
-endef
-
-define Package/freeradius2-mod-files
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2
-  TITLE:=Module using local files for authorization
-endef
-
-define Package/freeradius2-mod-files/conffiles
-/etc/freeradius2/acct_users
-/etc/freeradius2/preproxy_users
-/etc/freeradius2/users
-/etc/freeradius2/modules/files
-endef
-
-define Package/freeradius2-mod-passwd
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2
-  TITLE:=Rlm passwd module
-endef
-
-define Package/freeradius2-mod-passwd/conffiles
-/etc/freeradius2/modules/passwd
-endef
-
-define Package/freeradius2-mod-ldap
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2 +libopenldap
-  TITLE:=LDAP module
-endef
-
-define Package/freeradius2-mod-ldap/conffiles
-/etc/freeradius2/ldap.attrmap
-/etc/freeradius2/modules/ldap
-endef
-
-define Package/freeradius2-mod-logintime
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2
-  TITLE:=Logintime module
-endef
-
-define Package/freeradius2-mod-logintime/conffiles
-/etc/freeradius2/modules/logintime
-endef
-
-define Package/freeradius2-mod-mschap
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2
-  TITLE:=MS-CHAP and MS-CHAPv2 module
-endef
-
-define Package/freeradius2-mod-mschap/conffiles
-/etc/freeradius2/modules/mschap
-endef
-
-define Package/freeradius2-mod-pap
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2
-  TITLE:=PAP module
-endef
-
-define Package/freeradius2-mod-pap/conffiles
-/etc/freeradius2/modules/pap
-endef
-
-define Package/freeradius2-mod-preprocess
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2
-  TITLE:=Request pre-processing module
-endef
-
-define Package/freeradius2-mod-preprocess/conffiles
-/etc/freeradius2/hints
-/etc/freeradius2/huntgroups
-/etc/freeradius2/modules/preprocess
-endef
-
-define Package/freeradius2-mod-realm
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2
-  TITLE:=Realms handling module
-endef
-
-define Package/freeradius2-mod-realm/conffiles
-/etc/freeradius2/proxy.conf
-/etc/freeradius2/modules/realm
-endef
-
-define Package/freeradius2-mod-sql
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2
-  TITLE:=Base SQL module
-endef
-
-define Package/freeradius2-mod-sql/conffiles
-/etc/freeradius2/sql.conf
-endef
-
-define Package/freeradius2-mod-sql-mysql
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2-mod-sql +libmysqlclient-r
-  TITLE:=MySQL module
-endef
-
-define Package/freeradius2-mod-sql-pgsql
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2-mod-sql +libpq
-  TITLE:=PostgreSQL module
-endef
-
-define Package/freeradius2-mod-sql-sqlite
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2-mod-sql +libsqlite3
-  TITLE:=SQLite module
-endef
-
-define Package/freeradius2-mod-sqlcounter
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2-mod-sql
-  TITLE:=Generic SQL Counter module
-endef
-
-define Package/freeradius2-mod-radutmp
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2
-  TITLE:=Radius UTMP module
-endef
-
-define Package/freeradius2-mod-radutmp/conffiles
-/etc/freeradius2/modules/radutmp
-/etc/freeradius2/modules/sradutmp
-endef
-
-define Package/freeradius2-utils
-  $(call Package/freeradius2/Default)
-  DEPENDS:=+freeradius2-common
-  TITLE:=Misc. client utilities
-endef
-
-define Package/freeradius2-mod-sqllog
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2
-  TITLE:=SQL Logging module
-endef
-
-CONFIGURE_ARGS+= \
-	--libdir=/usr/lib/freeradius2 \
-	--libexecdir=/usr/lib/freeradius2 \
-	--enable-shared \
-	--disable-static \
-	--disable-developer \
-	--with-threads \
-	$(if $(CONFIG_FREERADIUS_OPENSSL),--with,--without)-openssl \
-	$(if $(CONFIG_FREERADIUS_OPENSSL),--with-openssl-includes="$(STAGING_DIR)/usr/include",) \
-	$(if $(CONFIG_FREERADIUS_OPENSSL),--with-openssl-libraries="$(STAGING_DIR)/usr/lib",) \
-	$(if $(CONFIG_FREERADIUS_OPENSSL),--disable-openssl-version-check,) \
-	--with-system-libtool \
-	--with-system-libltdl \
-	--enable-strict-dependencies \
-	--with-raddbdir=/etc/freeradius2 \
-	--with-radacctdir=/var/db/radacct \
-	--with-logdir=/var/log \
-	--without-edir \
-	--without-snmp \
-	--without-rlm_checkval \
-	--without-rlm_dbm \
-	--without-rlm_counter \
-	--with-rlm_expr \
-	--with-rlm_eap \
-	--without-rlm_eap_sim \
-	--without-rlm_example \
-	--without-rlm_ippool \
-	--without-rlm_krb5 \
-	--without-rlm_otp \
-	--without-rlm_smsotp \
-	--without-rlm_pam \
-	--without-rlm_perl \
-	--without-rlm_python \
-	--without-rlm_smb \
-	--with-rlm_sql \
-	--with-rlm_sqlcounter \
-	--without-rlm_sqlhpwippool \
-	--without-rlm_sqlippool \
-	--without-rlm_sql_db2 \
-	--without-rlm_sql_firebird \
-	--without-rlm_sql_freetds \
-	--without-rlm_sql_iodbc \
-	--without-rlm_sql_oracle \
-	--without-rlm_sql_sybase \
-	--without-rlm_sql_unixodbc \
-	--without-rlm_sql_log \
-	--without-rlm_unix \
-	--without-rlm_eap_tnc \
-	--without-rlm_eap_ikev2 \
-	--without-rlm_opendirectory \
-	--without-rlm_wimax \
-	--without-rlm_ruby \
-	--without-rlm_caching \
-	--without-rlm_redis \
-	--without-rlm_rediswho \
-	--without-rlm_soh \
-	--without-rlm_sim \
-	--without-rlm_replicate \
-	--without-rlm_protocol_filter \
-	--without-rlm_policy \
-	--without-rlm_linelog \
-	--without-rlm_jradius \
-	--without-rlm_fastusers \
-	--without-rlm_eap_leap \
-	--without-rlm_dynamic_clients \
-	--without-rlm_digest \
-	--without-rlm_cram \
-	--without-rlm_copy_packet \
-	--without-rlm_acct_unique \
-	--without-rlm_acctlog
-	
-
-PKG_DICTIONARIES:= \
-	freeradius freeradius.internal \
-	rfc2865 rfc2866 rfc2867 rfc2868 rfc2869 rfc3162 rfc3576 rfc3580 \
-	rfc4372 rfc4675 rfc4679 \
-	microsoft \
-	wispr \
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-ldap),)
-  CONFIGURE_ARGS+= \
-		--with-rlm_ldap-include-dir="$(STAGING_DIR)/usr/include" \
-		--with-rlm_ldap-lib-dir="$(STAGING_DIR)/usr/lib"
-  CONFIGURE_LIBS+= -lcrypto -lssl
-else
-  CONFIGURE_ARGS+= --without-rlm_ldap
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-sql-mysql),)
-  CONFIGURE_ARGS+= \
-		--with-mysql-include-dir="$(STAGING_DIR)/usr/include" \
-		--with-mysql-lib-dir="$(STAGING_DIR)/usr/lib/mysql"
-  CONFIGURE_LIBS+= -lz
-  CONFIGURE_VARS+= ac_cv_lib_mysqlclient_r_mysql_init=yes
-else
-  CONFIGURE_ARGS+= --without-rlm_sql_mysql
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-sql-pgsql),)
-  CONFIGURE_ARGS+= \
-		--with-rlm_sql_postgresql-include-dir="$(STAGING_DIR)/usr/include" \
-		--with-rlm_sql_postgresql-lib-dir="$(STAGING_DIR)/usr/lib"
-else
-  CONFIGURE_ARGS+= --without-rlm_sql_postgresql
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-sqllog),)
-  CONFIGURE_ARGS+= \
-        --with-rlm_sql_log \
-        --with-experimental-modules \
-else
-  CONFIGURE_ARGS+= --without-rlm_sql_log
-endif
-
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-sql-sqlite),)
-  CONFIGURE_ARGS+= \
-	--with-rlm_sql_sqlite \
-	--with-experimental-modules \
-	--with-sqlite-include-dir="$(STAGING_DIR)/usr/include" \
-	--with-sqlite-lib-dir="$(STAGING_DIR)/usr/lib"
-else
-  CONFIGURE_ARGS+= --without-rlm_sql_sqlite
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-eap-peap),)
-  CONFIGURE_ARGS+= \
-  		--with-rlm_eap_peap \
-		--with-rlm_eap_peap-include-dir="$(STAGING_DIR)/usr/include" \
-		--with-rlm_eap_peap-lib-dir="$(STAGING_DIR)/usr/lib"
-  CONFIGURE_LIBS+= -lcrypto -lssl
-else
-  CONFIGURE_ARGS+= --without-rlm_eap_peap
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-eap-tls),)
-  CONFIGURE_ARGS+= \
-  		--with-rlm_eap_tls \
-		--with-rlm_eap_tls-include-dir="$(STAGING_DIR)/usr/include" \
-		--with-rlm_eap_tls-lib-dir="$(STAGING_DIR)/usr/lib"
-  CONFIGURE_LIBS+= -lcrypto -lssl
-else
-  CONFIGURE_ARGS+= --without-rlm_eap_tls
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-eap-ttls),)
-  CONFIGURE_ARGS+= \
-  		--with-rlm_eap_ttls \
-		--with-rlm_eap_ttls-include-dir="$(STAGING_DIR)/usr/include" \
-		--with-rlm_eap_ttls-lib-dir="$(STAGING_DIR)/usr/lib"
-  CONFIGURE_LIBS+= -lcrypto -lssl
-else
-  CONFIGURE_ARGS+= --without-rlm_eap_ttls
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-attr-rewrite),)
-  CONFIGURE_ARGS+= --with-rlm_attr-rewrite
-else
-  CONFIGURE_ARGS+= --without-rlm_attr-rewrite
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-radutmp),)
-  CONFIGURE_ARGS+= --with-rlm_radutmp
-else
-  CONFIGURE_ARGS+= --without-rlm_radutmp
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-logintime),)
-  CONFIGURE_ARGS+= --with-rlm_logintime
-else
-  CONFIGURE_ARGS+= --without-rlm_logintime
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-expiration),)
-  CONFIGURE_ARGS+= --with-rlm_expiration
-else
-  CONFIGURE_ARGS+= --without-rlm_expiration
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-always),)
-  CONFIGURE_ARGS+= --with-rlm_always
-else
-  CONFIGURE_ARGS+= --without-rlm_always
-endif
-
-CONFIGURE_VARS+= \
-	LDFLAGS="$$$$LDFLAGS" \
-	LIBS="$(CONFIGURE_LIBS)" \
-	MYSQL_CONFIG="no" \
-	ac_cv_lib_readline=no \
-
-define Build/Compile
-	$(MAKE) -C $(PKG_BUILD_DIR) \
-		R="$(PKG_INSTALL_DIR)" \
-		INSTALLSTRIP="" \
-		all certs install
-endef
-
-define Package/freeradius2-common/install
-	$(INSTALL_DIR) $(1)/etc/freeradius2
-	chmod 771 $(1)/etc/freeradius2
-	$(CP) $(PKG_INSTALL_DIR)/etc/freeradius2/dictionary $(1)/etc/freeradius2/ ; \
-	$(INSTALL_DIR) $(1)/usr/lib/freeradius2
-	$(CP) $(PKG_INSTALL_DIR)/usr/lib/freeradius2/libfreeradius-radius{,-*}.so $(1)/usr/lib/freeradius2
-	$(CP) $(PKG_INSTALL_DIR)/usr/lib/freeradius2/libfreeradius-eap{,-*}.so $(1)/usr/lib/freeradius2
-	$(INSTALL_DIR) $(1)/usr/share/freeradius2
-	$(CP) $(PKG_INSTALL_DIR)/usr/share/freeradius/dictionary $(1)/usr/share/freeradius2/
-	$(SED) "s,^\(\$$$$INCLUDE\),#\1,g" $(1)/usr/share/freeradius2/dictionary
-	for f in $(PKG_DICTIONARIES); do \
-		$(CP) $(PKG_INSTALL_DIR)/usr/share/freeradius/dictionary.$$$${f} $(1)/usr/share/freeradius2/ ; \
-		$(SED) "s,^#\(\$$$$INCLUDE dictionary\.$$$${f}\),\1,g" $(1)/usr/share/freeradius2/dictionary ; \
-	done
-endef
-
-define Package/freeradius2/install
-	$(INSTALL_DIR) $(1)/etc/freeradius2/modules
-	$(INSTALL_DIR) $(1)/etc/freeradius2/sites
-	for f in clients.conf radiusd.conf policy.conf; do \
-		$(CP) $(PKG_INSTALL_DIR)/etc/freeradius2/$$$${f} $(1)/etc/freeradius2/ ; \
-	done
-	$(CP) $(PKG_INSTALL_DIR)/etc/freeradius2/sites-available/default $(1)/etc/freeradius2/sites/default
-	$(INSTALL_DIR) $(1)/usr/sbin
-	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/radiusd $(1)/usr/sbin/
-	$(INSTALL_DIR) $(1)/etc/init.d
-	$(INSTALL_BIN) ./files/radiusd.init $(1)/etc/init.d/radiusd
-endef
-
-define Package/freeradius2-democerts/install
-	$(INSTALL_DIR) $(1)/etc/freeradius2/certs
-	$(CP) \
-		$(PKG_BUILD_DIR)/raddb/certs/ca.pem \
-		$(PKG_BUILD_DIR)/raddb/certs/dh \
-		$(PKG_BUILD_DIR)/raddb/certs/random \
-		$(PKG_BUILD_DIR)/raddb/certs/server.pem \
-		$(1)/etc/freeradius2/certs/
-endef
-
-define Package/freeradius2-utils/install
-	$(INSTALL_DIR) $(1)/usr/bin
-	for f in radclient radeapclient radwho; do \
-		$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$$$${f} $(1)/usr/bin/ ; \
-	done
-endef
-
-define BuildPlugin
-  define Package/$(1)/install
-	[ -z "$(2)" ] || $(INSTALL_DIR) $$(1)/usr/lib/freeradius2
-	for m in $(2); do \
-		$(CP) $(PKG_INSTALL_DIR)/usr/lib/freeradius2/$$$$$$$${m}{,-*}.so $$(1)/usr/lib/freeradius2 ; \
-	done
-	[ -z "$(3)" ] || $(INSTALL_DIR) $$(1)/etc/freeradius2
-	[ -z "$(4)" ] || $(INSTALL_DIR) $$(1)/etc/freeradius2/$(4)
-	for f in $(3); do \
-		$(CP) $(PKG_INSTALL_DIR)/etc/freeradius2/$$$$$$$${f} $$(1)/etc/freeradius2/$$$$$$$${f} ; \
-	done
-  endef
-
-  $$(eval $$(call BuildPackage,$(1)))
-endef
-
-$(eval $(call BuildPackage,freeradius2))
-$(eval $(call BuildPackage,freeradius2-common))
-$(eval $(call BuildPackage,freeradius2-democerts))
-$(eval $(call BuildPlugin,freeradius2-mod-chap,rlm_chap,modules/chap,modules,))
-$(eval $(call BuildPlugin,freeradius2-mod-detail,rlm_detail,modules/detail,modules,))
-$(eval $(call BuildPlugin,freeradius2-mod-eap,rlm_eap,eap.conf))
-$(eval $(call BuildPlugin,freeradius2-mod-eap-gtc,rlm_eap_gtc,))
-$(eval $(call BuildPlugin,freeradius2-mod-eap-md5,rlm_eap_md5,))
-$(eval $(call BuildPlugin,freeradius2-mod-eap-mschapv2,rlm_eap_mschapv2,))
-$(eval $(call BuildPlugin,freeradius2-mod-eap-peap,rlm_eap_peap,))
-$(eval $(call BuildPlugin,freeradius2-mod-eap-tls,rlm_eap_tls,))
-$(eval $(call BuildPlugin,freeradius2-mod-eap-ttls,rlm_eap_ttls,))
-$(eval $(call BuildPlugin,freeradius2-mod-exec,rlm_exec,modules/exec modules/echo ,modules,))
-$(eval $(call BuildPlugin,freeradius2-mod-attr-rewrite,rlm_attr_rewrite,modules/attr_rewrite,modules,))
-$(eval $(call BuildPlugin,freeradius2-mod-files,rlm_files,acct_users preproxy_users users modules/files,modules,))
-$(eval $(call BuildPlugin,freeradius2-mod-passwd,rlm_passwd,modules/passwd,modules,))
-$(eval $(call BuildPlugin,freeradius2-mod-ldap,rlm_ldap,ldap.attrmap modules/ldap,modules,))
-$(eval $(call BuildPlugin,freeradius2-mod-mschap,rlm_mschap,modules/mschap,modules,))
-$(eval $(call BuildPlugin,freeradius2-mod-pap,rlm_pap,modules/pap,modules,))
-$(eval $(call BuildPlugin,freeradius2-mod-preprocess,rlm_preprocess,hints huntgroups modules/preprocess,modules,))
-$(eval $(call BuildPlugin,freeradius2-mod-realm,rlm_realm,proxy.conf modules/realm modules/inner-eap,modules,))
-$(eval $(call BuildPlugin,freeradius2-mod-sql,rlm_sql,sql.conf,))
-$(eval $(call BuildPlugin,freeradius2-mod-sql-mysql,rlm_sql_mysql,))
-$(eval $(call BuildPlugin,freeradius2-mod-sql-pgsql,rlm_sql_postgresql,))
-$(eval $(call BuildPlugin,freeradius2-mod-sql-sqlite,rlm_sql_sqlite,))
-$(eval $(call BuildPlugin,freeradius2-mod-sqlcounter,rlm_sqlcounter,))
-$(eval $(call BuildPlugin,freeradius2-mod-sqllog,rlm_sql_log,))
-$(eval $(call BuildPlugin,freeradius2-mod-radutmp,rlm_radutmp,modules/radutmp modules/sradutmp,modules,))
-$(eval $(call BuildPlugin,freeradius2-mod-logintime,rlm_logintime,modules/logintime,modules,))
-$(eval $(call BuildPlugin,freeradius2-mod-expr,rlm_expr,modules/expr,modules,))
-$(eval $(call BuildPlugin,freeradius2-mod-attr-filter,rlm_attr_filter,modules/attr_filter attrs attrs.access_reject attrs.accounting_response attrs.pre-proxy,modules,,))
-$(eval $(call BuildPlugin,freeradius2-mod-expiration,rlm_expiration,modules/expiration,modules,))
-$(eval $(call BuildPlugin,freeradius2-mod-always,rlm_always,modules/always,modules,))
-$(eval $(call BuildPackage,freeradius2-utils))

+ 0 - 29
net/freeradius2/files/radiusd.init

@@ -1,29 +0,0 @@
-#!/bin/sh /etc/rc.common
-#
-# Copyright (C) 2006-2015 OpenWrt.org
-#
-
-USE_PROCD=1
-
-START=50
-
-NAME=radiusd
-PROG=/usr/sbin/radiusd
-DEFAULT=/etc/default/radiusd
-
-start_service()
-{
-	[ -f $DEFAULT ] && . $DEFAULT
-	mkdir -p /var/log
-	mkdir -p /var/run
-	mkdir -p /var/db/radacct
-	mkdir -p /tmp/radiusd
-
-	procd_open_instance
-	procd_set_param command $PROG -f
-	procd_set_param env LD_LIBRARY_PATH=/usr/lib/freeradius2
-	[ -n "$IPADDR" ] && procd_append_param command -i $IPADDR
-	[ -n "$OPTIONS" ] && procd_append_param command $OPTIONS
-	procd_set_param respawn
-	procd_close_instance
-}

+ 0 - 12
net/freeradius2/patches/001-fix-makefile.patch

@@ -1,12 +0,0 @@
-Index: freeradius-server-2.2.7/Make.inc.in
-===================================================================
---- freeradius-server-2.2.7.orig/Make.inc.in
-+++ freeradius-server-2.2.7/Make.inc.in
-@@ -5,6 +5,7 @@
- #
- 
- # Location of files.
-+SHELL		= @SHELL@
- prefix		= @prefix@
- exec_prefix	= @exec_prefix@
- sysconfdir	= @sysconfdir@

+ 0 - 613
net/freeradius2/patches/002-config.patch

@@ -1,613 +0,0 @@
-Index: freeradius-server-2.2.7/raddb/dictionary.in
-===================================================================
---- freeradius-server-2.2.7.orig/raddb/dictionary.in
-+++ freeradius-server-2.2.7/raddb/dictionary.in
-@@ -11,7 +11,7 @@
- #
- #	The filename given here should be an absolute path. 
- #
--$INCLUDE	@prefix@/share/freeradius/dictionary
-+$INCLUDE	@prefix@/share/freeradius2/dictionary
- 
- #
- #	Place additional attributes or $INCLUDEs here.  They will
-Index: freeradius-server-2.2.7/raddb/eap.conf
-===================================================================
---- freeradius-server-2.2.7.orig/raddb/eap.conf
-+++ freeradius-server-2.2.7/raddb/eap.conf
-@@ -27,7 +27,7 @@
- 		#  then that EAP type takes precedence over the
- 		#  default type configured here.
- 		#
--		default_eap_type = md5
-+		default_eap_type = peap
- 
- 		#  A list is maintained to correlate EAP-Response
- 		#  packets with EAP-Request packets.  After a
-@@ -72,8 +72,8 @@
- 		#  for wireless connections.  It is insecure, and does
- 		#  not provide for dynamic WEP keys.
- 		#
--		md5 {
--		}
-+#		md5 {
-+#		}
- 
- 		# Cisco LEAP
- 		#
-@@ -87,8 +87,8 @@
- 		#  User-Password, or the NT-Password attributes.
- 		#  'System' authentication is impossible with LEAP.
- 		#
--		leap {
--		}
-+#		leap {
-+#		}
- 
- 		#  Generic Token Card.
- 		#
-@@ -101,7 +101,7 @@
- 		#  the users password will go over the wire in plain-text,
- 		#  for anyone to see.
- 		#
--		gtc {
-+#		gtc {
- 			#  The default challenge, which many clients
- 			#  ignore..
- 			#challenge = "Password: "
-@@ -118,8 +118,8 @@
- 			#  configured for the request, and do the
- 			#  authentication itself.
- 			#
--			auth_type = PAP
--		}
-+#			auth_type = PAP
-+#		}
- 
- 		## EAP-TLS
- 		#
-@@ -215,7 +215,7 @@
- 			#  In these cases, fragment size should be
- 			#  1024 or less.
- 			#
--		#	fragment_size = 1024
-+			fragment_size = 1024
- 
- 			#  include_length is a flag which is
- 			#  by default set to yes If set to
-@@ -225,7 +225,7 @@
- 			#  message is included ONLY in the
- 			#  First packet of a fragment series.
- 			#
--		#	include_length = yes
-+			include_length = yes
- 
- 			#  Check the Certificate Revocation List
- 			#
-@@ -297,7 +297,7 @@
- 			# for the server to print out an error message,
- 			# and refuse to start.
- 			#
--			make_cert_command = "${certdir}/bootstrap"
-+		#	make_cert_command = "${certdir}/bootstrap"
- 
- 			#
- 			#  Elliptical cryptography configuration
-@@ -332,7 +332,7 @@
- 			#  You probably also want "use_tunneled_reply = yes"
- 			#  when using fast session resumption.
- 			#
--			cache {
-+		#	cache {
- 			      #
- 			      #  Enable it.  The default is "no".
- 			      #  Deleting the entire "cache" subsection
-@@ -348,14 +348,14 @@
- 			      #  enable resumption for just one user
- 			      #  by setting the above attribute to "yes".
- 			      #
--			      enable = no
-+		#	      enable = no
- 
- 			      #
- 			      #  Lifetime of the cached entries, in hours.
- 			      #  The sessions will be deleted after this
- 			      #  time.
- 			      #
--			      lifetime = 24 # hours
-+		#	      lifetime = 24 # hours
- 
- 			      #
- 			      #  The maximum number of entries in the
-@@ -364,8 +364,8 @@
- 			      #  This could be set to the number of users
- 			      #  who are logged in... which can be a LOT.
- 			      #
--			      max_entries = 255
--			}
-+		#	      max_entries = 255
-+		#	}
- 
- 			#
- 			#  As of version 2.1.10, client certificates can be
-@@ -503,7 +503,7 @@
- 		#
- 		#  in the control items for a request.
- 		#
--		ttls {
-+#		ttls {
- 			#  The tunneled EAP session needs a default
- 			#  EAP type which is separate from the one for
- 			#  the non-tunneled EAP module.  Inside of the
-@@ -511,7 +511,7 @@
- 			#  If the request does not contain an EAP
- 			#  conversation, then this configuration entry
- 			#  is ignored.
--			default_eap_type = md5
-+#			default_eap_type = mschapv2
- 
- 			#  The tunneled authentication request does
- 			#  not usually contain useful attributes
-@@ -527,7 +527,7 @@
- 			#  is copied to the tunneled request.
- 			#
- 			# allowed values: {no, yes}
--			copy_request_to_tunnel = no
-+#			copy_request_to_tunnel = yes
- 
- 			#  The reply attributes sent to the NAS are
- 			#  usually based on the name of the user
-@@ -540,7 +540,7 @@
- 			#  the tunneled request.
- 			#
- 			# allowed values: {no, yes}
--			use_tunneled_reply = no
-+#			use_tunneled_reply = no
- 
- 			#
- 			#  The inner tunneled request can be sent
-@@ -552,13 +552,13 @@
- 			#  the virtual server that processed the
- 			#  outer requests.
- 			#
--			virtual_server = "inner-tunnel"
-+#			virtual_server = "inner-tunnel"
- 
- 			#  This has the same meaning as the
- 			#  same field in the "tls" module, above.
- 			#  The default value here is "yes".
- 		#	include_length = yes
--		}
-+#		}
- 
- 		##################################################
- 		#
-@@ -627,14 +627,14 @@
- 
- 			#  the PEAP module also has these configuration
- 			#  items, which are the same as for TTLS.
--			copy_request_to_tunnel = no
--			use_tunneled_reply = no
-+			copy_request_to_tunnel = yes
-+			use_tunneled_reply = yes
- 
- 			#  When the tunneled session is proxied, the
- 			#  home server may not understand EAP-MSCHAP-V2.
- 			#  Set this entry to "no" to proxy the tunneled
- 			#  EAP-MSCHAP-V2 as normal MSCHAPv2.
--		#	proxy_tunneled_request_as_eap = yes
-+			proxy_tunneled_request_as_eap = no
- 
- 			#
- 			#  The inner tunneled request can be sent
-@@ -646,7 +646,8 @@
- 			#  the virtual server that processed the
- 			#  outer requests.
- 			#
--			virtual_server = "inner-tunnel"
-+		#	virtual_server = "inner-tunnel"
-+			EAP-TLS-Require-Client-Cert = no
- 
- 			# This option enables support for MS-SoH
- 			# see doc/SoH.txt for more info.
-Index: freeradius-server-2.2.7/raddb/modules/counter
-===================================================================
---- freeradius-server-2.2.7.orig/raddb/modules/counter
-+++ freeradius-server-2.2.7/raddb/modules/counter
-@@ -69,7 +69,7 @@
- #  'check-name' attribute.
- #
- counter daily {
--	filename = ${db_dir}/db.daily
-+	filename = ${radacctdir}/db.daily
- 	key = User-Name
- 	count-attribute = Acct-Session-Time
- 	reset = daily
-Index: freeradius-server-2.2.7/raddb/modules/pap
-===================================================================
---- freeradius-server-2.2.7.orig/raddb/modules/pap
-+++ freeradius-server-2.2.7/raddb/modules/pap
-@@ -18,5 +18,5 @@
- #
- #  http://www.openldap.org/faq/data/cache/347.html
- pap {
--	auto_header = no
-+	auto_header = yes
- }
-Index: freeradius-server-2.2.7/raddb/modules/radutmp
-===================================================================
---- freeradius-server-2.2.7.orig/raddb/modules/radutmp
-+++ freeradius-server-2.2.7/raddb/modules/radutmp
-@@ -12,7 +12,7 @@ radutmp {
- 	#  Where the file is stored.  It's not a log file,
- 	#  so it doesn't need rotating.
- 	#
--	filename = ${logdir}/radutmp
-+	filename = ${radacctdir}/radutmp
- 
- 	#  The field in the packet to key on for the
- 	#  'user' name,  If you have other fields which you want
-Index: freeradius-server-2.2.7/raddb/modules/sradutmp
-===================================================================
---- freeradius-server-2.2.7.orig/raddb/modules/sradutmp
-+++ freeradius-server-2.2.7/raddb/modules/sradutmp
-@@ -10,7 +10,7 @@
- # then name "sradutmp" to identify it later in the "accounting"
- # section.
- radutmp sradutmp {
--	filename = ${logdir}/sradutmp
-+	filename = ${radacctdir}/sradutmp
- 	perm = 0644
- 	callerid = "no"
- }
-Index: freeradius-server-2.2.7/raddb/radiusd.conf.in
-===================================================================
---- freeradius-server-2.2.7.orig/raddb/radiusd.conf.in
-+++ freeradius-server-2.2.7/raddb/radiusd.conf.in
-@@ -66,7 +66,7 @@ name = radiusd
- 
- #  Location of config and logfiles.
- confdir = ${raddbdir}
--run_dir = ${localstatedir}/run/${name}
-+run_dir = ${localstatedir}/run
- 
- # Should likely be ${localstatedir}/lib/radiusd
- db_dir = ${raddbdir}
-@@ -323,7 +323,7 @@ listen {
- 	#  If your system does not support this feature, you will
- 	#  get an error if you try to use it.
- 	#
--#	interface = eth0
-+	interface = br-lan
- 
- 	#  Per-socket lists of clients.  This is a very useful feature.
- 	#
-@@ -350,7 +350,7 @@ listen {
- #	ipv6addr = ::
- 	port = 0
- 	type = acct
--#	interface = eth0
-+	interface = br-lan
- #	clients = per_socket_clients
- }
- 
-@@ -576,8 +576,8 @@ security {
- #
- #  allowed values: {no, yes}
- #
--proxy_requests  = yes
--$INCLUDE proxy.conf
-+proxy_requests  = no
-+#$INCLUDE proxy.conf
- 
- 
- # CLIENTS CONFIGURATION
-@@ -774,7 +774,7 @@ instantiate {
- 	#  The entire command line (and output) must fit into 253 bytes.
- 	#
- 	#  e.g. Framed-Pool = `%{exec:/bin/echo foo}`
--	exec
-+#	exec
- 
- 	#
- 	#  The expression module doesn't do authorization,
-@@ -791,15 +791,15 @@ instantiate {
- 	#  other xlat functions such as md5, sha1 and lc.
- 	#
- 	#  We do not recommend removing it's listing here.
--	expr
-+#	expr
- 
- 	#
- 	# We add the counter module here so that it registers
- 	# the check-name attribute before any module which sets
- 	# it
- #	daily
--	expiration
--	logintime
-+#	expiration
-+#	logintime
- 
- 	# subsections here can be thought of as "virtual" modules.
- 	#
-@@ -823,7 +823,7 @@ instantiate {
- #	to multiple times.
- #
- ######################################################################
--$INCLUDE policy.conf
-+#$INCLUDE policy.conf
- 
- ######################################################################
- #
-@@ -833,9 +833,9 @@ $INCLUDE policy.conf
- #	match the regular expression: /[a-zA-Z0-9_.]+/
- #
- #	It allows you to define new virtual servers simply by placing
--#	a file into the raddb/sites-enabled/ directory.
-+#	a file into the /etc/freeradius2/sites/ directory.
- #
--$INCLUDE sites-enabled/
-+$INCLUDE sites/
- 
- ######################################################################
- #
-@@ -843,7 +843,7 @@ $INCLUDE sites-enabled/
- #	"authenticate {}", "accounting {}", have been moved to the
- #	the file:
- #
--#		raddb/sites-available/default
-+#		/etc/freeradius2/sites/default
- #
- #	This is the "default" virtual server that has the same
- #	configuration as in version 1.0.x and 1.1.x.  The default
-Index: freeradius-server-2.2.7/raddb/sites-available/default
-===================================================================
---- freeradius-server-2.2.7.orig/raddb/sites-available/default
-+++ freeradius-server-2.2.7/raddb/sites-available/default
-@@ -85,7 +85,7 @@ authorize {
- 	#
- 	#  It takes care of processing the 'raddb/hints' and the
- 	#  'raddb/huntgroups' files.
--	preprocess
-+#	preprocess
- 
- 	#
- 	#  If you want to have a log of authentication requests,
-@@ -96,7 +96,7 @@ authorize {
- 	#
- 	#  The chap module will set 'Auth-Type := CHAP' if we are
- 	#  handling a CHAP request and Auth-Type has not already been set
--	chap
-+#	chap
- 
- 	#
- 	#  If the users are logging in with an MS-CHAP-Challenge
-@@ -104,13 +104,13 @@ authorize {
- 	#  the MS-CHAP-Challenge attribute, and add 'Auth-Type := MS-CHAP'
- 	#  to the request, which will cause the server to then use
- 	#  the mschap module for authentication.
--	mschap
-+#	mschap
- 
- 	#
- 	#  If you have a Cisco SIP server authenticating against
- 	#  FreeRADIUS, uncomment the following line, and the 'digest'
- 	#  line in the 'authenticate' section.
--	digest
-+#	digest
- 
- 	#
- 	#  The WiMAX specification says that the Calling-Station-Id
-@@ -133,7 +133,7 @@ authorize {
- 	#  Otherwise, when the first style of realm doesn't match,
- 	#  the other styles won't be checked.
- 	#
--	suffix
-+#	suffix
- #	ntdomain
- 
- 	#
-@@ -197,8 +197,8 @@ authorize {
- 	# Use the checkval module
- #	checkval
- 
--	expiration
--	logintime
-+#	expiration
-+#	logintime
- 
- 	#
- 	#  If no other module has claimed responsibility for
-@@ -279,7 +279,7 @@ authenticate {
- 	#  If you have a Cisco SIP server authenticating against
- 	#  FreeRADIUS, uncomment the following line, and the 'digest'
- 	#  line in the 'authorize' section.
--	digest
-+#	digest
- 
- 	#
- 	#  Pluggable Authentication Modules.
-@@ -296,7 +296,7 @@ authenticate {
- 	#  be used for authentication ONLY for compatibility with legacy
- 	#  FreeRADIUS configurations.
- 	#
--	unix
-+#	unix
- 
- 	# Uncomment it if you want to use ldap for authentication
- 	#
-@@ -332,8 +332,8 @@ authenticate {
- #
- #  Pre-accounting.  Decide which accounting type to use.
- #
--preacct {
--	preprocess
-+#preacct {
-+#	preprocess
- 
- 	#
- 	#  Session start times are *implied* in RADIUS.
-@@ -356,7 +356,7 @@ preacct {
- 	#
- 	#  Ensure that we have a semi-unique identifier for every
- 	#  request, and many NAS boxes are broken.
--	acct_unique
-+#	acct_unique
- 
- 	#
- 	#  Look for IPASS-style 'realm/', and if not found, look for
-@@ -366,13 +366,13 @@ preacct {
- 	#  Accounting requests are generally proxied to the same
- 	#  home server as authentication requests.
- #	IPASS
--	suffix
-+#	suffix
- #	ntdomain
- 
- 	#
- 	#  Read the 'acct_users' file
--	files
--}
-+#	files
-+#}
- 
- #
- #  Accounting.  Log the accounting data.
-@@ -382,7 +382,7 @@ accounting {
- 	#  Create a 'detail'ed log of the packets.
- 	#  Note that accounting requests which are proxied
- 	#  are also logged in the detail file.
--	detail
-+#	detail
- #	daily
- 
- 	#  Update the wtmp file
-@@ -434,7 +434,7 @@ accounting {
- 	exec
- 
- 	#  Filter attributes from the accounting response.
--	attr_filter.accounting_response
-+	#attr_filter.accounting_response
- 
- 	#
- 	#  See "Autz-Type Status-Server" for how this works.
-@@ -460,7 +460,7 @@ session {
- #  Post-Authentication
- #  Once we KNOW that the user has been authenticated, there are
- #  additional steps we can take.
--post-auth {
-+#post-auth {
- 	#  Get an address from the IP Pool.
- #	main_pool
- 
-@@ -490,7 +490,7 @@ post-auth {
- #	ldap
- 
- 	# For Exec-Program and Exec-Program-Wait
--	exec
-+#	exec
- 
- 	#
- 	#  Calculate the various WiMAX keys.  In order for this to work,
-@@ -574,18 +574,18 @@ post-auth {
- 	#  Add the ldap module name (or instance) if you have set 
- 	#  'edir_account_policy_check = yes' in the ldap module configuration
- 	#
--	Post-Auth-Type REJECT {
--		# log failed authentications in SQL, too.
-+#	Post-Auth-Type REJECT {
-+#		# log failed authentications in SQL, too.
- #		sql
- 
- 		# Insert EAP-Failure message if the request was
- 		# rejected by policy instead of because of an
- 		# authentication failure
--		eap
-+#		eap
- 
--		attr_filter.access_reject
--	}
--}
-+#		attr_filter.access_reject
-+#	}
-+#}
- 
- #
- #  When the server decides to proxy a request to a home server,
-@@ -595,7 +595,7 @@ post-auth {
- #
- #  Only a few modules currently have this method.
- #
--pre-proxy {
-+#pre-proxy {
- #	attr_rewrite
- 
- 	#  Uncomment the following line if you want to change attributes
-@@ -611,14 +611,14 @@ pre-proxy {
- 	#  server, un-comment the following line, and the
- 	#  'detail pre_proxy_log' section, above.
- #	pre_proxy_log
--}
-+#}
- 
- #
- #  When the server receives a reply to a request it proxied
- #  to a home server, the request may be massaged here, in the
- #  post-proxy stage.
- #
--post-proxy {
-+#post-proxy {
- 
- 	#  If you want to have a log of replies from a home server,
- 	#  un-comment the following line, and the 'detail post_proxy_log'
-@@ -642,7 +642,7 @@ post-proxy {
- 	#  hidden inside of the EAP packet, and the end server will
- 	#  reject the EAP request.
- 	#
--	eap
-+#	eap
- 
- 	#
- 	#  If the server tries to proxy a request and fails, then the
-@@ -664,5 +664,5 @@ post-proxy {
- #	Post-Proxy-Type Fail {
- #			detail
- #	}
--}
-+#}
- 
-Index: freeradius-server-2.2.7/raddb/users
-===================================================================
---- freeradius-server-2.2.7.orig/raddb/users
-+++ freeradius-server-2.2.7/raddb/users
-@@ -169,22 +169,22 @@
- #	by the terminal server in which case there may not be a "P" suffix.
- #	The terminal server sends "Framed-Protocol = PPP" for auto PPP.
- #
--DEFAULT	Framed-Protocol == PPP
--	Framed-Protocol = PPP,
--	Framed-Compression = Van-Jacobson-TCP-IP
-+#DEFAULT	Framed-Protocol == PPP
-+#	Framed-Protocol = PPP,
-+#	Framed-Compression = Van-Jacobson-TCP-IP
- 
- #
- # Default for CSLIP: dynamic IP address, SLIP mode, VJ-compression.
- #
--DEFAULT	Hint == "CSLIP"
--	Framed-Protocol = SLIP,
--	Framed-Compression = Van-Jacobson-TCP-IP
-+#DEFAULT	Hint == "CSLIP"
-+#	Framed-Protocol = SLIP,
-+#	Framed-Compression = Van-Jacobson-TCP-IP
- 
- #
- # Default for SLIP: dynamic IP address, SLIP mode.
- #
--DEFAULT	Hint == "SLIP"
--	Framed-Protocol = SLIP
-+#DEFAULT	Hint == "SLIP"
-+#	Framed-Protocol = SLIP
- 
- #
- # Last default: rlogin to our main server.

+ 0 - 4257
net/freeradius2/patches/004-ldap_configure.patch

@@ -1,4257 +0,0 @@
-Index: freeradius-server-2.2.7/src/modules/rlm_ldap/configure
-===================================================================
---- freeradius-server-2.2.7.orig/src/modules/rlm_ldap/configure
-+++ freeradius-server-2.2.7/src/modules/rlm_ldap/configure
-@@ -1,10 +1,10 @@
- #! /bin/sh
- # From configure.in Revision.
- # Guess values for system-dependent variables and create Makefiles.
--# Generated by GNU Autoconf 2.61.
-+# Generated by GNU Autoconf 2.63.
- #
- # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
--# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
-+# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
- # This configure script is free software; the Free Software Foundation
- # gives unlimited permission to copy, distribute and modify it.
- ## --------------------- ##
-@@ -16,7 +16,7 @@ DUALCASE=1; export DUALCASE # for MKS sh
- if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
-   emulate sh
-   NULLCMD=:
--  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
-+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
-   # is contrary to our usage.  Disable this feature.
-   alias -g '${1+"$@"}'='"$@"'
-   setopt NO_GLOB_SUBST
-@@ -38,17 +38,45 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTE
- as_cr_digits='0123456789'
- as_cr_alnum=$as_cr_Letters$as_cr_digits
- 
--# The user is always right.
--if test "${PATH_SEPARATOR+set}" != set; then
--  echo "#! /bin/sh" >conf$$.sh
--  echo  "exit 0"   >>conf$$.sh
--  chmod +x conf$$.sh
--  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
--    PATH_SEPARATOR=';'
-+as_nl='
-+'
-+export as_nl
-+# Printing a long string crashes Solaris 7 /usr/bin/printf.
-+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
-+  as_echo='printf %s\n'
-+  as_echo_n='printf %s'
-+else
-+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
-+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
-+    as_echo_n='/usr/ucb/echo -n'
-   else
--    PATH_SEPARATOR=:
-+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
-+    as_echo_n_body='eval
-+      arg=$1;
-+      case $arg in
-+      *"$as_nl"*)
-+	expr "X$arg" : "X\\(.*\\)$as_nl";
-+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
-+      esac;
-+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
-+    '
-+    export as_echo_n_body
-+    as_echo_n='sh -c $as_echo_n_body as_echo'
-   fi
--  rm -f conf$$.sh
-+  export as_echo_body
-+  as_echo='sh -c $as_echo_body as_echo'
-+fi
-+
-+# The user is always right.
-+if test "${PATH_SEPARATOR+set}" != set; then
-+  PATH_SEPARATOR=:
-+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
-+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
-+      PATH_SEPARATOR=';'
-+  }
- fi
- 
- # Support unset when possible.
-@@ -64,8 +92,6 @@ fi
- # there to prevent editors from complaining about space-tab.
- # (If _AS_PATH_WALK were called with IFS unset, it would disable word
- # splitting by setting IFS to empty value.)
--as_nl='
--'
- IFS=" ""	$as_nl"
- 
- # Find who we are.  Look in the path if we contain no directory separator.
-@@ -88,7 +114,7 @@ if test "x$as_myself" = x; then
-   as_myself=$0
- fi
- if test ! -f "$as_myself"; then
--  echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
-+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
-   { (exit 1); exit 1; }
- fi
- 
-@@ -101,17 +127,10 @@ PS2='> '
- PS4='+ '
- 
- # NLS nuisances.
--for as_var in \
--  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
--  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
--  LC_TELEPHONE LC_TIME
--do
--  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
--    eval $as_var=C; export $as_var
--  else
--    ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
--  fi
--done
-+LC_ALL=C
-+export LC_ALL
-+LANGUAGE=C
-+export LANGUAGE
- 
- # Required to use basename.
- if expr a : '\(a\)' >/dev/null 2>&1 &&
-@@ -133,7 +152,7 @@ as_me=`$as_basename -- "$0" ||
- $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- 	 X"$0" : 'X\(//\)$' \| \
- 	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
--echo X/"$0" |
-+$as_echo X/"$0" |
-     sed '/^.*\/\([^/][^/]*\)\/*$/{
- 	    s//\1/
- 	    q
-@@ -159,7 +178,7 @@ else
-   as_have_required=no
- fi
- 
--  if test $as_have_required = yes && 	 (eval ":
-+  if test $as_have_required = yes &&	 (eval ":
- (as_func_return () {
-   (exit \$1)
- }
-@@ -241,7 +260,7 @@ IFS=$as_save_IFS
- if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
-   emulate sh
-   NULLCMD=:
--  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
-+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
-   # is contrary to our usage.  Disable this feature.
-   alias -g '${1+"$@"}'='"$@"'
-   setopt NO_GLOB_SUBST
-@@ -262,7 +281,7 @@ _ASEOF
- if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
-   emulate sh
-   NULLCMD=:
--  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
-+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
-   # is contrary to our usage.  Disable this feature.
-   alias -g '${1+"$@"}'='"$@"'
-   setopt NO_GLOB_SUBST
-@@ -342,10 +361,10 @@ fi
- 
-       if test "x$CONFIG_SHELL" != x; then
-   for as_var in BASH_ENV ENV
--        do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
--        done
--        export CONFIG_SHELL
--        exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
-+	do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
-+	done
-+	export CONFIG_SHELL
-+	exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
- fi
- 
- 
-@@ -414,9 +433,10 @@ fi
- 
- test \$exitcode = 0") || {
-   echo No shell found that supports shell functions.
--  echo Please tell autoconf@gnu.org about your system,
--  echo including any error possibly output before this
--  echo message
-+  echo Please tell bug-autoconf@gnu.org about your system,
-+  echo including any error possibly output before this message.
-+  echo This can help us improve future autoconf versions.
-+  echo Configuration will now proceed without shell functions.
- }
- 
- 
-@@ -452,7 +472,7 @@ test \$exitcode = 0") || {
-       s/-\n.*//
-     ' >$as_me.lineno &&
-   chmod +x "$as_me.lineno" ||
--    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
-+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
-    { (exit 1); exit 1; }; }
- 
-   # Don't try to exec as it changes $[0], causing all sort of problems
-@@ -480,7 +500,6 @@ case `echo -n x` in
- *)
-   ECHO_N='-n';;
- esac
--
- if expr a : '\(a\)' >/dev/null 2>&1 &&
-    test "X`expr 00001 : '.*\(...\)'`" = X001; then
-   as_expr=expr
-@@ -493,19 +512,22 @@ if test -d conf$$.dir; then
-   rm -f conf$$.dir/conf$$.file
- else
-   rm -f conf$$.dir
--  mkdir conf$$.dir
-+  mkdir conf$$.dir 2>/dev/null
- fi
--echo >conf$$.file
--if ln -s conf$$.file conf$$ 2>/dev/null; then
--  as_ln_s='ln -s'
--  # ... but there are two gotchas:
--  # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
--  # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
--  # In both cases, we have to default to `cp -p'.
--  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-+if (echo >conf$$.file) 2>/dev/null; then
-+  if ln -s conf$$.file conf$$ 2>/dev/null; then
-+    as_ln_s='ln -s'
-+    # ... but there are two gotchas:
-+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
-+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-+    # In both cases, we have to default to `cp -p'.
-+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-+      as_ln_s='cp -p'
-+  elif ln conf$$.file conf$$ 2>/dev/null; then
-+    as_ln_s=ln
-+  else
-     as_ln_s='cp -p'
--elif ln conf$$.file conf$$ 2>/dev/null; then
--  as_ln_s=ln
-+  fi
- else
-   as_ln_s='cp -p'
- fi
-@@ -530,10 +552,10 @@ else
-   as_test_x='
-     eval sh -c '\''
-       if test -d "$1"; then
--        test -d "$1/.";
-+	test -d "$1/.";
-       else
- 	case $1 in
--        -*)set "./$1";;
-+	-*)set "./$1";;
- 	esac;
- 	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
- 	???[sx]*):;;*)false;;esac;fi
-@@ -578,57 +600,65 @@ PACKAGE_STRING=
- PACKAGE_BUGREPORT=
- 
- ac_unique_file="rlm_ldap.c"
--ac_subst_vars='SHELL
--PATH_SEPARATOR
--PACKAGE_NAME
--PACKAGE_TARNAME
--PACKAGE_VERSION
--PACKAGE_STRING
--PACKAGE_BUGREPORT
--exec_prefix
--prefix
--program_transform_name
--bindir
--sbindir
--libexecdir
--datarootdir
--datadir
--sysconfdir
--sharedstatedir
--localstatedir
--includedir
--oldincludedir
--docdir
--infodir
--htmldir
--dvidir
--pdfdir
--psdir
--libdir
--localedir
--mandir
--DEFS
--ECHO_C
--ECHO_N
--ECHO_T
--LIBS
--build_alias
--host_alias
--target_alias
--CC
--CFLAGS
--LDFLAGS
--CPPFLAGS
--ac_ct_CC
--EXEEXT
--OBJEXT
--edir
--ldap_ldflags
--ldap_cflags
--targetname
-+ac_subst_vars='LTLIBOBJS
- LIBOBJS
--LTLIBOBJS'
-+targetname
-+ldap_cflags
-+ldap_ldflags
-+edir
-+OBJEXT
-+EXEEXT
-+ac_ct_CC
-+CPPFLAGS
-+LDFLAGS
-+CFLAGS
-+CC
-+target_alias
-+host_alias
-+build_alias
-+LIBS
-+ECHO_T
-+ECHO_N
-+ECHO_C
-+DEFS
-+mandir
-+localedir
-+libdir
-+psdir
-+pdfdir
-+dvidir
-+htmldir
-+infodir
-+docdir
-+oldincludedir
-+includedir
-+localstatedir
-+sharedstatedir
-+sysconfdir
-+datadir
-+datarootdir
-+libexecdir
-+sbindir
-+bindir
-+program_transform_name
-+prefix
-+exec_prefix
-+PACKAGE_BUGREPORT
-+PACKAGE_STRING
-+PACKAGE_VERSION
-+PACKAGE_TARNAME
-+PACKAGE_NAME
-+PATH_SEPARATOR
-+SHELL'
- ac_subst_files=''
-+ac_user_opts='
-+enable_option_checking
-+with_rlm_ldap_lib_dir
-+with_rlm_ldap_include_dir
-+enable_shared
-+with_threads
-+with_edir
-+'
-       ac_precious_vars='build_alias
- host_alias
- target_alias
-@@ -642,6 +672,8 @@ CPPFLAGS'
- # Initialize some variables set by options.
- ac_init_help=
- ac_init_version=false
-+ac_unrecognized_opts=
-+ac_unrecognized_sep=
- # The variables have the same names as the options, with
- # dashes changed to underlines.
- cache_file=/dev/null
-@@ -740,13 +772,21 @@ do
-     datarootdir=$ac_optarg ;;
- 
-   -disable-* | --disable-*)
--    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
-+    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
-     # Reject names that are not valid shell variable names.
--    expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
--      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
-+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-+      { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
-    { (exit 1); exit 1; }; }
--    ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
--    eval enable_$ac_feature=no ;;
-+    ac_useropt_orig=$ac_useropt
-+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
-+    case $ac_user_opts in
-+      *"
-+"enable_$ac_useropt"
-+"*) ;;
-+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
-+	 ac_unrecognized_sep=', ';;
-+    esac
-+    eval enable_$ac_useropt=no ;;
- 
-   -docdir | --docdir | --docdi | --doc | --do)
-     ac_prev=docdir ;;
-@@ -759,13 +799,21 @@ do
-     dvidir=$ac_optarg ;;
- 
-   -enable-* | --enable-*)
--    ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
-+    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
-     # Reject names that are not valid shell variable names.
--    expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
--      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
-+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-+      { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
-    { (exit 1); exit 1; }; }
--    ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
--    eval enable_$ac_feature=\$ac_optarg ;;
-+    ac_useropt_orig=$ac_useropt
-+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
-+    case $ac_user_opts in
-+      *"
-+"enable_$ac_useropt"
-+"*) ;;
-+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
-+	 ac_unrecognized_sep=', ';;
-+    esac
-+    eval enable_$ac_useropt=\$ac_optarg ;;
- 
-   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
-   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
-@@ -956,22 +1004,38 @@ do
-     ac_init_version=: ;;
- 
-   -with-* | --with-*)
--    ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
-+    ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
-     # Reject names that are not valid shell variable names.
--    expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
--      { echo "$as_me: error: invalid package name: $ac_package" >&2
-+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-+      { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
-    { (exit 1); exit 1; }; }
--    ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
--    eval with_$ac_package=\$ac_optarg ;;
-+    ac_useropt_orig=$ac_useropt
-+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
-+    case $ac_user_opts in
-+      *"
-+"with_$ac_useropt"
-+"*) ;;
-+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
-+	 ac_unrecognized_sep=', ';;
-+    esac
-+    eval with_$ac_useropt=\$ac_optarg ;;
- 
-   -without-* | --without-*)
--    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
-+    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
-     # Reject names that are not valid shell variable names.
--    expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
--      { echo "$as_me: error: invalid package name: $ac_package" >&2
-+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-+      { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
-    { (exit 1); exit 1; }; }
--    ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
--    eval with_$ac_package=no ;;
-+    ac_useropt_orig=$ac_useropt
-+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
-+    case $ac_user_opts in
-+      *"
-+"with_$ac_useropt"
-+"*) ;;
-+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
-+	 ac_unrecognized_sep=', ';;
-+    esac
-+    eval with_$ac_useropt=no ;;
- 
-   --x)
-     # Obsolete; use --with-x.
-@@ -991,7 +1055,7 @@ do
-   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
-     x_libraries=$ac_optarg ;;
- 
--  -*) { echo "$as_me: error: unrecognized option: $ac_option
-+  -*) { $as_echo "$as_me: error: unrecognized option: $ac_option
- Try \`$0 --help' for more information." >&2
-    { (exit 1); exit 1; }; }
-     ;;
-@@ -1000,16 +1064,16 @@ Try \`$0 --help' for more information."
-     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
-     # Reject names that are not valid shell variable names.
-     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
--      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
-+      { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2
-    { (exit 1); exit 1; }; }
-     eval $ac_envvar=\$ac_optarg
-     export $ac_envvar ;;
- 
-   *)
-     # FIXME: should be removed in autoconf 3.0.
--    echo "$as_me: WARNING: you should use --build, --host, --target" >&2
-+    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
-     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
--      echo "$as_me: WARNING: invalid host type: $ac_option" >&2
-+      $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
-     : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
-     ;;
- 
-@@ -1018,22 +1082,38 @@ done
- 
- if test -n "$ac_prev"; then
-   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
--  { echo "$as_me: error: missing argument to $ac_option" >&2
-+  { $as_echo "$as_me: error: missing argument to $ac_option" >&2
-    { (exit 1); exit 1; }; }
- fi
- 
--# Be sure to have absolute directory names.
-+if test -n "$ac_unrecognized_opts"; then
-+  case $enable_option_checking in
-+    no) ;;
-+    fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2
-+   { (exit 1); exit 1; }; } ;;
-+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
-+  esac
-+fi
-+
-+# Check all directory arguments for consistency.
- for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
- 		datadir sysconfdir sharedstatedir localstatedir includedir \
- 		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
- 		libdir localedir mandir
- do
-   eval ac_val=\$$ac_var
-+  # Remove trailing slashes.
-+  case $ac_val in
-+    */ )
-+      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
-+      eval $ac_var=\$ac_val;;
-+  esac
-+  # Be sure to have absolute directory names.
-   case $ac_val in
-     [\\/$]* | ?:[\\/]* )  continue;;
-     NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
-   esac
--  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
-+  { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
-    { (exit 1); exit 1; }; }
- done
- 
-@@ -1048,7 +1128,7 @@ target=$target_alias
- if test "x$host_alias" != x; then
-   if test "x$build_alias" = x; then
-     cross_compiling=maybe
--    echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
-+    $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
-     If a cross compiler is detected then cross compile mode will be used." >&2
-   elif test "x$build_alias" != "x$host_alias"; then
-     cross_compiling=yes
-@@ -1064,10 +1144,10 @@ test "$silent" = yes && exec 6>/dev/null
- ac_pwd=`pwd` && test -n "$ac_pwd" &&
- ac_ls_di=`ls -di .` &&
- ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
--  { echo "$as_me: error: Working directory cannot be determined" >&2
-+  { $as_echo "$as_me: error: working directory cannot be determined" >&2
-    { (exit 1); exit 1; }; }
- test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
--  { echo "$as_me: error: pwd does not report name of working directory" >&2
-+  { $as_echo "$as_me: error: pwd does not report name of working directory" >&2
-    { (exit 1); exit 1; }; }
- 
- 
-@@ -1075,12 +1155,12 @@ test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
- if test -z "$srcdir"; then
-   ac_srcdir_defaulted=yes
-   # Try the directory containing this script, then the parent directory.
--  ac_confdir=`$as_dirname -- "$0" ||
--$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
--	 X"$0" : 'X\(//\)[^/]' \| \
--	 X"$0" : 'X\(//\)$' \| \
--	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
--echo X"$0" |
-+  ac_confdir=`$as_dirname -- "$as_myself" ||
-+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-+	 X"$as_myself" : 'X\(//\)[^/]' \| \
-+	 X"$as_myself" : 'X\(//\)$' \| \
-+	 X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
-+$as_echo X"$as_myself" |
-     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- 	    s//\1/
- 	    q
-@@ -1107,12 +1187,12 @@ else
- fi
- if test ! -r "$srcdir/$ac_unique_file"; then
-   test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
--  { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
-+  { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
-    { (exit 1); exit 1; }; }
- fi
- ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
- ac_abs_confdir=`(
--	cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2
-+	cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2
-    { (exit 1); exit 1; }; }
- 	pwd)`
- # When building in place, set srcdir=.
-@@ -1161,9 +1241,9 @@ Configuration:
- 
- Installation directories:
-   --prefix=PREFIX         install architecture-independent files in PREFIX
--			  [$ac_default_prefix]
-+                          [$ac_default_prefix]
-   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
--			  [PREFIX]
-+                          [PREFIX]
- 
- By default, \`make install' will install all the files in
- \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
-@@ -1173,25 +1253,25 @@ for instance \`--prefix=\$HOME'.
- For better control, use the options below.
- 
- Fine tuning of the installation directories:
--  --bindir=DIR           user executables [EPREFIX/bin]
--  --sbindir=DIR          system admin executables [EPREFIX/sbin]
--  --libexecdir=DIR       program executables [EPREFIX/libexec]
--  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
--  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
--  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
--  --libdir=DIR           object code libraries [EPREFIX/lib]
--  --includedir=DIR       C header files [PREFIX/include]
--  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
--  --datarootdir=DIR      read-only arch.-independent data root [PREFIX/share]
--  --datadir=DIR          read-only architecture-independent data [DATAROOTDIR]
--  --infodir=DIR          info documentation [DATAROOTDIR/info]
--  --localedir=DIR        locale-dependent data [DATAROOTDIR/locale]
--  --mandir=DIR           man documentation [DATAROOTDIR/man]
--  --docdir=DIR           documentation root [DATAROOTDIR/doc/PACKAGE]
--  --htmldir=DIR          html documentation [DOCDIR]
--  --dvidir=DIR           dvi documentation [DOCDIR]
--  --pdfdir=DIR           pdf documentation [DOCDIR]
--  --psdir=DIR            ps documentation [DOCDIR]
-+  --bindir=DIR            user executables [EPREFIX/bin]
-+  --sbindir=DIR           system admin executables [EPREFIX/sbin]
-+  --libexecdir=DIR        program executables [EPREFIX/libexec]
-+  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
-+  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
-+  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
-+  --libdir=DIR            object code libraries [EPREFIX/lib]
-+  --includedir=DIR        C header files [PREFIX/include]
-+  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
-+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
-+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
-+  --infodir=DIR           info documentation [DATAROOTDIR/info]
-+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
-+  --mandir=DIR            man documentation [DATAROOTDIR/man]
-+  --docdir=DIR            documentation root [DATAROOTDIR/doc/PACKAGE]
-+  --htmldir=DIR           html documentation [DOCDIR]
-+  --dvidir=DIR            dvi documentation [DOCDIR]
-+  --pdfdir=DIR            pdf documentation [DOCDIR]
-+  --psdir=DIR             ps documentation [DOCDIR]
- _ACEOF
- 
-   cat <<\_ACEOF
-@@ -1203,6 +1283,7 @@ if test -n "$ac_init_help"; then
-   cat <<\_ACEOF
- 
- Optional Features:
-+  --disable-option-checking  ignore unrecognized --enable/--with options
-   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
-   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
-   --enable-shared[=PKGS]  build shared libraries [default=yes]
-@@ -1234,15 +1315,17 @@ fi
- if test "$ac_init_help" = "recursive"; then
-   # If there are subdirs, report their specific --help.
-   for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
--    test -d "$ac_dir" || continue
-+    test -d "$ac_dir" ||
-+      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
-+      continue
-     ac_builddir=.
- 
- case "$ac_dir" in
- .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
- *)
--  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
-+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
-   # A ".." for each directory in $ac_dir_suffix.
--  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
-+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
-   case $ac_top_builddir_sub in
-   "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
-   *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
-@@ -1278,7 +1361,7 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_
-       echo &&
-       $SHELL "$ac_srcdir/configure" --help=recursive
-     else
--      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
-+      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
-     fi || ac_status=$?
-     cd "$ac_pwd" || { ac_status=$?; break; }
-   done
-@@ -1288,10 +1371,10 @@ test -n "$ac_init_help" && exit $ac_stat
- if $ac_init_version; then
-   cat <<\_ACEOF
- configure
--generated by GNU Autoconf 2.61
-+generated by GNU Autoconf 2.63
- 
- Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
--2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
-+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
- This configure script is free software; the Free Software Foundation
- gives unlimited permission to copy, distribute and modify it.
- _ACEOF
-@@ -1302,7 +1385,7 @@ This file contains any messages produced
- running configure, to aid debugging if configure makes a mistake.
- 
- It was created by $as_me, which was
--generated by GNU Autoconf 2.61.  Invocation command line was
-+generated by GNU Autoconf 2.63.  Invocation command line was
- 
-   $ $0 $@
- 
-@@ -1338,7 +1421,7 @@ for as_dir in $PATH
- do
-   IFS=$as_save_IFS
-   test -z "$as_dir" && as_dir=.
--  echo "PATH: $as_dir"
-+  $as_echo "PATH: $as_dir"
- done
- IFS=$as_save_IFS
- 
-@@ -1373,7 +1456,7 @@ do
-     | -silent | --silent | --silen | --sile | --sil)
-       continue ;;
-     *\'*)
--      ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
-+      ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
-     esac
-     case $ac_pass in
-     1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
-@@ -1425,11 +1508,12 @@ _ASBOX
-     case $ac_val in #(
-     *${as_nl}*)
-       case $ac_var in #(
--      *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
--echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
-+      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
-+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
-       esac
-       case $ac_var in #(
-       _ | IFS | as_nl) ;; #(
-+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
-       *) $as_unset $ac_var ;;
-       esac ;;
-     esac
-@@ -1459,9 +1543,9 @@ _ASBOX
-     do
-       eval ac_val=\$$ac_var
-       case $ac_val in
--      *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
-+      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
-       esac
--      echo "$ac_var='\''$ac_val'\''"
-+      $as_echo "$ac_var='\''$ac_val'\''"
-     done | sort
-     echo
- 
-@@ -1476,9 +1560,9 @@ _ASBOX
-       do
- 	eval ac_val=\$$ac_var
- 	case $ac_val in
--	*\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
-+	*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
- 	esac
--	echo "$ac_var='\''$ac_val'\''"
-+	$as_echo "$ac_var='\''$ac_val'\''"
-       done | sort
-       echo
-     fi
-@@ -1494,8 +1578,8 @@ _ASBOX
-       echo
-     fi
-     test "$ac_signal" != 0 &&
--      echo "$as_me: caught signal $ac_signal"
--    echo "$as_me: exit $exit_status"
-+      $as_echo "$as_me: caught signal $ac_signal"
-+    $as_echo "$as_me: exit $exit_status"
-   } >&5
-   rm -f core *.core core.conftest.* &&
-     rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
-@@ -1537,21 +1621,24 @@ _ACEOF
- 
- 
- # Let the site file select an alternate cache file if it wants to.
--# Prefer explicitly selected file to automatically selected ones.
-+# Prefer an explicitly selected file to automatically selected ones.
-+ac_site_file1=NONE
-+ac_site_file2=NONE
- if test -n "$CONFIG_SITE"; then
--  set x "$CONFIG_SITE"
-+  ac_site_file1=$CONFIG_SITE
- elif test "x$prefix" != xNONE; then
--  set x "$prefix/share/config.site" "$prefix/etc/config.site"
-+  ac_site_file1=$prefix/share/config.site
-+  ac_site_file2=$prefix/etc/config.site
- else
--  set x "$ac_default_prefix/share/config.site" \
--	"$ac_default_prefix/etc/config.site"
-+  ac_site_file1=$ac_default_prefix/share/config.site
-+  ac_site_file2=$ac_default_prefix/etc/config.site
- fi
--shift
--for ac_site_file
-+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
- do
-+  test "x$ac_site_file" = xNONE && continue
-   if test -r "$ac_site_file"; then
--    { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
--echo "$as_me: loading site script $ac_site_file" >&6;}
-+    { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
-+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
-     sed 's/^/| /' "$ac_site_file" >&5
-     . "$ac_site_file"
-   fi
-@@ -1561,16 +1648,16 @@ if test -r "$cache_file"; then
-   # Some versions of bash will fail to source /dev/null (special
-   # files actually), so we avoid doing that.
-   if test -f "$cache_file"; then
--    { echo "$as_me:$LINENO: loading cache $cache_file" >&5
--echo "$as_me: loading cache $cache_file" >&6;}
-+    { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5
-+$as_echo "$as_me: loading cache $cache_file" >&6;}
-     case $cache_file in
-       [\\/]* | ?:[\\/]* ) . "$cache_file";;
-       *)                      . "./$cache_file";;
-     esac
-   fi
- else
--  { echo "$as_me:$LINENO: creating cache $cache_file" >&5
--echo "$as_me: creating cache $cache_file" >&6;}
-+  { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5
-+$as_echo "$as_me: creating cache $cache_file" >&6;}
-   >$cache_file
- fi
- 
-@@ -1584,29 +1671,38 @@ for ac_var in $ac_precious_vars; do
-   eval ac_new_val=\$ac_env_${ac_var}_value
-   case $ac_old_set,$ac_new_set in
-     set,)
--      { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
--echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
-+      { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
-       ac_cache_corrupted=: ;;
-     ,set)
--      { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
--echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
-+      { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
-+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
-       ac_cache_corrupted=: ;;
-     ,);;
-     *)
-       if test "x$ac_old_val" != "x$ac_new_val"; then
--	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
--echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
--	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
--echo "$as_me:   former value:  $ac_old_val" >&2;}
--	{ echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
--echo "$as_me:   current value: $ac_new_val" >&2;}
--	ac_cache_corrupted=:
-+	# differences in whitespace do not lead to failure.
-+	ac_old_val_w=`echo x $ac_old_val`
-+	ac_new_val_w=`echo x $ac_new_val`
-+	if test "$ac_old_val_w" != "$ac_new_val_w"; then
-+	  { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
-+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
-+	  ac_cache_corrupted=:
-+	else
-+	  { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
-+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
-+	  eval $ac_var=\$ac_old_val
-+	fi
-+	{ $as_echo "$as_me:$LINENO:   former value:  \`$ac_old_val'" >&5
-+$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
-+	{ $as_echo "$as_me:$LINENO:   current value: \`$ac_new_val'" >&5
-+$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
-       fi;;
-   esac
-   # Pass precious variables to config.status.
-   if test "$ac_new_set" = set; then
-     case $ac_new_val in
--    *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
-+    *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
-     *) ac_arg=$ac_var=$ac_new_val ;;
-     esac
-     case " $ac_configure_args " in
-@@ -1616,10 +1712,12 @@ echo "$as_me:   current value: $ac_new_v
-   fi
- done
- if $ac_cache_corrupted; then
--  { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
--echo "$as_me: error: changes in the environment can compromise the build" >&2;}
--  { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
--echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
-+  { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-+  { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
-+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
-+  { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
-+$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
-    { (exit 1); exit 1; }; }
- fi
- 
-@@ -1662,10 +1760,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
- if test -n "$ac_tool_prefix"; then
-   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
- set dummy ${ac_tool_prefix}gcc; ac_word=$2
--{ echo "$as_me:$LINENO: checking for $ac_word" >&5
--echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-+$as_echo_n "checking for $ac_word... " >&6; }
- if test "${ac_cv_prog_CC+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
-+  $as_echo_n "(cached) " >&6
- else
-   if test -n "$CC"; then
-   ac_cv_prog_CC="$CC" # Let the user override the test.
-@@ -1678,7 +1776,7 @@ do
-   for ac_exec_ext in '' $ac_executable_extensions; do
-   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-     ac_cv_prog_CC="${ac_tool_prefix}gcc"
--    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-     break 2
-   fi
- done
-@@ -1689,11 +1787,11 @@ fi
- fi
- CC=$ac_cv_prog_CC
- if test -n "$CC"; then
--  { echo "$as_me:$LINENO: result: $CC" >&5
--echo "${ECHO_T}$CC" >&6; }
-+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
-+$as_echo "$CC" >&6; }
- else
--  { echo "$as_me:$LINENO: result: no" >&5
--echo "${ECHO_T}no" >&6; }
-+  { $as_echo "$as_me:$LINENO: result: no" >&5
-+$as_echo "no" >&6; }
- fi
- 
- 
-@@ -1702,10 +1800,10 @@ if test -z "$ac_cv_prog_CC"; then
-   ac_ct_CC=$CC
-   # Extract the first word of "gcc", so it can be a program name with args.
- set dummy gcc; ac_word=$2
--{ echo "$as_me:$LINENO: checking for $ac_word" >&5
--echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-+$as_echo_n "checking for $ac_word... " >&6; }
- if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
-+  $as_echo_n "(cached) " >&6
- else
-   if test -n "$ac_ct_CC"; then
-   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-@@ -1718,7 +1816,7 @@ do
-   for ac_exec_ext in '' $ac_executable_extensions; do
-   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-     ac_cv_prog_ac_ct_CC="gcc"
--    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-     break 2
-   fi
- done
-@@ -1729,11 +1827,11 @@ fi
- fi
- ac_ct_CC=$ac_cv_prog_ac_ct_CC
- if test -n "$ac_ct_CC"; then
--  { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
--echo "${ECHO_T}$ac_ct_CC" >&6; }
-+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-+$as_echo "$ac_ct_CC" >&6; }
- else
--  { echo "$as_me:$LINENO: result: no" >&5
--echo "${ECHO_T}no" >&6; }
-+  { $as_echo "$as_me:$LINENO: result: no" >&5
-+$as_echo "no" >&6; }
- fi
- 
-   if test "x$ac_ct_CC" = x; then
-@@ -1741,12 +1839,8 @@ fi
-   else
-     case $cross_compiling:$ac_tool_warned in
- yes:)
--{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
--whose name does not start with the host triplet.  If you think this
--configuration is useful to you, please write to autoconf@gnu.org." >&5
--echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
--whose name does not start with the host triplet.  If you think this
--configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
-+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
- ac_tool_warned=yes ;;
- esac
-     CC=$ac_ct_CC
-@@ -1759,10 +1853,10 @@ if test -z "$CC"; then
-           if test -n "$ac_tool_prefix"; then
-     # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
- set dummy ${ac_tool_prefix}cc; ac_word=$2
--{ echo "$as_me:$LINENO: checking for $ac_word" >&5
--echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-+$as_echo_n "checking for $ac_word... " >&6; }
- if test "${ac_cv_prog_CC+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
-+  $as_echo_n "(cached) " >&6
- else
-   if test -n "$CC"; then
-   ac_cv_prog_CC="$CC" # Let the user override the test.
-@@ -1775,7 +1869,7 @@ do
-   for ac_exec_ext in '' $ac_executable_extensions; do
-   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-     ac_cv_prog_CC="${ac_tool_prefix}cc"
--    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-     break 2
-   fi
- done
-@@ -1786,11 +1880,11 @@ fi
- fi
- CC=$ac_cv_prog_CC
- if test -n "$CC"; then
--  { echo "$as_me:$LINENO: result: $CC" >&5
--echo "${ECHO_T}$CC" >&6; }
-+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
-+$as_echo "$CC" >&6; }
- else
--  { echo "$as_me:$LINENO: result: no" >&5
--echo "${ECHO_T}no" >&6; }
-+  { $as_echo "$as_me:$LINENO: result: no" >&5
-+$as_echo "no" >&6; }
- fi
- 
- 
-@@ -1799,10 +1893,10 @@ fi
- if test -z "$CC"; then
-   # Extract the first word of "cc", so it can be a program name with args.
- set dummy cc; ac_word=$2
--{ echo "$as_me:$LINENO: checking for $ac_word" >&5
--echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-+$as_echo_n "checking for $ac_word... " >&6; }
- if test "${ac_cv_prog_CC+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
-+  $as_echo_n "(cached) " >&6
- else
-   if test -n "$CC"; then
-   ac_cv_prog_CC="$CC" # Let the user override the test.
-@@ -1820,7 +1914,7 @@ do
-        continue
-      fi
-     ac_cv_prog_CC="cc"
--    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-     break 2
-   fi
- done
-@@ -1843,11 +1937,11 @@ fi
- fi
- CC=$ac_cv_prog_CC
- if test -n "$CC"; then
--  { echo "$as_me:$LINENO: result: $CC" >&5
--echo "${ECHO_T}$CC" >&6; }
-+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
-+$as_echo "$CC" >&6; }
- else
--  { echo "$as_me:$LINENO: result: no" >&5
--echo "${ECHO_T}no" >&6; }
-+  { $as_echo "$as_me:$LINENO: result: no" >&5
-+$as_echo "no" >&6; }
- fi
- 
- 
-@@ -1858,10 +1952,10 @@ if test -z "$CC"; then
-   do
-     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
- set dummy $ac_tool_prefix$ac_prog; ac_word=$2
--{ echo "$as_me:$LINENO: checking for $ac_word" >&5
--echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-+$as_echo_n "checking for $ac_word... " >&6; }
- if test "${ac_cv_prog_CC+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
-+  $as_echo_n "(cached) " >&6
- else
-   if test -n "$CC"; then
-   ac_cv_prog_CC="$CC" # Let the user override the test.
-@@ -1874,7 +1968,7 @@ do
-   for ac_exec_ext in '' $ac_executable_extensions; do
-   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
--    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-     break 2
-   fi
- done
-@@ -1885,11 +1979,11 @@ fi
- fi
- CC=$ac_cv_prog_CC
- if test -n "$CC"; then
--  { echo "$as_me:$LINENO: result: $CC" >&5
--echo "${ECHO_T}$CC" >&6; }
-+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
-+$as_echo "$CC" >&6; }
- else
--  { echo "$as_me:$LINENO: result: no" >&5
--echo "${ECHO_T}no" >&6; }
-+  { $as_echo "$as_me:$LINENO: result: no" >&5
-+$as_echo "no" >&6; }
- fi
- 
- 
-@@ -1902,10 +1996,10 @@ if test -z "$CC"; then
- do
-   # Extract the first word of "$ac_prog", so it can be a program name with args.
- set dummy $ac_prog; ac_word=$2
--{ echo "$as_me:$LINENO: checking for $ac_word" >&5
--echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-+$as_echo_n "checking for $ac_word... " >&6; }
- if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
-+  $as_echo_n "(cached) " >&6
- else
-   if test -n "$ac_ct_CC"; then
-   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-@@ -1918,7 +2012,7 @@ do
-   for ac_exec_ext in '' $ac_executable_extensions; do
-   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-     ac_cv_prog_ac_ct_CC="$ac_prog"
--    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-     break 2
-   fi
- done
-@@ -1929,11 +2023,11 @@ fi
- fi
- ac_ct_CC=$ac_cv_prog_ac_ct_CC
- if test -n "$ac_ct_CC"; then
--  { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
--echo "${ECHO_T}$ac_ct_CC" >&6; }
-+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-+$as_echo "$ac_ct_CC" >&6; }
- else
--  { echo "$as_me:$LINENO: result: no" >&5
--echo "${ECHO_T}no" >&6; }
-+  { $as_echo "$as_me:$LINENO: result: no" >&5
-+$as_echo "no" >&6; }
- fi
- 
- 
-@@ -1945,12 +2039,8 @@ done
-   else
-     case $cross_compiling:$ac_tool_warned in
- yes:)
--{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
--whose name does not start with the host triplet.  If you think this
--configuration is useful to you, please write to autoconf@gnu.org." >&5
--echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
--whose name does not start with the host triplet.  If you think this
--configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
-+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
- ac_tool_warned=yes ;;
- esac
-     CC=$ac_ct_CC
-@@ -1960,44 +2050,50 @@ fi
- fi
- 
- 
--test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
-+test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-+{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
- See \`config.log' for more details." >&5
--echo "$as_me: error: no acceptable C compiler found in \$PATH
-+$as_echo "$as_me: error: no acceptable C compiler found in \$PATH
- See \`config.log' for more details." >&2;}
--   { (exit 1); exit 1; }; }
-+   { (exit 1); exit 1; }; }; }
- 
- # Provide some information about the compiler.
--echo "$as_me:$LINENO: checking for C compiler version" >&5
--ac_compiler=`set X $ac_compile; echo $2`
-+$as_echo "$as_me:$LINENO: checking for C compiler version" >&5
-+set X $ac_compile
-+ac_compiler=$2
- { (ac_try="$ac_compiler --version >&5"
- case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-   (eval "$ac_compiler --version >&5") 2>&5
-   ac_status=$?
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); }
- { (ac_try="$ac_compiler -v >&5"
- case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-   (eval "$ac_compiler -v >&5") 2>&5
-   ac_status=$?
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); }
- { (ac_try="$ac_compiler -V >&5"
- case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-   (eval "$ac_compiler -V >&5") 2>&5
-   ac_status=$?
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); }
- 
- cat >conftest.$ac_ext <<_ACEOF
-@@ -2016,27 +2112,22 @@ main ()
- }
- _ACEOF
- ac_clean_files_save=$ac_clean_files
--ac_clean_files="$ac_clean_files a.out a.exe b.out"
-+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
- # Try to create an executable without -o first, disregard a.out.
- # It will help us diagnose broken compilers, and finding out an intuition
- # of exeext.
--{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
--echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; }
--ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
--#
--# List of possible output files, starting from the most likely.
--# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
--# only as a last resort.  b.out is created by i960 compilers.
--ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
--#
--# The IRIX 6 linker writes into existing files which may not be
--# executable, retaining their permissions.  Remove them first so a
--# subsequent execution test works.
-+{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
-+$as_echo_n "checking for C compiler default output file name... " >&6; }
-+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-+
-+# The possible output files:
-+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
-+
- ac_rmfiles=
- for ac_file in $ac_files
- do
-   case $ac_file in
--    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
-+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
-     * ) ac_rmfiles="$ac_rmfiles $ac_file";;
-   esac
- done
-@@ -2047,10 +2138,11 @@ case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-   (eval "$ac_link_default") 2>&5
-   ac_status=$?
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); }; then
-   # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
- # So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
-@@ -2061,7 +2153,7 @@ for ac_file in $ac_files ''
- do
-   test -f "$ac_file" || continue
-   case $ac_file in
--    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj )
-+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
- 	;;
-     [ab].out )
- 	# We found the default executable, but exeext='' is most
-@@ -2088,25 +2180,27 @@ else
-   ac_file=''
- fi
- 
--{ echo "$as_me:$LINENO: result: $ac_file" >&5
--echo "${ECHO_T}$ac_file" >&6; }
-+{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5
-+$as_echo "$ac_file" >&6; }
- if test -z "$ac_file"; then
--  echo "$as_me: failed program was:" >&5
-+  $as_echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
- 
--{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
-+{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-+{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables
- See \`config.log' for more details." >&5
--echo "$as_me: error: C compiler cannot create executables
-+$as_echo "$as_me: error: C compiler cannot create executables
- See \`config.log' for more details." >&2;}
--   { (exit 77); exit 77; }; }
-+   { (exit 77); exit 77; }; }; }
- fi
- 
- ac_exeext=$ac_cv_exeext
- 
- # Check that the compiler produces executables we can run.  If not, either
- # the compiler is broken, or we cross compile.
--{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5
--echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; }
-+{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5
-+$as_echo_n "checking whether the C compiler works... " >&6; }
- # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
- # If not cross compiling, check that we can run a simple program.
- if test "$cross_compiling" != yes; then
-@@ -2115,49 +2209,53 @@ if test "$cross_compiling" != yes; then
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-   (eval "$ac_try") 2>&5
-   ac_status=$?
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); }; }; then
-     cross_compiling=no
-   else
-     if test "$cross_compiling" = maybe; then
- 	cross_compiling=yes
-     else
--	{ { echo "$as_me:$LINENO: error: cannot run C compiled programs.
-+	{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-+{ { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs.
- If you meant to cross compile, use \`--host'.
- See \`config.log' for more details." >&5
--echo "$as_me: error: cannot run C compiled programs.
-+$as_echo "$as_me: error: cannot run C compiled programs.
- If you meant to cross compile, use \`--host'.
- See \`config.log' for more details." >&2;}
--   { (exit 1); exit 1; }; }
-+   { (exit 1); exit 1; }; }; }
-     fi
-   fi
- fi
--{ echo "$as_me:$LINENO: result: yes" >&5
--echo "${ECHO_T}yes" >&6; }
-+{ $as_echo "$as_me:$LINENO: result: yes" >&5
-+$as_echo "yes" >&6; }
- 
--rm -f a.out a.exe conftest$ac_cv_exeext b.out
-+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
- ac_clean_files=$ac_clean_files_save
- # Check that the compiler produces executables we can run.  If not, either
- # the compiler is broken, or we cross compile.
--{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
--echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; }
--{ echo "$as_me:$LINENO: result: $cross_compiling" >&5
--echo "${ECHO_T}$cross_compiling" >&6; }
-+{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
-+$as_echo_n "checking whether we are cross compiling... " >&6; }
-+{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5
-+$as_echo "$cross_compiling" >&6; }
- 
--{ echo "$as_me:$LINENO: checking for suffix of executables" >&5
--echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; }
-+{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5
-+$as_echo_n "checking for suffix of executables... " >&6; }
- if { (ac_try="$ac_link"
- case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-   (eval "$ac_link") 2>&5
-   ac_status=$?
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); }; then
-   # If both `conftest.exe' and `conftest' are `present' (well, observable)
- # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
-@@ -2166,31 +2264,33 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec
- for ac_file in conftest.exe conftest conftest.*; do
-   test -f "$ac_file" || continue
-   case $ac_file in
--    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
-+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
-     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- 	  break;;
-     * ) break;;
-   esac
- done
- else
--  { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
-+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-+{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
- See \`config.log' for more details." >&5
--echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
-+$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
- See \`config.log' for more details." >&2;}
--   { (exit 1); exit 1; }; }
-+   { (exit 1); exit 1; }; }; }
- fi
- 
- rm -f conftest$ac_cv_exeext
--{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
--echo "${ECHO_T}$ac_cv_exeext" >&6; }
-+{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
-+$as_echo "$ac_cv_exeext" >&6; }
- 
- rm -f conftest.$ac_ext
- EXEEXT=$ac_cv_exeext
- ac_exeext=$EXEEXT
--{ echo "$as_me:$LINENO: checking for suffix of object files" >&5
--echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; }
-+{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5
-+$as_echo_n "checking for suffix of object files... " >&6; }
- if test "${ac_cv_objext+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
-+  $as_echo_n "(cached) " >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
-@@ -2213,40 +2313,43 @@ case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-   (eval "$ac_compile") 2>&5
-   ac_status=$?
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); }; then
-   for ac_file in conftest.o conftest.obj conftest.*; do
-   test -f "$ac_file" || continue;
-   case $ac_file in
--    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;;
-+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
-     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
-        break;;
-   esac
- done
- else
--  echo "$as_me: failed program was:" >&5
-+  $as_echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
- 
--{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
-+{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-+{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
- See \`config.log' for more details." >&5
--echo "$as_me: error: cannot compute suffix of object files: cannot compile
-+$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile
- See \`config.log' for more details." >&2;}
--   { (exit 1); exit 1; }; }
-+   { (exit 1); exit 1; }; }; }
- fi
- 
- rm -f conftest.$ac_cv_objext conftest.$ac_ext
- fi
--{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
--echo "${ECHO_T}$ac_cv_objext" >&6; }
-+{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
-+$as_echo "$ac_cv_objext" >&6; }
- OBJEXT=$ac_cv_objext
- ac_objext=$OBJEXT
--{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
--echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; }
-+{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
-+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
- if test "${ac_cv_c_compiler_gnu+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
-+  $as_echo_n "(cached) " >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
-@@ -2272,20 +2375,21 @@ case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-   (eval "$ac_compile") 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } && {
- 	 test -z "$ac_c_werror_flag" ||
- 	 test ! -s conftest.err
-        } && test -s conftest.$ac_objext; then
-   ac_compiler_gnu=yes
- else
--  echo "$as_me: failed program was:" >&5
-+  $as_echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
- 
- 	ac_compiler_gnu=no
-@@ -2295,15 +2399,19 @@ rm -f core conftest.err conftest.$ac_obj
- ac_cv_c_compiler_gnu=$ac_compiler_gnu
- 
- fi
--{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
--echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; }
--GCC=`test $ac_compiler_gnu = yes && echo yes`
-+{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
-+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
-+if test $ac_compiler_gnu = yes; then
-+  GCC=yes
-+else
-+  GCC=
-+fi
- ac_test_CFLAGS=${CFLAGS+set}
- ac_save_CFLAGS=$CFLAGS
--{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
--echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; }
-+{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
-+$as_echo_n "checking whether $CC accepts -g... " >&6; }
- if test "${ac_cv_prog_cc_g+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
-+  $as_echo_n "(cached) " >&6
- else
-   ac_save_c_werror_flag=$ac_c_werror_flag
-    ac_c_werror_flag=yes
-@@ -2330,20 +2438,21 @@ case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-   (eval "$ac_compile") 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } && {
- 	 test -z "$ac_c_werror_flag" ||
- 	 test ! -s conftest.err
-        } && test -s conftest.$ac_objext; then
-   ac_cv_prog_cc_g=yes
- else
--  echo "$as_me: failed program was:" >&5
-+  $as_echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
- 
- 	CFLAGS=""
-@@ -2368,20 +2477,21 @@ case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-   (eval "$ac_compile") 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } && {
- 	 test -z "$ac_c_werror_flag" ||
- 	 test ! -s conftest.err
-        } && test -s conftest.$ac_objext; then
-   :
- else
--  echo "$as_me: failed program was:" >&5
-+  $as_echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
- 
- 	ac_c_werror_flag=$ac_save_c_werror_flag
-@@ -2407,20 +2517,21 @@ case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-   (eval "$ac_compile") 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } && {
- 	 test -z "$ac_c_werror_flag" ||
- 	 test ! -s conftest.err
-        } && test -s conftest.$ac_objext; then
-   ac_cv_prog_cc_g=yes
- else
--  echo "$as_me: failed program was:" >&5
-+  $as_echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
- 
- 
-@@ -2435,8 +2546,8 @@ fi
- rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    ac_c_werror_flag=$ac_save_c_werror_flag
- fi
--{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
--echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; }
-+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
-+$as_echo "$ac_cv_prog_cc_g" >&6; }
- if test "$ac_test_CFLAGS" = set; then
-   CFLAGS=$ac_save_CFLAGS
- elif test $ac_cv_prog_cc_g = yes; then
-@@ -2452,10 +2563,10 @@ else
-     CFLAGS=
-   fi
- fi
--{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
--echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }
-+{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
-+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
- if test "${ac_cv_prog_cc_c89+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
-+  $as_echo_n "(cached) " >&6
- else
-   ac_cv_prog_cc_c89=no
- ac_save_CC=$CC
-@@ -2526,20 +2637,21 @@ case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-   (eval "$ac_compile") 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } && {
- 	 test -z "$ac_c_werror_flag" ||
- 	 test ! -s conftest.err
-        } && test -s conftest.$ac_objext; then
-   ac_cv_prog_cc_c89=$ac_arg
- else
--  echo "$as_me: failed program was:" >&5
-+  $as_echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
- 
- 
-@@ -2555,15 +2667,15 @@ fi
- # AC_CACHE_VAL
- case "x$ac_cv_prog_cc_c89" in
-   x)
--    { echo "$as_me:$LINENO: result: none needed" >&5
--echo "${ECHO_T}none needed" >&6; } ;;
-+    { $as_echo "$as_me:$LINENO: result: none needed" >&5
-+$as_echo "none needed" >&6; } ;;
-   xno)
--    { echo "$as_me:$LINENO: result: unsupported" >&5
--echo "${ECHO_T}unsupported" >&6; } ;;
-+    { $as_echo "$as_me:$LINENO: result: unsupported" >&5
-+$as_echo "unsupported" >&6; } ;;
-   *)
-     CC="$CC $ac_cv_prog_cc_c89"
--    { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
--echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
-+    { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
-+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
- esac
- 
- 
-@@ -2581,8 +2693,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
- if test "${with_rlm_ldap_lib_dir+set}" = set; then
-   withval=$with_rlm_ldap_lib_dir;  case "$withval" in
- 	    no)
--		{ { echo "$as_me:$LINENO: error: Need rlm-ldap-lib-dir" >&5
--echo "$as_me: error: Need rlm-ldap-lib-dir" >&2;}
-+		{ { $as_echo "$as_me:$LINENO: error: Need rlm-ldap-lib-dir" >&5
-+$as_echo "$as_me: error: Need rlm-ldap-lib-dir" >&2;}
-    { (exit 1); exit 1; }; }
- 		;;
- 	    yes)
-@@ -2601,8 +2713,8 @@ fi
- if test "${with_rlm_ldap_include_dir+set}" = set; then
-   withval=$with_rlm_ldap_include_dir;  case "$withval" in
- 	    no)
--		{ { echo "$as_me:$LINENO: error: Need rlm-ldap-include-dir" >&5
--echo "$as_me: error: Need rlm-ldap-include-dir" >&2;}
-+		{ { $as_echo "$as_me:$LINENO: error: Need rlm-ldap-include-dir" >&5
-+$as_echo "$as_me: error: Need rlm-ldap-include-dir" >&2;}
-    { (exit 1); exit 1; }; }
- 		;;
- 	    yes)
-@@ -2641,8 +2753,8 @@ fi
- 
- 
- 				if test "x$enable_shared" = "xno"; then
--		{ echo "$as_me:$LINENO: WARNING: Static linking with libldap will probably result in unresolved symbols." >&5
--echo "$as_me: WARNING: Static linking with libldap will probably result in unresolved symbols." >&2;}
-+		{ $as_echo "$as_me:$LINENO: WARNING: Static linking with libldap will probably result in unresolved symbols." >&5
-+$as_echo "$as_me: WARNING: Static linking with libldap will probably result in unresolved symbols." >&2;}
- 	fi
- 
- 		rlm_ldap_with_threads=yes
-@@ -2661,10 +2773,10 @@ fi
- 
- 
- 			if test "x$rlm_ldap_with_threads" = "xyes"; then
--	    { echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5
--echo $ECHO_N "checking for pthread_create in -lpthread... $ECHO_C" >&6; }
-+	    { $as_echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5
-+$as_echo_n "checking for pthread_create in -lpthread... " >&6; }
- if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
-+  $as_echo_n "(cached) " >&6
- else
-   ac_check_lib_save_LIBS=$LIBS
- LIBS="-lpthread  $LIBS"
-@@ -2696,39 +2808,43 @@ case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-   (eval "$ac_link") 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } && {
- 	 test -z "$ac_c_werror_flag" ||
- 	 test ! -s conftest.err
--       } && test -s conftest$ac_exeext &&
--       $as_test_x conftest$ac_exeext; then
-+       } && test -s conftest$ac_exeext && {
-+	 test "$cross_compiling" = yes ||
-+	 $as_test_x conftest$ac_exeext
-+       }; then
-   ac_cv_lib_pthread_pthread_create=yes
- else
--  echo "$as_me: failed program was:" >&5
-+  $as_echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
- 
- 	ac_cv_lib_pthread_pthread_create=no
- fi
- 
-+rm -rf conftest.dSYM
- rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-       conftest$ac_exeext conftest.$ac_ext
- LIBS=$ac_check_lib_save_LIBS
- fi
--{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5
--echo "${ECHO_T}$ac_cv_lib_pthread_pthread_create" >&6; }
--if test $ac_cv_lib_pthread_pthread_create = yes; then
-+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5
-+$as_echo "$ac_cv_lib_pthread_pthread_create" >&6; }
-+if test "x$ac_cv_lib_pthread_pthread_create" = x""yes; then
-    LIBS="-lpthread $LIBS"
- else
--  { echo "$as_me:$LINENO: checking for pthread_create in -lc_r" >&5
--echo $ECHO_N "checking for pthread_create in -lc_r... $ECHO_C" >&6; }
-+  { $as_echo "$as_me:$LINENO: checking for pthread_create in -lc_r" >&5
-+$as_echo_n "checking for pthread_create in -lc_r... " >&6; }
- if test "${ac_cv_lib_c_r_pthread_create+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
-+  $as_echo_n "(cached) " >&6
- else
-   ac_check_lib_save_LIBS=$LIBS
- LIBS="-lc_r  $LIBS"
-@@ -2761,33 +2877,37 @@ case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-   (eval "$ac_link") 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } && {
- 	 test -z "$ac_c_werror_flag" ||
- 	 test ! -s conftest.err
--       } && test -s conftest$ac_exeext &&
--       $as_test_x conftest$ac_exeext; then
-+       } && test -s conftest$ac_exeext && {
-+	 test "$cross_compiling" = yes ||
-+	 $as_test_x conftest$ac_exeext
-+       }; then
-   ac_cv_lib_c_r_pthread_create=yes
- else
--  echo "$as_me: failed program was:" >&5
-+  $as_echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
- 
- 	ac_cv_lib_c_r_pthread_create=no
- fi
- 
-+rm -rf conftest.dSYM
- rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-       conftest$ac_exeext conftest.$ac_ext
- LIBS=$ac_check_lib_save_LIBS
- fi
--{ echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_create" >&5
--echo "${ECHO_T}$ac_cv_lib_c_r_pthread_create" >&6; }
--if test $ac_cv_lib_c_r_pthread_create = yes; then
-+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_create" >&5
-+$as_echo "$ac_cv_lib_c_r_pthread_create" >&6; }
-+if test "x$ac_cv_lib_c_r_pthread_create" = x""yes; then
-    LIBS="-lc_r $LIBS"
- else
-    rlm_ldap_with_threads="no"
-@@ -2799,14 +2919,12 @@ fi
- 
- 	fi
- 
--				smart_try_dir=$rlm_ldap_lib_dir
--	if test "x$rlm_ldap_with_threads" = "xyes"; then
- 
- 
--sm_lib_safe=`echo "ldap_r" | sed 'y%./+-%__p_%'`
--sm_func_safe=`echo "ldap_init" | sed 'y%./+-%__p_%'`
--{ echo "$as_me:$LINENO: checking for ldap_init in -lldap_r" >&5
--echo $ECHO_N "checking for ldap_init in -lldap_r... $ECHO_C" >&6; }
-+sm_lib_safe=`echo "sasl" | sed 'y%./+-%__p_%'`
-+sm_func_safe=`echo "sasl_encode" | sed 'y%./+-%__p_%'`
-+{ $as_echo "$as_me:$LINENO: checking for sasl_encode in -lsasl" >&5
-+$as_echo_n "checking for sasl_encode in -lsasl... " >&6; }
- 
- old_LIBS="$LIBS"
- smart_lib=
-@@ -2814,18 +2932,18 @@ smart_lib_dir=
- 
- if test "x$smart_try_dir" != "x"; then
-   for try in $smart_try_dir; do
--    LIBS="-L$try -lldap_r $old_LIBS"
-+    LIBS="-L$try -lsasl $old_LIBS"
-     cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
--extern char ldap_init();
-+extern char sasl_encode();
- int
- main ()
- {
-- ldap_init()
-+ sasl_encode()
-   ;
-   return 0;
- }
-@@ -2836,26 +2954,30 @@ case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-   (eval "$ac_link") 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } && {
- 	 test -z "$ac_c_werror_flag" ||
- 	 test ! -s conftest.err
--       } && test -s conftest$ac_exeext &&
--       $as_test_x conftest$ac_exeext; then
--  smart_lib="-L$try -lldap_r"
-+       } && test -s conftest$ac_exeext && {
-+	 test "$cross_compiling" = yes ||
-+	 $as_test_x conftest$ac_exeext
-+       }; then
-+  smart_lib="-L$try -lsasl"
- else
--  echo "$as_me: failed program was:" >&5
-+  $as_echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
- 
- 
- fi
- 
-+rm -rf conftest.dSYM
- rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-       conftest$ac_exeext conftest.$ac_ext
-     if test "x$smart_lib" != "x"; then
-@@ -2866,18 +2988,18 @@ rm -f core conftest.err conftest.$ac_obj
- fi
- 
- if test "x$smart_lib" = "x"; then
--  LIBS="-lldap_r $old_LIBS"
-+  LIBS="-lsasl $old_LIBS"
-   cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
--extern char ldap_init();
-+extern char sasl_encode();
- int
- main ()
- {
-- ldap_init()
-+ sasl_encode()
-   ;
-   return 0;
- }
-@@ -2888,26 +3010,30 @@ case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-   (eval "$ac_link") 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } && {
- 	 test -z "$ac_c_werror_flag" ||
- 	 test ! -s conftest.err
--       } && test -s conftest$ac_exeext &&
--       $as_test_x conftest$ac_exeext; then
--  smart_lib="-lldap_r"
-+       } && test -s conftest$ac_exeext && {
-+	 test "$cross_compiling" = yes ||
-+	 $as_test_x conftest$ac_exeext
-+       }; then
-+  smart_lib="-lsasl"
- else
--  echo "$as_me: failed program was:" >&5
-+  $as_echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
- 
- 
- fi
- 
-+rm -rf conftest.dSYM
- rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-       conftest$ac_exeext conftest.$ac_ext
-   LIBS="$old_LIBS"
-@@ -2918,7 +3044,7 @@ if test "x$smart_lib" = "x"; then
- 
- if test "x$LOCATE" != "x"; then
-         DIRS=
--  file=libldap_r${libltdl_cv_shlibext}
-+  file=libsasl${libltdl_cv_shlibext}
- 
-   for x in `${LOCATE} $file 2>/dev/null`; do
-                                         base=`echo $x | sed "s%/${file}%%"`
-@@ -2945,7 +3071,7 @@ eval "smart_lib_dir=\"\$smart_lib_dir $D
- 
- if test "x$LOCATE" != "x"; then
-         DIRS=
--  file=libldap_r.a
-+  file=libsasl.a
- 
-   for x in `${LOCATE} $file 2>/dev/null`; do
-                                         base=`echo $x | sed "s%/${file}%%"`
-@@ -2970,18 +3096,18 @@ eval "smart_lib_dir=\"\$smart_lib_dir $D
- 
- 
-   for try in $smart_lib_dir /usr/local/lib /opt/lib; do
--    LIBS="-L$try -lldap_r $old_LIBS"
-+    LIBS="-L$try -lsasl $old_LIBS"
-     cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
--extern char ldap_init();
-+extern char sasl_encode();
- int
- main ()
- {
-- ldap_init()
-+ sasl_encode()
-   ;
-   return 0;
- }
-@@ -2992,26 +3118,30 @@ case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-   (eval "$ac_link") 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } && {
- 	 test -z "$ac_c_werror_flag" ||
- 	 test ! -s conftest.err
--       } && test -s conftest$ac_exeext &&
--       $as_test_x conftest$ac_exeext; then
--  smart_lib="-L$try -lldap_r"
-+       } && test -s conftest$ac_exeext && {
-+	 test "$cross_compiling" = yes ||
-+	 $as_test_x conftest$ac_exeext
-+       }; then
-+  smart_lib="-L$try -lsasl"
- else
--  echo "$as_me: failed program was:" >&5
-+  $as_echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
- 
- 
- fi
- 
-+rm -rf conftest.dSYM
- rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-       conftest$ac_exeext conftest.$ac_ext
-     if test "x$smart_lib" != "x"; then
-@@ -3022,26 +3152,22 @@ rm -f core conftest.err conftest.$ac_obj
- fi
- 
- if test "x$smart_lib" != "x"; then
--  { echo "$as_me:$LINENO: result: yes" >&5
--echo "${ECHO_T}yes" >&6; }
-+  { $as_echo "$as_me:$LINENO: result: yes" >&5
-+$as_echo "yes" >&6; }
-   eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes"
-   LIBS="$smart_lib $old_LIBS"
-   SMART_LIBS="$smart_lib $SMART_LIBS"
- else
--  { echo "$as_me:$LINENO: result: no" >&5
--echo "${ECHO_T}no" >&6; }
-+  { $as_echo "$as_me:$LINENO: result: no" >&5
-+$as_echo "no" >&6; }
- fi
- 
--	    if test "x$ac_cv_lib_ldap_r_ldap_init" != "xyes"; then
--		fail="$fail libldap_r"
--	    fi
--	else
- 
- 
--sm_lib_safe=`echo "ldap" | sed 'y%./+-%__p_%'`
--sm_func_safe=`echo "ldap_init" | sed 'y%./+-%__p_%'`
--{ echo "$as_me:$LINENO: checking for ldap_init in -lldap" >&5
--echo $ECHO_N "checking for ldap_init in -lldap... $ECHO_C" >&6; }
-+sm_lib_safe=`echo "lber" | sed 'y%./+-%__p_%'`
-+sm_func_safe=`echo "ber_init" | sed 'y%./+-%__p_%'`
-+{ $as_echo "$as_me:$LINENO: checking for ber_init in -llber" >&5
-+$as_echo_n "checking for ber_init in -llber... " >&6; }
- 
- old_LIBS="$LIBS"
- smart_lib=
-@@ -3049,18 +3175,18 @@ smart_lib_dir=
- 
- if test "x$smart_try_dir" != "x"; then
-   for try in $smart_try_dir; do
--    LIBS="-L$try -lldap $old_LIBS"
-+    LIBS="-L$try -llber $old_LIBS"
-     cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
--extern char ldap_init();
-+extern char ber_init();
- int
- main ()
- {
-- ldap_init()
-+ ber_init()
-   ;
-   return 0;
- }
-@@ -3071,26 +3197,30 @@ case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-   (eval "$ac_link") 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } && {
- 	 test -z "$ac_c_werror_flag" ||
- 	 test ! -s conftest.err
--       } && test -s conftest$ac_exeext &&
--       $as_test_x conftest$ac_exeext; then
--  smart_lib="-L$try -lldap"
-+       } && test -s conftest$ac_exeext && {
-+	 test "$cross_compiling" = yes ||
-+	 $as_test_x conftest$ac_exeext
-+       }; then
-+  smart_lib="-L$try -llber"
- else
--  echo "$as_me: failed program was:" >&5
-+  $as_echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
- 
- 
- fi
- 
-+rm -rf conftest.dSYM
- rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-       conftest$ac_exeext conftest.$ac_ext
-     if test "x$smart_lib" != "x"; then
-@@ -3101,18 +3231,18 @@ rm -f core conftest.err conftest.$ac_obj
- fi
- 
- if test "x$smart_lib" = "x"; then
--  LIBS="-lldap $old_LIBS"
-+  LIBS="-llber $old_LIBS"
-   cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
--extern char ldap_init();
-+extern char ber_init();
- int
- main ()
- {
-- ldap_init()
-+ ber_init()
-   ;
-   return 0;
- }
-@@ -3123,26 +3253,30 @@ case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-   (eval "$ac_link") 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } && {
- 	 test -z "$ac_c_werror_flag" ||
- 	 test ! -s conftest.err
--       } && test -s conftest$ac_exeext &&
--       $as_test_x conftest$ac_exeext; then
--  smart_lib="-lldap"
-+       } && test -s conftest$ac_exeext && {
-+	 test "$cross_compiling" = yes ||
-+	 $as_test_x conftest$ac_exeext
-+       }; then
-+  smart_lib="-llber"
- else
--  echo "$as_me: failed program was:" >&5
-+  $as_echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
- 
- 
- fi
- 
-+rm -rf conftest.dSYM
- rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-       conftest$ac_exeext conftest.$ac_ext
-   LIBS="$old_LIBS"
-@@ -3153,7 +3287,7 @@ if test "x$smart_lib" = "x"; then
- 
- if test "x$LOCATE" != "x"; then
-         DIRS=
--  file=libldap${libltdl_cv_shlibext}
-+  file=liblber${libltdl_cv_shlibext}
- 
-   for x in `${LOCATE} $file 2>/dev/null`; do
-                                         base=`echo $x | sed "s%/${file}%%"`
-@@ -3180,7 +3314,7 @@ eval "smart_lib_dir=\"\$smart_lib_dir $D
- 
- if test "x$LOCATE" != "x"; then
-         DIRS=
--  file=libldap.a
-+  file=liblber.a
- 
-   for x in `${LOCATE} $file 2>/dev/null`; do
-                                         base=`echo $x | sed "s%/${file}%%"`
-@@ -3205,18 +3339,18 @@ eval "smart_lib_dir=\"\$smart_lib_dir $D
- 
- 
-   for try in $smart_lib_dir /usr/local/lib /opt/lib; do
--    LIBS="-L$try -lldap $old_LIBS"
-+    LIBS="-L$try -llber $old_LIBS"
-     cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
--extern char ldap_init();
-+extern char ber_init();
- int
- main ()
- {
-- ldap_init()
-+ ber_init()
-   ;
-   return 0;
- }
-@@ -3227,26 +3361,30 @@ case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-   (eval "$ac_link") 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } && {
- 	 test -z "$ac_c_werror_flag" ||
- 	 test ! -s conftest.err
--       } && test -s conftest$ac_exeext &&
--       $as_test_x conftest$ac_exeext; then
--  smart_lib="-L$try -lldap"
-+       } && test -s conftest$ac_exeext && {
-+	 test "$cross_compiling" = yes ||
-+	 $as_test_x conftest$ac_exeext
-+       }; then
-+  smart_lib="-L$try -llber"
- else
--  echo "$as_me: failed program was:" >&5
-+  $as_echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
- 
- 
- fi
- 
-+rm -rf conftest.dSYM
- rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-       conftest$ac_exeext conftest.$ac_ext
-     if test "x$smart_lib" != "x"; then
-@@ -3257,136 +3395,145 @@ rm -f core conftest.err conftest.$ac_obj
- fi
- 
- if test "x$smart_lib" != "x"; then
--  { echo "$as_me:$LINENO: result: yes" >&5
--echo "${ECHO_T}yes" >&6; }
-+  { $as_echo "$as_me:$LINENO: result: yes" >&5
-+$as_echo "yes" >&6; }
-   eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes"
-   LIBS="$smart_lib $old_LIBS"
-   SMART_LIBS="$smart_lib $SMART_LIBS"
- else
--  { echo "$as_me:$LINENO: result: no" >&5
--echo "${ECHO_T}no" >&6; }
-+  { $as_echo "$as_me:$LINENO: result: no" >&5
-+$as_echo "no" >&6; }
- fi
- 
--	    if test "x$ac_cv_lib_ldap_ldap_init" != "xyes"; then
--		fail="$fail libldap"
--	    fi
--	fi
--
- 
--	smart_try_dir=$rlm_ldap_include_dir
-+				smart_try_dir=$rlm_ldap_lib_dir
-+	if test "x$rlm_ldap_with_threads" = "xyes"; then
- 
- 
--ac_safe=`echo "ldap.h" | sed 'y%./+-%__pm%'`
--{ echo "$as_me:$LINENO: checking for ldap.h" >&5
--echo $ECHO_N "checking for ldap.h... $ECHO_C" >&6; }
-+sm_lib_safe=`echo "ldap_r" | sed 'y%./+-%__p_%'`
-+sm_func_safe=`echo "ldap_init" | sed 'y%./+-%__p_%'`
-+{ $as_echo "$as_me:$LINENO: checking for ldap_init in -lldap_r" >&5
-+$as_echo_n "checking for ldap_init in -lldap_r... " >&6; }
- 
--old_CFLAGS="$CFLAGS"
--smart_include=
--smart_include_dir=
-+old_LIBS="$LIBS"
-+smart_lib=
-+smart_lib_dir=
- 
- if test "x$smart_try_dir" != "x"; then
-   for try in $smart_try_dir; do
--    CFLAGS="$old_CFLAGS -I$try"
-+    LIBS="-L$try -lldap_r $old_LIBS"
-     cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
--
--		    #include <ldap.h>
-+extern char ldap_init();
- int
- main ()
- {
-- int a = 1;
-+ ldap_init()
-   ;
-   return 0;
- }
- _ACEOF
--rm -f conftest.$ac_objext
--if { (ac_try="$ac_compile"
-+rm -f conftest.$ac_objext conftest$ac_exeext
-+if { (ac_try="$ac_link"
- case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
--  (eval "$ac_compile") 2>conftest.er1
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-+  (eval "$ac_link") 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } && {
- 	 test -z "$ac_c_werror_flag" ||
- 	 test ! -s conftest.err
--       } && test -s conftest.$ac_objext; then
--  smart_include="-I$try"
-+       } && test -s conftest$ac_exeext && {
-+	 test "$cross_compiling" = yes ||
-+	 $as_test_x conftest$ac_exeext
-+       }; then
-+  smart_lib="-L$try -lldap_r"
- else
--  echo "$as_me: failed program was:" >&5
-+  $as_echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
- 
--	smart_include=
-+
- fi
- 
--rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
--    if test "x$smart_include" != "x"; then
-+rm -rf conftest.dSYM
-+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-+      conftest$ac_exeext conftest.$ac_ext
-+    if test "x$smart_lib" != "x"; then
-       break;
-     fi
-   done
--  CFLAGS="$old_CFLAGS"
-+  LIBS="$old_LIBS"
- fi
- 
--if test "x$smart_include" = "x"; then
-+if test "x$smart_lib" = "x"; then
-+  LIBS="-lldap_r $old_LIBS"
-   cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
--
--		  #include <ldap.h>
-+extern char ldap_init();
- int
- main ()
- {
-- int a = 1;
-+ ldap_init()
-   ;
-   return 0;
- }
- _ACEOF
--rm -f conftest.$ac_objext
--if { (ac_try="$ac_compile"
-+rm -f conftest.$ac_objext conftest$ac_exeext
-+if { (ac_try="$ac_link"
- case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
--  (eval "$ac_compile") 2>conftest.er1
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-+  (eval "$ac_link") 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } && {
- 	 test -z "$ac_c_werror_flag" ||
- 	 test ! -s conftest.err
--       } && test -s conftest.$ac_objext; then
--  smart_include=" "
-+       } && test -s conftest$ac_exeext && {
-+	 test "$cross_compiling" = yes ||
-+	 $as_test_x conftest$ac_exeext
-+       }; then
-+  smart_lib="-lldap_r"
- else
--  echo "$as_me: failed program was:" >&5
-+  $as_echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
- 
--	smart_include=
-+
- fi
- 
--rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+rm -rf conftest.dSYM
-+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-+      conftest$ac_exeext conftest.$ac_ext
-+  LIBS="$old_LIBS"
- fi
- 
--if test "x$smart_include" = "x"; then
-+if test "x$smart_lib" = "x"; then
- 
- 
- if test "x$LOCATE" != "x"; then
-         DIRS=
--  file=ldap.h
-+  file=libldap_r${libltdl_cv_shlibext}
- 
-   for x in `${LOCATE} $file 2>/dev/null`; do
-                                         base=`echo $x | sed "s%/${file}%%"`
-@@ -3400,19 +3547,505 @@ if test "x$LOCATE" != "x"; then
-       continue
-     fi
- 
--                    already=`echo \$smart_include_dir ${DIRS} | ${GREP} ${dir}`
-+                    already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}`
-     if test "x$already" = "x"; then
-       DIRS="$DIRS $dir"
-     fi
-   done
- fi
- 
--eval "smart_include_dir=\"\$smart_include_dir $DIRS\""
-+eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\""
- 
- 
--  for try in $smart_include_dir /usr/local/include /opt/include; do
--    CFLAGS="$old_CFLAGS -I$try"
--    cat >conftest.$ac_ext <<_ACEOF
-+
-+if test "x$LOCATE" != "x"; then
-+        DIRS=
-+  file=libldap_r.a
-+
-+  for x in `${LOCATE} $file 2>/dev/null`; do
-+                                        base=`echo $x | sed "s%/${file}%%"`
-+    if test "x$x" = "x$base"; then
-+      continue;
-+    fi
-+
-+    dir=`${DIRNAME} $x 2>/dev/null`
-+                exclude=`echo ${dir} | ${GREP} /home`
-+    if test "x$exclude" != "x"; then
-+      continue
-+    fi
-+
-+                    already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}`
-+    if test "x$already" = "x"; then
-+      DIRS="$DIRS $dir"
-+    fi
-+  done
-+fi
-+
-+eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\""
-+
-+
-+  for try in $smart_lib_dir /usr/local/lib /opt/lib; do
-+    LIBS="-L$try -lldap_r $old_LIBS"
-+    cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h.  */
-+extern char ldap_init();
-+int
-+main ()
-+{
-+ ldap_init()
-+  ;
-+  return 0;
-+}
-+_ACEOF
-+rm -f conftest.$ac_objext conftest$ac_exeext
-+if { (ac_try="$ac_link"
-+case "(($ac_try" in
-+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-+  *) ac_try_echo=$ac_try;;
-+esac
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-+  (eval "$ac_link") 2>conftest.er1
-+  ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } && {
-+	 test -z "$ac_c_werror_flag" ||
-+	 test ! -s conftest.err
-+       } && test -s conftest$ac_exeext && {
-+	 test "$cross_compiling" = yes ||
-+	 $as_test_x conftest$ac_exeext
-+       }; then
-+  smart_lib="-L$try -lldap_r"
-+else
-+  $as_echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
-+
-+fi
-+
-+rm -rf conftest.dSYM
-+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-+      conftest$ac_exeext conftest.$ac_ext
-+    if test "x$smart_lib" != "x"; then
-+      break;
-+    fi
-+  done
-+  LIBS="$old_LIBS"
-+fi
-+
-+if test "x$smart_lib" != "x"; then
-+  { $as_echo "$as_me:$LINENO: result: yes" >&5
-+$as_echo "yes" >&6; }
-+  eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes"
-+  LIBS="$smart_lib $old_LIBS"
-+  SMART_LIBS="$smart_lib $SMART_LIBS"
-+else
-+  { $as_echo "$as_me:$LINENO: result: no" >&5
-+$as_echo "no" >&6; }
-+fi
-+
-+	    if test "x$ac_cv_lib_ldap_r_ldap_init" != "xyes"; then
-+		fail="$fail libldap_r"
-+	    fi
-+	else
-+
-+
-+sm_lib_safe=`echo "ldap" | sed 'y%./+-%__p_%'`
-+sm_func_safe=`echo "ldap_init" | sed 'y%./+-%__p_%'`
-+{ $as_echo "$as_me:$LINENO: checking for ldap_init in -lldap" >&5
-+$as_echo_n "checking for ldap_init in -lldap... " >&6; }
-+
-+old_LIBS="$LIBS"
-+smart_lib=
-+smart_lib_dir=
-+
-+if test "x$smart_try_dir" != "x"; then
-+  for try in $smart_try_dir; do
-+    LIBS="-L$try -lldap $old_LIBS"
-+    cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h.  */
-+extern char ldap_init();
-+int
-+main ()
-+{
-+ ldap_init()
-+  ;
-+  return 0;
-+}
-+_ACEOF
-+rm -f conftest.$ac_objext conftest$ac_exeext
-+if { (ac_try="$ac_link"
-+case "(($ac_try" in
-+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-+  *) ac_try_echo=$ac_try;;
-+esac
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-+  (eval "$ac_link") 2>conftest.er1
-+  ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } && {
-+	 test -z "$ac_c_werror_flag" ||
-+	 test ! -s conftest.err
-+       } && test -s conftest$ac_exeext && {
-+	 test "$cross_compiling" = yes ||
-+	 $as_test_x conftest$ac_exeext
-+       }; then
-+  smart_lib="-L$try -lldap"
-+else
-+  $as_echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
-+
-+fi
-+
-+rm -rf conftest.dSYM
-+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-+      conftest$ac_exeext conftest.$ac_ext
-+    if test "x$smart_lib" != "x"; then
-+      break;
-+    fi
-+  done
-+  LIBS="$old_LIBS"
-+fi
-+
-+if test "x$smart_lib" = "x"; then
-+  LIBS="-lldap $old_LIBS"
-+  cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h.  */
-+extern char ldap_init();
-+int
-+main ()
-+{
-+ ldap_init()
-+  ;
-+  return 0;
-+}
-+_ACEOF
-+rm -f conftest.$ac_objext conftest$ac_exeext
-+if { (ac_try="$ac_link"
-+case "(($ac_try" in
-+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-+  *) ac_try_echo=$ac_try;;
-+esac
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-+  (eval "$ac_link") 2>conftest.er1
-+  ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } && {
-+	 test -z "$ac_c_werror_flag" ||
-+	 test ! -s conftest.err
-+       } && test -s conftest$ac_exeext && {
-+	 test "$cross_compiling" = yes ||
-+	 $as_test_x conftest$ac_exeext
-+       }; then
-+  smart_lib="-lldap"
-+else
-+  $as_echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
-+
-+fi
-+
-+rm -rf conftest.dSYM
-+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-+      conftest$ac_exeext conftest.$ac_ext
-+  LIBS="$old_LIBS"
-+fi
-+
-+if test "x$smart_lib" = "x"; then
-+
-+
-+if test "x$LOCATE" != "x"; then
-+        DIRS=
-+  file=libldap${libltdl_cv_shlibext}
-+
-+  for x in `${LOCATE} $file 2>/dev/null`; do
-+                                        base=`echo $x | sed "s%/${file}%%"`
-+    if test "x$x" = "x$base"; then
-+      continue;
-+    fi
-+
-+    dir=`${DIRNAME} $x 2>/dev/null`
-+                exclude=`echo ${dir} | ${GREP} /home`
-+    if test "x$exclude" != "x"; then
-+      continue
-+    fi
-+
-+                    already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}`
-+    if test "x$already" = "x"; then
-+      DIRS="$DIRS $dir"
-+    fi
-+  done
-+fi
-+
-+eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\""
-+
-+
-+
-+if test "x$LOCATE" != "x"; then
-+        DIRS=
-+  file=libldap.a
-+
-+  for x in `${LOCATE} $file 2>/dev/null`; do
-+                                        base=`echo $x | sed "s%/${file}%%"`
-+    if test "x$x" = "x$base"; then
-+      continue;
-+    fi
-+
-+    dir=`${DIRNAME} $x 2>/dev/null`
-+                exclude=`echo ${dir} | ${GREP} /home`
-+    if test "x$exclude" != "x"; then
-+      continue
-+    fi
-+
-+                    already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}`
-+    if test "x$already" = "x"; then
-+      DIRS="$DIRS $dir"
-+    fi
-+  done
-+fi
-+
-+eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\""
-+
-+
-+  for try in $smart_lib_dir /usr/local/lib /opt/lib; do
-+    LIBS="-L$try -lldap $old_LIBS"
-+    cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h.  */
-+extern char ldap_init();
-+int
-+main ()
-+{
-+ ldap_init()
-+  ;
-+  return 0;
-+}
-+_ACEOF
-+rm -f conftest.$ac_objext conftest$ac_exeext
-+if { (ac_try="$ac_link"
-+case "(($ac_try" in
-+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-+  *) ac_try_echo=$ac_try;;
-+esac
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-+  (eval "$ac_link") 2>conftest.er1
-+  ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } && {
-+	 test -z "$ac_c_werror_flag" ||
-+	 test ! -s conftest.err
-+       } && test -s conftest$ac_exeext && {
-+	 test "$cross_compiling" = yes ||
-+	 $as_test_x conftest$ac_exeext
-+       }; then
-+  smart_lib="-L$try -lldap"
-+else
-+  $as_echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
-+
-+fi
-+
-+rm -rf conftest.dSYM
-+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-+      conftest$ac_exeext conftest.$ac_ext
-+    if test "x$smart_lib" != "x"; then
-+      break;
-+    fi
-+  done
-+  LIBS="$old_LIBS"
-+fi
-+
-+if test "x$smart_lib" != "x"; then
-+  { $as_echo "$as_me:$LINENO: result: yes" >&5
-+$as_echo "yes" >&6; }
-+  eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes"
-+  LIBS="$smart_lib $old_LIBS"
-+  SMART_LIBS="$smart_lib $SMART_LIBS"
-+else
-+  { $as_echo "$as_me:$LINENO: result: no" >&5
-+$as_echo "no" >&6; }
-+fi
-+
-+	    if test "x$ac_cv_lib_ldap_ldap_init" != "xyes"; then
-+		fail="$fail libldap"
-+	    fi
-+	fi
-+
-+
-+	smart_try_dir=$rlm_ldap_include_dir
-+
-+
-+ac_safe=`echo "ldap.h" | sed 'y%./+-%__pm%'`
-+{ $as_echo "$as_me:$LINENO: checking for ldap.h" >&5
-+$as_echo_n "checking for ldap.h... " >&6; }
-+
-+old_CFLAGS="$CFLAGS"
-+smart_include=
-+smart_include_dir=
-+
-+if test "x$smart_try_dir" != "x"; then
-+  for try in $smart_try_dir; do
-+    CFLAGS="$old_CFLAGS -I$try"
-+    cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h.  */
-+
-+		    #include <ldap.h>
-+int
-+main ()
-+{
-+ int a = 1;
-+  ;
-+  return 0;
-+}
-+_ACEOF
-+rm -f conftest.$ac_objext
-+if { (ac_try="$ac_compile"
-+case "(($ac_try" in
-+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-+  *) ac_try_echo=$ac_try;;
-+esac
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-+  (eval "$ac_compile") 2>conftest.er1
-+  ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } && {
-+	 test -z "$ac_c_werror_flag" ||
-+	 test ! -s conftest.err
-+       } && test -s conftest.$ac_objext; then
-+  smart_include="-I$try"
-+else
-+  $as_echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
-+	smart_include=
-+fi
-+
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+    if test "x$smart_include" != "x"; then
-+      break;
-+    fi
-+  done
-+  CFLAGS="$old_CFLAGS"
-+fi
-+
-+if test "x$smart_include" = "x"; then
-+  cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h.  */
-+
-+		  #include <ldap.h>
-+int
-+main ()
-+{
-+ int a = 1;
-+  ;
-+  return 0;
-+}
-+_ACEOF
-+rm -f conftest.$ac_objext
-+if { (ac_try="$ac_compile"
-+case "(($ac_try" in
-+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-+  *) ac_try_echo=$ac_try;;
-+esac
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-+  (eval "$ac_compile") 2>conftest.er1
-+  ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } && {
-+	 test -z "$ac_c_werror_flag" ||
-+	 test ! -s conftest.err
-+       } && test -s conftest.$ac_objext; then
-+  smart_include=" "
-+else
-+  $as_echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
-+	smart_include=
-+fi
-+
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+fi
-+
-+if test "x$smart_include" = "x"; then
-+
-+
-+if test "x$LOCATE" != "x"; then
-+        DIRS=
-+  file=ldap.h
-+
-+  for x in `${LOCATE} $file 2>/dev/null`; do
-+                                        base=`echo $x | sed "s%/${file}%%"`
-+    if test "x$x" = "x$base"; then
-+      continue;
-+    fi
-+
-+    dir=`${DIRNAME} $x 2>/dev/null`
-+                exclude=`echo ${dir} | ${GREP} /home`
-+    if test "x$exclude" != "x"; then
-+      continue
-+    fi
-+
-+                    already=`echo \$smart_include_dir ${DIRS} | ${GREP} ${dir}`
-+    if test "x$already" = "x"; then
-+      DIRS="$DIRS $dir"
-+    fi
-+  done
-+fi
-+
-+eval "smart_include_dir=\"\$smart_include_dir $DIRS\""
-+
-+
-+  for try in $smart_include_dir /usr/local/include /opt/include; do
-+    CFLAGS="$old_CFLAGS -I$try"
-+    cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -3434,20 +4067,21 @@ case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-   (eval "$ac_compile") 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } && {
- 	 test -z "$ac_c_werror_flag" ||
- 	 test ! -s conftest.err
-        } && test -s conftest.$ac_objext; then
-   smart_include="-I$try"
- else
--  echo "$as_me: failed program was:" >&5
-+  $as_echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
- 
- 	smart_include=
-@@ -3462,14 +4096,14 @@ rm -f core conftest.err conftest.$ac_obj
- fi
- 
- if test "x$smart_include" != "x"; then
--  { echo "$as_me:$LINENO: result: yes" >&5
--echo "${ECHO_T}yes" >&6; }
-+  { $as_echo "$as_me:$LINENO: result: yes" >&5
-+$as_echo "yes" >&6; }
-   eval "ac_cv_header_$ac_safe=yes"
-   CFLAGS="$old_CFLAGS $smart_include"
-   SMART_CFLAGS="$SMART_CFLAGS $smart_include"
- else
--  { echo "$as_me:$LINENO: result: no" >&5
--echo "${ECHO_T}no" >&6; }
-+  { $as_echo "$as_me:$LINENO: result: no" >&5
-+$as_echo "no" >&6; }
- fi
- 
- 	if test "$ac_cv_header_ldap_h" != "yes"; then
-@@ -3478,10 +4112,10 @@ fi
- 
- 
- 	if test "x$fail" = "x"; then
--	    { echo "$as_me:$LINENO: checking for ldap_start_tls_s" >&5
--echo $ECHO_N "checking for ldap_start_tls_s... $ECHO_C" >&6; }
-+	    { $as_echo "$as_me:$LINENO: checking for ldap_start_tls_s" >&5
-+$as_echo_n "checking for ldap_start_tls_s... " >&6; }
- if test "${ac_cv_func_ldap_start_tls_s+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
-+  $as_echo_n "(cached) " >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
-@@ -3534,39 +4168,43 @@ case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-   (eval "$ac_link") 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } && {
- 	 test -z "$ac_c_werror_flag" ||
- 	 test ! -s conftest.err
--       } && test -s conftest$ac_exeext &&
--       $as_test_x conftest$ac_exeext; then
-+       } && test -s conftest$ac_exeext && {
-+	 test "$cross_compiling" = yes ||
-+	 $as_test_x conftest$ac_exeext
-+       }; then
-   ac_cv_func_ldap_start_tls_s=yes
- else
--  echo "$as_me: failed program was:" >&5
-+  $as_echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
- 
- 	ac_cv_func_ldap_start_tls_s=no
- fi
- 
-+rm -rf conftest.dSYM
- rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-       conftest$ac_exeext conftest.$ac_ext
- fi
--{ echo "$as_me:$LINENO: result: $ac_cv_func_ldap_start_tls_s" >&5
--echo "${ECHO_T}$ac_cv_func_ldap_start_tls_s" >&6; }
--if test $ac_cv_func_ldap_start_tls_s = yes; then
-+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_ldap_start_tls_s" >&5
-+$as_echo "$ac_cv_func_ldap_start_tls_s" >&6; }
-+if test "x$ac_cv_func_ldap_start_tls_s" = x""yes; then
-    SMART_CFLAGS="$SMART_CFLAGS -DHAVE_LDAP_START_TLS"
- fi
- 
--	    { echo "$as_me:$LINENO: checking for ldap_initialize" >&5
--echo $ECHO_N "checking for ldap_initialize... $ECHO_C" >&6; }
-+	    { $as_echo "$as_me:$LINENO: checking for ldap_initialize" >&5
-+$as_echo_n "checking for ldap_initialize... " >&6; }
- if test "${ac_cv_func_ldap_initialize+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
-+  $as_echo_n "(cached) " >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
-@@ -3619,39 +4257,43 @@ case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-   (eval "$ac_link") 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } && {
- 	 test -z "$ac_c_werror_flag" ||
- 	 test ! -s conftest.err
--       } && test -s conftest$ac_exeext &&
--       $as_test_x conftest$ac_exeext; then
-+       } && test -s conftest$ac_exeext && {
-+	 test "$cross_compiling" = yes ||
-+	 $as_test_x conftest$ac_exeext
-+       }; then
-   ac_cv_func_ldap_initialize=yes
- else
--  echo "$as_me: failed program was:" >&5
-+  $as_echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
- 
- 	ac_cv_func_ldap_initialize=no
- fi
- 
-+rm -rf conftest.dSYM
- rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-       conftest$ac_exeext conftest.$ac_ext
- fi
--{ echo "$as_me:$LINENO: result: $ac_cv_func_ldap_initialize" >&5
--echo "${ECHO_T}$ac_cv_func_ldap_initialize" >&6; }
--if test $ac_cv_func_ldap_initialize = yes; then
-+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_ldap_initialize" >&5
-+$as_echo "$ac_cv_func_ldap_initialize" >&6; }
-+if test "x$ac_cv_func_ldap_initialize" = x""yes; then
-    SMART_CFLAGS="$SMART_CFLAGS -DHAVE_LDAP_INITIALIZE"
- fi
- 
--	    { echo "$as_me:$LINENO: checking for ldap_int_tls_config" >&5
--echo $ECHO_N "checking for ldap_int_tls_config... $ECHO_C" >&6; }
-+	    { $as_echo "$as_me:$LINENO: checking for ldap_int_tls_config" >&5
-+$as_echo_n "checking for ldap_int_tls_config... " >&6; }
- if test "${ac_cv_func_ldap_int_tls_config+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
-+  $as_echo_n "(cached) " >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
-@@ -3704,32 +4346,36 @@ case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-   (eval "$ac_link") 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } && {
- 	 test -z "$ac_c_werror_flag" ||
- 	 test ! -s conftest.err
--       } && test -s conftest$ac_exeext &&
--       $as_test_x conftest$ac_exeext; then
-+       } && test -s conftest$ac_exeext && {
-+	 test "$cross_compiling" = yes ||
-+	 $as_test_x conftest$ac_exeext
-+       }; then
-   ac_cv_func_ldap_int_tls_config=yes
- else
--  echo "$as_me: failed program was:" >&5
-+  $as_echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
- 
- 	ac_cv_func_ldap_int_tls_config=no
- fi
- 
-+rm -rf conftest.dSYM
- rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-       conftest$ac_exeext conftest.$ac_ext
- fi
--{ echo "$as_me:$LINENO: result: $ac_cv_func_ldap_int_tls_config" >&5
--echo "${ECHO_T}$ac_cv_func_ldap_int_tls_config" >&6; }
--if test $ac_cv_func_ldap_int_tls_config = yes; then
-+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_ldap_int_tls_config" >&5
-+$as_echo "$ac_cv_func_ldap_int_tls_config" >&6; }
-+if test "x$ac_cv_func_ldap_int_tls_config" = x""yes; then
-    SMART_CFLAGS="$SMART_CFLAGS -DHAVE_LDAP_INT_TLS_CONFIG"
- fi
- 
-@@ -3738,11 +4384,11 @@ fi
- 
- for ac_func in ldap_set_rebind_proc
- do
--as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
--{ echo "$as_me:$LINENO: checking for $ac_func" >&5
--echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-+$as_echo_n "checking for $ac_func... " >&6; }
- if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
-+  $as_echo_n "(cached) " >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
-@@ -3795,44 +4441,51 @@ case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-   (eval "$ac_link") 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } && {
- 	 test -z "$ac_c_werror_flag" ||
- 	 test ! -s conftest.err
--       } && test -s conftest$ac_exeext &&
--       $as_test_x conftest$ac_exeext; then
-+       } && test -s conftest$ac_exeext && {
-+	 test "$cross_compiling" = yes ||
-+	 $as_test_x conftest$ac_exeext
-+       }; then
-   eval "$as_ac_var=yes"
- else
--  echo "$as_me: failed program was:" >&5
-+  $as_echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
- 
- 	eval "$as_ac_var=no"
- fi
- 
-+rm -rf conftest.dSYM
- rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-       conftest$ac_exeext conftest.$ac_ext
- fi
--ac_res=`eval echo '${'$as_ac_var'}'`
--	       { echo "$as_me:$LINENO: result: $ac_res" >&5
--echo "${ECHO_T}$ac_res" >&6; }
--if test `eval echo '${'$as_ac_var'}'` = yes; then
-+ac_res=`eval 'as_val=${'$as_ac_var'}
-+		 $as_echo "$as_val"'`
-+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-+$as_echo "$ac_res" >&6; }
-+as_val=`eval 'as_val=${'$as_ac_var'}
-+		 $as_echo "$as_val"'`
-+   if test "x$as_val" = x""yes; then
-   cat >>confdefs.h <<_ACEOF
--#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
- _ACEOF
- 
- fi
- done
- 
--        { echo "$as_me:$LINENO: checking whether ldap_set_rebind_proc takes 3 arguments" >&5
--echo $ECHO_N "checking whether ldap_set_rebind_proc takes 3 arguments... $ECHO_C" >&6; }
-+        { $as_echo "$as_me:$LINENO: checking whether ldap_set_rebind_proc takes 3 arguments" >&5
-+$as_echo_n "checking whether ldap_set_rebind_proc takes 3 arguments... " >&6; }
- if test "${ac_cv_ldap_set_rebind_proc+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
-+  $as_echo_n "(cached) " >&6
- else
- 
-         cat >conftest.$ac_ext <<_ACEOF
-@@ -3858,20 +4511,21 @@ case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-   (eval "$ac_compile") 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } && {
- 	 test -z "$ac_c_werror_flag" ||
- 	 test ! -s conftest.err
-        } && test -s conftest.$ac_objext; then
-   ac_cv_ldap_set_rebind_proc=3
- else
--  echo "$as_me: failed program was:" >&5
-+  $as_echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
- 
- 	ac_cv_ldap_set_rebind_proc=2
-@@ -3879,8 +4533,8 @@ fi
- 
- rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
--{ echo "$as_me:$LINENO: result: $ac_cv_ldap_set_rebind_proc" >&5
--echo "${ECHO_T}$ac_cv_ldap_set_rebind_proc" >&6; }
-+{ $as_echo "$as_me:$LINENO: result: $ac_cv_ldap_set_rebind_proc" >&5
-+$as_echo "$ac_cv_ldap_set_rebind_proc" >&6; }
- 	fi
- 
- 	targetname=rlm_ldap
-@@ -3891,21 +4545,21 @@ fi
- 
- if test x"$fail" != x""; then
- 	if test x"${enable_strict_dependencies}" = x"yes"; then
--		{ { echo "$as_me:$LINENO: error: set --without-rlm_ldap to disable it explicitly." >&5
--echo "$as_me: error: set --without-rlm_ldap to disable it explicitly." >&2;}
-+		{ { $as_echo "$as_me:$LINENO: error: set --without-rlm_ldap to disable it explicitly." >&5
-+$as_echo "$as_me: error: set --without-rlm_ldap to disable it explicitly." >&2;}
-    { (exit 1); exit 1; }; }
- 	else
--		{ echo "$as_me:$LINENO: WARNING: silently not building rlm_ldap." >&5
--echo "$as_me: WARNING: silently not building rlm_ldap." >&2;}
--		{ echo "$as_me:$LINENO: WARNING: FAILURE: rlm_ldap requires: $fail." >&5
--echo "$as_me: WARNING: FAILURE: rlm_ldap requires: $fail." >&2;}
-+		{ $as_echo "$as_me:$LINENO: WARNING: silently not building rlm_ldap." >&5
-+$as_echo "$as_me: WARNING: silently not building rlm_ldap." >&2;}
-+		{ $as_echo "$as_me:$LINENO: WARNING: FAILURE: rlm_ldap requires: $fail." >&5
-+$as_echo "$as_me: WARNING: FAILURE: rlm_ldap requires: $fail." >&2;}
- 		if test x"$headersuggestion" != x; then
--			{ echo "$as_me:$LINENO: WARNING: $headersuggestion" >&5
--echo "$as_me: WARNING: $headersuggestion" >&2;}
-+			{ $as_echo "$as_me:$LINENO: WARNING: $headersuggestion" >&5
-+$as_echo "$as_me: WARNING: $headersuggestion" >&2;}
- 		fi
- 		if test x"$libsuggestion" != x; then
--			{ echo "$as_me:$LINENO: WARNING: $libsuggestion" >&5
--echo "$as_me: WARNING: $libsuggestion" >&2;}
-+			{ $as_echo "$as_me:$LINENO: WARNING: $libsuggestion" >&5
-+$as_echo "$as_me: WARNING: $libsuggestion" >&2;}
- 		fi
- 		targetname=""
- 	fi
-@@ -3966,11 +4620,12 @@ _ACEOF
-     case $ac_val in #(
-     *${as_nl}*)
-       case $ac_var in #(
--      *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
--echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
-+      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
-+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
-       esac
-       case $ac_var in #(
-       _ | IFS | as_nl) ;; #(
-+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
-       *) $as_unset $ac_var ;;
-       esac ;;
-     esac
-@@ -4003,12 +4658,12 @@ echo "$as_me: WARNING: Cache variable $a
- if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
-   if test -w "$cache_file"; then
-     test "x$cache_file" != "x/dev/null" &&
--      { echo "$as_me:$LINENO: updating cache $cache_file" >&5
--echo "$as_me: updating cache $cache_file" >&6;}
-+      { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5
-+$as_echo "$as_me: updating cache $cache_file" >&6;}
-     cat confcache >$cache_file
-   else
--    { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
--echo "$as_me: not updating unwritable cache $cache_file" >&6;}
-+    { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
-+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
-   fi
- fi
- rm -f confcache
-@@ -4025,6 +4680,12 @@ test "x$exec_prefix" = xNONE && exec_pre
- # take arguments), then branch to the quote section.  Otherwise,
- # look for a macro that doesn't take arguments.
- ac_script='
-+:mline
-+/\\$/{
-+ N
-+ s,\\\n,,
-+ b mline
-+}
- t clear
- :clear
- s/^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 (][^	 (]*([^)]*)\)[	 ]*\(.*\)/-D\1=\2/g
-@@ -4054,7 +4715,7 @@ ac_ltlibobjs=
- for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
-   # 1. Remove the extension, and $U if already installed.
-   ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
--  ac_i=`echo "$ac_i" | sed "$ac_script"`
-+  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
-   # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
-   #    will be set to the directory where LIBOBJS objects are built.
-   ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
-@@ -4067,11 +4728,12 @@ LTLIBOBJS=$ac_ltlibobjs
- 
- 
- : ${CONFIG_STATUS=./config.status}
-+ac_write_fail=0
- ac_clean_files_save=$ac_clean_files
- ac_clean_files="$ac_clean_files $CONFIG_STATUS"
--{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
--echo "$as_me: creating $CONFIG_STATUS" >&6;}
--cat >$CONFIG_STATUS <<_ACEOF
-+{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
-+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
-+cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
- #! $SHELL
- # Generated by $as_me.
- # Run this file to recreate the current configuration.
-@@ -4084,7 +4746,7 @@ ac_cs_silent=false
- SHELL=\${CONFIG_SHELL-$SHELL}
- _ACEOF
- 
--cat >>$CONFIG_STATUS <<\_ACEOF
-+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
- ## --------------------- ##
- ## M4sh Initialization.  ##
- ## --------------------- ##
-@@ -4094,7 +4756,7 @@ DUALCASE=1; export DUALCASE # for MKS sh
- if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
-   emulate sh
-   NULLCMD=:
--  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
-+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
-   # is contrary to our usage.  Disable this feature.
-   alias -g '${1+"$@"}'='"$@"'
-   setopt NO_GLOB_SUBST
-@@ -4116,17 +4778,45 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTE
- as_cr_digits='0123456789'
- as_cr_alnum=$as_cr_Letters$as_cr_digits
- 
--# The user is always right.
--if test "${PATH_SEPARATOR+set}" != set; then
--  echo "#! /bin/sh" >conf$$.sh
--  echo  "exit 0"   >>conf$$.sh
--  chmod +x conf$$.sh
--  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
--    PATH_SEPARATOR=';'
-+as_nl='
-+'
-+export as_nl
-+# Printing a long string crashes Solaris 7 /usr/bin/printf.
-+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
-+  as_echo='printf %s\n'
-+  as_echo_n='printf %s'
-+else
-+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
-+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
-+    as_echo_n='/usr/ucb/echo -n'
-   else
--    PATH_SEPARATOR=:
-+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
-+    as_echo_n_body='eval
-+      arg=$1;
-+      case $arg in
-+      *"$as_nl"*)
-+	expr "X$arg" : "X\\(.*\\)$as_nl";
-+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
-+      esac;
-+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
-+    '
-+    export as_echo_n_body
-+    as_echo_n='sh -c $as_echo_n_body as_echo'
-   fi
--  rm -f conf$$.sh
-+  export as_echo_body
-+  as_echo='sh -c $as_echo_body as_echo'
-+fi
-+
-+# The user is always right.
-+if test "${PATH_SEPARATOR+set}" != set; then
-+  PATH_SEPARATOR=:
-+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
-+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
-+      PATH_SEPARATOR=';'
-+  }
- fi
- 
- # Support unset when possible.
-@@ -4142,8 +4832,6 @@ fi
- # there to prevent editors from complaining about space-tab.
- # (If _AS_PATH_WALK were called with IFS unset, it would disable word
- # splitting by setting IFS to empty value.)
--as_nl='
--'
- IFS=" ""	$as_nl"
- 
- # Find who we are.  Look in the path if we contain no directory separator.
-@@ -4166,7 +4854,7 @@ if test "x$as_myself" = x; then
-   as_myself=$0
- fi
- if test ! -f "$as_myself"; then
--  echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
-+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
-   { (exit 1); exit 1; }
- fi
- 
-@@ -4179,17 +4867,10 @@ PS2='> '
- PS4='+ '
- 
- # NLS nuisances.
--for as_var in \
--  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
--  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
--  LC_TELEPHONE LC_TIME
--do
--  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
--    eval $as_var=C; export $as_var
--  else
--    ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
--  fi
--done
-+LC_ALL=C
-+export LC_ALL
-+LANGUAGE=C
-+export LANGUAGE
- 
- # Required to use basename.
- if expr a : '\(a\)' >/dev/null 2>&1 &&
-@@ -4211,7 +4892,7 @@ as_me=`$as_basename -- "$0" ||
- $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- 	 X"$0" : 'X\(//\)$' \| \
- 	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
--echo X/"$0" |
-+$as_echo X/"$0" |
-     sed '/^.*\/\([^/][^/]*\)\/*$/{
- 	    s//\1/
- 	    q
-@@ -4262,7 +4943,7 @@ $as_unset CDPATH
-       s/-\n.*//
-     ' >$as_me.lineno &&
-   chmod +x "$as_me.lineno" ||
--    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
-+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
-    { (exit 1); exit 1; }; }
- 
-   # Don't try to exec as it changes $[0], causing all sort of problems
-@@ -4290,7 +4971,6 @@ case `echo -n x` in
- *)
-   ECHO_N='-n';;
- esac
--
- if expr a : '\(a\)' >/dev/null 2>&1 &&
-    test "X`expr 00001 : '.*\(...\)'`" = X001; then
-   as_expr=expr
-@@ -4303,19 +4983,22 @@ if test -d conf$$.dir; then
-   rm -f conf$$.dir/conf$$.file
- else
-   rm -f conf$$.dir
--  mkdir conf$$.dir
-+  mkdir conf$$.dir 2>/dev/null
- fi
--echo >conf$$.file
--if ln -s conf$$.file conf$$ 2>/dev/null; then
--  as_ln_s='ln -s'
--  # ... but there are two gotchas:
--  # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
--  # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
--  # In both cases, we have to default to `cp -p'.
--  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-+if (echo >conf$$.file) 2>/dev/null; then
-+  if ln -s conf$$.file conf$$ 2>/dev/null; then
-+    as_ln_s='ln -s'
-+    # ... but there are two gotchas:
-+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
-+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-+    # In both cases, we have to default to `cp -p'.
-+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-+      as_ln_s='cp -p'
-+  elif ln conf$$.file conf$$ 2>/dev/null; then
-+    as_ln_s=ln
-+  else
-     as_ln_s='cp -p'
--elif ln conf$$.file conf$$ 2>/dev/null; then
--  as_ln_s=ln
-+  fi
- else
-   as_ln_s='cp -p'
- fi
-@@ -4340,10 +5023,10 @@ else
-   as_test_x='
-     eval sh -c '\''
-       if test -d "$1"; then
--        test -d "$1/.";
-+	test -d "$1/.";
-       else
- 	case $1 in
--        -*)set "./$1";;
-+	-*)set "./$1";;
- 	esac;
- 	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
- 	???[sx]*):;;*)false;;esac;fi
-@@ -4366,7 +5049,7 @@ exec 6>&1
- # values after options handling.
- ac_log="
- This file was extended by $as_me, which was
--generated by GNU Autoconf 2.61.  Invocation command line was
-+generated by GNU Autoconf 2.63.  Invocation command line was
- 
-   CONFIG_FILES    = $CONFIG_FILES
-   CONFIG_HEADERS  = $CONFIG_HEADERS
-@@ -4379,26 +5062,33 @@ on `(hostname || uname -n) 2>/dev/null |
- 
- _ACEOF
- 
--cat >>$CONFIG_STATUS <<_ACEOF
-+case $ac_config_files in *"
-+"*) set x $ac_config_files; shift; ac_config_files=$*;;
-+esac
-+
-+
-+
-+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
- # Files that config.status was made for.
- config_files="$ac_config_files"
- 
- _ACEOF
- 
--cat >>$CONFIG_STATUS <<\_ACEOF
-+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
- ac_cs_usage="\
- \`$as_me' instantiates files from templates according to the
- current configuration.
- 
--Usage: $0 [OPTIONS] [FILE]...
-+Usage: $0 [OPTION]... [FILE]...
- 
-   -h, --help       print this help, then exit
-   -V, --version    print version number and configuration settings, then exit
--  -q, --quiet      do not print progress messages
-+  -q, --quiet, --silent
-+                   do not print progress messages
-   -d, --debug      don't remove temporary files
-       --recheck    update $as_me by reconfiguring in the same conditions
--  --file=FILE[:TEMPLATE]
--		   instantiate the configuration file FILE
-+      --file=FILE[:TEMPLATE]
-+                   instantiate the configuration file FILE
- 
- Configuration files:
- $config_files
-@@ -4406,23 +5096,23 @@ $config_files
- Report bugs to <bug-autoconf@gnu.org>."
- 
- _ACEOF
--cat >>$CONFIG_STATUS <<_ACEOF
-+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
- ac_cs_version="\\
- config.status
--configured by $0, generated by GNU Autoconf 2.61,
--  with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
-+configured by $0, generated by GNU Autoconf 2.63,
-+  with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
- 
--Copyright (C) 2006 Free Software Foundation, Inc.
-+Copyright (C) 2008 Free Software Foundation, Inc.
- This config.status script is free software; the Free Software Foundation
- gives unlimited permission to copy, distribute and modify it."
- 
- ac_pwd='$ac_pwd'
- srcdir='$srcdir'
-+test -n "\$AWK" || AWK=awk
- _ACEOF
- 
--cat >>$CONFIG_STATUS <<\_ACEOF
--# If no file are specified by the user, then we need to provide default
--# value.  By we need to know if files were specified by the user.
-+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-+# The default lists apply if the user does not specify any file.
- ac_need_defaults=:
- while test $# != 0
- do
-@@ -4444,21 +5134,24 @@ do
-   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
-     ac_cs_recheck=: ;;
-   --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
--    echo "$ac_cs_version"; exit ;;
-+    $as_echo "$ac_cs_version"; exit ;;
-   --debug | --debu | --deb | --de | --d | -d )
-     debug=: ;;
-   --file | --fil | --fi | --f )
-     $ac_shift
--    CONFIG_FILES="$CONFIG_FILES $ac_optarg"
-+    case $ac_optarg in
-+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
-+    esac
-+    CONFIG_FILES="$CONFIG_FILES '$ac_optarg'"
-     ac_need_defaults=false;;
-   --he | --h |  --help | --hel | -h )
--    echo "$ac_cs_usage"; exit ;;
-+    $as_echo "$ac_cs_usage"; exit ;;
-   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
-   | -silent | --silent | --silen | --sile | --sil | --si | --s)
-     ac_cs_silent=: ;;
- 
-   # This is an error.
--  -*) { echo "$as_me: error: unrecognized option: $1
-+  -*) { $as_echo "$as_me: error: unrecognized option: $1
- Try \`$0 --help' for more information." >&2
-    { (exit 1); exit 1; }; } ;;
- 
-@@ -4477,30 +5170,32 @@ if $ac_cs_silent; then
- fi
- 
- _ACEOF
--cat >>$CONFIG_STATUS <<_ACEOF
-+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
- if \$ac_cs_recheck; then
--  echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
--  CONFIG_SHELL=$SHELL
-+  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
-+  shift
-+  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
-+  CONFIG_SHELL='$SHELL'
-   export CONFIG_SHELL
--  exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
-+  exec "\$@"
- fi
- 
- _ACEOF
--cat >>$CONFIG_STATUS <<\_ACEOF
-+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
- exec 5>>config.log
- {
-   echo
-   sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
- ## Running $as_me. ##
- _ASBOX
--  echo "$ac_log"
-+  $as_echo "$ac_log"
- } >&5
- 
- _ACEOF
--cat >>$CONFIG_STATUS <<_ACEOF
-+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
- _ACEOF
- 
--cat >>$CONFIG_STATUS <<\_ACEOF
-+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
- 
- # Handling of arguments.
- for ac_config_target in $ac_config_targets
-@@ -4508,8 +5203,8 @@ do
-   case $ac_config_target in
-     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
- 
--  *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
--echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
-+  *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
-+$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
-    { (exit 1); exit 1; }; };;
-   esac
- done
-@@ -4548,114 +5243,143 @@ $debug ||
-   (umask 077 && mkdir "$tmp")
- } ||
- {
--   echo "$me: cannot create a temporary directory in ." >&2
-+   $as_echo "$as_me: cannot create a temporary directory in ." >&2
-    { (exit 1); exit 1; }
- }
- 
--#
--# Set up the sed scripts for CONFIG_FILES section.
--#
--
--# No need to generate the scripts if there are no CONFIG_FILES.
--# This happens for instance when ./config.status config.h
-+# Set up the scripts for CONFIG_FILES section.
-+# No need to generate them if there are no CONFIG_FILES.
-+# This happens for instance with `./config.status config.h'.
- if test -n "$CONFIG_FILES"; then
- 
--_ACEOF
- 
-+ac_cr='
'
-+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
-+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
-+  ac_cs_awk_cr='\\r'
-+else
-+  ac_cs_awk_cr=$ac_cr
-+fi
-+
-+echo 'BEGIN {' >"$tmp/subs1.awk" &&
-+_ACEOF
- 
- 
-+{
-+  echo "cat >conf$$subs.awk <<_ACEOF" &&
-+  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
-+  echo "_ACEOF"
-+} >conf$$subs.sh ||
-+  { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
-+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
-+   { (exit 1); exit 1; }; }
-+ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
- ac_delim='%!_!# '
- for ac_last_try in false false false false false :; do
--  cat >conf$$subs.sed <<_ACEOF
--SHELL!$SHELL$ac_delim
--PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim
--PACKAGE_NAME!$PACKAGE_NAME$ac_delim
--PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim
--PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim
--PACKAGE_STRING!$PACKAGE_STRING$ac_delim
--PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim
--exec_prefix!$exec_prefix$ac_delim
--prefix!$prefix$ac_delim
--program_transform_name!$program_transform_name$ac_delim
--bindir!$bindir$ac_delim
--sbindir!$sbindir$ac_delim
--libexecdir!$libexecdir$ac_delim
--datarootdir!$datarootdir$ac_delim
--datadir!$datadir$ac_delim
--sysconfdir!$sysconfdir$ac_delim
--sharedstatedir!$sharedstatedir$ac_delim
--localstatedir!$localstatedir$ac_delim
--includedir!$includedir$ac_delim
--oldincludedir!$oldincludedir$ac_delim
--docdir!$docdir$ac_delim
--infodir!$infodir$ac_delim
--htmldir!$htmldir$ac_delim
--dvidir!$dvidir$ac_delim
--pdfdir!$pdfdir$ac_delim
--psdir!$psdir$ac_delim
--libdir!$libdir$ac_delim
--localedir!$localedir$ac_delim
--mandir!$mandir$ac_delim
--DEFS!$DEFS$ac_delim
--ECHO_C!$ECHO_C$ac_delim
--ECHO_N!$ECHO_N$ac_delim
--ECHO_T!$ECHO_T$ac_delim
--LIBS!$LIBS$ac_delim
--build_alias!$build_alias$ac_delim
--host_alias!$host_alias$ac_delim
--target_alias!$target_alias$ac_delim
--CC!$CC$ac_delim
--CFLAGS!$CFLAGS$ac_delim
--LDFLAGS!$LDFLAGS$ac_delim
--CPPFLAGS!$CPPFLAGS$ac_delim
--ac_ct_CC!$ac_ct_CC$ac_delim
--EXEEXT!$EXEEXT$ac_delim
--OBJEXT!$OBJEXT$ac_delim
--edir!$edir$ac_delim
--ldap_ldflags!$ldap_ldflags$ac_delim
--ldap_cflags!$ldap_cflags$ac_delim
--targetname!$targetname$ac_delim
--LIBOBJS!$LIBOBJS$ac_delim
--LTLIBOBJS!$LTLIBOBJS$ac_delim
--_ACEOF
-+  . ./conf$$subs.sh ||
-+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
-+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
-+   { (exit 1); exit 1; }; }
- 
--  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 50; then
-+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
-+  if test $ac_delim_n = $ac_delim_num; then
-     break
-   elif $ac_last_try; then
--    { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
--echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
-+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
-+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
-    { (exit 1); exit 1; }; }
-   else
-     ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
-   fi
- done
-+rm -f conf$$subs.sh
- 
--ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
--if test -n "$ac_eof"; then
--  ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
--  ac_eof=`expr $ac_eof + 1`
--fi
--
--cat >>$CONFIG_STATUS <<_ACEOF
--cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
--/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
--_ACEOF
--sed '
--s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
--s/^/s,@/; s/!/@,|#_!!_#|/
--:n
--t n
--s/'"$ac_delim"'$/,g/; t
--s/$/\\/; p
--N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
--' >>$CONFIG_STATUS <conf$$subs.sed
--rm -f conf$$subs.sed
--cat >>$CONFIG_STATUS <<_ACEOF
--:end
--s/|#_!!_#|//g
--CEOF$ac_eof
-+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-+cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
- _ACEOF
-+sed -n '
-+h
-+s/^/S["/; s/!.*/"]=/
-+p
-+g
-+s/^[^!]*!//
-+:repl
-+t repl
-+s/'"$ac_delim"'$//
-+t delim
-+:nl
-+h
-+s/\(.\{148\}\).*/\1/
-+t more1
-+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
-+p
-+n
-+b repl
-+:more1
-+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
-+p
-+g
-+s/.\{148\}//
-+t nl
-+:delim
-+h
-+s/\(.\{148\}\).*/\1/
-+t more2
-+s/["\\]/\\&/g; s/^/"/; s/$/"/
-+p
-+b
-+:more2
-+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
-+p
-+g
-+s/.\{148\}//
-+t delim
-+' <conf$$subs.awk | sed '
-+/^[^""]/{
-+  N
-+  s/\n//
-+}
-+' >>$CONFIG_STATUS || ac_write_fail=1
-+rm -f conf$$subs.awk
-+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-+_ACAWK
-+cat >>"\$tmp/subs1.awk" <<_ACAWK &&
-+  for (key in S) S_is_set[key] = 1
-+  FS = ""
- 
-+}
-+{
-+  line = $ 0
-+  nfields = split(line, field, "@")
-+  substed = 0
-+  len = length(field[1])
-+  for (i = 2; i < nfields; i++) {
-+    key = field[i]
-+    keylen = length(key)
-+    if (S_is_set[key]) {
-+      value = S[key]
-+      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
-+      len += length(value) + length(field[++i])
-+      substed = 1
-+    } else
-+      len += 1 + keylen
-+  }
-+
-+  print line
-+}
-+
-+_ACAWK
-+_ACEOF
-+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
-+  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
-+else
-+  cat
-+fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
-+  || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5
-+$as_echo "$as_me: error: could not setup config files machinery" >&2;}
-+   { (exit 1); exit 1; }; }
-+_ACEOF
- 
- # VPATH may cause trouble with some makes, so we remove $(srcdir),
- # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
-@@ -4672,19 +5396,21 @@ s/^[^=]*=[	 ]*$//
- }'
- fi
- 
--cat >>$CONFIG_STATUS <<\_ACEOF
-+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
- fi # test -n "$CONFIG_FILES"
- 
- 
--for ac_tag in  :F $CONFIG_FILES
-+eval set X "  :F $CONFIG_FILES      "
-+shift
-+for ac_tag
- do
-   case $ac_tag in
-   :[FHLC]) ac_mode=$ac_tag; continue;;
-   esac
-   case $ac_mode$ac_tag in
-   :[FHL]*:*);;
--  :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
--echo "$as_me: error: Invalid tag $ac_tag." >&2;}
-+  :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5
-+$as_echo "$as_me: error: invalid tag $ac_tag" >&2;}
-    { (exit 1); exit 1; }; };;
-   :[FH]-) ac_tag=-:-;;
-   :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
-@@ -4713,26 +5439,38 @@ echo "$as_me: error: Invalid tag $ac_tag
- 	   [\\/$]*) false;;
- 	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
- 	   esac ||
--	   { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
--echo "$as_me: error: cannot find input file: $ac_f" >&2;}
-+	   { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
-+$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;}
-    { (exit 1); exit 1; }; };;
-       esac
--      ac_file_inputs="$ac_file_inputs $ac_f"
-+      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
-+      ac_file_inputs="$ac_file_inputs '$ac_f'"
-     done
- 
-     # Let's still pretend it is `configure' which instantiates (i.e., don't
-     # use $as_me), people would be surprised to read:
-     #    /* config.h.  Generated by config.status.  */
--    configure_input="Generated from "`IFS=:
--	  echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure."
-+    configure_input='Generated from '`
-+	  $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
-+	`' by configure.'
-     if test x"$ac_file" != x-; then
-       configure_input="$ac_file.  $configure_input"
--      { echo "$as_me:$LINENO: creating $ac_file" >&5
--echo "$as_me: creating $ac_file" >&6;}
-+      { $as_echo "$as_me:$LINENO: creating $ac_file" >&5
-+$as_echo "$as_me: creating $ac_file" >&6;}
-     fi
-+    # Neutralize special characters interpreted by sed in replacement strings.
-+    case $configure_input in #(
-+    *\&* | *\|* | *\\* )
-+       ac_sed_conf_input=`$as_echo "$configure_input" |
-+       sed 's/[\\\\&|]/\\\\&/g'`;; #(
-+    *) ac_sed_conf_input=$configure_input;;
-+    esac
- 
-     case $ac_tag in
--    *:-:* | *:-) cat >"$tmp/stdin";;
-+    *:-:* | *:-) cat >"$tmp/stdin" \
-+      || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
-+$as_echo "$as_me: error: could not create $ac_file" >&2;}
-+   { (exit 1); exit 1; }; } ;;
-     esac
-     ;;
-   esac
-@@ -4742,7 +5480,7 @@ $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^
- 	 X"$ac_file" : 'X\(//\)[^/]' \| \
- 	 X"$ac_file" : 'X\(//\)$' \| \
- 	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
--echo X"$ac_file" |
-+$as_echo X"$ac_file" |
-     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- 	    s//\1/
- 	    q
-@@ -4768,7 +5506,7 @@ echo X"$ac_file" |
-     as_dirs=
-     while :; do
-       case $as_dir in #(
--      *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
-+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
-       *) as_qdir=$as_dir;;
-       esac
-       as_dirs="'$as_qdir' $as_dirs"
-@@ -4777,7 +5515,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/
- 	 X"$as_dir" : 'X\(//\)[^/]' \| \
- 	 X"$as_dir" : 'X\(//\)$' \| \
- 	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
--echo X"$as_dir" |
-+$as_echo X"$as_dir" |
-     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- 	    s//\1/
- 	    q
-@@ -4798,17 +5536,17 @@ echo X"$as_dir" |
-       test -d "$as_dir" && break
-     done
-     test -z "$as_dirs" || eval "mkdir $as_dirs"
--  } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
--echo "$as_me: error: cannot create directory $as_dir" >&2;}
-+  } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
-+$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
-    { (exit 1); exit 1; }; }; }
-   ac_builddir=.
- 
- case "$ac_dir" in
- .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
- *)
--  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
-+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
-   # A ".." for each directory in $ac_dir_suffix.
--  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
-+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
-   case $ac_top_builddir_sub in
-   "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
-   *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
-@@ -4844,12 +5582,13 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_
- 
- _ACEOF
- 
--cat >>$CONFIG_STATUS <<\_ACEOF
-+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
- # If the template does not know about datarootdir, expand it.
- # FIXME: This hack should be removed a few years after 2.60.
- ac_datarootdir_hack=; ac_datarootdir_seen=
- 
--case `sed -n '/datarootdir/ {
-+ac_sed_dataroot='
-+/datarootdir/ {
-   p
-   q
- }
-@@ -4858,13 +5597,14 @@ case `sed -n '/datarootdir/ {
- /@infodir@/p
- /@localedir@/p
- /@mandir@/p
--' $ac_file_inputs` in
-+'
-+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
- *datarootdir*) ac_datarootdir_seen=yes;;
- *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
--  { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
--echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
-+  { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
-+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
- _ACEOF
--cat >>$CONFIG_STATUS <<_ACEOF
-+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-   ac_datarootdir_hack='
-   s&@datadir@&$datadir&g
-   s&@docdir@&$docdir&g
-@@ -4878,15 +5618,16 @@ _ACEOF
- # Neutralize VPATH when `$srcdir' = `.'.
- # Shell code in configure.ac might set extrasub.
- # FIXME: do we really want to maintain this feature?
--cat >>$CONFIG_STATUS <<_ACEOF
--  sed "$ac_vpsub
-+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-+ac_sed_extra="$ac_vpsub
- $extrasub
- _ACEOF
--cat >>$CONFIG_STATUS <<\_ACEOF
-+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
- :t
- /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
--s&@configure_input@&$configure_input&;t t
-+s|@configure_input@|$ac_sed_conf_input|;t t
- s&@top_builddir@&$ac_top_builddir_sub&;t t
-+s&@top_build_prefix@&$ac_top_build_prefix&;t t
- s&@srcdir@&$ac_srcdir&;t t
- s&@abs_srcdir@&$ac_abs_srcdir&;t t
- s&@top_srcdir@&$ac_top_srcdir&;t t
-@@ -4895,21 +5636,28 @@ s&@builddir@&$ac_builddir&;t t
- s&@abs_builddir@&$ac_abs_builddir&;t t
- s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
- $ac_datarootdir_hack
--" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out
-+"
-+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
-+  || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
-+$as_echo "$as_me: error: could not create $ac_file" >&2;}
-+   { (exit 1); exit 1; }; }
- 
- test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
-   { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
-   { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
--  { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-+  { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
- which seems to be undefined.  Please make sure it is defined." >&5
--echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
- which seems to be undefined.  Please make sure it is defined." >&2;}
- 
-   rm -f "$tmp/stdin"
-   case $ac_file in
--  -) cat "$tmp/out"; rm -f "$tmp/out";;
--  *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;
--  esac
-+  -) cat "$tmp/out" && rm -f "$tmp/out";;
-+  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
-+  esac \
-+  || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
-+$as_echo "$as_me: error: could not create $ac_file" >&2;}
-+   { (exit 1); exit 1; }; }
-  ;;
- 
- 
-@@ -4924,6 +5672,11 @@ _ACEOF
- chmod +x $CONFIG_STATUS
- ac_clean_files=$ac_clean_files_save
- 
-+test $ac_write_fail = 0 ||
-+  { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5
-+$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;}
-+   { (exit 1); exit 1; }; }
-+
- 
- # configure is writing to config.log, and then calls config.status.
- # config.status does its own redirection, appending to config.log.
-@@ -4945,5 +5698,9 @@ if test "$no_create" != yes; then
-   # would make configure fail if this is the last instruction.
-   $ac_cs_success || { (exit 1); exit 1; }
- fi
-+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
-+  { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
-+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
-+fi
- 
- 
-Index: freeradius-server-2.2.7/src/modules/rlm_ldap/configure.in
-===================================================================
---- freeradius-server-2.2.7.orig/src/modules/rlm_ldap/configure.in
-+++ freeradius-server-2.2.7/src/modules/rlm_ldap/configure.in
-@@ -87,6 +87,9 @@ if test x$with_[]modname != xno; then
- 			 )
- 	fi
- 
-+	FR_SMART_CHECK_LIB(sasl, sasl_encode)
-+	FR_SMART_CHECK_LIB(lber, ber_init)
-+
- 	dnl Try only "-lldap_r" or "-lldap"
- 	dnl Static linking will probably not work, but nobody ever
- 	dnl complained about it.

+ 0 - 17
net/freeradius2/patches/008-honor_ccpflags.patch

@@ -1,17 +0,0 @@
-Index: freeradius-server-2.2.7/src/modules/rules.mak
-===================================================================
---- freeradius-server-2.2.7.orig/src/modules/rules.mak
-+++ freeradius-server-2.2.7/src/modules/rules.mak
-@@ -63,10 +63,10 @@ $(LT_OBJS): $(SERVER_HEADERS)
- #
- #######################################################################
- %.lo: %.c
--	$(LIBTOOL) --mode=compile --tag=CC $(CC) $(CFLAGS) $(RLM_CFLAGS) -c $<
-+	$(LIBTOOL) --mode=compile --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(RLM_CFLAGS) -c $<
- 
- %.lo: %.cpp
--	$(LIBTOOL) --mode=compile --tag=CXX $(CXX) $(CFLAGS) $(RLM_CFLAGS) -c $<
-+	$(LIBTOOL) --mode=compile --tag=CXX $(CXX) $(CFLAGS) $(CPPFLAGS) $(RLM_CFLAGS) -c $<
- 
- ifneq ($(TARGET),)
- #######################################################################

+ 0 - 40
net/freeradius2/patches/010-disbale-openssl-check.patch

@@ -1,40 +0,0 @@
-Index: freeradius-server-2.2.7/configure.in
-===================================================================
---- freeradius-server-2.2.7.orig/configure.in
-+++ freeradius-server-2.2.7/configure.in
-@@ -820,35 +820,6 @@ if test "x$WITH_OPENSSL" = xyes; then
-     OPENSSL_INCLUDE="-DOPENSSL_NO_KRB5"
-   fi
- 
--  dnl #
--  dnl #  Now check that the header versions match the library
--  dnl #
--  AC_MSG_CHECKING([OpenSSL library and header version consistency])
--  AC_RUN_IFELSE(
--    [AC_LANG_PROGRAM(
--      [[
--        #include <stdio.h>
--        #include <openssl/opensslv.h>
--        #include <openssl/crypto.h>
--      ]],
--      [[
--        if (SSLeay() == OPENSSL_VERSION_NUMBER) {
--          return 0;
--        } else {
--          printf("library: %lx header: %lx... ", (unsigned long) SSLeay(), (unsigned long) OPENSSL_VERSION_NUMBER);
--          return 1;
--        }
--      ]]
--    )],
--    [
--      AC_MSG_RESULT(yes)
--    ],
--    [
--      AC_MSG_RESULT(no)
--      AC_MSG_FAILURE([OpenSSL library version does not match header version])
--    ]
--  )
--
-   if test "x$OPENSSL_LIBS" = x; then
-     LIBS=$old_LIBS
-     LDFLAGS="$old_LDFLAGS"

+ 2 - 2
net/git/Makefile

@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=git
-PKG_VERSION:=2.11.0
+PKG_VERSION:=2.11.3
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@KERNEL/software/scm/git/
-PKG_MD5SUM:=dd4e3360e28aec5bb902fb34dd7fce3b
+PKG_HASH:=7343bbd489f59531d66bc086393f0d5f530b5175927c29fb97b07f9d2cbc31ac
 
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1

+ 3 - 3
net/haproxy/Makefile

@@ -9,12 +9,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=haproxy
-PKG_VERSION:=1.7.8
-PKG_RELEASE:=18
+PKG_VERSION:=1.7.5
+PKG_RELEASE:=01
 
 PKG_SOURCE:=haproxy-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.haproxy.org/download/1.7/src/
-PKG_MD5SUM:=7e94653cc5a1dba006bbe43736f53595
+PKG_MD5SUM:=ed84c80cb97852d2aa3161ed16c48a1c
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_LICENSE:=GPL-2.0

+ 0 - 299
net/haproxy/patches/0001-BUG-MINOR-peers-peer-synchronization-issue-with-seve.patch

@@ -1,299 +0,0 @@
-From fa73e6b0d5f64eb8a6fd8a1706d7ec03293a943e Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20L=C3=A9caille?= <flecaille@haproxy.com>
-Date: Thu, 13 Jul 2017 09:07:09 +0200
-Subject: [PATCH 01/18] BUG/MINOR: peers: peer synchronization issue (with
- several peers sections).
-
-When several stick-tables were configured with several peers sections,
-only a part of them could be synchronized: the ones attached to the last
-parsed 'peers' section. This was due to the fact that, at least, the peer I/O handler
-refered to the wrong peer section list, in fact always the same: the last one parsed.
-
-The fact that the global peer section list was named "struct peers *peers"
-lead to this issue. This variable name is dangerous ;).
-
-So this patch renames global 'peers' variable to 'cfg_peers' to ensure that
-no such wrong references are still in use, then all the functions wich used
-old 'peers' variable have been modified to refer to the correct peer list.
-
-Must be backported to 1.6 and 1.7.
-(cherry picked from commit ed2b4a6b793d062000518e51ed71e014c649c313)
-
-Signed-off-by: Willy Tarreau <w@1wt.eu>
----
- include/types/peers.h |  2 +-
- src/cfgparse.c        | 18 +++++++++---------
- src/haproxy.c         | 10 +++++-----
- src/peers.c           | 40 ++++++++++++++++++++--------------------
- src/proxy.c           |  6 +++---
- 5 files changed, 38 insertions(+), 38 deletions(-)
-
-diff --git a/include/types/peers.h b/include/types/peers.h
-index 105dffb0..a77a0942 100644
---- a/include/types/peers.h
-+++ b/include/types/peers.h
-@@ -91,7 +91,7 @@ struct peers {
- };
- 
- 
--extern struct peers *peers;
-+extern struct peers *cfg_peers;
- 
- #endif /* _TYPES_PEERS_H */
- 
-diff --git a/src/cfgparse.c b/src/cfgparse.c
-index 8c0906bf..1b53006b 100644
---- a/src/cfgparse.c
-+++ b/src/cfgparse.c
-@@ -2124,7 +2124,7 @@ int cfg_parse_peers(const char *file, int linenum, char **args, int kwm)
- 			goto out;
- 		}
- 
--		for (curpeers = peers; curpeers != NULL; curpeers = curpeers->next) {
-+		for (curpeers = cfg_peers; curpeers != NULL; curpeers = curpeers->next) {
- 			/*
- 			 * If there are two proxies with the same name only following
- 			 * combinations are allowed:
-@@ -2142,8 +2142,8 @@ int cfg_parse_peers(const char *file, int linenum, char **args, int kwm)
- 			goto out;
- 		}
- 
--		curpeers->next = peers;
--		peers = curpeers;
-+		curpeers->next = cfg_peers;
-+		cfg_peers = curpeers;
- 		curpeers->conf.file = strdup(file);
- 		curpeers->conf.line = linenum;
- 		curpeers->last_change = now.tv_sec;
-@@ -2223,7 +2223,7 @@ int cfg_parse_peers(const char *file, int linenum, char **args, int kwm)
- 		if (strcmp(newpeer->id, localpeer) == 0) {
- 			/* Current is local peer, it define a frontend */
- 			newpeer->local = 1;
--			peers->local = newpeer;
-+			cfg_peers->local = newpeer;
- 
- 			if (!curpeers->peers_fe) {
- 				if ((curpeers->peers_fe  = calloc(1, sizeof(struct proxy))) == NULL) {
-@@ -8189,9 +8189,9 @@ int check_config_validity()
- 		}
- 
- 		if (curproxy->table.peers.name) {
--			struct peers *curpeers = peers;
-+			struct peers *curpeers;
- 
--			for (curpeers = peers; curpeers; curpeers = curpeers->next) {
-+			for (curpeers = cfg_peers; curpeers; curpeers = curpeers->next) {
- 				if (strcmp(curpeers->id, curproxy->table.peers.name) == 0) {
- 					free((void *)curproxy->table.peers.name);
- 					curproxy->table.peers.p = curpeers;
-@@ -9279,15 +9279,15 @@ out_uri_auth_compat:
- 		if (curproxy->table.peers.p)
- 			curproxy->table.peers.p->peers_fe->bind_proc |= curproxy->bind_proc;
- 
--	if (peers) {
--		struct peers *curpeers = peers, **last;
-+	if (cfg_peers) {
-+		struct peers *curpeers = cfg_peers, **last;
- 		struct peer *p, *pb;
- 
- 		/* Remove all peers sections which don't have a valid listener,
- 		 * which are not used by any table, or which are bound to more
- 		 * than one process.
- 		 */
--		last = &peers;
-+		last = &cfg_peers;
- 		while (*last) {
- 			curpeers = *last;
- 
-diff --git a/src/haproxy.c b/src/haproxy.c
-index 6d09aed4..25cea0cd 100644
---- a/src/haproxy.c
-+++ b/src/haproxy.c
-@@ -988,7 +988,7 @@ void init(int argc, char **argv)
- 		struct peers *pr;
- 		struct proxy *px;
- 
--		for (pr = peers; pr; pr = pr->next)
-+		for (pr = cfg_peers; pr; pr = pr->next)
- 			if (pr->peers_fe)
- 				break;
- 
-@@ -1217,11 +1217,11 @@ void init(int argc, char **argv)
- 	if (global.stats_fe)
- 		global.maxsock += global.stats_fe->maxconn;
- 
--	if (peers) {
-+	if (cfg_peers) {
- 		/* peers also need to bypass global maxconn */
--		struct peers *p = peers;
-+		struct peers *p = cfg_peers;
- 
--		for (p = peers; p; p = p->next)
-+		for (p = cfg_peers; p; p = p->next)
- 			if (p->peers_fe)
- 				global.maxsock += p->peers_fe->maxconn;
- 	}
-@@ -2067,7 +2067,7 @@ int main(int argc, char **argv)
- 		}
- 
- 		/* we might have to unbind some peers sections from some processes */
--		for (curpeers = peers; curpeers; curpeers = curpeers->next) {
-+		for (curpeers = cfg_peers; curpeers; curpeers = curpeers->next) {
- 			if (!curpeers->peers_fe)
- 				continue;
- 
-diff --git a/src/peers.c b/src/peers.c
-index 543c84c1..5b8a287a 100644
---- a/src/peers.c
-+++ b/src/peers.c
-@@ -171,7 +171,7 @@ enum {
- #define PEER_MINOR_VER        1
- #define PEER_DWNGRD_MINOR_VER 0
- 
--struct peers *peers = NULL;
-+struct peers *cfg_peers = NULL;
- static void peer_session_forceshutdown(struct appctx *appctx);
- 
- /* This function encode an uint64 to 'dynamic' length format.
-@@ -727,19 +727,19 @@ switchstate:
- 				/* if current peer is local */
-                                 if (curpeer->local) {
-                                         /* if current host need resyncfrom local and no process assined  */
--                                        if ((peers->flags & PEERS_RESYNC_STATEMASK) == PEERS_RESYNC_FROMLOCAL &&
--                                            !(peers->flags & PEERS_F_RESYNC_ASSIGN)) {
-+                                        if ((curpeers->flags & PEERS_RESYNC_STATEMASK) == PEERS_RESYNC_FROMLOCAL &&
-+                                            !(curpeers->flags & PEERS_F_RESYNC_ASSIGN)) {
-                                                 /* assign local peer for a lesson, consider lesson already requested */
-                                                 curpeer->flags |= PEER_F_LEARN_ASSIGN;
--                                                peers->flags |= (PEERS_F_RESYNC_ASSIGN|PEERS_F_RESYNC_PROCESS);
-+                                                curpeers->flags |= (PEERS_F_RESYNC_ASSIGN|PEERS_F_RESYNC_PROCESS);
-                                         }
- 
-                                 }
--                                else if ((peers->flags & PEERS_RESYNC_STATEMASK) == PEERS_RESYNC_FROMREMOTE &&
--                                         !(peers->flags & PEERS_F_RESYNC_ASSIGN)) {
-+                                else if ((curpeers->flags & PEERS_RESYNC_STATEMASK) == PEERS_RESYNC_FROMREMOTE &&
-+                                         !(curpeers->flags & PEERS_F_RESYNC_ASSIGN)) {
-                                         /* assign peer for a lesson  */
-                                         curpeer->flags |= PEER_F_LEARN_ASSIGN;
--                                        peers->flags |= PEERS_F_RESYNC_ASSIGN;
-+                                        curpeers->flags |= PEERS_F_RESYNC_ASSIGN;
-                                 }
- 
- 
-@@ -807,7 +807,7 @@ switchstate:
- 				curpeer->statuscode = atoi(trash.str);
- 
- 				/* Awake main task */
--				task_wakeup(peers->sync_task, TASK_WOKEN_MSG);
-+				task_wakeup(curpeers->sync_task, TASK_WOKEN_MSG);
- 
- 				/* If status code is success */
- 				if (curpeer->statuscode == PEER_SESS_SC_SUCCESSCODE) {
-@@ -830,14 +830,14 @@ switchstate:
-                                                 curpeer->flags |= PEER_F_TEACH_PROCESS;
- 
-                                         }
--                                        else if ((peers->flags & PEERS_RESYNC_STATEMASK) == PEERS_RESYNC_FROMREMOTE &&
--                                                    !(peers->flags & PEERS_F_RESYNC_ASSIGN)) {
-+                                        else if ((curpeers->flags & PEERS_RESYNC_STATEMASK) == PEERS_RESYNC_FROMREMOTE &&
-+                                                    !(curpeers->flags & PEERS_F_RESYNC_ASSIGN)) {
-                                                 /* If peer is remote and resync from remote is needed,
-                                                    and no peer currently assigned */
- 
-                                                 /* assign peer for a lesson */
-                                                 curpeer->flags |= PEER_F_LEARN_ASSIGN;
--						peers->flags |= PEERS_F_RESYNC_ASSIGN;
-+						curpeers->flags |= PEERS_F_RESYNC_ASSIGN;
- 					}
- 
- 				}
-@@ -950,8 +950,8 @@ switchstate:
- 
- 						if (curpeer->flags & PEER_F_LEARN_ASSIGN) {
- 							curpeer->flags &= ~PEER_F_LEARN_ASSIGN;
--							peers->flags &= ~(PEERS_F_RESYNC_ASSIGN|PEERS_F_RESYNC_PROCESS);
--							peers->flags |= (PEERS_F_RESYNC_LOCAL|PEERS_F_RESYNC_REMOTE);
-+							curpeers->flags &= ~(PEERS_F_RESYNC_ASSIGN|PEERS_F_RESYNC_PROCESS);
-+							curpeers->flags |= (PEERS_F_RESYNC_LOCAL|PEERS_F_RESYNC_REMOTE);
- 						}
- 						curpeer->confirm++;
- 					}
-@@ -959,11 +959,11 @@ switchstate:
- 
- 						if (curpeer->flags & PEER_F_LEARN_ASSIGN) {
- 							curpeer->flags &= ~PEER_F_LEARN_ASSIGN;
--							peers->flags &= ~(PEERS_F_RESYNC_ASSIGN|PEERS_F_RESYNC_PROCESS);
-+							curpeers->flags &= ~(PEERS_F_RESYNC_ASSIGN|PEERS_F_RESYNC_PROCESS);
- 
- 							curpeer->flags |= PEER_F_LEARN_NOTUP2DATE;
--							peers->resync_timeout = tick_add(now_ms, MS_TO_TICKS(5000));
--							task_wakeup(peers->sync_task, TASK_WOKEN_MSG);
-+							curpeers->resync_timeout = tick_add(now_ms, MS_TO_TICKS(5000));
-+							task_wakeup(curpeers->sync_task, TASK_WOKEN_MSG);
- 						}
- 						curpeer->confirm++;
- 					}
-@@ -1334,8 +1334,8 @@ incomplete:
- 
- 				/* Need to request a resync */
-                                 if ((curpeer->flags & PEER_F_LEARN_ASSIGN) &&
--                                        (peers->flags & PEERS_F_RESYNC_ASSIGN) &&
--                                        !(peers->flags & PEERS_F_RESYNC_PROCESS)) {
-+                                        (curpeers->flags & PEERS_F_RESYNC_ASSIGN) &&
-+                                        !(curpeers->flags & PEERS_F_RESYNC_PROCESS)) {
- 					unsigned char msg[2];
- 
-                                         /* Current peer was elected to request a resync */
-@@ -1351,7 +1351,7 @@ incomplete:
-                                                 appctx->st0 = PEER_SESS_ST_END;
-                                                 goto switchstate;
-                                         }
--                                        peers->flags |= PEERS_F_RESYNC_PROCESS;
-+                                        curpeers->flags |= PEERS_F_RESYNC_PROCESS;
-                                 }
- 
- 				/* Nothing to read, now we start to write */
-@@ -1624,7 +1624,7 @@ incomplete:
- 
-                                         /* Current peer was elected to request a resync */
- 					msg[0] = PEER_MSG_CLASS_CONTROL;
--					msg[1] = ((peers->flags & PEERS_RESYNC_STATEMASK) == PEERS_RESYNC_FINISHED) ? PEER_MSG_CTRL_RESYNCFINISHED : PEER_MSG_CTRL_RESYNCPARTIAL;
-+					msg[1] = ((curpeers->flags & PEERS_RESYNC_STATEMASK) == PEERS_RESYNC_FINISHED) ? PEER_MSG_CTRL_RESYNCFINISHED : PEER_MSG_CTRL_RESYNCPARTIAL;
- 					/* process final lesson message */
- 					repl = bi_putblk(si_ic(si), (char *)msg, sizeof(msg));
- 					if (repl <= 0) {
-diff --git a/src/proxy.c b/src/proxy.c
-index 78120d9b..bedc7ae0 100644
---- a/src/proxy.c
-+++ b/src/proxy.c
-@@ -1007,7 +1007,7 @@ void soft_stop(void)
- 		p = p->next;
- 	}
- 
--	prs = peers;
-+	prs = cfg_peers;
- 	while (prs) {
- 		if (prs->peers_fe)
- 			stop_proxy(prs->peers_fe);
-@@ -1142,7 +1142,7 @@ void pause_proxies(void)
- 		p = p->next;
- 	}
- 
--	prs = peers;
-+	prs = cfg_peers;
- 	while (prs) {
- 		if (prs->peers_fe)
- 			err |= !pause_proxy(prs->peers_fe);
-@@ -1176,7 +1176,7 @@ void resume_proxies(void)
- 		p = p->next;
- 	}
- 
--	prs = peers;
-+	prs = cfg_peers;
- 	while (prs) {
- 		if (prs->peers_fe)
- 			err |= !resume_proxy(prs->peers_fe);
--- 
-2.13.0
-

+ 0 - 36
net/haproxy/patches/0002-BUG-MINOR-lua-In-error-case-the-safe-mode-is-not-rem.patch

@@ -1,36 +0,0 @@
-From bcc483a9edfeb8ab69d1af83886d9e1323cffd06 Mon Sep 17 00:00:00 2001
-From: Thierry FOURNIER <thierry.fournier@ozon.io>
-Date: Wed, 12 Jul 2017 11:18:00 +0200
-Subject: [PATCH 02/18] BUG/MINOR: lua: In error case, the safe mode is not
- removed
-
-Just forgot of reset the safe mode. This have not consequences
-the safe mode just set a pointer on fucntion which is called only
-and initialises a longjmp.
-
-Out of lua execution, this longjmp is never executed and the
-function is never called.
-
-This patch should be backported in 1.6 and 1.7
-(cherry picked from commit 0a97620c080232a21ad7fce2c859a2edc9d7147e)
-
-Signed-off-by: Willy Tarreau <w@1wt.eu>
----
- src/hlua.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/src/hlua.c b/src/hlua.c
-index c862102d..4c1c2d21 100644
---- a/src/hlua.c
-+++ b/src/hlua.c
-@@ -854,6 +854,7 @@ int hlua_ctx_init(struct hlua *lua, struct task *task)
- 	lua->T = lua_newthread(gL.T);
- 	if (!lua->T) {
- 		lua->Tref = LUA_REFNIL;
-+		RESET_SAFE_LJMP(gL.T);
- 		return 0;
- 	}
- 	hlua_sethlua(lua);
--- 
-2.13.0
-

+ 0 - 59
net/haproxy/patches/0003-BUG-MINOR-lua-executes-the-function-destroying-the-L.patch

@@ -1,59 +0,0 @@
-From 49d319a677432b69c6a69ef5331ae2ed592075c9 Mon Sep 17 00:00:00 2001
-From: Thierry FOURNIER <thierry.fournier@ozon.io>
-Date: Wed, 12 Jul 2017 13:41:33 +0200
-Subject: [PATCH 03/18] BUG/MINOR: lua: executes the function destroying the
- Lua session in safe mode
-
-When we destroy the Lua session, we manipulates Lua stack,
-so errors can raises. It will be better to catch these errors.
-
-This patch should be backported in 1.6 and 1.7
-(cherry picked from commit 75d0208009c3189b5d10793e08f27dd62a76c3ae)
-
-Signed-off-by: Willy Tarreau <w@1wt.eu>
----
- src/hlua.c | 17 +++++++++++++++--
- 1 file changed, 15 insertions(+), 2 deletions(-)
-
-diff --git a/src/hlua.c b/src/hlua.c
-index 4c1c2d21..2d312804 100644
---- a/src/hlua.c
-+++ b/src/hlua.c
-@@ -876,9 +876,15 @@ void hlua_ctx_destroy(struct hlua *lua)
- 	/* Purge all the pending signals. */
- 	hlua_com_purge(lua);
- 
-+	if (!SET_SAFE_LJMP(lua->T))
-+		return;
- 	luaL_unref(lua->T, LUA_REGISTRYINDEX, lua->Mref);
--	luaL_unref(gL.T, LUA_REGISTRYINDEX, lua->Tref);
-+	RESET_SAFE_LJMP(lua->T);
- 
-+	if (!SET_SAFE_LJMP(gL.T))
-+		return;
-+	luaL_unref(gL.T, LUA_REGISTRYINDEX, lua->Tref);
-+	RESET_SAFE_LJMP(gL.T);
- 	/* Forces a garbage collecting process. If the Lua program is finished
- 	 * without error, we run the GC on the thread pointer. Its freed all
- 	 * the unused memory.
-@@ -889,9 +895,16 @@ void hlua_ctx_destroy(struct hlua *lua)
- 	 * the garbage collection.
- 	 */
- 	if (lua->flags & HLUA_MUST_GC) {
-+		if (!SET_SAFE_LJMP(lua->T))
-+			return;
- 		lua_gc(lua->T, LUA_GCCOLLECT, 0);
--		if (lua_status(lua->T) != LUA_OK)
-+		RESET_SAFE_LJMP(lua->T);
-+		if (lua_status(lua->T) != LUA_OK) {
-+			if (!SET_SAFE_LJMP(gL.T))
-+				return;
- 			lua_gc(gL.T, LUA_GCCOLLECT, 0);
-+			RESET_SAFE_LJMP(gL.T);
-+		}
- 	}
- 
- 	lua->T = NULL;
--- 
-2.13.0
-

+ 0 - 97
net/haproxy/patches/0004-BUG-MAJOR-lua-socket-resources-not-detroyed-when-the.patch

@@ -1,97 +0,0 @@
-From 2823f54f706f56304970313cb14a98a4ce20d5ab Mon Sep 17 00:00:00 2001
-From: Thierry FOURNIER <thierry.fournier@ozon.io>
-Date: Sun, 16 Jul 2017 20:48:54 +0200
-Subject: [PATCH 04/18] BUG/MAJOR: lua/socket: resources not detroyed when the
- socket is aborted
-
-In some cases, the socket is misused. The user can open socket and never
-close it, or open the socket and close it without sending data. This
-causes resources leak on all resources associated to the stream (buffer,
-spoe, ...)
-
-This is caused by the stream_shutdown function which is called outside
-of the stream execution process. Sometimes, the shtudown is required
-while the stream is not started, so the cleanup is ignored.
-
-This patch change the shutdown mode of the session. Now if the session is
-no longer used and the Lua want to destroy it, it just set a destroy flag
-and the session kill itself.
-
-This patch should be backported in 1.6 and 1.7
-
-(cherry picked from cmomit b13b20a19aacb039a33f886e38a181b00c9a6d41)
-
-Signed-off-by: Willy Tarreau <w@1wt.eu>
----
- include/types/applet.h |  1 +
- src/hlua.c             | 16 ++++++++++++++--
- 2 files changed, 15 insertions(+), 2 deletions(-)
-
-diff --git a/include/types/applet.h b/include/types/applet.h
-index 46b2bc10..aee9167e 100644
---- a/include/types/applet.h
-+++ b/include/types/applet.h
-@@ -122,6 +122,7 @@ struct appctx {
- 			struct hlua_socket *socket;
- 			struct list wake_on_read;
- 			struct list wake_on_write;
-+			int die;
- 		} hlua;
- 		struct {
- 			struct hlua hlua;
-diff --git a/src/hlua.c b/src/hlua.c
-index 2d312804..eb003558 100644
---- a/src/hlua.c
-+++ b/src/hlua.c
-@@ -1544,6 +1544,15 @@ static void hlua_socket_handler(struct appctx *appctx)
- 	struct stream_interface *si = appctx->owner;
- 	struct connection *c = objt_conn(si_opposite(si)->end);
- 
-+	if (appctx->ctx.hlua.die) {
-+		si_shutw(si);
-+		si_shutr(si);
-+		si_ic(si)->flags |= CF_READ_NULL;
-+		hlua_com_wake(&appctx->ctx.hlua.wake_on_read);
-+		hlua_com_wake(&appctx->ctx.hlua.wake_on_write);
-+		stream_shutdown(si_strm(si), SF_ERR_KILLED);
-+	}
-+
- 	/* If the connection object is not avalaible, close all the
- 	 * streams and wakeup everithing waiting for.
- 	 */
-@@ -1619,9 +1628,10 @@ __LJMP static int hlua_socket_gc(lua_State *L)
- 
- 	/* Remove all reference between the Lua stack and the coroutine stream. */
- 	appctx = objt_appctx(socket->s->si[0].end);
--	stream_shutdown(socket->s, SF_ERR_KILLED);
- 	socket->s = NULL;
- 	appctx->ctx.hlua.socket = NULL;
-+	appctx->ctx.hlua.die = 1;
-+	appctx_wakeup(appctx);
- 
- 	return 0;
- }
-@@ -1641,10 +1651,11 @@ __LJMP static int hlua_socket_close(lua_State *L)
- 		return 0;
- 
- 	/* Close the stream and remove the associated stop task. */
--	stream_shutdown(socket->s, SF_ERR_KILLED);
- 	appctx = objt_appctx(socket->s->si[0].end);
- 	appctx->ctx.hlua.socket = NULL;
- 	socket->s = NULL;
-+	appctx->ctx.hlua.die = 1;
-+	appctx_wakeup(appctx);
- 
- 	return 0;
- }
-@@ -2316,6 +2327,7 @@ __LJMP static int hlua_socket_new(lua_State *L)
- 
- 	appctx->ctx.hlua.socket = socket;
- 	appctx->ctx.hlua.connected = 0;
-+	appctx->ctx.hlua.die = 0;
- 	LIST_INIT(&appctx->ctx.hlua.wake_on_write);
- 	LIST_INIT(&appctx->ctx.hlua.wake_on_read);
- 
--- 
-2.13.0
-

+ 0 - 46
net/haproxy/patches/0005-BUG-MEDIUM-lua-bad-memory-access.patch

@@ -1,46 +0,0 @@
-From ea3b479be6cacb399a6541a00b1bdce17b0179d0 Mon Sep 17 00:00:00 2001
-From: Thierry FOURNIER <thierry.fournier@ozon.io>
-Date: Mon, 17 Jul 2017 00:44:40 +0200
-Subject: [PATCH 05/18] BUG/MEDIUM: lua: bad memory access
-
-We cannot perform garbage collection on unreferenced thread.
-This memory is now free and another Lua process can use it for
-other things.
-
-HAProxy is monothread, so this bug doesn't cause crash.
-
-This patch must be backported in 1.6 and 1.7
-(cherry picked from commit 7bd10d58d3aecf7cf1e5ee7df01193e07128a52d)
-
-Signed-off-by: Willy Tarreau <w@1wt.eu>
----
- src/hlua.c | 12 +++---------
- 1 file changed, 3 insertions(+), 9 deletions(-)
-
-diff --git a/src/hlua.c b/src/hlua.c
-index eb003558..a998860e 100644
---- a/src/hlua.c
-+++ b/src/hlua.c
-@@ -895,16 +895,10 @@ void hlua_ctx_destroy(struct hlua *lua)
- 	 * the garbage collection.
- 	 */
- 	if (lua->flags & HLUA_MUST_GC) {
--		if (!SET_SAFE_LJMP(lua->T))
-+		if (!SET_SAFE_LJMP(gL.T))
- 			return;
--		lua_gc(lua->T, LUA_GCCOLLECT, 0);
--		RESET_SAFE_LJMP(lua->T);
--		if (lua_status(lua->T) != LUA_OK) {
--			if (!SET_SAFE_LJMP(gL.T))
--				return;
--			lua_gc(gL.T, LUA_GCCOLLECT, 0);
--			RESET_SAFE_LJMP(gL.T);
--		}
-+		lua_gc(gL.T, LUA_GCCOLLECT, 0);
-+		RESET_SAFE_LJMP(gL.T);
- 	}
- 
- 	lua->T = NULL;
--- 
-2.13.0
-

+ 0 - 64
net/haproxy/patches/0006-DOC-update-CONTRIBUTING-regarding-optional-parts-and.patch

@@ -1,64 +0,0 @@
-From 20850d19250eb530cab889bb9059a630b3f805a3 Mon Sep 17 00:00:00 2001
-From: Willy Tarreau <w@1wt.eu>
-Date: Tue, 18 Jul 2017 06:56:40 +0200
-Subject: [PATCH 06/18] DOC: update CONTRIBUTING regarding optional parts and
- message format
-
-Make it clear that optional components must not break when disabled,
-that openssl is the only officially supported library and its support
-must not be broken, and that bug fixes must always be detailed.
-(cherry picked from commit 9d84cd602f4adb3954209eb14c94eea9254d1b5b)
-
-Signed-off-by: Willy Tarreau <w@1wt.eu>
----
- CONTRIBUTING | 21 ++++++++++++++++++++-
- 1 file changed, 20 insertions(+), 1 deletion(-)
-
-diff --git a/CONTRIBUTING b/CONTRIBUTING
-index 74a099bc..b2c2b493 100644
---- a/CONTRIBUTING
-+++ b/CONTRIBUTING
-@@ -69,6 +69,16 @@ code :
- Since most of these restrictions are just a matter of coding style, it is
- normally not a problem to comply.
- 
-+When modifying some optional subsystem (SSL, Lua, compression, device detection
-+engines), please make sure the code continues to build (and to work) when these
-+features are disabled. Similarly, when modifying the SSL stack, please always
-+ensure that supported OpenSSL versions continue to build and to work, especially
-+if you modify support for alternate libraries. Clean support for the legacy
-+OpenSSL libraries is mandatory, support for its derivatives is a bonus and may
-+occasionally break eventhough a great care is taken. In other words, if you
-+provide a patch for OpenSSL you don't need to test its derivatives, but if you
-+provide a patch for a derivative you also need to test with OpenSSL.
-+
- If your work is very confidential and you can't publicly discuss it, you can
- also mail willy@haproxy.org directly about it, but your mail may be waiting
- several days in the queue before you get a response, if you get a response at
-@@ -441,13 +451,22 @@ do not think about them anymore after a few patches.
-    way the subject is built. Please see the section below for more information
-    regarding this formatting.
- 
--   As a rule of thumb, your patch must never be made only of a subject line,
-+   As a rule of thumb, your patch MUST NEVER be made only of a subject line,
-    it *must* contain a description. Even one or two lines, or indicating
-    whether a backport is desired or not. It turns out that single-line commits
-    are so rare in the Git world that they require special manual (hence
-    painful) handling when they are backported, and at least for this reason
-    it's important to keep this in mind.
- 
-+   Each patch fixing a bug MUST be tagged with "BUG", a severity level, an
-+   indication of the affected subsystem and a brief description of the nature
-+   of the issue in the subject line, and a detailed analysis in the message
-+   body. The explanation of the user-visible impact and the need for
-+   backporting to stable branches or not are MANDATORY. Bug fixes with no
-+   indication will simply be rejected as they are very likely to cause more
-+   harm when nobody is able to tell whether or not the patch needs to be
-+   backported or can be reverted in case of regression.
-+
- 12) Discuss on the mailing list
- 
-    When submitting changes, please always CC the mailing list address so that
--- 
-2.13.0
-

+ 0 - 36
net/haproxy/patches/0007-DOC-update-the-list-of-OpenSSL-versions-in-the-READM.patch

@@ -1,36 +0,0 @@
-From 8d99949c4c51d95c14fb2b09d18e1cff058f0c17 Mon Sep 17 00:00:00 2001
-From: Willy Tarreau <w@1wt.eu>
-Date: Tue, 18 Jul 2017 06:58:16 +0200
-Subject: [PATCH 07/18] DOC: update the list of OpenSSL versions in the README
-
-1.1.0 is also supported nowadays. Also mention the best effort support
-for derivatives.
-(cherry picked from commit 7ab16868bc6e9d5ef879e1046effa035789835cc)
-
-Signed-off-by: Willy Tarreau <w@1wt.eu>
----
- README | 8 ++++++--
- 1 file changed, 6 insertions(+), 2 deletions(-)
-
-diff --git a/README b/README
-index 839d06ec..8ad70e66 100644
---- a/README
-+++ b/README
-@@ -113,8 +113,12 @@ build fails due to missing symbols such as deflateInit(), then try again with
- Your are strongly encouraged to always use an up-to-date version of OpenSSL, as
- found on https://www.openssl.org/ as vulnerabilities are occasionally found and
- you don't want them on your systems. HAProxy is known to build correctly on all
--currently supported branches (0.9.8, 1.0.0, 1.0.1 and 1.0.2 at the time of
--writing). Branch 1.0.2 is recommended for the richest features.
-+currently supported branches (0.9.8, 1.0.0, 1.0.1, 1.0.2 and 1.1.0 at the time
-+of writing). Branch 1.0.2 is currently recommended for the best combination of
-+features and stability. Asynchronous engines require OpenSSL 1.1.0 though. It's
-+worth mentionning that some OpenSSL derivatives are also reported to work but
-+may occasionally break. Patches to fix them are welcome but please read the
-+CONTRIBUTING file first.
- 
- To link OpenSSL statically against haproxy, build OpenSSL with the no-shared
- keyword and install it to a local directory, so your system is not affected :
--- 
-2.13.0
-

+ 0 - 129
net/haproxy/patches/0008-MINOR-tools-add-a-portable-timegm-alternative.patch

@@ -1,129 +0,0 @@
-From 3e21b8d25ad148ef4e6544f28a8b2305f9484a7b Mon Sep 17 00:00:00 2001
-From: Willy Tarreau <w@1wt.eu>
-Date: Wed, 19 Jul 2017 19:05:29 +0200
-Subject: [PATCH 08/18] MINOR: tools: add a portable timegm() alternative
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-timegm() is not provided everywhere and the documentation on how to
-replace it is bogus as it proposes an inefficient and non-thread safe
-alternative.
-
-Here we reimplement everything needed to compute the number of seconds
-since Epoch based on the broken down fields in struct tm. It is only
-guaranteed to return correct values for correct inputs. It was successfully
-tested with all possible 32-bit values of time_t converted to struct tm
-using gmtime() and back to time_t using the legacy timegm() and this
-function, and both functions always produced the same result.
-
-Thanks to Benoît Garnier for an instructive discussion and detailed
-explanations of the various time functions, leading to this solution.
-(cherry picked from commit cb1949b8b30b8db7e05546da2939eff2b5973321)
-
-Signed-off-by: Willy Tarreau <w@1wt.eu>
----
- include/common/standard.h | 21 ++++++++++++++++++
- src/standard.c            | 54 +++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 75 insertions(+)
-
-diff --git a/include/common/standard.h b/include/common/standard.h
-index 87f90a65..c19c368b 100644
---- a/include/common/standard.h
-+++ b/include/common/standard.h
-@@ -624,6 +624,27 @@ static inline void get_gmtime(const time_t now, struct tm *tm)
- 	gmtime_r(&now, tm);
- }
- 
-+/* Counts a number of elapsed days since 01/01/0000 based solely on elapsed
-+ * years and assuming the regular rule for leap years applies. It's fake but
-+ * serves as a temporary origin. It's worth remembering that it's the first
-+ * year of each period that is leap and not the last one, so for instance year
-+ * 1 sees 366 days since year 0 was leap. For this reason we have to apply
-+ * modular arithmetics which is why we offset the year by 399 before
-+ * subtracting the excess at the end. No overflow here before ~11.7 million
-+ * years.
-+ */
-+static inline unsigned int days_since_zero(unsigned int y)
-+{
-+	return y * 365 + (y + 399) / 4 - (y + 399) / 100 + (y + 399) / 400
-+	       - 399 / 4 + 399 / 100;
-+}
-+
-+/* Returns the number of seconds since 01/01/1970 0:0:0 GMT for GMT date <tm>.
-+ * It is meant as a portable replacement for timegm() for use with valid inputs.
-+ * Returns undefined results for invalid dates (eg: months out of range 0..11).
-+ */
-+extern time_t my_timegm(const struct tm *tm);
-+
- /* This function parses a time value optionally followed by a unit suffix among
-  * "d", "h", "m", "s", "ms" or "us". It converts the value into the unit
-  * expected by the caller. The computation does its best to avoid overflows.
-diff --git a/src/standard.c b/src/standard.c
-index 8df1da6c..e1d414f3 100644
---- a/src/standard.c
-+++ b/src/standard.c
-@@ -2841,6 +2841,60 @@ char *localdate2str_log(char *dst, time_t t, struct tm *tm, size_t size)
- 	return dst;
- }
- 
-+/* Returns the number of seconds since 01/01/1970 0:0:0 GMT for GMT date <tm>.
-+ * It is meant as a portable replacement for timegm() for use with valid inputs.
-+ * Returns undefined results for invalid dates (eg: months out of range 0..11).
-+ */
-+time_t my_timegm(const struct tm *tm)
-+{
-+	/* Each month has 28, 29, 30 or 31 days, or 28+N. The date in the year
-+	 * is thus (current month - 1)*28 + cumulated_N[month] to count the
-+	 * sum of the extra N days for elapsed months. The sum of all these N
-+	 * days doesn't exceed 30 for a complete year (366-12*28) so it fits
-+	 * in a 5-bit word. This means that with 60 bits we can represent a
-+	 * matrix of all these values at once, which is fast and efficient to
-+	 * access. The extra February day for leap years is not counted here.
-+	 *
-+	 * Jan : none      =  0 (0)
-+	 * Feb : Jan       =  3 (3)
-+	 * Mar : Jan..Feb  =  3 (3 + 0)
-+	 * Apr : Jan..Mar  =  6 (3 + 0 + 3)
-+	 * May : Jan..Apr  =  8 (3 + 0 + 3 + 2)
-+	 * Jun : Jan..May  = 11 (3 + 0 + 3 + 2 + 3)
-+	 * Jul : Jan..Jun  = 13 (3 + 0 + 3 + 2 + 3 + 2)
-+	 * Aug : Jan..Jul  = 16 (3 + 0 + 3 + 2 + 3 + 2 + 3)
-+	 * Sep : Jan..Aug  = 19 (3 + 0 + 3 + 2 + 3 + 2 + 3 + 3)
-+	 * Oct : Jan..Sep  = 21 (3 + 0 + 3 + 2 + 3 + 2 + 3 + 3 + 2)
-+	 * Nov : Jan..Oct  = 24 (3 + 0 + 3 + 2 + 3 + 2 + 3 + 3 + 2 + 3)
-+	 * Dec : Jan..Nov  = 26 (3 + 0 + 3 + 2 + 3 + 2 + 3 + 3 + 2 + 3 + 2)
-+	 */
-+	uint64_t extra =
-+		( 0ULL <<  0*5) + ( 3ULL <<  1*5) + ( 3ULL <<  2*5) + /* Jan, Feb, Mar, */
-+		( 6ULL <<  3*5) + ( 8ULL <<  4*5) + (11ULL <<  5*5) + /* Apr, May, Jun, */
-+		(13ULL <<  6*5) + (16ULL <<  7*5) + (19ULL <<  8*5) + /* Jul, Aug, Sep, */
-+		(21ULL <<  9*5) + (24ULL << 10*5) + (26ULL << 11*5);  /* Oct, Nov, Dec, */
-+
-+	unsigned int y = tm->tm_year + 1900;
-+	unsigned int m = tm->tm_mon;
-+	unsigned long days = 0;
-+
-+	/* days since 1/1/1970 for full years */
-+	days += days_since_zero(y) - days_since_zero(1970);
-+
-+	/* days for full months in the current year */
-+	days += 28 * m + ((extra >> (m * 5)) & 0x1f);
-+
-+	/* count + 1 after March for leap years. A leap year is a year multiple
-+	 * of 4, unless it's multiple of 100 without being multiple of 400. 2000
-+	 * is leap, 1900 isn't, 1904 is.
-+	 */
-+	if ((m > 1) && !(y & 3) && ((y % 100) || !(y % 400)))
-+		days++;
-+
-+	days += tm->tm_mday - 1;
-+	return days * 86400ULL + tm->tm_hour * 3600 + tm->tm_min * 60 + tm->tm_sec;
-+}
-+
- /* This function check a char. It returns true and updates
-  * <date> and <len> pointer to the new position if the
-  * character is found.
--- 
-2.13.0
-

+ 0 - 38
net/haproxy/patches/0009-BUILD-lua-replace-timegm-with-my_timegm-to-fix-build.patch

@@ -1,38 +0,0 @@
-From df1655a6c0e4431317cc66c67693281092a952b0 Mon Sep 17 00:00:00 2001
-From: Willy Tarreau <w@1wt.eu>
-Date: Wed, 19 Jul 2017 19:08:48 +0200
-Subject: [PATCH 09/18] BUILD: lua: replace timegm() with my_timegm() to fix
- build on Solaris 10
-
-Akhnin Nikita reported that Lua doesn't build on Solaris 10 because
-the code uses timegm() to parse a date, which is not provided there.
-The recommended way to implement timegm() is broken in the man page,
-as it is based on a change of the TZ environment variable at run time
-before calling the function (which is obviously not thread safe, and
-terribly inefficient).
-
-Here instead we rely on the new my_timegm() function, it should be
-sufficient for all known use cases.
-(cherry picked from commit abd9bb20b76818c9f461a82b72b10818736ff8b3)
-
-Signed-off-by: Willy Tarreau <w@1wt.eu>
----
- src/hlua_fcn.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/hlua_fcn.c b/src/hlua_fcn.c
-index 58905d7d..fe899a4a 100644
---- a/src/hlua_fcn.c
-+++ b/src/hlua_fcn.c
-@@ -287,7 +287,7 @@ static int hlua_parse_date(lua_State *L, int (*fcn)(const char *, int, struct tm
- 	 * the timezone from the broken-down time, it must be fixed
- 	 * after the conversion.
- 	 */
--	time = timegm(&tm);
-+	time = my_timegm(&tm);
- 	if (time == -1) {
- 		lua_pushnil(L);
- 		return 1;
--- 
-2.13.0
-

+ 0 - 32
net/haproxy/patches/0010-DOC-Updated-51Degrees-git-URL-to-point-to-a-stable-v.patch

@@ -1,32 +0,0 @@
-From e14ec1d816de60b648dd7cb6c55b665f5163156b Mon Sep 17 00:00:00 2001
-From: ben51degrees <ben@51degrees.com>
-Date: Wed, 19 Jul 2017 16:22:04 +0100
-Subject: [PATCH 10/18] DOC: Updated 51Degrees git URL to point to a stable
- version.
-
-The previously documented location doesn't work anymore and must not be
-used. Warning for backports, different branches are in use depending on
-the version (v3.2.10 for 1.7, v3.2.5 for 1.6).
-(cherry picked from commit ac752ff68cd3ac88a7a27ce17daa5c3f0c839694)
-
-Signed-off-by: Willy Tarreau <w@1wt.eu>
----
- doc/51Degrees-device-detection.txt | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/doc/51Degrees-device-detection.txt b/doc/51Degrees-device-detection.txt
-index 1ee912d9..71b2eb76 100644
---- a/doc/51Degrees-device-detection.txt
-+++ b/doc/51Degrees-device-detection.txt
-@@ -14,7 +14,7 @@ headers as configurable parameters.
- In order to enable 51Degrees download the 51Degrees source code from the
- official github repository :
- 
--    git clone https://github.com/51Degrees/Device-Detection
-+    git clone https://git.51Degrees.com/Device-Detection.git -b v3.2.10
- 
- then run 'make' with USE_51DEGREES and 51DEGREES_SRC set. Both 51DEGREES_INC
- and 51DEGREES_LIB may additionally be used to force specific different paths
--- 
-2.13.0
-

+ 0 - 33
net/haproxy/patches/0011-BUG-MINOR-http-Set-the-response-error-state-in-http_.patch

@@ -1,33 +0,0 @@
-From 9304b76fb37a36f6249ec963093d74210bd237f6 Mon Sep 17 00:00:00 2001
-From: Christopher Faulet <cfaulet@haproxy.com>
-Date: Tue, 18 Jul 2017 10:35:55 +0200
-Subject: [PATCH 11/18] BUG/MINOR: http: Set the response error state in
- http_sync_res_state
-
-This is just typo. It may only report a wrong response message state in
-"show errors" on the CLI.
-
-This patch must be backported in 1.7.
-
-(cherry picked from commit a3992e06a6e74142d9784d18d8cb3527fadb64d6)
-Signed-off-by: William Lallemand <wlallemand@haproxy.org>
----
- src/proto_http.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/proto_http.c b/src/proto_http.c
-index 94c8d639..796955f5 100644
---- a/src/proto_http.c
-+++ b/src/proto_http.c
-@@ -5530,7 +5530,7 @@ int http_sync_res_state(struct stream *s)
- 			goto http_msg_closed;
- 		}
- 		else if (chn->flags & CF_SHUTW) {
--			txn->req.err_state = txn->req.msg_state;
-+			txn->rsp.err_state = txn->rsp.msg_state;
- 			txn->rsp.msg_state = HTTP_MSG_ERROR;
- 			s->be->be_counters.cli_aborts++;
- 			if (objt_server(s->target))
--- 
-2.13.0
-

+ 0 - 100
net/haproxy/patches/0012-MINOR-http-Reorder-rewrite-checks-in-http_resync_sta.patch

@@ -1,100 +0,0 @@
-From a49007a187ab7fddfcec58e1d9fc8a707e4531c9 Mon Sep 17 00:00:00 2001
-From: Christopher Faulet <cfaulet@haproxy.com>
-Date: Tue, 18 Jul 2017 11:18:46 +0200
-Subject: [PATCH 12/18] MINOR: http: Reorder/rewrite checks in
- http_resync_states
-
-The previous patch removed the forced symmetry of the TUNNEL mode during the
-state synchronization. Here, we take care to remove body analyzer only on the
-channel in TUNNEL mode. In fact, today, this change has no effect because both
-sides are switched in same time. But this way, with some changes, it will be
-possible to keep body analyzer on a side (to finish the states synchronization)
-with the other one in TUNNEL mode.
-
-WARNING: This patch will be used to fix a bug. The fix will be commited in a
-very next commit. So if the fix is backported, this one must be backported too.
-
-(cherry picked from commit f77bb539d4846ab278269b99a3165a5608ca0cf4)
-Signed-off-by: William Lallemand <wlallemand@haproxy.org>
----
- src/proto_http.c | 48 +++++++++++++++++++++++++++++-------------------
- 1 file changed, 29 insertions(+), 19 deletions(-)
-
-diff --git a/src/proto_http.c b/src/proto_http.c
-index 796955f5..aaf9f648 100644
---- a/src/proto_http.c
-+++ b/src/proto_http.c
-@@ -5577,34 +5577,27 @@ int http_resync_states(struct stream *s)
- 
- 	/* OK, both state machines agree on a compatible state.
- 	 * There are a few cases we're interested in :
--	 *  - HTTP_MSG_TUNNEL on either means we have to disable both analysers
- 	 *  - HTTP_MSG_CLOSED on both sides means we've reached the end in both
- 	 *    directions, so let's simply disable both analysers.
--	 *  - HTTP_MSG_CLOSED on the response only means we must abort the
--	 *    request.
--	 *  - HTTP_MSG_CLOSED on the request and HTTP_MSG_DONE on the response
--	 *    with server-close mode means we've completed one request and we
--	 *    must re-initialize the server connection.
-+	 *  - HTTP_MSG_CLOSED on the response only or HTTP_MSG_ERROR on either
-+	 *    means we must abort the request.
-+	 *  - HTTP_MSG_TUNNEL on either means we have to disable analyser on
-+	 *    corresponding channel.
-+	 *  - HTTP_MSG_DONE or HTTP_MSG_CLOSED on the request and HTTP_MSG_DONE
-+	 *    on the response with server-close mode means we've completed one
-+	 *    request and we must re-initialize the server connection.
- 	 */
--
--	if (txn->req.msg_state == HTTP_MSG_TUNNEL ||
--	    txn->rsp.msg_state == HTTP_MSG_TUNNEL ||
--	    (txn->req.msg_state == HTTP_MSG_CLOSED &&
--	     txn->rsp.msg_state == HTTP_MSG_CLOSED)) {
-+	if (txn->req.msg_state == HTTP_MSG_CLOSED &&
-+	    txn->rsp.msg_state == HTTP_MSG_CLOSED) {
- 		s->req.analysers &= AN_REQ_FLT_END;
- 		channel_auto_close(&s->req);
- 		channel_auto_read(&s->req);
- 		s->res.analysers &= AN_RES_FLT_END;
- 		channel_auto_close(&s->res);
- 		channel_auto_read(&s->res);
--		if (txn->req.msg_state == HTTP_MSG_TUNNEL && HAS_REQ_DATA_FILTERS(s))
--			s->req.analysers |= AN_REQ_FLT_XFER_DATA;
--		if (txn->rsp.msg_state == HTTP_MSG_TUNNEL && HAS_RSP_DATA_FILTERS(s))
--			s->res.analysers |= AN_RES_FLT_XFER_DATA;
--	}
--	else if ((txn->req.msg_state >= HTTP_MSG_DONE &&
--		  (txn->rsp.msg_state == HTTP_MSG_CLOSED || (s->res.flags & CF_SHUTW))) ||
--		 txn->rsp.msg_state == HTTP_MSG_ERROR ||
-+	}
-+	else if (txn->rsp.msg_state == HTTP_MSG_CLOSED ||
-+		 txn->rsp.msg_state == HTTP_MSG_ERROR  ||
- 		 txn->req.msg_state == HTTP_MSG_ERROR) {
- 		s->res.analysers &= AN_RES_FLT_END;
- 		channel_auto_close(&s->res);
-@@ -5615,6 +5608,23 @@ int http_resync_states(struct stream *s)
- 		channel_auto_read(&s->req);
- 		channel_truncate(&s->req);
- 	}
-+	else if (txn->req.msg_state == HTTP_MSG_TUNNEL ||
-+		 txn->rsp.msg_state == HTTP_MSG_TUNNEL) {
-+		if (txn->req.msg_state == HTTP_MSG_TUNNEL) {
-+			s->req.analysers &= AN_REQ_FLT_END;
-+			if (HAS_REQ_DATA_FILTERS(s))
-+				s->req.analysers |= AN_REQ_FLT_XFER_DATA;
-+		}
-+		if (txn->rsp.msg_state == HTTP_MSG_TUNNEL) {
-+			s->res.analysers &= AN_RES_FLT_END;
-+			if (HAS_RSP_DATA_FILTERS(s))
-+				s->res.analysers |= AN_RES_FLT_XFER_DATA;
-+		}
-+		channel_auto_close(&s->req);
-+		channel_auto_read(&s->req);
-+		channel_auto_close(&s->res);
-+		channel_auto_read(&s->res);
-+	}
- 	else if ((txn->req.msg_state == HTTP_MSG_DONE ||
- 		  txn->req.msg_state == HTTP_MSG_CLOSED) &&
- 		 txn->rsp.msg_state == HTTP_MSG_DONE &&
--- 
-2.13.0
-

+ 0 - 153
net/haproxy/patches/0013-MINOR-http-Switch-requests-responses-in-TUNNEL-mode-.patch

@@ -1,153 +0,0 @@
-From 1430a0c0f62fcff4303706f5baf2b544e00fcda3 Mon Sep 17 00:00:00 2001
-From: Christopher Faulet <cfaulet@haproxy.com>
-Date: Tue, 18 Jul 2017 10:48:24 +0200
-Subject: [PATCH 13/18] MINOR: http: Switch requests/responses in TUNNEL mode
- only by checking txn flags
-
-Today, the only way to have a request or a response in HTTP_MSG_TUNNEL state is
-to have the flag TX_CON_WANT_TUN set on the transaction. So this is a symmetric
-state. Both the request and the response are switch in same time in this
-state. This can be done only by checking transaction flags instead of relying on
-the other side state. This is the purpose of this patch.
-
-This way, if for any reason we need to switch only one side in TUNNEL mode, it
-will be possible. And to prepare asymmetric cases, we check channel flags in
-DONE _AND_ TUNNEL states.
-
-WARNING: This patch will be used to fix a bug. The fix will be commited in a
-very next commit. So if the fix is backported, this one must be backported too.
-
-(cherry picked from commit 4be9803914ae7156109c915659aad216e4a3c6c1)
-Signed-off-by: William Lallemand <wlallemand@haproxy.org>
----
- src/proto_http.c | 65 +++++++++++++++++++-------------------------------------
- 1 file changed, 22 insertions(+), 43 deletions(-)
-
-diff --git a/src/proto_http.c b/src/proto_http.c
-index aaf9f648..00a92cdb 100644
---- a/src/proto_http.c
-+++ b/src/proto_http.c
-@@ -5294,7 +5294,7 @@ int http_sync_req_state(struct stream *s)
- 	unsigned int old_flags = chn->flags;
- 	unsigned int old_state = txn->req.msg_state;
- 
--	if (unlikely(txn->req.msg_state < HTTP_MSG_BODY))
-+	if (unlikely(txn->req.msg_state < HTTP_MSG_DONE))
- 		return 0;
- 
- 	if (txn->req.msg_state == HTTP_MSG_DONE) {
-@@ -5338,13 +5338,6 @@ int http_sync_req_state(struct stream *s)
- 			goto wait_other_side;
- 		}
- 
--		if (txn->rsp.msg_state == HTTP_MSG_TUNNEL) {
--			/* if any side switches to tunnel mode, the other one does too */
--			channel_auto_read(chn);
--			txn->req.msg_state = HTTP_MSG_TUNNEL;
--			goto wait_other_side;
--		}
--
- 		/* When we get here, it means that both the request and the
- 		 * response have finished receiving. Depending on the connection
- 		 * mode, we'll have to wait for the last bytes to leave in either
-@@ -5377,20 +5370,7 @@ int http_sync_req_state(struct stream *s)
- 			}
- 		}
- 
--		if (chn->flags & (CF_SHUTW|CF_SHUTW_NOW)) {
--			/* if we've just closed an output, let's switch */
--			s->si[1].flags |= SI_FL_NOLINGER;  /* we want to close ASAP */
--
--			if (!channel_is_empty(chn)) {
--				txn->req.msg_state = HTTP_MSG_CLOSING;
--				goto http_msg_closing;
--			}
--			else {
--				txn->req.msg_state = HTTP_MSG_CLOSED;
--				goto http_msg_closed;
--			}
--		}
--		goto wait_other_side;
-+		goto check_channel_flags;
- 	}
- 
- 	if (txn->req.msg_state == HTTP_MSG_CLOSING) {
-@@ -5419,6 +5399,16 @@ int http_sync_req_state(struct stream *s)
- 		goto wait_other_side;
- 	}
- 
-+ check_channel_flags:
-+	/* Here, we are in HTTP_MSG_DONE or HTTP_MSG_TUNNEL */
-+	if (chn->flags & (CF_SHUTW|CF_SHUTW_NOW)) {
-+		/* if we've just closed an output, let's switch */
-+		s->si[1].flags |= SI_FL_NOLINGER;  /* we want to close ASAP */
-+		txn->req.msg_state = HTTP_MSG_CLOSING;
-+		goto http_msg_closing;
-+	}
-+
-+
-  wait_other_side:
- 	return txn->req.msg_state != old_state || chn->flags != old_flags;
- }
-@@ -5438,7 +5428,7 @@ int http_sync_res_state(struct stream *s)
- 	unsigned int old_flags = chn->flags;
- 	unsigned int old_state = txn->rsp.msg_state;
- 
--	if (unlikely(txn->rsp.msg_state < HTTP_MSG_BODY))
-+	if (unlikely(txn->rsp.msg_state < HTTP_MSG_DONE))
- 		return 0;
- 
- 	if (txn->rsp.msg_state == HTTP_MSG_DONE) {
-@@ -5461,14 +5451,6 @@ int http_sync_res_state(struct stream *s)
- 			goto wait_other_side;
- 		}
- 
--		if (txn->req.msg_state == HTTP_MSG_TUNNEL) {
--			/* if any side switches to tunnel mode, the other one does too */
--			channel_auto_read(chn);
--			txn->rsp.msg_state = HTTP_MSG_TUNNEL;
--			chn->flags |= CF_NEVER_WAIT;
--			goto wait_other_side;
--		}
--
- 		/* When we get here, it means that both the request and the
- 		 * response have finished receiving. Depending on the connection
- 		 * mode, we'll have to wait for the last bytes to leave in either
-@@ -5506,18 +5488,7 @@ int http_sync_res_state(struct stream *s)
- 				txn->rsp.msg_state = HTTP_MSG_TUNNEL;
- 		}
- 
--		if (chn->flags & (CF_SHUTW|CF_SHUTW_NOW)) {
--			/* if we've just closed an output, let's switch */
--			if (!channel_is_empty(chn)) {
--				txn->rsp.msg_state = HTTP_MSG_CLOSING;
--				goto http_msg_closing;
--			}
--			else {
--				txn->rsp.msg_state = HTTP_MSG_CLOSED;
--				goto http_msg_closed;
--			}
--		}
--		goto wait_other_side;
-+		goto check_channel_flags;
- 	}
- 
- 	if (txn->rsp.msg_state == HTTP_MSG_CLOSING) {
-@@ -5548,6 +5519,14 @@ int http_sync_res_state(struct stream *s)
- 		goto wait_other_side;
- 	}
- 
-+ check_channel_flags:
-+	/* Here, we are in HTTP_MSG_DONE or HTTP_MSG_TUNNEL */
-+	if (chn->flags & (CF_SHUTW|CF_SHUTW_NOW)) {
-+		/* if we've just closed an output, let's switch */
-+		txn->rsp.msg_state = HTTP_MSG_CLOSING;
-+		goto http_msg_closing;
-+	}
-+
-  wait_other_side:
- 	/* We force the response to leave immediately if we're waiting for the
- 	 * other side, since there is no pending shutdown to push it out.
--- 
-2.13.0
-

+ 0 - 118
net/haproxy/patches/0014-BUG-MEDIUM-http-Switch-HTTP-responses-in-TUNNEL-mode.patch

@@ -1,118 +0,0 @@
-From f82344c1cf20afcf77e8c3df8f9d341d659da93b Mon Sep 17 00:00:00 2001
-From: Christopher Faulet <cfaulet@haproxy.com>
-Date: Tue, 18 Jul 2017 11:42:08 +0200
-Subject: [PATCH 14/18] BUG/MEDIUM: http: Switch HTTP responses in TUNNEL mode
- when body length is undefined
-
-When the body length of a HTTP response is undefined, the HTTP parser is blocked
-in the body parsing. Before HAProxy 1.7, in this case, because
-AN_RES_HTTP_XFER_BODY is never set, there is no visible effect. When the server
-closes its connection to terminate the response, HAProxy catches it as a normal
-closure. Since 1.7, we always set this analyzer to enter at least once in
-http_response_forward_body. But, in the present case, when the server connection
-is closed, http_response_forward_body is called one time too many. The response
-is correctly sent to the client, but an error is catched and logged with "SD--"
-flags.
-
-To reproduce the bug, you can use the configuration "tests/test-fsm.cfg". The
-tests 3 and 21 hit the bug.
-
-Idea to fix the bug is to switch the response in TUNNEL mode without switching
-the request. This is possible because of previous patches.
-
-First, we need to detect responses with undefined body length during states
-synchronization. Excluding tunnelled transactions, when the response length is
-undefined, TX_CON_WANT_CLO is always set on the transaction. So, when states are
-synchronized, if TX_CON_WANT_CLO is set, the response is switched in TUNNEL mode
-and the request remains unchanged.
-
-Then, in http_msg_forward_body, we add a specific check to switch the response
-in DONE mode if the body length is undefined and if there is no data filter.
-
-This patch depends on following previous commits:
-
-  * MINOR: http: Switch requests/responses in TUNNEL mode only by checking txn flags
-  * MINOR: http: Reorder/rewrite checks in http_resync_states
-
-This patch must be backported in 1.7 with 2 previous ones.
-
-(cherry picked from commit 1486b0ab6de744e14ae684af105951345534f9ec)
-Signed-off-by: William Lallemand <wlallemand@haproxy.org>
----
- src/proto_http.c | 37 +++++++++++++++++++++++++------------
- 1 file changed, 25 insertions(+), 12 deletions(-)
-
-diff --git a/src/proto_http.c b/src/proto_http.c
-index 00a92cdb..e776e4d5 100644
---- a/src/proto_http.c
-+++ b/src/proto_http.c
-@@ -5354,7 +5354,16 @@ int http_sync_req_state(struct stream *s)
- 			 * let's enforce it now that we're not expecting any new
- 			 * data to come. The caller knows the stream is complete
- 			 * once both states are CLOSED.
-+			 *
-+			 *  However, there is an exception if the response
-+			 *  length is undefined. In this case, we need to wait
-+			 *  the close from the server. The response will be
-+			 *  switched in TUNNEL mode until the end.
- 			 */
-+			if (!(txn->rsp.flags & HTTP_MSGF_XFER_LEN) &&
-+			    txn->rsp.msg_state != HTTP_MSG_CLOSED)
-+				goto check_channel_flags;
-+
- 			if (!(chn->flags & (CF_SHUTW|CF_SHUTW_NOW))) {
- 				channel_shutr_now(chn);
- 				channel_shutw_now(chn);
-@@ -5471,8 +5480,16 @@ int http_sync_res_state(struct stream *s)
- 			 * let's enforce it now that we're not expecting any new
- 			 * data to come. The caller knows the stream is complete
- 			 * once both states are CLOSED.
-+			 *
-+			 * However, there is an exception if the response length
-+			 * is undefined. In this case, we switch in TUNNEL mode.
- 			 */
--			if (!(chn->flags & (CF_SHUTW|CF_SHUTW_NOW))) {
-+			if (!(txn->rsp.flags & HTTP_MSGF_XFER_LEN)) {
-+				channel_auto_read(chn);
-+				txn->rsp.msg_state = HTTP_MSG_TUNNEL;
-+				chn->flags |= CF_NEVER_WAIT;
-+			}
-+			else if (!(chn->flags & (CF_SHUTW|CF_SHUTW_NOW))) {
- 				channel_shutr_now(chn);
- 				channel_shutw_now(chn);
- 			}
-@@ -6952,14 +6969,6 @@ int http_response_forward_body(struct stream *s, struct channel *res, int an_bit
- 	if ((msg->flags & HTTP_MSGF_TE_CHNK) || (msg->flags & HTTP_MSGF_COMPRESSING))
- 		res->flags |= CF_EXPECT_MORE;
- 
--	/* If there is neither content-length, nor transfer-encoding header
--	 * _AND_ there is no data filtering, we can safely forward all data
--	 * indefinitely. */
--	if (!(msg->flags & HTTP_MSGF_XFER_LEN) && !HAS_DATA_FILTERS(s, res)) {
--		buffer_flush(res->buf);
--		channel_forward_forever(res);
--	}
--
- 	/* the stream handler will take care of timeouts and errors */
- 	return 0;
- 
-@@ -7036,9 +7045,13 @@ http_msg_forward_body(struct stream *s, struct http_msg *msg)
- 		goto missing_data_or_waiting;
- 	}
- 
--	/* The server still sending data that should be filtered */
--	if (!(msg->flags & HTTP_MSGF_XFER_LEN) && !(chn->flags & CF_SHUTR))
--		goto missing_data_or_waiting;
-+	/* This check can only be true for a response. HTTP_MSGF_XFER_LEN is
-+	 * always set for a request. */
-+	if (!(msg->flags & HTTP_MSGF_XFER_LEN)) {
-+		/* The server still sending data that should be filtered */
-+		if (!(chn->flags & CF_SHUTR) && HAS_DATA_FILTERS(s, chn))
-+			goto missing_data_or_waiting;
-+	}
- 
- 	msg->msg_state = HTTP_MSG_ENDING;
- 
--- 
-2.13.0
-

+ 0 - 43
net/haproxy/patches/0015-BUG-MAJOR-http-Fix-possible-infinity-loop-in-http_sy.patch

@@ -1,43 +0,0 @@
-From af9b52e92be8ca6a07f9156dcb0b08dd2ad8db75 Mon Sep 17 00:00:00 2001
-From: Christopher Faulet <cfaulet@haproxy.com>
-Date: Thu, 20 Jul 2017 11:05:10 +0200
-Subject: [PATCH 15/18] BUG/MAJOR: http: Fix possible infinity loop in
- http_sync_(req|res)_state
-
-In commit "MINOR: http: Switch requests/responses in TUNNEL mode only by
-checking txn flags", it is possible to have an infinite loop on HTTP_MSG_CLOSING
-state.
-
-(cherry picked from commit 56d260916f61e48c8b2f1fd2f9431afac776d160)
-Signed-off-by: William Lallemand <wlallemand@haproxy.org>
----
- src/proto_http.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/src/proto_http.c b/src/proto_http.c
-index e776e4d5..4a030013 100644
---- a/src/proto_http.c
-+++ b/src/proto_http.c
-@@ -5394,8 +5394,8 @@ int http_sync_req_state(struct stream *s)
- 		else if (chn->flags & CF_SHUTW) {
- 			txn->req.err_state = txn->req.msg_state;
- 			txn->req.msg_state = HTTP_MSG_ERROR;
--			goto wait_other_side;
- 		}
-+		goto wait_other_side;
- 	}
- 
- 	if (txn->req.msg_state == HTTP_MSG_CLOSED) {
-@@ -5523,8 +5523,8 @@ int http_sync_res_state(struct stream *s)
- 			s->be->be_counters.cli_aborts++;
- 			if (objt_server(s->target))
- 				objt_server(s->target)->counters.cli_aborts++;
--			goto wait_other_side;
- 		}
-+		goto wait_other_side;
- 	}
- 
- 	if (txn->rsp.msg_state == HTTP_MSG_CLOSED) {
--- 
-2.13.0
-

+ 0 - 45
net/haproxy/patches/0016-BUG-MINOR-lua-Fix-Server.get_addr-port-values.patch

@@ -1,45 +0,0 @@
-From c00347899e9f0c3420f98c53eab1469644e28e06 Mon Sep 17 00:00:00 2001
-From: Nenad Merdanovic <nmerdan@haproxy.com>
-Date: Sun, 23 Jul 2017 22:04:58 -0400
-Subject: [PATCH 16/18] BUG/MINOR: lua: Fix Server.get_addr() port values
-
-The get_addr() method of the Lua Server class was using the
-'sockaddr_storage addr' member to get the port value. HAProxy does not
-store ports in this member as it uses a separate member, called
-'svc_port'.
-
-This fix should be backported to 1.7.
-
-(cherry picked from commit 3849473828f319829aff422d2fbbce0823e65d64)
-Signed-off-by: William Lallemand <wlallemand@haproxy.org>
----
- src/hlua_fcn.c | 6 ++----
- 1 file changed, 2 insertions(+), 4 deletions(-)
-
-diff --git a/src/hlua_fcn.c b/src/hlua_fcn.c
-index fe899a4a..0752220e 100644
---- a/src/hlua_fcn.c
-+++ b/src/hlua_fcn.c
-@@ -545,8 +545,7 @@ int hlua_server_get_addr(lua_State *L)
- 		          addr, INET_ADDRSTRLEN);
- 		luaL_addstring(&b, addr);
- 		luaL_addstring(&b, ":");
--		snprintf(addr, INET_ADDRSTRLEN, "%d",
--		         ntohs(((struct sockaddr_in *)&srv->addr)->sin_port));
-+		snprintf(addr, INET_ADDRSTRLEN, "%d", srv->svc_port);
- 		luaL_addstring(&b, addr);
- 		break;
- 	case AF_INET6:
-@@ -554,8 +553,7 @@ int hlua_server_get_addr(lua_State *L)
- 		          addr, INET_ADDRSTRLEN);
- 		luaL_addstring(&b, addr);
- 		luaL_addstring(&b, ":");
--		snprintf(addr, INET_ADDRSTRLEN, "%d",
--		         ntohs(((struct sockaddr_in6 *)&srv->addr)->sin6_port));
-+		snprintf(addr, INET_ADDRSTRLEN, "%d", srv->svc_port);
- 		luaL_addstring(&b, addr);
- 		break;
- 	case AF_UNIX:
--- 
-2.13.0
-

+ 0 - 34
net/haproxy/patches/0017-BUG-MINOR-lua-Correctly-use-INET6_ADDRSTRLEN-in-Serv.patch

@@ -1,34 +0,0 @@
-From e79fe9bc0ae363e91555f1ba64889e2ddf475b8e Mon Sep 17 00:00:00 2001
-From: Nenad Merdanovic <nmerdan@haproxy.com>
-Date: Sun, 23 Jul 2017 22:04:59 -0400
-Subject: [PATCH 17/18] BUG/MINOR: lua: Correctly use INET6_ADDRSTRLEN in
- Server.get_addr()
-
-The get_addr() method of the Lua Server class incorrectly used
-INET_ADDRSTRLEN for IPv6 addresses resulting in failing to convert
-longer IPv6 addresses to strings.
-
-This fix should be backported to 1.7.
-
-(cherry picked from commit a9f040453acc09e888c3f2dc983f15dcf3fa66e3)
-Signed-off-by: William Lallemand <wlallemand@haproxy.org>
----
- src/hlua_fcn.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/hlua_fcn.c b/src/hlua_fcn.c
-index 0752220e..f8b9b5ec 100644
---- a/src/hlua_fcn.c
-+++ b/src/hlua_fcn.c
-@@ -550,7 +550,7 @@ int hlua_server_get_addr(lua_State *L)
- 		break;
- 	case AF_INET6:
- 		inet_ntop(AF_INET6, &((struct sockaddr_in6 *)&srv->addr)->sin6_addr,
--		          addr, INET_ADDRSTRLEN);
-+		          addr, INET6_ADDRSTRLEN);
- 		luaL_addstring(&b, addr);
- 		luaL_addstring(&b, ":");
- 		snprintf(addr, INET_ADDRSTRLEN, "%d", srv->svc_port);
--- 
-2.13.0
-

+ 0 - 45
net/haproxy/patches/0018-BUG-MINOR-lua-always-detach-the-tcp-http-tasks-befor.patch

@@ -1,45 +0,0 @@
-From dd18f945c26fc30872a52c66b06b5a0a86b10060 Mon Sep 17 00:00:00 2001
-From: Willy Tarreau <w@1wt.eu>
-Date: Mon, 24 Jul 2017 17:35:27 +0200
-Subject: [PATCH 18/18] BUG/MINOR: lua: always detach the tcp/http tasks before
- freeing them
-
-In hlua_{http,tcp}_applet_release(), a call to task_free() is performed
-to release the task, but no task_delete() is made on these tasks. Till
-now it wasn't much of a problem because this was normally not done with
-the task in the run queue, and the task was never put into the wait queue
-since it doesn't have any timer. But with threading it will become an
-issue. And not having this already prevents another bug from being fixed.
-
-Thanks to Christopher for spotting this one. A backport to 1.7 and 1.6 is
-preferred for safety.
-
-(cherry picked from commit bd7fc95edbce821f1d7b745a7b75deef4d6b1e27)
-Signed-off-by: William Lallemand <wlallemand@haproxy.org>
----
- src/hlua.c | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/src/hlua.c b/src/hlua.c
-index a998860e..67b9458c 100644
---- a/src/hlua.c
-+++ b/src/hlua.c
-@@ -5948,6 +5948,7 @@ error:
- 
- static void hlua_applet_tcp_release(struct appctx *ctx)
- {
-+	task_delete(ctx->ctx.hlua_apptcp.task);
- 	task_free(ctx->ctx.hlua_apptcp.task);
- 	ctx->ctx.hlua_apptcp.task = NULL;
- 	hlua_ctx_destroy(&ctx->ctx.hlua_apptcp.hlua);
-@@ -6226,6 +6227,7 @@ error:
- 
- static void hlua_applet_http_release(struct appctx *ctx)
- {
-+	task_delete(ctx->ctx.hlua_apphttp.task);
- 	task_free(ctx->ctx.hlua_apphttp.task);
- 	ctx->ctx.hlua_apphttp.task = NULL;
- 	hlua_ctx_destroy(&ctx->ctx.hlua_apphttp.hlua);
--- 
-2.13.0
-

+ 0 - 51
net/horst/Makefile

@@ -1,51 +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:=horst
-PKG_VERSION:=5.0
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-git.tar.gz
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_URL:=git://github.com/br101/horst.git
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_VERSION:=version-$(PKG_VERSION)
-
-PKG_MAINTAINER:=Bruno Randolf <br1@einfach.org>
-PKG_LICENSE:=GPL-2.0+
-PKG_LICENSE_FILES:=LICENSE
-
-PKG_BUILD_PARALLEL:=1
-
-include $(INCLUDE_DIR)/package.mk
-
-MAKE_FLAGS += DEBUG=1 LIBNL=tiny
-
-define Package/horst
-	SECTION:=net
-	CATEGORY:=Network
-	SUBMENU:=wireless
-	DEPENDS:=+libncurses +libnl-tiny
-	MAINTAINER:=Bruno Randolf <br1@einfach.org>
-	TITLE:=Highly Optimized 802.11 Radio Scanning Tool
-	URL:=http://br1.einfach.org/tech/horst/
-endef
-
-define Package/horst/description
-	[horst] is a scanning and analysis tool for 802.11 wireless networks
-	and especially IBSS (ad-hoc) mode and mesh networks (OLSR).
-endef
-
-define Package/horst/install
-	$(INSTALL_DIR) $(1)/usr/sbin
-	$(INSTALL_BIN) $(PKG_BUILD_DIR)/horst $(1)/usr/sbin/
-	$(INSTALL_BIN) $(PKG_BUILD_DIR)/horst.sh $(1)/usr/sbin/
-endef
-
-$(eval $(call BuildPackage,horst))

+ 4 - 5
net/https-dns-proxy/Makefile

@@ -1,15 +1,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=https_dns_proxy
-PKG_VERSION:=2018-01-24
-PKG_RELEASE=1
+PKG_VERSION:=2017-01-07
+PKG_RELEASE=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_MIRROR_HASH:=0eef98106c584b986117f33458e8d1e2447a8b6eb12a2e3bfc5df06d45114144
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_URL:=https://github.com/aarond10/https_dns_proxy/
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_VERSION:=f08b51d7c07c0156794e2c23d7a4d1a5344b2e07
+PKG_SOURCE_VERSION:=c62ce3f6807a4067230a8bc5ea5a829f532de785
 PKG_MAINTAINER:=Aaron Drew <aarond10@gmail.com>
 PKG_LICENSE:=MIT
 
@@ -20,7 +19,7 @@ define Package/https_dns_proxy
   SECTION:=net
   CATEGORY:=Network
   TITLE:=DNS over HTTPS proxy server
-  DEPENDS:=+libcares +libcurl +libev +ca-bundle
+  DEPENDS:=+libcares +libcurl +libev
 endef
 
 define Package/https_dns_proxy/install

+ 2 - 2
net/jool/Makefile

@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=jool
 PKG_VERSION:=2016.12.17
-PKG_RELEASE:=2
+PKG_RELEASE:=1
 
 PKG_LICENSE:=GPL-3.0
 PKG_LICENSE_FILES:=COPYING
@@ -19,7 +19,7 @@ PKG_SOURCE_VERSION:=66a791c90751d7941b08c142babe1deec73d0996
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.xz
 
-PKG_BUILD_DIR=$(KERNEL_BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
 PKG_BUILD_PARALLEL:=1
 PKG_BUILD_DEPENDS:=USE_UCLIBC:argp-standalone USE_MUSL:argp-standalone
 

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